Interface CometPublicationPluginLocal
- All Known Implementing Classes:
CometPublicationPluginDefault
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe Enum DocumentStatus. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Constant JNDINAME.static final StringThe Constant MAPPED_NAME.static final intThe Constant NODETYPE_DOCUMENT_ID.static final intThe Constant NODETYPE_PUBLICATION_ID.static final intThe Constant NODETYPE_SPREAD_ID.static final intThe Constant PARAMETER_TYPE_CHECKBOX.static final intThe Constant PARAMETER_TYPE_COMBO.static final intThe Constant PARAMETER_TYPE_TEXT. -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks for required modulescheckinDocument(String sessionID, CometPriintRemote.ServerDocument document, String callback) Checks in a documentcheckoutDocument(String sessionID, String documentID, String masterDocumentID, String callback, String options) Checks out a document.collectDocuments(String publicationId, int levels) Collects all documents of a publication up to levels levels.documentStatus(String sessionID, String documentID, String callback) Gets the status for a particular documentdownloadMetaData(String sessionID, String documentID, String callback) Gets meta data for a document.getDocumentParameters(String documentId) Gets parameters for a particular document.getDocumentProductPlanning(String entityModelIdentifier, Context context, String documentId, String resultEntityId, String searchString) Gets the product selection for a document.getDocumentProductPlanning(String entityModelIdentifier, Context context, String documentId, String resultEntityId, String searchString, int mappingFlag) Gets the product selection for a document.getDocumentProductSelection(String entityModelIdentifier, Context context, String documentId) Gets the product selection for a document.getDocumentProperty(String documentId, String propertyName) Gets the value of a document property.getDocumentPublicationId(String documentId) Gets the publication ID for a document.getDocumentRootPublicationId(String documentId) Gets the root publication ID for a document.Gets document templatesgetDocumentWorkflowStates(String documentId) Gets workflow states for a particular document.getDocumentWorkflowStatus(String documentId) Gets the current workflow status of a documentDeprecated.getNextDocumentWorkflowStates(String documentId) Gets the next workflow states applicable for this documentgetParameterDropdownValues(String parameterId) Gets dropdown values for a particular parameter.Gets all parameter definitions.getPublicationPath(String publicationId) Gets the path (folder) of a publication.Gets the list of publication typesgetRootPublicationId(String publicationId) Gets the root publication ID for a publication.Gets the list of root / top level publications.getSubPublications(String publicationId) Gets sub publications for a particular publication.Gets all workflow states.revertDocument(String sessionID, String documentID, String callback) Reverts a document.search(String publicationId, String subPublicationsId, String documentName, String workflowStatusId1, String workflowStatusId2, String workflowStatusId3, String param1, String value11, String value12, String value13, String param2, String value21, String value22, String value23, String param3, String value31, String value32, String value33, boolean restrictiveCheckbox, boolean recursive) Searches documents according to search criteriavoidsetDocumentParameters(String documentId, String parameterName, int count, String parameterValue1, String parameterValue2, String parameterValue3) Sets a parameter value for a particular document.voidsetDocumentProperty(String documentId, String propertyName, String propertyValue) Sets a property for a particular document.voidsetDocumentWorkflowStatus(String documentId, String actionId, String url) Sets the document workflow statusuploadMetaData(String sessionID, String documentID, CometPriintRemote.ServerDocument document, String callback) Uploads meta data for a document
-
Field Details
-
JNDINAME
The Constant JNDINAME.- See Also:
-
MAPPED_NAME
The Constant MAPPED_NAME.- See Also:
-
PARAMETER_TYPE_CHECKBOX
static final int PARAMETER_TYPE_CHECKBOXThe Constant PARAMETER_TYPE_CHECKBOX.- See Also:
-
PARAMETER_TYPE_COMBO
static final int PARAMETER_TYPE_COMBOThe Constant PARAMETER_TYPE_COMBO.- See Also:
-
PARAMETER_TYPE_TEXT
static final int PARAMETER_TYPE_TEXTThe Constant PARAMETER_TYPE_TEXT.- See Also:
-
NODETYPE_PUBLICATION_ID
static final int NODETYPE_PUBLICATION_IDThe Constant NODETYPE_PUBLICATION_ID.- See Also:
-
NODETYPE_DOCUMENT_ID
static final int NODETYPE_DOCUMENT_IDThe Constant NODETYPE_DOCUMENT_ID.- See Also:
-
NODETYPE_SPREAD_ID
static final int NODETYPE_SPREAD_IDThe Constant NODETYPE_SPREAD_ID.- See Also:
-
-
Method Details
-
getDocumentParameters
Gets parameters for a particular document.
Gets parameters for a particular document.
The method returns parameters as simple key value pairs (parameter identifier => value).
Parameters with multiple values are returned in the format- parameter name => combined value (fields delimited by ':')
- parameter name_1 => value 1
- parameter name_2 => value 2
- parameter name_3 => value 3
getParameters()method.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "67123456"; StringList parameters = publication::get_parameters(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- Map of parameters set for this document
- Throws:
CometException- the comet exception
-
setDocumentParameters
void setDocumentParameters(String documentId, String parameterName, int count, String parameterValue1, String parameterValue2, String parameterValue3) throws CometException Sets a parameter value for a particular document.
Sets a parameter value for a particular document.
If this parameter has multiple values, either one, two or all values can be set. This is determined by the count argument.
To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * parameterId = "country.selection"; char * parameterValue1 = "DE"; // in this example we omit value2 and value3, "count&auot; is set // to "1" in this case: publication::set_parameters(documentId, parameterId, parameterValue1); // ... return 0; }- Parameters:
documentId- ID of the documentparameterName- identifier of the parametercount- number of values to setparameterValue1- first valueparameterValue2- second valueparameterValue3- third value- Throws:
CometException- the comet exception
-
getDocumentRootPublicationId
Gets the root publication ID for a document.
Gets the root publication ID for a document.
The root publication is a top level publication, i.e.: this publication does not have any parent.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * rootPublicationId = publication::get_rootpublication_id(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- ID of the root publication
- Throws:
CometException- the comet exception
-
getDocumentPublicationId
Gets the publication ID for a document.
Gets the publication ID for a document.
The documents publication is the direct parent of a document node.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * publicationId = publication::get_publication_id(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- ID of the documents publication
- Throws:
CometException- the comet exception
-
getRootPublicationId
Gets the root publication ID for a publication.
Gets the root publication ID for a publication.
The root publication is a top level publication, i.e.: this publication does not have any parent.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * publicationId = publication::get_publication_id(documentId); char * rootPublicationId = publication::get_rootpublication_id(publicationId); // ... return 0; }- Parameters:
publicationId- ID of the publication- Returns:
- ID of the root publication
- Throws:
CometException- the comet exception
-
getPublicationPath
Gets the path (folder) of a publication.
- Parameters:
publicationId- Id of the publication- Returns:
- path / folder of the publication
- Throws:
CometException- the comet exception
-
collectDocuments
Collects all documents of a publication up to levels levels.
- Parameters:
publicationId- Id of the publicationlevels- search depth- Returns:
- list of all documents in this publication
- Throws:
CometException- the comet exception
-
setDocumentProperty
void setDocumentProperty(String documentId, String propertyName, String propertyValue) throws CometException Sets a property for a particular document.
Sets a property for a particular document.
The method is responsible for any evaluation and saving the new value to the publication system if possible.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * propertName = "label"; char * propertyValue = "newLabelForMyDocument"; int result = publication::set_property(documentId, propertyName, propertyValue); // ... return result; }- Parameters:
documentId- ID of the documentpropertyName- name of the property. Note: only a view names are supported at the moment (label, description, sort), other values will cause an exceptionpropertyValue- new value for the property- Throws:
CometException- the comet exception
-
getDocumentProperty
Gets the value of a document property.
Gets the value of a document property.
To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * documentLabel = publication::get_document_property(documentId, "label"); // ... return 0; }- Parameters:
documentId- ID of the documentpropertyName- name of the property. Note: only a view names are supported at the moment (label, description, sort), other values will cause an exception- Returns:
- the value of a document property
- Throws:
CometException- the comet exception
-
getRootPublications
Gets the list of root / top level publications.
Gets the list of root / top level publications.
The result list should only contain publication nodes, i.e.:- the path property set to empty or zero
- iconId set to 2020 (or other suitable icons)
- hasChildren set to true, if this node has sub publications or contains documents
To test this method, you can either select "Tree view" in the InDesign publication panel and click the "search" button or use the following cscript fragment:
int main() { // the publication::get_tree function takes one optional parameter // "parentId". // If omitted, the root tree is requessted. PublicationList rootPublications = publication::get_tree(); // ... return 0; }*- Returns:
- list of root / top level publications
- Throws:
CometException- the comet exception
-
getSubPublications
Gets sub publications for a particular publication.
Gets sub publications for a particular publication.
Clients can request sub publications for any publication node or for documents.
The result list may contain publication, document and spread nodes. The path property should only be set for actual document nodes, otherwise clients may misinterpret the result. Usually a publication node contains documents and / or sub publications and a document node contains spreads.
Also, a suitable icon ID should be set, typically this is- 2020 for publications
- 2017 for documents and
- 2036 for spreads
To test this method, either click the "open" arrow of any node shown in the InDesign publication panel tree or you can use the following cscript fragment:
int main() { char * parentNode = "789234567"; PublicationList subPublications = publication::get_tree(parentNode); // ... return 0; }- Parameters:
publicationId- ID of the parent publication- Returns:
- list of publications (including documents or spreads, depending on the parent)
- Throws:
CometException- the comet exception
-
getWorkflowStates
Gets all workflow states.
Gets all workflow states. The list may be filtered according to access rights for the current user / session.
The method returns abstract workflow states, i.e.: workflow states not linked with a particular document.
To test this method, you can use the following cscript fragment:
int main() { WorkflowStatusList workflowStates = publication::get_workflow_states(); // ... return 0; }- Returns:
- list of workflow states visible for the current user.
- Throws:
CometException- the comet exception
-
getDocumentWorkflowStates
Gets workflow states for a particular document.
Gets all workflow states applicable for a particular document.
This method must also define the actionId for each workflow status returned, i.e.: the ID of a concrete task created for this document and workflow status.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; WorkflowStatusList workflowStates = publication::get_document_workflow_states(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- list of workflow states applicable for this document
- Throws:
CometException- the comet exception
-
getDocumentWorkflowStatus
Gets the current workflow status of a document
Gets the currentworkflow status including the actionId, i.e. ID of the concrete task created for this document and workflow status.
To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; WorkflowStatus workflowStatus = publication::get_document_workflow_status(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- creent workflow status of the document
- Throws:
CometException- the comet exception
-
getNextDocumentWorkflowStates
Gets the next workflow states applicable for this document
Gets the next workflow states applicable for this document including the actionIds, i.e. the IDs of concrete tasks created for this document and workflow states.
To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; WorkflowStatusList workflowStates = publication::get_next_workflow_states(documentId); // ... return 0; }- Parameters:
documentId- ID of the document- Returns:
- list of workflow states, which can be set for this dociument next
- Throws:
CometException- the comet exception
-
setDocumentWorkflowStatus
void setDocumentWorkflowStatus(String documentId, String actionId, String url) throws CometException Sets the document workflow status
Sets the document workflow status.
This method is also responsible for checking, if the new workflow status can be applied to this document.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * actionId = "123678900"; char * url = "not used at the moment"; int result = publication::set_document_workflow_status(documentId, actionId, url); // ... return result; }- Parameters:
documentId- ID of the documentactionId- ID of the task to set for this documenturl- currently unused- Throws:
CometException- the comet exception
-
search
List<Publication> search(String publicationId, String subPublicationsId, String documentName, String workflowStatusId1, String workflowStatusId2, String workflowStatusId3, String param1, String value11, String value12, String value13, String param2, String value21, String value22, String value23, String param3, String value31, String value32, String value33, boolean restrictiveCheckbox, boolean recursive) throws CometException Searches documents according to search criteria
Searches for document using very sophisticated search criteria.
To test this method, you can either select "Detail Search" in the InDesign publication panel, enter search criteria and click the search button, or use the following cscript fragment:
int main() { // Note: ALL parameters have default, so this call should just // result in "find all" PublicationList publications = publication::search(); // ... return 0; }- Parameters:
publicationId- ID of the publication documents must be child ofsubPublicationsId- ID of the subpublication documents must be child ofdocumentName- name (part of name) of documentsworkflowStatusId1- a workflow status, which should be assigned to this documentworkflowStatusId2- an alternative workflow statusworkflowStatusId3- another alternative workflow statusparam1- name of a parameter documents must match, ignored if null or emptyvalue11- first value of first parameter to matchvalue12- second value of first parameter to matchvalue13- third value of first parameter to matchparam2- name of a parameter documents must match, ignored if null or emptyvalue21- first value of second parameter to matchvalue22- second value of second parameter to matchvalue23- third value of second parameter to matchparam3- name of parameter documents must match, ignored if null or emptyvalue31- first value of third parameter to matchvalue32- second value of third parameter to matchvalue33- third value of third parameter to matchrestrictiveCheckbox- link search criteria with "AND" (true) or "OR" (false)recursive- search recursive in publications- Returns:
- list of documents, which match all search criteria
- Throws:
CometException- the comet exception
-
getPublicationTypes
Gets the list of publication types
Gets the list of publication types configured for this system.
To test this method, you can use the following cscript fragment:
int main() { PublicationTypeList publicationTypes = publication::get_publication_types(); // ... return 0; }- Returns:
- list of publication types
- Throws:
CometException- the comet exception
-
getParameters
Gets all parameter definitions.
Gets all parameter definitions configured on this system.
To test this method, you can use the following cscript fragment:
int main() { ParameterList parameters = publication::get_all_parameters(); // ... return 0; }- Returns:
- list of parameters
- Throws:
CometException- the comet exception
-
getParameterDropdownValues
Gets dropdown values for a particular parameter.
Gets dropdown values for a particular Combo parameter.
To test this method, you can use the following cscript fragment:
int main() { char * parameterId = "country.selection"; ParameterList dropDownValues = publication::get_parameter_values(parameterId); // ... return 0; }- Parameters:
parameterId- the parameter id- Returns:
- list of parameters (key value pairs) for a particular Combo parameter
- Throws:
CometException- the comet exception
-
getDocumentProductSelection
List<Product> getDocumentProductSelection(String entityModelIdentifier, Context context, String documentId) throws CometException Gets the product selection for a document.
Gets the product selection for a particular document.
This method returns the product selection of the "classic" planning tool. To get data from the new planning tool, usegetDocumentProductPlanning(String, Context, String, String, String). Product data should include placement information such as templateID.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; ProductList products = publication::get_document_product_selection(documentId, entityIdentifier, searchString); // ... return 0; }- Parameters:
entityModelIdentifier- identifier of the entity modelcontext- context criteriadocumentId- ID of the document- Returns:
- list of products selected for this document
- Throws:
CometException- the comet exception
-
getDocumentProductPlanning
List<Product> getDocumentProductPlanning(String entityModelIdentifier, Context context, String documentId, String resultEntityId, String searchString) throws CometException Gets the product selection for a document.
Gets the product selection for a particular document.
This method returns the product selection of the "new" planning tool. To get data from the classic planning tool, usegetDocumentProductSelection(String, Context, String)Product data should include placement information such as templateID.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * entityIdentifier = ""; // leave empty to get all entities char * searchString = ""; // leave empty to get all results ProductList products = publication::get_document_product_planning(documentId, entityIdentifier, searchString); // ... return 0; }- Parameters:
entityModelIdentifier- identifier of the entity modelcontext- context criteriadocumentId- ID of the documentresultEntityId- identifier of entity to returnsearchString- additional search criteria- Returns:
- list of products matching search criteria and selected for this document
- Throws:
CometException- the comet exception
-
getDocumentProductPlanning
List<Product> getDocumentProductPlanning(String entityModelIdentifier, Context context, String documentId, String resultEntityId, String searchString, int mappingFlag) throws CometException Gets the product selection for a document.
Gets the product selection for a particular document.
This method returns the product selection of the "new" planning tool. To get data from the classic planning tool, usegetDocumentProductSelection(String, Context, String)Product data should include placement information such as templateID.To test this method, you can use the following cscript fragment:
int main() { char * documentId = "678123456"; char * entityIdentifier = ""; // leave empty to get all entities char * searchString = ""; // leave empty to get all results ProductList products = publication::get_document_product_planning(documentId, entityIdentifier, searchString); // ... return 0; }- Parameters:
entityModelIdentifier- identifier of the entity modelcontext- context criteriadocumentId- ID of the documentresultEntityId- identifier of entity to returnsearchString- additional search criteriamappingFlag- which ID to use in the result, 0 = use ID of bucket linked with the planning record, 1 = use ID of planning record, 2 = use ID of bucket and as parent ID of planning record.- Returns:
- list of products matching search criteria and selected for this document
- Throws:
CometException- the comet exception
-
getDocumentTemplates
Gets document templates
Gets the list of master documents configured on this system
Document templates are managed in a flat list, there is no hierarchy or further structure available for master documents.To test this method, you can use the following cscript fragment:
int main() { PublicationList documentTemplates = publication::get_document_templates(); // ... return 0; }- Returns:
- list of master documents
- Throws:
CometException- the comet exception
-
getMasterDocuments
Deprecated.- Throws:
CometException
-
uploadMetaData
CometPriintRemote.UploadMetaDataResult uploadMetaData(String sessionID, String documentID, CometPriintRemote.ServerDocument document, String callback) throws RemoteException Uploads meta data for a document
Uploads meta data for a document.
This method is usually called within the checkin process for a document, which can be triggered either by clicking the "check in" button in the InDesign publication panel or by calling the cscript function publication::checkin.- Parameters:
sessionID- the session IDdocumentID- the document IDdocument- the documentcallback- optional arguments, for historical reason called callback- Returns:
- the upload meta data result
- Throws:
RemoteException- the remote exception
-
downloadMetaData
CometPriintRemote.DownloadMetaDataResult downloadMetaData(String sessionID, String documentID, String callback) throws RemoteException Gets meta data for a document.
Gets meta data for a document.
This method is usually called during the checkout process (triggered either by clicking the "checkout" button in the InDesign publication panel or by calling the cscript function publication::checkout or priint::checkout).
- Parameters:
sessionID- the session IDdocumentID- the document IDcallback- the callback- Returns:
- the download meta data result
- Throws:
RemoteException- the remote exception
-
checkoutDocument
CometPriintRemote.CheckoutDocumentResult checkoutDocument(String sessionID, String documentID, String masterDocumentID, String callback, String options) throws RemoteException Checks out a document.
This method is called when the "checkout" button has been clicked in the client application or the cscript function publication::checkout or priint::checkout has been called.
The method is responsible for checking, if the document can be checked out in this session, deliver document data and mark the document as "checked out" (e.g. set to {@link DocumentStatus#OPENED_ON_CLIENT#getId()} OPENED_ON_CLIENT.getId()).
- Parameters:
sessionID- the session IDdocumentID- the document IDmasterDocumentID- the master document IDcallback- the callbackoptions- the options- Returns:
- the checkout document result
- Throws:
RemoteException- the remote exception
-
checkinDocument
CometPriintRemote.CheckinDocumentResult checkinDocument(String sessionID, CometPriintRemote.ServerDocument document, String callback) throws RemoteException Checks in a document
Checks in a document.
This method is called when the "checkin" button has been clicked in the client application or the cscript function publication::checkin or priint::checkin has been called.
The method is responsible for checking, if the document can be checked in in this session, do any required action for saving the document data and reset the document status (e.g. set to {@link DocumentStatus#AVAILABLE#getId()}).
- Parameters:
sessionID- ID of the sessiondocument- ID of the documentcallback- optional arguments, for historical reason called callback- Returns:
- CheckinDocumentResult with execution result code
- Throws:
RemoteException- the remote exception
-
documentStatus
CometPriintRemote.DocumentStatusResult documentStatus(String sessionID, String documentID, String callback) throws RemoteException Gets the status for a particular document
Gets the status for a particular document.
Status can be one of- int kAvailable = 1; ({@link DocumentStatus#AVAILABLE#getId()})
- int kOpenedOnServer = 2; ({@link DocumentStatus#OPENED_ON_SERVER#getId()})
- int kOpenedOnClient = 3; ({@link DocumentStatus#OPENED_ON_CLIENT#getId()})
- int kOpenedByUser = 4; ({@link DocumentStatus#OPENED_BY_USER#getId()})
- int kOpenedInSession = 5; ({@link DocumentStatus#OPENED_IN_SESSION#getId()})
- int kNotExisting = 6; ({@link DocumentStatus#NOT_EXISTING#getId()})
- int kNotRegistered = 7; ({@link DocumentStatus#NOT_REGISTERED#getId()})
- for each publication node shown in the publication panel or
- when the cscript function priint::document_status is called
- Parameters:
sessionID- ID of the current sessiondocumentID- ID of the documentcallback- optional arguments, for historical reason called callback- Returns:
- DocumentStatusResult with status and execution result code
- Throws:
RemoteException- the remote exception
-
revertDocument
CometPriintRemote.RevertDocumentResult revertDocument(String sessionID, String documentID, String callback) throws RemoteException Reverts a document.
Called, when a client (InDesign priint:comet) reverts a document.
This can either be triggered by clicking the "revert" button in the priint:comet publication panel or by calling the cscript function priint::revert.
The method is responsible for checking, if the document can be reverted in this session and reset the document status (e.g. set to closed or available).- Parameters:
sessionID- ID of the current sessiondocumentID- ID of the documentcallback- optional arguments, for historical reason called callback- Returns:
- RevertDocumentResult with execution result code
- Throws:
RemoteException- the remote exception
-
checkForRequiredModules
Checks for required modules
Checks for required modules. This method is called during CometBridge login to determine, if publication data is available or not.
If any module or prerequisite is missing, an Exception must be thrown. This won't deny login, but disable publication access and related functions for the current session.- Throws:
CometException- the comet exception
-