IWorkspacePublisherService
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Service for managing page templates, document templates and documents.
export interface IWorkspacePublisherService
Remarks
Page templates returned by this service include the default page templates shipped with the product (DefaultPublisherPageTemplates). Default page templates carry isDefault: 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 template. | |
(ALPHA) Delete an existing document. | |
(ALPHA) Delete an existing document template. | |
(ALPHA) Delete an existing page template. Rejects default and locked page templates. | |
(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 template by its reference. | |
(ALPHA) Get the list of page templates available in the workspace, default page templates first. | |
(ALPHA) Tells whether the workspace has any document, without loading them. | |
(ALPHA) Update an existing document. Rejects locked documents. | |
(ALPHA) Update an existing document template. Rejects locked templates. | |
(ALPHA) Update an existing page template. Rejects default and locked page templates. |
Method details
IWorkspacePublisherService.createDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Create a new document.
createDocument(publisherDocument: IPublisherDocumentDefinitionV1): Promise<IPublisherDocumentV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
publisherDocument |
Returns
Promise<IPublisherDocumentV1>
IWorkspacePublisherService.createDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Create a new document template.
createDocumentTemplate(template: IPublisherDocumentTemplateDefinitionV1): Promise<IPublisherDocumentTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
template |
Returns
Promise<IPublisherDocumentTemplateV1>
IWorkspacePublisherService.createPageTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Create a new page template.
createPageTemplate(page: IPublisherPageTemplateDefinitionV1): Promise<IPublisherPageTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
page |
Returns
Promise<IPublisherPageTemplateV1>
IWorkspacePublisherService.deleteDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
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. See API maturity.
Delete an existing document template.
deleteDocumentTemplate(ref: ObjRef): Promise<void>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<void>
IWorkspacePublisherService.deletePageTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Delete an existing page template. Rejects default and locked page templates.
deletePageTemplate(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. See API maturity.
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. See API maturity.
Get a single document by its reference.
getDocument(ref: ObjRef): Promise<IPublisherDocumentV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherDocumentV1>
IWorkspacePublisherService.getDocuments()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Get the list of documents available in the workspace.
getDocuments(): Promise<IPublisherDocumentV1[]>;
Returns
Promise<IPublisherDocumentV1[]>
IWorkspacePublisherService.getDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Get a single document template by its reference.
getDocumentTemplate(ref: ObjRef): Promise<IPublisherDocumentTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherDocumentTemplateV1>
IWorkspacePublisherService.getDocumentTemplates()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Get the list of document templates available in the workspace.
getDocumentTemplates(): Promise<IPublisherDocumentTemplateV1[]>;
Returns
Promise<IPublisherDocumentTemplateV1[]>
IWorkspacePublisherService.getPageTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Get a single page template by its reference.
getPageTemplate(ref: ObjRef): Promise<IPublisherPageTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
ref |
Returns
Promise<IPublisherPageTemplateV1>
IWorkspacePublisherService.getPageTemplates()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Get the list of page templates available in the workspace, default page templates first.
getPageTemplates(): Promise<IPublisherPageTemplateV1[]>;
Returns
Promise<IPublisherPageTemplateV1[]>
IWorkspacePublisherService.hasDocuments()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Tells whether the workspace has any document, without loading them.
hasDocuments(): Promise<boolean>;
Returns
Promise<boolean>
IWorkspacePublisherService.updateDocument()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Update an existing document. Rejects locked documents.
updateDocument(publisherDocument: IPublisherDocumentV1): Promise<IPublisherDocumentV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
publisherDocument |
Returns
Promise<IPublisherDocumentV1>
IWorkspacePublisherService.updateDocumentTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Update an existing document template. Rejects locked templates.
updateDocumentTemplate(template: IPublisherDocumentTemplateV1): Promise<IPublisherDocumentTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
template |
Returns
Promise<IPublisherDocumentTemplateV1>
IWorkspacePublisherService.updatePageTemplate()methodAlpha
Alpha API. Initial API, highly likely to change outside SemVer. Don’t build on it in production. See API maturity.
Update an existing page template. Rejects default and locked page templates.
updatePageTemplate(page: IPublisherPageTemplateV1): Promise<IPublisherPageTemplateV1>;
Parameters
Parameter | Type | Description |
|---|---|---|
page |
Returns
Promise<IPublisherPageTemplateV1>