Package wt.doc
Interface WTDocumentService
Service for WTDocumentMaster and WTDocument objects and their associations.
Supported API: true
Extendable: false
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptioncheckinDocument(FormatContentHolder document, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to do the checkin of the document and allows for any post checkin processing.checkOutDocument(FormatContentHolder document, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to do the checkout of the document and allows for any post checkout processing.createDependencyLink(WTDocument doc, Vector referenced_docs, Vector comment) Convenience method for creating a dependency link between multiple documents.createDependencyLink(WTDocument doc, Vector referenced_docs, Vector comment, String checkOutNote, String checkInNote) Convenience method for creating a dependency link between multiple documents.createDependencyLink(WTDocument doc, WTDocument referenced_doc, String comment) Convenience method for creating a dependency link between two documents.createDocument(String doc_type, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to create a document object and persist it.createOrderedUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) Convenience method for creating a usage link between multiple documents.createUsageLink(WTDocument parent, Vector child) Convenience method for creating a usage link between multiple documents.createUsageLink(WTDocument parent, Vector child, String checkOutNote, String checkInNote) Convenience method for creating a usage link between multiple documents.Returns the WTDocumentConfigSpec for the current principal.getDependsOnWTDocuments(WTDocument document) Return a QueryResult of WTDocuments that the given WTDocument is dependent on.getDependsOnWTDocuments(WTDocument document, boolean onlyOtherSides) Return a QueryResult of WTDocuments that the given WTDocument is dependent on.getHasDependentWTDocuments(WTDocument document) Return a QueryResult of WTDocuments that are dependent on the given WTDocument.getHasDependentWTDocuments(WTDocument document, boolean onlyOtherSides) Return a QueryResult of WTDocuments that are dependent on the given WTDocument.getOrderedUsesWTDocumentMasters(WTDocument document) Navigates the WTDocumentUsageLink along the uses role, returning a Enumeration of WTDocumentMaster.getOrderedUsesWTDocuments(WTDocument document, ConfigSpec configSpec) Applies the configSpec to the result of navigating the WTDocumentUsageLink along the uses role; returns a Enumeration of Persistable[], in which the WTDocumentUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position.getUsedByWTDocuments(WTDocumentMaster documentMaster) Navigates the WTDocumentUsageLink along the usedBy role, returning a QueryResult of WTDocuments.getUsesWTDocumentMasters(WTDocument document) Navigates the WTDocumentUsageLink along the uses role, returning a QueryResult of WTDocumentMaster.getUsesWTDocuments(WTDocument document, WTDocumentConfigSpec configSpec) Applies the configSpec to the result of navigating the WTDocumentUsageLink along the uses role; returns a QueryResult of Persistable[], in which the WTDocumentUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position.getUsesWTDocumentUsageLinks(WTDocument document) Returns the WTDocumentUsageLinks resulting from navigating the WTDocumentUsageLink along the uses role.getWTDocumentStructure(WTDocument document, WTDocumentConfigSpec configSpec, int traversal) Recursively walk a document structure returning the documents down the structure.orderUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) Order usage links between the parent document and it's children documents.postCreateDocument(FormatContentHolder document, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to allow for extra post processing of the document after it has been persisted.postUpdateDocument(FormatContentHolder document, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to allow for extra post processing of the document after it has been persisted.voidremoveDependencyLink(Vector links) Convenience method for removing multiple dependency links.voidConvenience method for removing a dependency link between two documents.removeDependencyLink(WTDocument document, Vector links, String checkOutNote, String checkInNote) Convenience method for removing multiple dependency links.removeOrderedUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) Remove usage links from a parent document.voidremoveUsageLink(WTDocument parent, Vector child) Convenience method for removing a usage link between multiple documents.voidremoveUsageLink(WTDocument parent, WTDocumentMaster child) Convenience method for removing a usage link between two documents.saveWTDocumentConfigSpec(WTDocumentConfigSpec a_WTDocumentConfigSpec) Saves the WTDocumentConfigSpec for the current principal.updateDependencyLink(Vector links, Vector comments) Convenience method for updating a multiple dependency links.updateDependencyLink(WTDocument document, Vector links, Vector comments, String checkOutNote, String checkInNote) Convenience method for updating multiple dependency links.updateDocument(FormatContentHolder document, DocumentFormData form_data) Uses the DocumentFactory to get the delegate to update a document object and persist it.
-
Method Details
-
getUsesWTDocuments
QueryResult getUsesWTDocuments(WTDocument document, WTDocumentConfigSpec configSpec) throws WTException Applies the configSpec to the result of navigating the WTDocumentUsageLink along the uses role; returns a QueryResult of Persistable[], in which the WTDocumentUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position.
Supported API: true- Parameters:
document- The WTDocument to navigate.configSpec- The ConfigSpec to use to filter the iterations for the masters used.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getUsesWTDocumentUsageLinks
Returns the WTDocumentUsageLinks resulting from navigating the WTDocumentUsageLink along the uses role.
Supported API: true- Parameters:
document- The WTDocument to navigate.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getUsesWTDocumentMasters
Navigates the WTDocumentUsageLink along the uses role, returning a QueryResult of WTDocumentMaster.
Supported API: true- Parameters:
document- The document to navigate.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getUsedByWTDocuments
Navigates the WTDocumentUsageLink along the usedBy role, returning a QueryResult of WTDocuments. Note that only the latest iteration for any of the document versions is returned.
Supported API: true- Parameters:
documentMaster- The document master to navigate to find those documents that use it.- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
createOrderedUsageLinks
WTDocument createOrderedUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) throws WTException Convenience method for creating a usage link between multiple documents. This method executes the work within a transaction so if one change fails all will be rolled back. Returns the parent document. It is very important that all of the children documents of this document should be passed into this method both ones with persisted usage links to the parent and ones without persisted links to the parent. This will allow the ordering of all of the children after the new usage links are created. The user must have sufficient access to parent document to allow a checkout of the document. If the parent document is not checked out this method will checkout the document and then on completion of the creating and ordering of links the parent is checked back in. If the document is already checked out to the user then this method will do the creating and reordering and return the parent document still checked out. This method does not honor administrative rights to modify a document that another user has checked out. If the administrator wants to modify the document structure then they should check the document in for the user and then modify the structure.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink.. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
orderUsageLinks
WTDocument orderUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) throws WTException Order usage links between the parent document and it's children documents. The usage links are already created. This method executes the work within a transaction so if one change fails all will be rolled back. Returns the parent document. It is very important that all of the children documents of this document should be passed into this method so that the order on all of the children can be set correctly. The user must have sufficient access to parent document to allow a checkout of the document. If the parent document is not checked out this method will checkout the document and then on completion of the ordering the parent is checked back in. If the document is already checked out to the user then this method will do the reordering and return the parent document still checked out. This method does not honor administrative rights to modify a document that another user has checked out. If the administrator wants to modify the document structure then they should check the document in for the user and then modify the structure.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink.. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
removeOrderedUsageLinks
WTDocument removeOrderedUsageLinks(WTDocument parent, Vector child, String checkOutNote, String checkInNote) throws WTException Remove usage links from a parent document. This method executes the work within a transaction so if one change fails all will be rolled back. Returns the parent document. The user must have sufficient access to parent document to allow a checkout of the document. If the parent document is not checked out this method will checkout the document and then on completion of the removals the parent is checked back in. If the document is already checked out to the user then this method will do the removals and return the parent document still checked out. This method does not honor administrative rights to modify a document that another user has checked out. If the administrator wants to modify the document structure then they should check the document in for the user and then modify the structure.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink.. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
getOrderedUsesWTDocuments
Enumeration getOrderedUsesWTDocuments(WTDocument document, ConfigSpec configSpec) throws WTException Applies the configSpec to the result of navigating the WTDocumentUsageLink along the uses role; returns a Enumeration of Persistable[], in which the WTDocumentUsageLinks are at the 0th position and the corresponding iterations (or master if there is no corresponding iteration) in the 1th position. The items returned are ordered by the order attribute on the WTDocumentUsageLink.
Supported API: true- Parameters:
document- The WTDocument to navigate.configSpec- The ConfigSpec to use to filter the iterations for the masters used.- Returns:
- Enumeration
- Throws:
WTException- See Also:
-
getOrderedUsesWTDocumentMasters
Navigates the WTDocumentUsageLink along the uses role, returning a Enumeration of WTDocumentMaster. The items returned are ordered by the order attribute on the WTDocumentUsageLink.
Supported API: true- Parameters:
document- The document to navigate.- Returns:
- Enumeration
- Throws:
WTException- See Also:
-
getDependsOnWTDocuments
Return a QueryResult of WTDocuments that the given WTDocument is dependent on.
Supported API: true- Parameters:
document-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getDependsOnWTDocuments
Return a QueryResult of WTDocuments that the given WTDocument is dependent on. If the onlyOtherSides parameter is false, the QueryResult includes a set of WTDocumentDependencyLinks that have references to the WTDocuments.
Supported API: true- Parameters:
document-onlyOtherSides-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getHasDependentWTDocuments
Return a QueryResult of WTDocuments that are dependent on the given WTDocument.
Supported API: true- Parameters:
document-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
getHasDependentWTDocuments
QueryResult getHasDependentWTDocuments(WTDocument document, boolean onlyOtherSides) throws WTException Return a QueryResult of WTDocuments that are dependent on the given WTDocument. If the onlyOtherSides parameter is false, the QueryResult includes a set of WTDocumentDependencyLinks that have references to the WTDocuments.
Supported API: true- Parameters:
document-onlyOtherSides-- Returns:
- QueryResult
- Throws:
WTException- See Also:
-
createDependencyLink
WTDocumentDependencyLink createDependencyLink(WTDocument doc, WTDocument referenced_doc, String comment) throws WTException Convenience method for creating a dependency link between two documents. Sets the comment field and persists the link.
Supported API: true- Parameters:
doc- The document that depends on the other document or the one that references other documents.referenced_doc- The document that is referenced by the other document.comment- Some explanation of why one document is dependent on the other document.- Returns:
- WTDocumentDependencyLink
- Throws:
WTException
-
createDependencyLink
Vector createDependencyLink(WTDocument doc, Vector referenced_docs, Vector comment) throws WTException Convenience method for creating a dependency link between multiple documents. Sets the comment field and persists the link. Is executed inside of a transactions so if one fails all will be rolled back. Returns a vector of all of the dependency links that were created. The referenced_doc vector and the comments vector must be in the same order. This method depends on the document being in an updateable state, it does not check.
Supported API: true- Parameters:
doc- The document that depends on the other document or the one that references other documents.referenced_docs- The documents that are referenced the other document. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.comment- Some explanation of why one document is dependent on the other document. In the same order as the child vector.- Returns:
- Vector
- Throws:
WTException
-
createDependencyLink
WTDocument createDependencyLink(WTDocument doc, Vector referenced_docs, Vector comment, String checkOutNote, String checkInNote) throws WTException Convenience method for creating a dependency link between multiple documents. Sets the comment field and persists the link. Is executed inside of a transactions so if one fails all will be rolled back. The referenced_doc vector and the comments vector must be in the same order. Does a checkout of the document if required and will check it back in on completion, if this method checked it out. Returns the up to date iteration of the document that was passed in.
Supported API: true- Parameters:
doc- The document that depends on the other document or the one that references other documents.referenced_docs- The documents that are referenced the other document. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.comment- Some explanation of why one document is dependent on the other document. In the same order as the child vector.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
updateDependencyLink
Convenience method for updating a multiple dependency links. Sets the comment field and persists the link. Is executed inside of a transactions so if one fails all will be rolled back. Returns a vector of all of the dependency links that were updated. The child vector and the comments vector must be in the same order.
Supported API: true- Parameters:
links- The dependency links that are to be updated.comments- Some explanation of why one document is dependent on the other document. In the same order as the child vector.- Returns:
- Vector
- Throws:
WTException
-
updateDependencyLink
WTDocument updateDependencyLink(WTDocument document, Vector links, Vector comments, String checkOutNote, String checkInNote) throws WTException Convenience method for updating multiple dependency links. Sets the comment field and persists the link. Is executed inside of a transactions so if one fails all will be rolled back. Does a checkout of the document if required and will check it back in on completion, if this method checked it out. Returns the up to date iteration of the document that was passed in. The links vector and the comments vector must be in the same order.
Supported API: true- Parameters:
document- The document that depends on the other document or the one that references other documents.links- The dependency links that are to be updated.comments- Some explanation of why one document is dependent on the other document. In the same order as the child vector.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
createUsageLink
Convenience method for creating a usage link between multiple documents. Creating the usage link depends on the parent document being in an updateable state, which is the document was just created during this user interaction, the document is in the personal cabinet or the checked out folder of the person who is creating the usage link. This method assumes that the document is in an updateable state, it does not check. This method should never be called if the document is not in an updateable state. Is executed inside of a transactions so if one fails all will be rolled back. Returns a vector of all of the usage links that were created.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink.. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.- Returns:
- Vector
- Throws:
WTException
-
createUsageLink
WTDocument createUsageLink(WTDocument parent, Vector child, String checkOutNote, String checkInNote) throws WTException Convenience method for creating a usage link between multiple documents. This method executes the work within a transaction so if one change fails all will be rolled back. Returns the parent document. This method sets the order of the usage links to 0. The user must have sufficient access to parent document to allow a checkout of the document. If the parent document is not checked out this method will checkout the document and then on completion of the creating and ordering of links the parent is checked back in. If the document is already checked out to the user then this method will do the creating and reordering and return the parent document still checked out. This method does not honor administrative rights to modify a document that another user has checked out. If the administrator wants to modify the document structure then they should check the document in for the user and then modify the structure.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink.. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
getWTDocumentStructure
Vector getWTDocumentStructure(WTDocument document, WTDocumentConfigSpec configSpec, int traversal) throws WTException Recursively walk a document structure returning the documents down the structure. Use a configuration specification to walk the structure. The selected document to walk is included in the structure.
Supported API: true- Parameters:
document- The WTDocument to navigate.configSpec- The ConfigSpec to use to filter the iterations for the masters used.traversal- DocumentStructureNavigatorFactory.DEPTH_FIRST_NAVIGATOR or DocumentStructureNavigatorFactory.BREADTH_FIRST_NAVIGATOR.- Returns:
- Vector
- Throws:
WTException
-
removeDependencyLink
Convenience method for removing multiple dependency links. Is executed inside of a transactions so if one fails all will be rolled back.
Supported API: true- Parameters:
links- Remove all of the dependency links in the vector.- Throws:
WTException
-
removeDependencyLink
Convenience method for removing a dependency link between two documents.
Supported API: true- Parameters:
link- The dependency link to be removed.- Throws:
WTException
-
removeDependencyLink
WTDocument removeDependencyLink(WTDocument document, Vector links, String checkOutNote, String checkInNote) throws WTException Convenience method for removing multiple dependency links. Is executed inside of a transactions so if one fails all will be rolled back. Does a checkout of the document if required and will check it back in on completion, if this method checked it out. Returns the up to date iteration of the document that was passed in.
Supported API: true- Parameters:
document- The document that depends on the other document or the one that references other documents.links- The link oids for the dependency links.checkOutNote- Used if the parent document is checked out. If null is passed in the note is set to empty string.checkInNote- Used if the parent document is checked in. If null is passed in the note is set to empty string.- Returns:
- WTDocument
- Throws:
WTException
-
removeUsageLink
Convenience method for removing a usage link between multiple documents. Removing the usage link depends on the parent document being in an updateable state, which is the document is in the personal cabinet or the checked out folder of the person who is removing the usage link. This method assumes that the document is in an updateable state, it does not check. This method should never be called if the document is not in an updateable state. Is executed inside of a transactions so if one fails all will be rolled back.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument or WTDocumentMaster that is usedBy the other side of the WTDocumentUsageLink. Should not be the actual document but the reference string used in the client like VR:wt.doc.WTDocumet:oid.- Throws:
WTException
-
removeUsageLink
Convenience method for removing a usage link between two documents. Removing the usage link depends on the parent document being in an updateable state, which is the document is in the personal cabinet or the checked out folder of the person who is removing the usage link. This method assumes that the document is in an updateable state, it does not check. This method should never be called if the document is not in an updateable state.
Supported API: true- Parameters:
parent- WTDocument that uses the other side of the WTDocumentUsageLink.child- WTDocument that is usedBy the other side of the WTDocumentUsageLink..- Throws:
WTException
-
createDocument
Uses the DocumentFactory to get the delegate to create a document object and persist it.
Supported API: true- Parameters:
doc_type- The class for the document to be created.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
postCreateDocument
FormatContentHolder postCreateDocument(FormatContentHolder document, DocumentFormData form_data) throws WTException Uses the DocumentFactory to get the delegate to allow for extra post processing of the document after it has been persisted. For example this will handle the creation and persistance of relationships.
Supported API: true- Parameters:
document- The document that will be processed.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
updateDocument
FormatContentHolder updateDocument(FormatContentHolder document, DocumentFormData form_data) throws WTException Uses the DocumentFactory to get the delegate to update a document object and persist it.
Supported API: true- Parameters:
document- The document that will be processed.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
postUpdateDocument
FormatContentHolder postUpdateDocument(FormatContentHolder document, DocumentFormData form_data) throws WTException Uses the DocumentFactory to get the delegate to allow for extra post processing of the document after it has been persisted. For example this will handle the creation and persistance of relationships or the removal of relationships.
Supported API: true- Parameters:
document- The document that will be processed.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
checkinDocument
FormatContentHolder checkinDocument(FormatContentHolder document, DocumentFormData form_data) throws WTException Uses the DocumentFactory to get the delegate to do the checkin of the document and allows for any post checkin processing.
Supported API: true- Parameters:
document- The document that will be processed.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
checkOutDocument
FormatContentHolder checkOutDocument(FormatContentHolder document, DocumentFormData form_data) throws WTException Uses the DocumentFactory to get the delegate to do the checkout of the document and allows for any post checkout processing.
Supported API: true- Parameters:
document- The document that will be processed.form_data- Name value pairs from the UI.- Returns:
- FormatContentHolder
- Throws:
WTException
-
findWTDocumentConfigSpec
Returns the WTDocumentConfigSpec for the current principal. If one does not exist, a null value is returned.
Supported API: true- Returns:
- WTDocumentConfigSpec
- Throws:
WTException
-
saveWTDocumentConfigSpec
WTDocumentConfigSpec saveWTDocumentConfigSpec(WTDocumentConfigSpec a_WTDocumentConfigSpec) throws WTException Saves the WTDocumentConfigSpec for the current principal. If one already exists, it is modified by applying the current values. If the supplied value is null and the current principal has a stored config spec, it is deleted.
Supported API: true- Parameters:
a_WTDocumentConfigSpec-- Returns:
- WTDocumentConfigSpec
- Throws:
WTException
-