Package com.jalios.jcms
Class WorkflowManager
- java.lang.Object
-
- com.jalios.jcms.WorkflowManager
-
- All Implemented Interfaces:
DBConstants
,JcmsConstants
,PluginComponent
,ReplicaMessageListener
,WorkflowConstants
,JaliosConstants
public class WorkflowManager extends java.lang.Object implements ReplicaMessageListener, JcmsConstants, WorkflowConstants, DBConstants
This class manages JCMS workflows.- Since:
- jcms-5.5.0
- Author:
- Olivier Dedieu
-
-
Field Summary
Fields Modifier and Type Field Description static Workflow
DEFAULT_WORKFLOW
protected static java.lang.String
REPLICA_MESSAGE_WORKFLOW
protected static java.lang.String
REPLICA_MESSAGE_WORKFLOW_DELETE
protected int[]
visiblePstatus
protected java.util.Map<java.lang.String,WFRole>
wfRoleMap
-
Fields inherited from interface com.jalios.jcms.db.DBConstants
ALL_CATEGORIES_SET_FIELD, ATTACH_WS_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, CLASSIFICATION_LEVEL_FIELD, DBDATA_URID, EXTENDED_READ_RIGHTS, HAS_ATTACH_WS_FIELD, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HAS_ATTACH_WS, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAININSTANCE_ID, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MERGE_DATE, HIBERNATE_MAPPING_MERGE_ID, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_OPAUTHOR, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READ_ACK, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_RESTRICTIVE_UPDATE_RIGHTS, HIBERNATE_MAPPING_TITLE, HIBERNATE_MAPPING_TRACKED, HIBERNATE_MAPPING_UDATE, HIBERNATE_MAPPING_VOTECOUNT, HIBERNATE_MAPPING_VOTESCORE, HIBERNATE_MAPPING_WORKFLOW_ID, HIBERNATE_MAPPING_WORKSPACE_ID, MAX_HIBERNATE_MAPPING_PUBLICATION, MDATE_FIELD, OPAUTHOR_ID_FIELD, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
-
Fields inherited from interface com.jalios.util.JaliosConstants
CRLF, MILLIS_IN_ONE_DAY, MILLIS_IN_ONE_HOUR, MILLIS_IN_ONE_MINUTE, MILLIS_IN_ONE_MONTH, MILLIS_IN_ONE_SECOND, MILLIS_IN_ONE_WEEK, MILLIS_IN_ONE_YEAR
-
Fields inherited from interface com.jalios.jcms.JcmsConstants
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, AJAX_MODE_ATTR, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, CLASS_PROPERTY, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, COUNTRY_SPRITE, CS_TYPOLOGY_ROOT_CAT_VID, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DATA_DIRECTORY, DEFAULT_PHOTO_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, GLYPH_ICON_PREFIX, ICON_ARCHIVE, ICON_ICON_PREFIX, ICON_LOCK, ICON_LOCK_STRONG, ICON_PREFIX_PROP, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, IS_IN_FRONT_OFFICE, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JCMS_TOASTR_COLLECTION, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, LANG_SPRITE, LOG_FILE, LOG_TOPIC_SECURITY, LOGGER_PROP, LOGGER_XMLPROP, MBR_PHOTO_DIR, MDATE_SEARCH, MONITOR_XML, OP_CREATE, OP_CREATE_STR, OP_DEEP_COPY, OP_DEEP_COPY_STR, OP_DEEP_DELETE, OP_DEEP_DELETE_STR, OP_DELETE, OP_DELETE_STR, OP_MERGE, OP_MERGE_STR, OP_UPDATE, OP_UPDATE_STR, ORGANIZATION_ROOT_GROUP_PROP, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_PROP_PREFIX, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_PROP_PREFIX, PHOTO_LARGE_WIDTH, PHOTO_MINI, PHOTO_MINI_HEIGHT, PHOTO_MINI_PROP_PREFIX, PHOTO_MINI_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_PROP_PREFIX, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_PROP_PREFIX, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_PROP_PREFIX, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, RAW_CONTENT_ICON_PREFIX, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SECURITY_LOG_FILE, SESSION_AUTHORIZED_FILENAMES_SET, SPRITE_ICON_PREFIX, STATS_REPORT_DIR, STATUS_PROP, STORE_DIR, STORE_XML, SUCCESS_MSG, SVG_ICON_PREFIX, SVGINLINE_ICON_PREFIX, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_WIDTH, TTCARD_MEDIA_HEIGHT, TTCARD_MEDIA_WIDTH, TYPES_ICON_ALT_PROP, TYPES_ICON_SUFFIX_PROP, TYPES_ICON_TITLE_PROP, TYPES_PREFIX_PROP, TYPES_THUMB_SUFFIX_PROP, UDATE_SEARCH, UPDATE_RIGHT_TAB, UPLOAD_DIR, UPLOAD_PERMISSION_COUNT_PROP_PREFIX, UPLOAD_PERMISSION_SIZE_PROP_PREFIX, URL_REGEXP, VID_LOGGED_MEMBER, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
-
Fields inherited from interface com.jalios.jcms.WorkflowConstants
ACTION, ACTION_REPEAT, ACTION_TYPE, ACTION_WHEN, ALL_WF, ARCHIVED_PSTATUS, DEFAULT_DRAFT_PSTATUS, EXPIRED_PSTATUS, PUBLISHED_PSTATUS, ROLE, ROLE_DESCRIPTION, ROLE_GROUP, ROLE_GRPID, ROLE_ID, ROLE_MBRID, ROLE_MEMBER, ROLE_NAME, ROLE_TYPE, ROLE_WEIGHT, SCHEDULED_PSTATUS, STATE, STATE_COLOR, STATE_DESCRIPTION, STATE_DURATION, STATE_LABEL, STATE_PSTATUS, STATE_REMINDER, STATE_TARGETPSTATUS, STATE_TYPE, STATESPE, TRANSITION, TRANSITION_GROUP, TRANSITION_ROLEID, TRANSITION_SOURCE, TRANSITION_TARGET, TRASHED_PSTATUS, UNKNOWN_PSTATUS, WF_ATTACHMENT_ID, WF_BASIC_ID, WF_DEFAULT_ID, WF_DIR, WF_ELT_NAME, WF_ID, WF_INIT, WF_LABEL, WF_MDATE, WF_MODERATION_ID, WF_TYPE, WF_VERSION, WF_VERSION_VALUE, WFTYPE_PROCESS, WFTYPE_PUBLISH
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addRole(WFRole role)
void
addWFExpressAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).void
addWFReminderAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).void
addWorkflow(java.lang.String id, Workflow wf)
Binds a Workflow to a given classvoid
cleanUnprefixedRoleMap(java.util.Map roleMap)
This is a JCMS 9 migration method.void
convertFromVersion3()
Converts old JCMS (<= 5.6) workflow.xml to new (>=5.7) workflow structure.boolean
convertPstatus(Publication pub, Workflow wf, int oldPstatus, int newPstatus, Member opAuthor)
Converts a publication in the given pstatus with the given workflow to a new pstatus.int
convertPstatus(Workflow wf, int oldPstatus, int newPstatus, Member opAuthor)
Converts publications in the given pstatus with the given workflow to a new pstatus.java.util.Comparator<Workflow>
getAlphabeticalComparator()
static java.util.Set<Workflow>
getAvailableWorkflowSet(java.lang.Class<? extends Publication> pubClass, Workspace targetWorkspace)
returnSet
of available workflow for this publication classWorkflow
getCopyWorkflow(java.lang.String id)
Returns the workflow bound to the given id in copyWorkflowMapjava.util.Map<java.lang.String,Workflow>
getCopyWorkflowMap()
Returns the copy of the workflow map (used to perform changes with no effect until the workflows are saved)Workflow
getDefaultFileDocumentWorkflow()
Returns the Default Workflow associated with FileDocumentWorkflow
getDefaultWorkflow()
static WorkflowManager
getInstance()
WFNote
getLastWFNote(Publication pub)
Returns the last WFNote created for this publication.Member
getManager(Publication pub)
Returns the manager associated to this publication (ie the manager of the submitMember for Form and the manager of the author for other Publication)static java.util.Set<WFState>
getNextWfState(Publication pub, Member mbr)
Computes all states which can be reached by a member on a publication.static java.util.Set<WFState>
getNextWfState(Publication pub, Member mbr, Workflow targetWorkflow, Workspace targetWorkspace)
Computes all states which can be reached by a member on a publication.static java.util.Set<WFState>
getNextWfState(java.lang.Class<? extends Publication> clazz, Member mbr, Workflow targetWorkflow, Workspace targetWorkspace)
Computes all states which can be reached by a member on a publication's class.java.util.Map<java.lang.String,WFState>
getSpecialStateMap()
Returns the map of special states (schedule, published, expired, archived).java.lang.String
getUnknownWFStateLabel(int pstatus)
Returns the label of an unknown pstatus.int[]
getVisiblePstatus()
Returns the array of Workflow pstatus visible in front-office.java.util.List<WFNote>
getWFNoteList(Publication pub)
Returns the list of WFNote bound to the given publication.WFRole
getWFRole(java.lang.String wfRoleId)
java.util.Set<java.lang.String>
getWFRoleIdSet()
Returns a Set of workflow role's ids (String).java.lang.String
getWFStateStateLabel(Publication pub, int pstatus, java.lang.String userLang)
Returns the label of the given pstatus.java.lang.String
getWFStateStateLabel(Workflow wf, int pstatus, java.lang.String userLang)
Returns the label of the given pstatus.java.lang.String
getWFStateStateLabelHtml(Publication pub, int pstatus, java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.java.lang.String
getWFStateStateLabelHtml(Workflow wf, int pstatus, java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.WKRole
getWKRole(java.lang.String wkRoleId)
java.util.Set<WKRole>
getWKRoles(WFRole wfRole)
Workflow
getWorkflow(Publication pub)
Returns the workflow bound to a given publication (general workflow, not instance one if any is set.Workflow
getWorkflow(java.lang.String wfId)
Return a Workflow from a given Idjava.util.Set<java.lang.String>
getWorkflowIdSet()
Return the set ofWorkflow
id from the workflow Mapjava.util.Set<java.lang.String>
getWorkflowIdSet(java.lang.Class typeClass)
Return the set of workflow id from the workflow Map compatible with the typeClassjava.util.Map<java.lang.String,Workflow>
getWorkflowMap()
Returns the workflow map.java.util.Map<java.lang.String,Workflow>
getWorkflowMap(boolean copy)
Returns the workflow map or the copy of the workflow map (without the default workflow)java.util.Set<Workflow>
getWorkflowSet()
Return the set of workflow from the workflow Mapjava.util.Set<Workflow>
getWorkflowSet(java.lang.Class typeClass)
Return the set of workflow from the workflow Map compatible with the typeClassboolean
hasAlreadyVoted(Publication pub, Member mbr)
Check if the given member has already voted for the given publication.void
initReplicaMessageListener()
void
initWorkflow()
Initialize the workflowsvoid
initWorkflowAlarms()
void
invalidateVisiblePstatus()
Invalidate current visible pstatus (they will be computed again at the next call).boolean
isCompatibleWorkflow(Workflow workflow, java.lang.Class typeClass)
indicates if theWorkflow
is compatible with the typeClass
boolean
isUpdated()
Returns true if at least one workflow is new, has been updated or has been deleted.java.util.Map<java.lang.String,Workflow>
parseAllWorkflows()
Parse all workflows contains in JCMSworkflows
directory.boolean
previewInFO(Publication pub)
Returns true if the given publication must be previewed in front-officevoid
processMessage(ReplicaMessage msg)
Process the given ReplicaMessage.void
removeAllWFNotes(Publication pub)
Removes all the WFNote bound to the given publication.void
removeMemberFromAllWKRole(Member member)
Remove a Member from allWKRole
in which he's involved.protected void
removeRole(WFRole role)
void
removeWFExpressAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.void
removeWFExpressAlarm(java.lang.String pubId)
Removes the WFExpress alarm for the given publication.void
removeWFReminderAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.void
removeWFReminderAlarm(java.lang.String pubId)
Removes the WFExpress alarm for the given publication.void
removeWorkflow(java.lang.String id)
Unbinds a Workflow to a given wfIdvoid
revertAllWorkflows()
Revert all the workflowvoid
saveAllWorkflows()
Save the Workflow on disk-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jalios.jcms.plugin.PluginComponent
init
-
-
-
-
Field Detail
-
DEFAULT_WORKFLOW
public static Workflow DEFAULT_WORKFLOW
-
REPLICA_MESSAGE_WORKFLOW
protected static final java.lang.String REPLICA_MESSAGE_WORKFLOW
- See Also:
- Constant Field Values
-
REPLICA_MESSAGE_WORKFLOW_DELETE
protected static final java.lang.String REPLICA_MESSAGE_WORKFLOW_DELETE
- See Also:
- Constant Field Values
-
wfRoleMap
protected final java.util.Map<java.lang.String,WFRole> wfRoleMap
-
visiblePstatus
protected int[] visiblePstatus
-
-
Method Detail
-
getInstance
public static WorkflowManager getInstance()
-
initReplicaMessageListener
public void initReplicaMessageListener()
-
getSpecialStateMap
public java.util.Map<java.lang.String,WFState> getSpecialStateMap()
Returns the map of special states (schedule, published, expired, archived).- Returns:
- the map of special states (schedule, published, expired, archived).
- Since:
- jcms-9.0.0
-
convertFromVersion3
public void convertFromVersion3() throws java.io.IOException, org.jdom.JDOMException
Converts old JCMS (<= 5.6) workflow.xml to new (>=5.7) workflow structure.- Throws:
java.io.IOException
- If an I/O error occursorg.jdom.JDOMException
- If an error occurs while parsing the DOM- Since:
- jcms-5.7.0
-
parseAllWorkflows
public java.util.Map<java.lang.String,Workflow> parseAllWorkflows() throws org.jdom.JDOMException, java.io.IOException
Parse all workflows contains in JCMSworkflows
directory.- Returns:
- the Map {id, Workflow}
- Throws:
java.io.IOException
- If an I/O error occursorg.jdom.JDOMException
- If an error occurs while parsing the DOM- Since:
- jcms-5.7.0
-
initWorkflowAlarms
public void initWorkflowAlarms()
-
getWorkflow
public Workflow getWorkflow(java.lang.String wfId)
Return a Workflow from a given Id- Parameters:
wfId
- the WOrkflow Id- Returns:
- a Workflow
-
getWorkflowSet
public java.util.Set<Workflow> getWorkflowSet()
Return the set of workflow from the workflow Map- Returns:
- the workflowSet
-
getWorkflowIdSet
public java.util.Set<java.lang.String> getWorkflowIdSet()
Return the set ofWorkflow
id from the workflow Map- Returns:
- the workflowSet of
Workflow
id
-
getWorkflowSet
public java.util.Set<Workflow> getWorkflowSet(java.lang.Class typeClass)
Return the set of workflow from the workflow Map compatible with the typeClass- Parameters:
typeClass
- theClass
with wich the workflow should be compatible- Returns:
- the workflowSet compatible with the typeClass
-
isCompatibleWorkflow
public boolean isCompatibleWorkflow(Workflow workflow, java.lang.Class typeClass)
indicates if theWorkflow
is compatible with the typeClass
-
getWorkflowIdSet
public java.util.Set<java.lang.String> getWorkflowIdSet(java.lang.Class typeClass)
Return the set of workflow id from the workflow Map compatible with the typeClass- Parameters:
typeClass
- theClass
with wich the workflow should be compatible- Returns:
- the Set of
Workflow
id compatible with the typeClass
-
getWorkflowMap
public java.util.Map<java.lang.String,Workflow> getWorkflowMap()
Returns the workflow map. Keys are the workflow ids, values are the workflows.- Returns:
- the workflow map
- Since:
- jcms-2.1
-
getCopyWorkflowMap
public java.util.Map<java.lang.String,Workflow> getCopyWorkflowMap()
Returns the copy of the workflow map (used to perform changes with no effect until the workflows are saved)- Returns:
- the copy of the workflow map
- Since:
- jcms-5.5.0
-
getWorkflowMap
public java.util.Map<java.lang.String,Workflow> getWorkflowMap(boolean copy)
Returns the workflow map or the copy of the workflow map (without the default workflow)- Parameters:
copy
- if true returns the copy of the workflow map- Returns:
- the workflow map or the copy of the workflow map
- Since:
- jcms-5.5.0
-
addWorkflow
public void addWorkflow(java.lang.String id, Workflow wf)
Binds a Workflow to a given class- Parameters:
id
- the workflow idwf
- the workflow- Since:
- jcms-2.1
-
removeWorkflow
public void removeWorkflow(java.lang.String id)
Unbinds a Workflow to a given wfId- Parameters:
id
- the workflow id- Since:
- jcms-2.1
-
getCopyWorkflow
public Workflow getCopyWorkflow(java.lang.String id)
Returns the workflow bound to the given id in copyWorkflowMap- Parameters:
id
- the workflow id- Returns:
- the workflow bound to the given id in copyWorkflowMap
- Since:
- jcms-5.5.0
-
getWorkflow
public Workflow getWorkflow(Publication pub)
Returns the workflow bound to a given publication (general workflow, not instance one if any is set. Publication.getWorkflow() will give it if any is set.- Parameters:
pub
- the publication- Returns:
- the bound Workflow (or null if none)
- Since:
- jcms-2.1
-
saveAllWorkflows
public void saveAllWorkflows()
Save the Workflow on disk- Since:
- jcms-2.1
-
revertAllWorkflows
public void revertAllWorkflows()
Revert all the workflow- Since:
- jcms-5.5.0
-
initWorkflow
public void initWorkflow() throws java.lang.Exception
Initialize the workflows- Throws:
java.lang.Exception
- if the initialization failed- Since:
- jcms-5.5.0
-
getDefaultWorkflow
public Workflow getDefaultWorkflow()
-
isUpdated
public boolean isUpdated()
Returns true if at least one workflow is new, has been updated or has been deleted.- Returns:
- true if at least one workflow is new, has been updated or has been deleted.
- Since:
- jcms-5.5.0
-
addRole
protected void addRole(WFRole role)
-
removeRole
protected void removeRole(WFRole role)
-
getWFRoleIdSet
public java.util.Set<java.lang.String> getWFRoleIdSet()
Returns a Set of workflow role's ids (String). As defined by the tag<role... >
in the workflow.xml file of this JCMS site.- Returns:
- Set of String
-
getWFRole
public WFRole getWFRole(java.lang.String wfRoleId)
-
getWKRole
public WKRole getWKRole(java.lang.String wkRoleId)
-
getWFStateStateLabel
public java.lang.String getWFStateStateLabel(Publication pub, int pstatus, java.lang.String userLang)
Returns the label of the given pstatus.- Parameters:
pub
- the publication to be used to get the workflow.pstatus
- the pstatususerLang
- the user language- Returns:
- the label of the given pstatus.
- Since:
- jcms-5.7.0
-
getWFStateStateLabel
public java.lang.String getWFStateStateLabel(Workflow wf, int pstatus, java.lang.String userLang)
Returns the label of the given pstatus.- Parameters:
wf
- the workflow.pstatus
- the pstatususerLang
- the user language- Returns:
- the label of the given pstatus.
- Since:
- jcms-5.7.0
-
getWFStateStateLabelHtml
public java.lang.String getWFStateStateLabelHtml(Publication pub, int pstatus, java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.- Parameters:
pub
- the publication to be used to get the workflow.pstatus
- the pstatususerLang
- the user language- Returns:
- the HTML code for the label of the given pstatus.
- Since:
- jcms-7.0.0
-
getWFStateStateLabelHtml
public java.lang.String getWFStateStateLabelHtml(Workflow wf, int pstatus, java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.- Parameters:
wf
- the workflow.pstatus
- the pstatususerLang
- the user language- Returns:
- the HTML code for the label of the given pstatus.
- Since:
- jcms-7.0.0
-
getUnknownWFStateLabel
public java.lang.String getUnknownWFStateLabel(int pstatus)
Returns the label of an unknown pstatus.- Parameters:
pstatus
- the pstatus- Returns:
- the label of an unknown pstatus.
- Since:
- jcms-5.7.0
-
getWFNoteList
public java.util.List<WFNote> getWFNoteList(Publication pub)
Returns the list of WFNote bound to the given publication.- Parameters:
pub
- the publication- Returns:
- the list of WFNote bound to the given publication.
- Since:
- jcms-6.0.0
-
getLastWFNote
public WFNote getLastWFNote(Publication pub)
Returns the last WFNote created for this publication.- Parameters:
pub
- the publication- Returns:
- the last WFNote created for this publication.
- Since:
- jcms-6.0.0
-
hasAlreadyVoted
public boolean hasAlreadyVoted(Publication pub, Member mbr)
Check if the given member has already voted for the given publication.- Parameters:
pub
- the publicationmbr
- the member- Returns:
- true if the given member has already voted (ie add a WFNote) in the workflow for the given publication.
- Since:
- jcms-6.0.0
-
removeAllWFNotes
public void removeAllWFNotes(Publication pub)
Removes all the WFNote bound to the given publication.- Parameters:
pub
- the publication- Since:
- jcms-6.0.0
-
addWFReminderAlarm
public void addWFReminderAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).- Parameters:
pub
- the publication- Since:
- jcms-6.0.0
-
removeWFReminderAlarm
public void removeWFReminderAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.- Parameters:
pub
- the publication- Since:
- jcms-6.0.0
-
removeWFReminderAlarm
public void removeWFReminderAlarm(java.lang.String pubId)
Removes the WFExpress alarm for the given publication.- Parameters:
pubId
- the publication's ID- Since:
- jcms-10.0.7
-
addWFExpressAlarm
public void addWFExpressAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).- Parameters:
pub
- the publication- Since:
- jcms-6.0.0
-
removeWFExpressAlarm
public void removeWFExpressAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.- Parameters:
pub
- the publication- Since:
- jcms-6.0.0
-
removeWFExpressAlarm
public void removeWFExpressAlarm(java.lang.String pubId)
Removes the WFExpress alarm for the given publication.- Parameters:
pubId
- the publication's ID- Since:
- jcms-10.0.7
-
getAlphabeticalComparator
public java.util.Comparator<Workflow> getAlphabeticalComparator()
-
getVisiblePstatus
public int[] getVisiblePstatus()
Returns the array of Workflow pstatus visible in front-office.- Returns:
- the array of Workflow pstatus visible in front-office.
- Since:
- jcms-9.0.0
-
invalidateVisiblePstatus
public void invalidateVisiblePstatus()
Invalidate current visible pstatus (they will be computed again at the next call).- Since:
- jcms-9.0.0
-
convertPstatus
public int convertPstatus(Workflow wf, int oldPstatus, int newPstatus, Member opAuthor)
Converts publications in the given pstatus with the given workflow to a new pstatus. Associated WFNotes are also updated.- Parameters:
wf
- the workflowoldPstatus
- the current pstatusnewPstatus
- the new pstatusopAuthor
- the author of the operation- Returns:
- the count of publication converted
- Since:
- jcms-9.0.0
-
convertPstatus
public boolean convertPstatus(Publication pub, Workflow wf, int oldPstatus, int newPstatus, Member opAuthor)
Converts a publication in the given pstatus with the given workflow to a new pstatus. Associated WFNotes are also updated.- Parameters:
pub
- the publicationwf
- the workflow the publication must used to be convertedoldPstatus
- the current pstatusnewPstatus
- the new pstatusopAuthor
- the author of the operation- Returns:
- true if the publication has been converted
- Since:
- jcms-9.0.0
-
cleanUnprefixedRoleMap
public void cleanUnprefixedRoleMap(java.util.Map roleMap)
This is a JCMS 9 migration method. It cleans the role id contains in the given roleMap. Unprefixed roles (eg. "writers") are replaced with WF prefixed role (eg. "basic-writers").- Parameters:
roleMap
- the roleMap to be cleaned.- Since:
- jcms-9.0.0
-
previewInFO
public boolean previewInFO(Publication pub)
Returns true if the given publication must be previewed in front-office- Parameters:
pub
- the publication- Returns:
- true if the given publication must be previewed in front-office
- Since:
- jcms-9.0.0
-
getDefaultFileDocumentWorkflow
public Workflow getDefaultFileDocumentWorkflow()
Returns the Default Workflow associated with FileDocument- Returns:
- Workflow the default workflow for FileDocuments
-
processMessage
public void processMessage(ReplicaMessage msg)
Description copied from interface:ReplicaMessageListener
Process the given ReplicaMessage.- Specified by:
processMessage
in interfaceReplicaMessageListener
- Parameters:
msg
- the ReplicaMessage to process
-
removeMemberFromAllWKRole
public void removeMemberFromAllWKRole(Member member)
Remove a Member from allWKRole
in which he's involved.- Parameters:
member
- theMember
to remove
-
getManager
public Member getManager(Publication pub)
Returns the manager associated to this publication (ie the manager of the submitMember for Form and the manager of the author for other Publication)- Parameters:
pub
- the publication- Returns:
- the manager associated to this publication
- Since:
- jcms-10.0.4
-
getNextWfState
public static java.util.Set<WFState> getNextWfState(Publication pub, Member mbr)
Computes all states which can be reached by a member on a publication. Result Set cannot be empty as the initial state is always available.- Parameters:
pub
- the publicationmbr
- The Member- Returns:
- null if any parameters is null, a Set of
WFState
which can be reached
-
getNextWfState
public static java.util.Set<WFState> getNextWfState(java.lang.Class<? extends Publication> clazz, Member mbr, Workflow targetWorkflow, Workspace targetWorkspace)
Computes all states which can be reached by a member on a publication's class.
-
getNextWfState
public static java.util.Set<WFState> getNextWfState(Publication pub, Member mbr, Workflow targetWorkflow, Workspace targetWorkspace)
Computes all states which can be reached by a member on a publication.
-
getAvailableWorkflowSet
public static java.util.Set<Workflow> getAvailableWorkflowSet(java.lang.Class<? extends Publication> pubClass, Workspace targetWorkspace)
returnSet
of available workflow for this publication class
-
-