IWorkspacePublisherService
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Service for managing page layouts, document templates and documents.
export interface IWorkspacePublisherService
Remarks
Page layouts returned by this service include the built-in layouts shipped with the product (BuiltInPublisherPageLayouts). Built-ins carry isBuiltIn: true, are never persisted on the backend, and reject update and delete.
Methods
Method | Description |
|---|---|
(ALPHA) Create a new document. | |
(ALPHA) Create a new document template. | |
(ALPHA) Create a new page layout. | |
(ALPHA) Delete an existing document. | |
(ALPHA) Delete an existing document template. | |
(ALPHA) Delete an existing page layout. Rejects built-in and locked layouts. | |
(ALPHA) Export a document to PDF. | |
(ALPHA) Get a single document by its reference. | |
(ALPHA) Get the list of documents available in the workspace. | |
(ALPHA) Get a single document template by its reference. | |
(ALPHA) Get the list of document templates available in the workspace. | |
(ALPHA) Get a single page layout by its reference. | |
(ALPHA) Get the list of page layouts available in the workspace, built-in layouts first. | |
(ALPHA) Update an existing document. Rejects locked documents. | |
(ALPHA) Update an existing document template. Rejects locked templates. | |
(ALPHA) Update an existing page layout. Rejects built-in and locked layouts. |
Method details
IWorkspacePublisherService.createDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Create a new document.
createDocument(publisherDocument: IPublisherDocumentDefinition): Promise<IPublisherDocument>;
Parameters
Parameter | Type | Description |
|---|---|---|
publisherDocument |
Returns
Promise<IPublisherDocument>
IWorkspacePublisherService.createDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Create a new document template.
createDocumentTemplate(template: IPublisherDocumentTemplateDefinition): Promise<IPublisherDocumentTemplate>;
Parameters
Parameter | Type | Description |
|---|---|---|
template |
Returns
Promise<IPublisherDocumentTemplate>
IWorkspacePublisherService.createPageLayout()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Create a new page layout.
createPageLayout(page: IPublisherPageLayoutDefinition): Promise<IPublisherPageLayout>;
Parameters
Parameter | Type | Description |
|---|---|---|
page |
Returns
Promise<IPublisherPageLayout>
IWorkspacePublisherService.deleteDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Delete an existing document.
deleteDocument(ref: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<void>
IWorkspacePublisherService.deleteDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Delete an existing document template.
deleteDocumentTemplate(ref: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<void>
IWorkspacePublisherService.deletePageLayout()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Delete an existing page layout. Rejects built-in and locked layouts.
deletePageLayout(ref: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<void>
IWorkspacePublisherService.exportDocumentToPdf()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Export a document to PDF.
exportDocumentToPdf(ref: ObjRef, options?: IPublisherDocumentExportPdfOptions): Promise<IExportResult>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref | ||
options | (Optional) |
Returns
Promise<IExportResult>
Remarks
The backend renders the document as it is saved, so unsaved changes are not part of the export.
IWorkspacePublisherService.getDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get a single document by its reference.
getDocument(ref: ObjRef): Promise<IPublisherDocument>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherDocument>
IWorkspacePublisherService.getDocuments()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get the list of documents available in the workspace.
getDocuments(): Promise<IPublisherDocument[]>;
Returns
Promise<IPublisherDocument[]>
IWorkspacePublisherService.getDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get a single document template by its reference.
getDocumentTemplate(ref: ObjRef): Promise<IPublisherDocumentTemplate>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherDocumentTemplate>
IWorkspacePublisherService.getDocumentTemplates()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get the list of document templates available in the workspace.
getDocumentTemplates(): Promise<IPublisherDocumentTemplate[]>;
Returns
Promise<IPublisherDocumentTemplate[]>
IWorkspacePublisherService.getPageLayout()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get a single page layout by its reference.
getPageLayout(ref: ObjRef): Promise<IPublisherPageLayout>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherPageLayout>
IWorkspacePublisherService.getPageLayouts()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Get the list of page layouts available in the workspace, built-in layouts first.
getPageLayouts(): Promise<IPublisherPageLayout[]>;
Returns
Promise<IPublisherPageLayout[]>
IWorkspacePublisherService.updateDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Update an existing document. Rejects locked documents.
updateDocument(publisherDocument: IPublisherDocument): Promise<IPublisherDocument>;
Parameters
Parameter | Type | Description |
|---|---|---|
publisherDocument |
Returns
Promise<IPublisherDocument>
IWorkspacePublisherService.updateDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Update an existing document template. Rejects locked templates.
updateDocumentTemplate(template: IPublisherDocumentTemplate): Promise<IPublisherDocumentTemplate>;
Parameters
Parameter | Type | Description |
|---|---|---|
template |
Returns
Promise<IPublisherDocumentTemplate>
IWorkspacePublisherService.updatePageLayout()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production.
Update an existing page layout. Rejects built-in and locked layouts.
updatePageLayout(page: IPublisherPageLayout): Promise<IPublisherPageLayout>;
Parameters
Parameter | Type | Description |
|---|---|---|
page |
Returns
Promise<IPublisherPageLayout>