Create a page in persistent storage.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const layout = {
content: [
{
type: 'stack',
content: [
{
type: 'component',
componentName: 'view',
componentState: {
name: 'myViewName',
url: 'http://google.com'
}
}
]
}
]
};
const page = {
title: 'myPageTitle',
pageId: 'myPageId',
layout
};
await workspacePlatform.Storage.createPage({page});
the page to create in persistent storage.
Delete a page from persistent storage.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
await workspacePlatform.Storage.deletePage('myPageId');
the id of the page to delete.
Get a specific page in persistent storage.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const myPage = await workspacePlatform.Storage.getPage('myPageId');
the id of the page to get.
Get all pages that are saved in persistent storage.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const pages = await workspacePlatform.Storage.getPages();
Save a page in persistent storage.
This is a helper function that will call getPage
to determine if a page is already in storage.
If the page is already in storage, it will call updatePage
.
If it does not exist in storage, the function will call createPage
instead.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const layout = {
content: [
{
type: 'stack',
content: [
{
type: 'component',
componentName: 'view',
componentState: {
name: 'myViewName',
url: 'http://google.com'
}
}
]
}
]
};
const page = {
title: 'myPageTitle',
pageId: 'myPageId',
layout
};
await workspacePlatform.Storage.savePage(page);
the page to save.
Update a page in persistent storage.
import * as WorkspacePlatform from '@openfin/workspace-platform-5.0';
const workspacePlatform = WorkspacePlatform.getCurrentSync();
const layout = {
content: [
{
type: 'stack',
content: [
{
type: 'component',
componentName: 'view',
componentState: {
name: 'myViewName',
url: 'http://google.com'
}
}
]
}
]
};
const page = {
title: 'myPageTitle',
pageId: 'myPageId',
layout
};
const req = {
pageId: 'myPageId',
page
};
await workspacePlatform.Storage.updatePage(req);
the update saved page request.
Generated using TypeDoc
API for interacting with persistent storage.