Package com.polarion.alm.tracker.model
Interface IModule
- All Superinterfaces:
IAdaptable
,IChangeListener
,IFolderItem
,IHasCustomValues
,IHasValues
,IPObject
,IUniqueObject
,IWithAttachments<IModuleAttachment>
,IWithLinkedOslcResources
,IWorkflowObject
public interface IModule
extends IWorkflowObject, IFolderItem, IWithAttachments<IModuleAttachment>, IWithLinkedOslcResources
- Since:
- 3.2
- Author:
- Miroslav Ruza
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Report of moveIn and moveOut methods - which work items were skipped and which additional were moved.static interface
static interface
Mutable extension ofIModulePageLayouter.IRenderingLayout
.static interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String[]
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from interface com.polarion.alm.projects.model.IUniqueObject
KEY_ID, KEY_PROJECT
Fields inherited from interface com.polarion.alm.tracker.model.IWithLinkedOslcResources
KEY_LINKED_OSLC_RESOURCES
Fields inherited from interface com.polarion.alm.tracker.model.IWorkflowObject
KEY_STATUS, KEY_TYPE, KEY_WORKFLOW_SIGNATURES
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExternalWorkItem
(IWorkItem externalWorkItem) Adds external Work Item into Document content.addRenderingLayout
(String label, String type, String layouter) Adds a new layout configuration.boolean
Returns builder of the home page that is useful for clients that build the full home page at once, in which case it is more convenient to use than the structure nodes API, and it also has much better performance in this scenario.can()
boolean
checkConflictInParts
(Set<String> partIds, Set<String> addedPartIds, Set<String> modifiedPartIds, Set<String> removedPartIds, IModule revisionModule) Checks if there is some conflict which would prevent merging of changes using the mergeContentParts method.compareCustomFields
(String revision1, String revision2) Deprecated.compareCustomFieldsWith
(IModule module, String revision1, String revision2) Deprecated.compareFields
(String revision1, String revision2) Compares fields of two revisions of the document.compareFieldsWith
(IModule module, String revision1, String revision2) Compares fields of a revision of this document with fields of a revision of the specified document.compareRevisions
(String revision1, String revision2) Compares two revisions of this module.Compares with other module.boolean
containsWorkItem
(IWorkItem item) createAttachment
(String fileName, String title, InputStream data) createComment
(Text text) Creates the (temporary) comment object, which can be manipulated by the client.Creates unreferenced work item stored in this module.Deprecated.use thecreateWorkItem(String)
createWorkItem
(String type) Creates and persists a Work Item, which will be stored in this Module.Creates a query for Work Items in this Document.void
delete()
Removes modulevoid
deleteAttachment
(IModuleAttachment attachment) filterWorkItems
(String query) Returns the Document's active Work Items that match the query and adds their ancestors.findCommentsReferencingWorkItem
(IWorkItem workItem) Finds comments for which theIModuleComment.getReferredWorkItem()
equals the given work itemvoid
freezeExternalWorkItem
(IWorkItem externalWorkItem, String revision) Freezes given external Work Item on given revision in Document content.Returns all work items (even unreferenced) contained in this module.getAttachment
(String fileName) Returns this module author.Returns Module from which was this one branched.Returns all documents/modules which are branched from this one.Returns the list of Work Item fields that were cleared and initialized with default values when this Document was branched.Returns query from which was this Module branched ornull
if Module was branched without query.getCommentById
(String id) Returns the comment with the given id (returns also the newly created comments)Returns all comments of this module.Returns sorted list of active work items contained in this module.If this module is derived (getDerivedFrom()
does not returnnull
), this method returns the set of field IDs that are derived.If this module is derived (getDerivedFrom does not return false) this method returns the link role that is used to link derived item to original itemReturns all documents/modules which are derived from this one.Returns all external Work Items contained in Document content.Returns field configuration for Work Item properties sidebar panel.Returns home page content.Module location - location of module folder, relative to modules root in the given project.Module name (name of the module's file, without path).Method returns module name with space in readable form Format: Space Name / Module Name or Module Name only if it's located in default spaceReturns configuration of outline numbering of workitems for this module.Gets prefix for outline numbering ornull
if prefix is not defined.Returns outline number of work item.Returns rendering layouts.Shortcut forgetRootComments(true)
.getRootComments
(boolean includeResolved) Returns root comments of this module.getStructureNodeOfWI
(IWorkItem workitem) Returns the structure node representing this work item if the work item is from this modulegetTitle()
Returns unreferenced work items contained in this module(even module is from specific revision).Gets the Variant work item this Module was created from.Returns all workflow signatures in the creation order.Returns signatures manager that can be used for all signature related tasks.getWorkItem
(String id) Returns work item with given id.getWorkItem
(String projectId, String id) Returns work item with given project id and id.handleDocumentComments
(String html, String userAgent) Process comments in form of span with id and add comment icon with tooltipboolean
boolean
Whether this module structure (tree of IStructureNode returned by getRootNode) was modified after it was read from storage (newly created modules are always modified).boolean
mergeContentParts
(Set<String> partIds, Map<String, String> addedParts, Map<String, String> modifiedParts, Set<String> removedPartIds) Merges partial changes with changes done by someone else, conflicts must be checked first by calling checkConflictInParts, result of calling this method when the conflict is detected is not defines.void
Moves or renames this document/module.void
moveIn
(Collection<IWorkItem> wis) Moves workitems from XML storage to this module.void
moveIn
(Collection<IWorkItem> wis, String sort) Moves workitems from XML storage to this module.moveInWithReport
(Collection<IWorkItem> wis, String sort) Moves workitems from XML storage to this module and reports which were skipped and which additional were moved.void
moveOut
(Collection<IWorkItem> wis) Moves workitems out from module to normal XML storage.Moves workitems out from module to normal XML storage and reports which were skipped and which additional were moved.overwriteExternalWorkItem
(IWorkItem externalWorkItem) Replace the given external Work Item in the Document content with a new one.void
removeComment
(IModuleComment comment) Remove comment object and all of it's children from module and persistencevoid
removeWorkItem
(IWorkItem item) Removes contained or external Work Item from the Document.renderHomePageContent
(String target, String userAgent, String query) Returns rendered home page content.renderHomePageContent
(String target, String userAgent, String query, ILocalId currentDocumentId) renderHomePageContent
(String target, String userAgent, String query, String language) Returns localized rendered home page content.void
save()
Saves modifications to the module structure (tree of IStructureNode returned by getRootNode)void
setAutoSuspect
(boolean autoSuspect) void
setBranchedFrom
(IModule value) Sets Module from which was this one branched.void
Sets the Work Item initialized fields (@see getBranchedWithInitializedFields to get to know what is the Work Item initialized field)void
setBranchedWithQuery
(String value) Sets query from which was this Module branched.void
setDerivedFields
(Collection<String> fields) Set the derived fields (@see getDerivedField to get to know what is the derived field)void
setDerivedFrom
(IModule source) Set the reference to the derived module.void
Set the derived_from link role (@see getDerivedFromLinkRole to get to know what is this link role)void
setHomePageContent
(Text content) Set home page content.void
setOutlineNumberingPrefix
(String prefix) Sets prefix of outline numbering of workitems for this module.void
Sets new document title.void
setUsesOutlineNumbering
(boolean uses) Sets whether outline numbering of workitems is used for this module.void
setVariant
(IWorkItem variant) Sets the Variant work item from which this Module was createdvoid
unfreezeExternalWorkItem
(IWorkItem externalWorkItem) Un-freezes given external Work Item.void
unreference
(IWorkItem workItem) Moves workItem to documents recycle bin, does nothing when the workItem cannot be foundupdateTitleHeading
(String title) Updates the first Title Heading in document content (if permissions allow it).boolean
Returnstrue
if outline numbering of workitems is used for this module.Methods inherited from interface com.polarion.platform.persistence.model.IAdaptable
adapt
Methods inherited from interface com.polarion.platform.persistence.model.IChangeListener
markChanged
Methods inherited from interface com.polarion.alm.tracker.model.IFolderItem
getFolder
Methods inherited from interface com.polarion.platform.persistence.model.IHasCustomValues
getCustomField, getCustomFieldPrototype, getCustomFieldsList, setCustomField
Methods inherited from interface com.polarion.platform.persistence.model.IPObject
copyTo, createStructureForKey, forget, getContextId, getDataRevision, getDataSvc, getEnumerationOptionForField, getEnumerationTypeForField, getFieldLabel, getFieldType, getIncompatibleCustomField, getIncompatibleCustomFieldPrototype, getIncompatibleCustomFieldsList, getLastRevision, getLocalId, getObjectId, getPrototype, getRevision, getUri, getValue, isPersisted, isReadOnly, isResolved, isUnresolvable, resolve, setEnumerationValue, setValue, update
Methods inherited from interface com.polarion.alm.projects.model.IUniqueObject
getId, getProjectId
Methods inherited from interface com.polarion.alm.tracker.model.IWithLinkedOslcResources
addLinkedOslcResource, getLinkedOslcResourcesStructs, getLinkedOslcResourceStruct, removeLinkedOslcResource
Methods inherited from interface com.polarion.alm.tracker.model.IWorkflowObject
getAvailableActions, getInitialAction, getProject, getStatus, getTrackerService, getType, getUnavailableActions, performAction, resetWorkflow, setType
-
Field Details
-
RENDERING_TARGET_PREVIEW
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_EDITOR
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_ROUNDTRIP
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_COMPARE
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_EXPORT_PDF
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_EXPORT_COMPARE_PDF
- Since:
- 3.6.1
- See Also:
-
RENDERING_TARGET_PRINT
- Since:
- 3.5
- See Also:
-
RENDERING_TARGET_SAVE
- Since:
- 3.8.2
- See Also:
-
PROTO
- See Also:
-
KEY_MODULENAME
- See Also:
-
KEY_LOCATION
- See Also:
-
KEY_MODULELOCATION
- See Also:
-
KEY_MODULELOCATION_TREE
- Since:
- 3.4
- See Also:
-
KEY_MODULELOCATION_GRANDPARENT
- Since:
- 3.5
- See Also:
-
KEY_MODULEFOLDER
- Since:
- 3.5
- See Also:
-
KEY_ALLOWEDWITYPES
- See Also:
-
KEY_STRUCTURELINKROLE
- See Also:
-
KEY_ARELINKSFROMPARENTTOCHILD
- See Also:
-
KEY_ROOTNODE
- See Also:
-
KEY_AUTHOR
- See Also:
-
KEY_CREATED
- See Also:
-
KEY_UPDATED
- See Also:
-
KEY_UPDATEDBY
- See Also:
-
KEY_DERIVEDFROM
- Since:
- 3.3
- See Also:
-
KEY_DERIVEDFIELDS
- Since:
- 3.3
- See Also:
-
KEY_BRANCHED_FROM
- Since:
- 3.6.0
- See Also:
-
KEY_BRANCHED_WITH_QUERY
- Since:
- 3.6.0
- See Also:
-
KEY_DERIVEDFROMLINKROLE
- Since:
- 3.3
- See Also:
-
KEY_USESOUTLINENUMBERING
- Since:
- 3.4
- See Also:
-
KEY_OUTLINENUMBERING
- Since:
- 3.4
- See Also:
-
KEY_HOMEPAGECONTENT
- Since:
- 3.5
- See Also:
-
KEY_RENDERINGLAYOUTS
- Since:
- 3.5
- See Also:
-
KEY_ATTACHMENTS
- Since:
- 3.5
- See Also:
-
KEY_COMMENTS
- Since:
- 3.5
- See Also:
-
ATTACHMENT_IMG_PREFIX
- Since:
- 3.5
- See Also:
-
KEY_AUTOSUSPECT
- Since:
- 3.5
- See Also:
-
KEY_TITLE
- Since:
- 3.8.2
- See Also:
-
KEY_VARIANT
- Since:
- 3.9.0
- See Also:
-
KEY_HEADING_SIDEBAR_FIELDS
- Since:
- 3.9.1
- See Also:
-
KEY_XCELERATOR_SHARES
- Since:
- 3.21.2
- See Also:
-
FIELD_ORDER
- Since:
- 3.8.1
-
DIFF_IGNORED_FIELDS
- Since:
- 3.8.0
-
ENUM_ID_TYPE
- Since:
- 3.8.1
- See Also:
-
ENUM_ID_STATUS
- Since:
- 3.8.1
- See Also:
-
KEY_BRANCHED_WITH_INITIALIZED_FIELDS
- Since:
- 3.23.10
- See Also:
-
-
Method Details
-
addRenderingLayout
Adds a new layout configuration.- Parameters:
label
- label of the configuration.type
- Work Item type the layout applies to.layouter
- layouter to use. Unless custom layouters were registered onlyIModuleManager.DEFAULT_LAYOUTER
or IModuleManager.PARAGRAPH_LAYOUTER or IModuleManager.SECTION_LAYOUTER are valid values..- Returns:
- the created
IRenderingLayoutStruct
. - Since:
- 3.5
-
getModuleName
String getModuleName()Module name (name of the module's file, without path).- Returns:
- Module name (name of the module's file, without path).
- See Also:
-
getTitle
- Returns:
- Module title.
- Since:
- 3.8.2
-
setTitle
Sets new document title.- Since:
- 3.8.2
-
updateTitleHeading
Updates the first Title Heading in document content (if permissions allow it).IPObject.save()
is called on the updated Title Heading.- Returns:
- updated Title Heading or
null
if no Title Heading in document content was updated. - Since:
- 3.8.2
-
getTitleOrName
- Returns:
- Title or Module Name if Title is not set
- Since:
- 3.8.2
-
getModuleFolder
String getModuleFolder()- Returns:
- Folder which this module is stored in;
null
if the module is directly below modules folder - Since:
- 3.5.0
-
getModuleNameWithSpace
String getModuleNameWithSpace()Method returns module name with space in readable form Format: Space Name / Module Name or Module Name only if it's located in default space- Returns:
- module name with space
- Since:
- 3.5.1
-
getRelativePath
- Returns:
- Module name with space in readable form: Space Name/Module Name
- Since:
- 3.10.1
-
getTitleWithSpace
- Returns:
- "Space Name / Title" or "Title" if located in default space (will use Module Name if Title is not set)
- Since:
- 3.8.2
-
getAuthor
IUser getAuthor()Returns this module author. The author field can not be changed, therefore there is no set method for this field. -
getCreated
Date getCreated()- Returns:
- the date of a module creation
-
getUpdated
Date getUpdated()- Returns:
- the date of a last update of this module
-
getUpdatedBy
IUser getUpdatedBy()- Returns:
- user who have last updated this module.
-
getModuleLocation
ILocation getModuleLocation()Module location - location of module folder, relative to modules root in the given project.- Returns:
- location
-
getAllowedWITypes
- Returns:
- read only list of work item types allowed to be in this module
-
getStructureLinkRole
ILinkRoleOpt getStructureLinkRole()- Returns:
- work item link role
-
areLinksFromParentToChild
boolean areLinksFromParentToChild()- Returns:
- true when structure links go from parent to child. (3.2 allows only false)
-
getRootNode
IModule.IStructureNode getRootNode()- Returns:
- virtual root node (with no associated work item) of the module structure tree
-
isModified
boolean isModified()Whether this module structure (tree of IStructureNode returned by getRootNode) was modified after it was read from storage (newly created modules are always modified).- Specified by:
isModified
in interfaceIPObject
- Returns:
true
if module was modified
-
save
void save()Saves modifications to the module structure (tree of IStructureNode returned by getRootNode) -
delete
void delete()Removes module -
getContainedWorkItems
Returns sorted list of active work items contained in this module. -
filterWorkItems
Returns the Document's active Work Items that match the query and adds their ancestors. Returns an empty collection if the query is null, empty, or contains only white space. Since 3.17.2 when filtering by outline number, only outline numbers in the given Document are taken into account. For example, for queryoutlineNumber:2*
this method would NOT return Work Items that are referenced in other Documents but happen to match the outline number in the query.- Since:
- 3.5.0
-
containsWorkItem
- Parameters:
item
-- Returns:
- true if the item is active and contained in this module.
-
getAllWorkItems
Returns all work items (even unreferenced) contained in this module. Works correctly only after commit.- Returns:
getContainedWorkItems()
+getUnreferencedWorkItems()
(notnull
)- Since:
- 3.5
-
getUnreferencedWorkItems
Returns unreferenced work items contained in this module(even module is from specific revision). Works correctly only after commit.- Returns:
- unreferenced work items (not
null
) or empty list if this is old-style module - Since:
- 3.5
-
createWorkItem
Deprecated.use thecreateWorkItem(String)
Creates and persists a Work Item, which will be stored in this Module.Note: Since it is already persisted, calling
IPObject.save()
afterwards on the Work Item is not necessary.- Returns:
- a persisted
IWorkItem
-
createWorkItem
Creates and persists a Work Item, which will be stored in this Module.Note: Since it is already persisted, calling
IPObject.save()
afterwards on the Work Item is not necessary.- Parameters:
type
- Work Item type (notnull
)- Returns:
- a persisted
IWorkItem
- Since:
- 3.5.0
-
createUnreferencedWorkItem
IWorkItem createUnreferencedWorkItem()Creates unreferenced work item stored in this module. The instance is not persisted (IPObject.save()
must be called).Behaves the same as
createWorkItem()
for old-style modules.- Returns:
- not persisted work item
- Since:
- 3.5.0
-
removeWorkItem
Removes contained or external Work Item from the Document.- Parameters:
item
- can be null
-
getStructureNodeOfWI
Returns the structure node representing this work item if the work item is from this module- Parameters:
workitem
-
-
getWorkItem
Returns work item with given id.null
is returned when such a work item does not exist in this module. Works only for internal work items, for external work items it returnsnull
even when the external work item with given id exists in this module.- Returns:
- work item with given id or
null
if not present in this module - Since:
- 3.5.0
-
getWorkItem
Returns work item with given project id and id.null
is returned when such a work item does not exist in this module. Works for both internal and external work items.- Returns:
- work item with given project id and id or
null
if not present in this module - Since:
- 3.6.0
-
moveIn
Moves workitems from XML storage to this module. Workitems from LiveDoc are skipped, because it is not supported to move them to module.- Parameters:
wis
-
-
moveIn
Moves workitems from XML storage to this module. Workitems from LiveDoc are skipped, because it is not supported to move them to module. Note it moves also all workitems which are (direct or indirect) children of passed workitems.- Parameters:
wis
-sort
- sort order by which the children of moved-in workitems are sorted (can benull
, the format is same as forIIndexSearch.sort(String)
.- Since:
- 3.3.1
-
moveInWithReport
Moves workitems from XML storage to this module and reports which were skipped and which additional were moved. Workitems from LiveDoc are skipped, because it is not supported to move them to module. Note it moves also all workitems which are (direct or indirect) children of passed workitems.- Parameters:
wis
-sort
- sort order by which the children of moved-in workitems are sorted (can benull
), the format is same as forIIndexSearch.sort(String)
.- Since:
- 3.4
-
moveOut
Moves workitems out from module to normal XML storage. Workitems which are not in this module are skipped. Note it moves also all workitems which are (direct or indirect) children of passed workitems.- Parameters:
wis
-- Since:
- 3.3
-
moveOutWithReport
Moves workitems out from module to normal XML storage and reports which were skipped and which additional were moved. Workitems which are not in this module are skipped. Note it moves also all workitems which are (direct or indirect) children of passed workitems.- Parameters:
wis
-- Returns:
- report about moved work items (not
null
). - Since:
- 3.4
-
setDerivedFrom
Set the reference to the derived module. This method should not be usually called directly, but user should rather use IModuleManager.createDerivedModule- Parameters:
source
- - might be historical object- Since:
- 3.3
-
getDerivedFrom
IModule getDerivedFrom()- Returns:
- return module from which is this module derived
- Since:
- 3.3
-
getDerivedFields
Collection<String> getDerivedFields()If this module is derived (getDerivedFrom()
does not returnnull
), this method returns the set of field IDs that are derived. This means theIModuleManager.updateDerivedModule(IModule, String, Set, Set)
replaces the content of this fields with the values from original module.- Since:
- 3.3
-
setDerivedFields
Set the derived fields (@see getDerivedField to get to know what is the derived field)- Parameters:
fields
- = comma separated list- Since:
- 3.3
-
getDerivedFromLinkRole
ILinkRoleOpt getDerivedFromLinkRole()If this module is derived (getDerivedFrom does not return false) this method returns the link role that is used to link derived item to original item- Since:
- 3.3
-
setDerivedFromLinkRole
Set the derived_from link role (@see getDerivedFromLinkRole to get to know what is this link role)- Parameters:
role
-- Since:
- 3.3
-
setBranchedFrom
Sets Module from which was this one branched.- Since:
- 3.6.0
-
setVariant
Sets the Variant work item from which this Module was created- Since:
- 3.9.0
-
getVariant
Gets the Variant work item this Module was created from. Returns null, if Module was not created through a Variant- Since:
- 3.9.0
-
getBranchedFrom
IModule getBranchedFrom()Returns Module from which was this one branched.- Since:
- 3.6.0
-
setBranchedWithQuery
Sets query from which was this Module branched.- Since:
- 3.6.0
-
getBranchedWithQuery
String getBranchedWithQuery()Returns query from which was this Module branched ornull
if Module was branched without query.- Since:
- 3.6.0
-
usesOutlineNumbering
boolean usesOutlineNumbering()Returnstrue
if outline numbering of workitems is used for this module.- Since:
- 3.4
-
setUsesOutlineNumbering
void setUsesOutlineNumbering(boolean uses) Sets whether outline numbering of workitems is used for this module.- Since:
- 3.4
-
getOutlineNumbering
Returns configuration of outline numbering of workitems for this module.- Since:
- 3.4
-
getOutlineNumberingPrefix
Gets prefix for outline numbering ornull
if prefix is not defined.- Since:
- 3.8.2
-
setOutlineNumberingPrefix
Sets prefix of outline numbering of workitems for this module.- Since:
- 3.4
-
getOutlineNumberOfWorkitem
Returns outline number of work item. If the number is not defined, either empty string ornull
could be returned.- Since:
- 3.4
-
isOldStyleModule
boolean isOldStyleModule()- Returns:
true
if this is old-style module- Since:
- 3.5
-
getHomePageContent
Text getHomePageContent()Returns home page content.- Returns:
- content of module's home page or
null
- Since:
- 3.5
-
setHomePageContent
Set home page content. If this is not an old-style module then any prior change of the module structure will be forgotten and calls togetRootNode()
,getStructureNodeOfWI(IWorkItem)
,getContainedWorkItems()
,containsWorkItem(IWorkItem)
,getUnreferencedWorkItems()
or any other method working with module structure will not return correct values or perform correctly unlesssave()
andIPObject.update()
are called.Behavioral differences when used with old-style modules:
- Can be used only if there already is home page (which should be after call to
IModuleManager.createModule(com.polarion.alm.projects.model.IProject, com.polarion.subterra.base.location.ILocation, String, java.util.List, com.polarion.alm.tracker.model.ILinkRoleOpt, boolean)
). - Is not bound to
save()
- data in the repository will be overwritten immediately.
- Parameters:
content
- Wiki markup to set (notnull
)- Since:
- 3.5
- Can be used only if there already is home page (which should be after call to
-
getRenderingLayouts
List<IModule.IRenderingLayoutStruct> getRenderingLayouts()Returns rendering layouts.- Returns:
- mutable list of rendering layouts (not
null
) - Since:
- 3.5
-
renderHomePageContent
Returns rendered home page content.Returns unchanged content for old-style modules.
- Parameters:
target
- target of rendering, e.g.RENDERING_TARGET_EDITOR
,RENDERING_TARGET_COMPARE
, ...userAgent
- user-agent string of the browser if applicable, can be nullquery
- Lucene query string for filtering visible Work Items, null or empty string means no filtering- Returns:
- rendered home page content (
null
only ifgetHomePageContent()
returnsnull
) - Since:
- 3.5
-
renderHomePageContent
Returns localized rendered home page content.Returns unchanged content for old-style modules.
- Parameters:
target
- target of rendering, e.g.RENDERING_TARGET_EDITOR
,RENDERING_TARGET_COMPARE
, ...userAgent
- user-agent string of the browser if applicable, can be nullquery
- Lucene query string for filtering visible Work Items, null or empty string means no filteringlanguage
- id of the language to be used when rendering the content ornull
for default language (seeILanguageDefinition
)- Returns:
- localized rendered home page content (
null
only ifgetHomePageContent()
returnsnull
) - Since:
- 3.6.1
-
renderHomePageContent
Text renderHomePageContent(String target, String userAgent, String query, ILocalId currentDocumentId) - Parameters:
target
-userAgent
-query
-currentDocumentId
-- Since:
- 3.5.1
-
createAttachment
@NotNull IModuleAttachment createAttachment(@NotNull String fileName, @Nullable String title, @NotNull InputStream data) - Specified by:
createAttachment
in interfaceIWithAttachments<IModuleAttachment>
- Parameters:
fileName
- The file name, can not benull
.title
- The title (can benull
- file name is used then).data
- The content input stream, can not benull
- Returns:
- the temporary
IAttachement
created - Since:
- 3.5.0
-
getAttachments
- Specified by:
getAttachments
in interfaceIWithAttachments<IModuleAttachment>
- Returns:
- attachments (never
null
) - Since:
- 3.5.0
-
getAttachment
- Specified by:
getAttachment
in interfaceIWithAttachments<IModuleAttachment>
- Parameters:
fileName
- attachment's id (notnull
)- Returns:
- attachment or
null
if not found - Since:
- 3.5.0
-
deleteAttachment
- Specified by:
deleteAttachment
in interfaceIWithAttachments<IModuleAttachment>
- Parameters:
attachment
- attachment (notnull
)- Since:
- 3.5.0
-
createComment
Creates the (temporary) comment object, which can be manipulated by the client. However, the comment is not persisted until it's explicitly saved.The fields
workItem, project, author, date
are pre-filled with the values.- Parameters:
text
- Text, can not benull
.- Returns:
- the Comment object, with the necessary fields filled in
- Since:
- 3.5.0
-
getComments
IPObjectList<IModuleComment> getComments()Returns all comments of this module.- Returns:
- all comments (not
null
) - Since:
- 3.5.0
-
getRootComments
IPObjectList<IModuleComment> getRootComments()Shortcut forgetRootComments(true)
.- Since:
- 3.5.0
-
getRootComments
Returns root comments of this module. Optionally includes resolved comments.- Returns:
- root
IModuleComment
s (notnull
) - Since:
- 3.7.1
- See Also:
-
getHeadingWorkItemType
ITypeOpt getHeadingWorkItemType()- Returns:
- type of the heading work items, not
null
- Since:
- 3.5.0
-
removeComment
Remove comment object and all of it's children from module and persistence- Parameters:
comment
- comment to remove- Since:
- 3.5.0
-
getHomePageContentParts
- Returns:
- List of String arrays having the ID in first element and html content part in second.
- Since:
- 3.5.0
-
checkConflictInParts
boolean checkConflictInParts(Set<String> partIds, Set<String> addedPartIds, Set<String> modifiedPartIds, Set<String> removedPartIds, IModule revisionModule) Checks if there is some conflict which would prevent merging of changes using the mergeContentParts method.- Parameters:
partIds
- - ordered set of IDs of parts as the current user sees them in his UI (can not be null).addedPartIds
- - set of IDs of added parts (can not be null)modifiedPartIds
- - set of IDs of modified parts (can not be null)removedPartIds
- - set of IDs of removed parts (can not be null)revisionModule
- - instance of IModule read from revision from which the editing started (can not be null)- Returns:
- true when there is some conflict detected
- Since:
- 3.5.0
-
mergeContentParts
Map<String,String> mergeContentParts(Set<String> partIds, Map<String, String> addedParts, Map<String, String> modifiedParts, Set<String> removedPartIds) Merges partial changes with changes done by someone else, conflicts must be checked first by calling checkConflictInParts, result of calling this method when the conflict is detected is not defines.- Parameters:
partIds
- - ordered set of IDs of parts as the current user sees them in his UI (can not be null).addedParts
- - map of added parts; key is the ID; value is the content including the start and end tag (can not be null)modifiedParts
- - map of modified parts; key is the ID; value is the content including the start and end tag (can not be null)removedPartIds
- - set of IDs of removed parts (can not be null)- Returns:
- map with the ID under which the added parts were actually persisted; keys are keys from addedParts; values are the actual IDs (never returns null)
- Since:
- 3.5.0
-
isAutoSuspect
boolean isAutoSuspect()- Since:
- 3.5.0
-
setAutoSuspect
void setAutoSuspect(boolean autoSuspect) - Since:
- 3.5.0
-
handleDocumentComments
Process comments in form of span with id and add comment icon with tooltip- Parameters:
html
- HTML string containing commentsuserAgent
-- Returns:
- string with comments replaced for display on UI
- Since:
- 3.5.0
-
compareRevisions
Compares two revisions of this module.- Parameters:
revision1
- first revision (passnull
for HEAD/current)revision2
- second revision (passnull
for HEAD/current)- Returns:
IBaselineDiff
(notnull
) with onlyIBaselineDiff.getWorkItemDiff()
filled- Throws:
UnresolvableObjectException
- if module did not exist in one of given revisions- Since:
- 3.5.0
-
compareWith
@NotNull IBaselineDiff compareWith(@NotNull IModule module, @Nullable String revision1, @Nullable String revision2, @Nullable String query1, @Nullable String query2) Compares with other module.- Parameters:
revision1
- first revision (passnull
for HEAD/current)revision2
- second revision (passnull
for HEAD/current)query1
- first query (passnull
for HEAD/current)query2
- second query (passnull
for HEAD/current)- Returns:
IBaselineDiff
(notnull
) with onlyIBaselineDiff.getWorkItemDiff()
filled- Throws:
UnresolvableObjectException
- if module did not exist in one of given revisions- Since:
- 3.6.0
-
move
Moves or renames this document/module.- Parameters:
newModuleFolder
- new module folder to move this document to. Can benull
, that means the document is kept in its current folder.newModuleName
- new name of the document. Can benull
, that means the document will keep its current name.- Since:
- 3.5.1
-
getDerivedModules
IPObjectList getDerivedModules()Returns all documents/modules which are derived from this one.- Returns:
- documents/modules which are derived from this one
- Since:
- 3.5.1
-
getBranchedModules
IPObjectList getBranchedModules()Returns all documents/modules which are branched from this one.- Since:
- 3.6.0
-
findCommentsReferencingWorkItem
Finds comments for which theIModuleComment.getReferredWorkItem()
equals the given work item- Since:
- 3.6.0
-
getCommentById
Returns the comment with the given id (returns also the newly created comments)- Since:
- 3.7.3
-
unreference
Moves workItem to documents recycle bin, does nothing when the workItem cannot be found- Parameters:
workItem
- the workItem to be recycled- Since:
- 3.8.0
-
compareCustomFields
@Deprecated @NotNull IBaselineDiff compareCustomFields(@Nullable String revision1, @Nullable String revision2) Deprecated.Compares custom fields of two revisions of the document.- Since:
- 3.8.0
-
compareCustomFieldsWith
@Deprecated @NotNull IBaselineDiff compareCustomFieldsWith(@NotNull IModule module, String revision1, String revision2) Deprecated.Compares custom fields of two documents.- Since:
- 3.8.0
-
compareFields
Compares fields of two revisions of the document.- Parameters:
revision1
- the first revision or null for headrevision2
- the second revision or null for head- Since:
- 3.8.1
-
compareFieldsWith
@NotNull IModificationDiff compareFieldsWith(@NotNull IModule module, @Nullable String revision1, @Nullable String revision2) Compares fields of a revision of this document with fields of a revision of the specified document.- Parameters:
module
- the module to compare with this modulerevision1
- the revision of this module,null
for headrevision2
- the revision of the second module,null
for head- Since:
- 3.8.1
-
can
- Specified by:
can
in interfaceIPObject
- Specified by:
can
in interfaceIWorkflowObject
- Since:
- 3.8.2
-
getWorkflowSignaturesManager
Description copied from interface:IWorkflowObject
Returns signatures manager that can be used for all signature related tasks.- Specified by:
getWorkflowSignaturesManager
in interfaceIWorkflowObject
- Since:
- 3.9.0
-
getWorkflowSignatures
Description copied from interface:IWorkflowObject
Returns all workflow signatures in the creation order. Usually the clients will use the signatures manager to work with signatures.- Specified by:
getWorkflowSignatures
in interfaceIWorkflowObject
- Since:
- 3.9.0
- See Also:
-
getExternalWorkItems
Returns all external Work Items contained in Document content.- Since:
- 3.8.3
-
addExternalWorkItem
Adds external Work Item into Document content. The external Work Item must not exist in Document content yet and must not be heading type (getHeadingWorkItemType()
). If external Work Item has revision (IPObject.getRevision()
then it is frozen in document content.- Throws:
IllegalStateException
- when given Work Item is heading type, exists in Document content or is not external (stored within Document).- Since:
- 3.8.3
-
overwriteExternalWorkItem
Replace the given external Work Item in the Document content with a new one. The newly created Work Item within the Document will have updated values from the given one according to the layout defined in the Document. The content of the document will be updated.- Returns:
- The new persisted
IWorkItem
. - Throws:
IllegalArgumentException
- If the given external Work Item does not exist in the document.- Since:
- 3.8.3
-
freezeExternalWorkItem
Freezes given external Work Item on given revision in Document content. The external Work Item must not be heading type (getHeadingWorkItemType()
). Whether or not the given item is revisioned is ignored.- Parameters:
externalWorkItem
- Work Item to freezerevision
- revision to which work item will be frozen- Since:
- 3.8.3
-
unfreezeExternalWorkItem
Un-freezes given external Work Item. Revision of given Work Item is deleted from Document content. Whether or not the given item is revisioned is ignored.- Parameters:
externalWorkItem
- work item to un-freeze- Since:
- 3.8.3
-
getHeadingSidebarFields
Returns field configuration for Work Item properties sidebar panel. IDs of fields are comma separated.- Since:
- 3.9.1
-
buildHomePage
Returns builder of the home page that is useful for clients that build the full home page at once, in which case it is more convenient to use than the structure nodes API, and it also has much better performance in this scenario. You need to callIModuleHomePageBuilder.set()
at the end to actually set the new home page content to the module.- Since:
- 3.10.1
-
createWorkItemsQuery
Creates a query for Work Items in this Document.- Since:
- 3.17.2
-
getBranchedWithInitializedFields
Returns the list of Work Item fields that were cleared and initialized with default values when this Document was branched.- Since:
- 3.23.10
-
setBranchedWithInitializedFields
Sets the Work Item initialized fields (@see getBranchedWithInitializedFields to get to know what is the Work Item initialized field)- Since:
- 3.23.10
-
compareFields(String, String)
.