public class WorkflowManager extends java.lang.Object implements JcmsConstants, WorkflowConstants, DBConstants
Modifier and Type | Field and Description |
---|---|
static Workflow |
DEFAULT_WORKFLOW |
static java.lang.String |
REVISION |
protected static java.util.Map<java.lang.String,WFRole> |
wfRoleMap |
ADATE_SEARCH, ADMIN_NOTES_PROP, ADVANCED_TAB, ARCHIVES_DIR, ASCII_WIDTH, CATEGORY_TAB, CDATE_SEARCH, COMMON_ALARM, CONTENT_TAB, COOKIE_MAX_AGE, CTRL_TOPIC_INTERNAL, CTRL_TOPIC_REF, CTRL_TOPIC_VALUE, CTRL_TOPIC_WRITE, CUSTOM_PROP, DOCCHOOSER_HEIGHT, DOCCHOOSER_WIDTH, DOCS_DIR, EDATE_SEARCH, EMAIL_REGEXP, ERROR_MSG, FORBIDDEN_FILE_ACCESS, FORBIDDEN_REDIRECT, FORCE_REDIRECT, ICON_ARCHIVE, ICON_LOCK, ICON_LOCK_STRONG, ICON_WARN, ICON_WH_BOOK_CLOSED, ICON_WH_BOOK_OPEN, INFORMATION_MSG, JALIOS_JUNIT_PROP, JCMS_CADDY, JCMS_MSG_LIST, JSYNC_DOWNLOAD_DIR, JSYNC_SYNC_ALARM, 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, PDATE_SEARCH, PHOTO_DIR, PHOTO_ICON, PHOTO_ICON_HEIGHT, PHOTO_ICON_WIDTH, PHOTO_LARGE, PHOTO_LARGE_HEIGHT, PHOTO_LARGE_WIDTH, PHOTO_NORMAL, PHOTO_NORMAL_HEIGHT, PHOTO_NORMAL_WIDTH, PHOTO_SMALL, PHOTO_SMALL_HEIGHT, PHOTO_SMALL_WIDTH, PHOTO_TINY, PHOTO_TINY_HEIGHT, PHOTO_TINY_WIDTH, PREVIOUS_TAB, PRINT_VIEW, PRIVATE_FILE_ACCESS, PUBLIC_FILE_ACCESS, READ_RIGHT_TAB, SDATE_SEARCH, SEARCHENGINE_ALARM, SESSION_AUTHORIZED_FILENAMES_SET, STATS_REPORT_DIR, STATUS_PROP, STORE_XML, TEMPLATE_TAB, THUMBNAIL_LARGE_HEIGHT, THUMBNAIL_LARGE_WIDTH, THUMBNAIL_SMALL_HEIGHT, THUMBNAIL_SMALL_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, URL_REGEXP, WARNING_MSG, WEBAPP_PROP, WFEXPRESS_ALARM, WFREMINDER_ALARM, WORKFLOW_TAB, WORKFLOW_XML
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
ACTION, ACTION_REPEAT, ACTION_TYPE, ACTION_WHEN, ALL_WF, ARCHIVED_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_DESCRIPTION, STATE_DURATION, STATE_LABEL, STATE_PSTATUS, STATE_REMINDER, STATE_TARGETPSTATUS, STATE_TYPE, STATESPE, TRANSITION, TRANSITION_GROUP, TRANSITION_ROLEID, TRANSITION_SOURCE, TRANSITION_TARGET, UNKNOWN_PSTATUS, WF_DEFAULT_ID, WF_DIR, WF_ELT_NAME, WF_ID, WF_INIT, WF_LABEL, WF_TYPE, WF_VERSION, WF_VERSION_VALUE, WFTYPE_PROCESS, WFTYPE_PUBLISH
ALL_CATEGORIES_SET_FIELD, AUTH_GRP_SET_FIELD, AUTH_MBR_SET_FIELD, AUTHOR_ID_FIELD, CATEGORIES_SET_FIELD, CDATE_FIELD, CHANNEL_JCMSDB_PROP, DBDATA_URID, HAS_NO_READ_RIGHTS, HIBERNATE_MAPPING_ADATE, HIBERNATE_MAPPING_AUTHOR, HIBERNATE_MAPPING_CDATE, HIBERNATE_MAPPING_EDATE, HIBERNATE_MAPPING_HASNOREADRIGHTS, HIBERNATE_MAPPING_MAJORVERSION, HIBERNATE_MAPPING_MDATE, HIBERNATE_MAPPING_MINORVERSION, HIBERNATE_MAPPING_PDATE, HIBERNATE_MAPPING_PSTATUS, HIBERNATE_MAPPING_READERCOUNT, HIBERNATE_MAPPING_ROLEMAPSTR, 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, PSTATUS_FIELD, ROW_ID_FIELD, SCROLL_FETCH_SIZE, WORKFLOW_ID_FIELD, WORKSPACE_ID_FIELD
Modifier and Type | Method and Description |
---|---|
protected static void |
addRole(WFRole role) |
static void |
addWFExpressAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).
|
static void |
addWFReminderAlarm(Publication pub)
Adds a WFReminder alarm for the given publication (only for main leader replica).
|
static void |
addWorkflow(java.lang.String id,
Workflow wf)
Binds a Workflow to a given class
|
static void |
convertFromVersion3()
Converts old JCMS (<= 5.6) workflow.xml to new (>=5.7) workflow
structure.
|
static java.util.Comparator<Workflow> |
getAlphabeticalComparator() |
static Workflow |
getCopyWorkflow(java.lang.String id)
Returns the workflow bound to the given id in copyWorkflowMap
|
static 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)
|
static Workflow |
getDefaultWorkflow() |
static WorkflowManager |
getInstance() |
static WFNote |
getLastWFNote(Publication pub)
Returns the last WFNote created for this publication.
|
static java.lang.String |
getUnknownWFStateLabel(int pstatus)
Returns the label of an unknown pstatus.
|
static java.util.List<WFNote> |
getWFNoteList(Publication pub)
Returns the list of WFNote bound to the given publication.
|
static WFRole |
getWFRole(java.lang.String wfRoleId) |
static java.util.Set<java.lang.String> |
getWFRoleIdSet()
Returns a Set of workflow role's ids (String).
|
static java.lang.String |
getWFStateStateLabel(Publication pub,
int pstatus,
java.lang.String userLang)
Returns the label of the given pstatus.
|
static java.lang.String |
getWFStateStateLabel(Workflow wf,
int pstatus,
java.lang.String userLang)
Returns the label of the given pstatus.
|
static java.lang.String |
getWFStateStateLabelHtml(Publication pub,
int pstatus,
java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.
|
static java.lang.String |
getWFStateStateLabelHtml(Workflow wf,
int pstatus,
java.lang.String userLang)
Returns the HTML code for the label of the given pstatus.
|
static WKRole |
getWKRole(java.lang.String wkRoleId) |
static java.util.Set<WKRole> |
getWKRoles(WFRole wfRole) |
static Workflow |
getWorkflow(Publication pub)
Returns the workflow bound to a given publication (general workflow, not instance one if any is set.
|
static Workflow |
getWorkflow(java.lang.String wfId)
Return a Workflow from a given Id
|
static java.util.Set<java.lang.String> |
getWorkflowIdSet()
Return the set of
Workflow id from the workflow Map |
static 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
|
static java.util.Map<java.lang.String,Workflow> |
getWorkflowMap()
Returns the workflow map.
|
static 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)
|
static java.util.Set<Workflow> |
getWorkflowSet()
Return the set of workflow from the workflow Map
|
static java.util.Set<Workflow> |
getWorkflowSet(java.lang.Class typeClass)
Return the set of workflow from the workflow Map compatible with the typeClass
|
static boolean |
hasAlreadyVoted(Publication pub,
Member mbr)
Check if the given member has already voted for the given publication.
|
static void |
initWorkflow()
Initialize the workflows
|
static void |
initWorkflowAlarms() |
static boolean |
isCompatibleWorkflow(Workflow workflow,
java.lang.Class typeClass)
indicates if the
Workflow is compatible with the type Class |
static boolean |
isUpdated()
Returns true if at least one workflow is new, has been updated or has been
deleted.
|
static java.util.Map<java.lang.String,Workflow> |
parseAllWorkflows()
Parse all workflows contains in JCMS
workflows directory. |
static void |
removeAllWFNotes(Publication pub)
Removes all the WFNote bound to the given publication.
|
protected static void |
removeRole(WFRole role) |
static void |
removeWFExpressAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.
|
static void |
removeWFReminderAlarm(Publication pub)
Removes the WFExpress alarm for the given publication.
|
static void |
removeWorkflow(java.lang.String id)
Unbinds a Workflow to a given wfId
|
static void |
revertAllWorkflows()
Revert all the workflow
|
static void |
saveAllWorkflows()
Save the Workflow on disk
|
public static final java.lang.String REVISION
public static Workflow DEFAULT_WORKFLOW
protected static final java.util.Map<java.lang.String,WFRole> wfRoleMap
public static WorkflowManager getInstance()
public static void convertFromVersion3() throws java.io.IOException, org.jdom.JDOMException
java.io.IOException
- If an I/O error occursorg.jdom.JDOMException
- If an error occurs while parsing the DOMpublic static java.util.Map<java.lang.String,Workflow> parseAllWorkflows() throws org.jdom.JDOMException, java.io.IOException
workflows
directory.java.io.IOException
- If an I/O error occursorg.jdom.JDOMException
- If an error occurs while parsing the DOMpublic static void initWorkflowAlarms()
public static Workflow getWorkflow(java.lang.String wfId)
wfId
- the WOrkflow Idpublic static java.util.Set<Workflow> getWorkflowSet()
public static java.util.Set<java.lang.String> getWorkflowIdSet()
Workflow
id from the workflow MapWorkflow
idpublic static java.util.Set<Workflow> getWorkflowSet(java.lang.Class typeClass)
typeClass
- the Class
with wich the workflow should be compatiblepublic static boolean isCompatibleWorkflow(Workflow workflow, java.lang.Class typeClass)
Workflow
is compatible with the type Class
public static java.util.Set<java.lang.String> getWorkflowIdSet(java.lang.Class typeClass)
typeClass
- the Class
with wich the workflow should be compatibleWorkflow
id compatible with the typeClasspublic static java.util.Map<java.lang.String,Workflow> getWorkflowMap()
public static java.util.Map<java.lang.String,Workflow> getCopyWorkflowMap()
public static java.util.Map<java.lang.String,Workflow> getWorkflowMap(boolean copy)
copy
- if true returns the copy of the workflow mappublic static void addWorkflow(java.lang.String id, Workflow wf)
id
- the workflow idwf
- the workflowpublic static void removeWorkflow(java.lang.String id)
id
- the workflow idpublic static Workflow getCopyWorkflow(java.lang.String id)
id
- the workflow idpublic static Workflow getWorkflow(Publication pub)
pub
- the publicationpublic static void saveAllWorkflows()
public static void revertAllWorkflows()
public static void initWorkflow() throws java.lang.Exception
java.lang.Exception
- if the initialization failedpublic static Workflow getDefaultWorkflow()
public static boolean isUpdated()
protected static void addRole(WFRole role)
protected static void removeRole(WFRole role)
public static java.util.Set<java.lang.String> getWFRoleIdSet()
<role... > in the workflow.xml file of this JCMS site.
public static WFRole getWFRole(java.lang.String wfRoleId)
public static WKRole getWKRole(java.lang.String wkRoleId)
public static java.lang.String getWFStateStateLabel(Publication pub, int pstatus, java.lang.String userLang)
pub
- the publication to be used to get the workflow.pstatus
- the pstatususerLang
- the user languagepublic static java.lang.String getWFStateStateLabel(Workflow wf, int pstatus, java.lang.String userLang)
wf
- the workflow.pstatus
- the pstatususerLang
- the user languagepublic static java.lang.String getWFStateStateLabelHtml(Publication pub, int pstatus, java.lang.String userLang)
pub
- the publication to be used to get the workflow.pstatus
- the pstatususerLang
- the user languagepublic static java.lang.String getWFStateStateLabelHtml(Workflow wf, int pstatus, java.lang.String userLang)
wf
- the workflow.pstatus
- the pstatususerLang
- the user languagepublic static java.lang.String getUnknownWFStateLabel(int pstatus)
pstatus
- the pstatuspublic static java.util.List<WFNote> getWFNoteList(Publication pub)
pub
- the publicationpublic static WFNote getLastWFNote(Publication pub)
pub
- the publicationpublic static boolean hasAlreadyVoted(Publication pub, Member mbr)
pub
- the publicationmbr
- the memberpublic static void removeAllWFNotes(Publication pub)
pub
- the publicationpublic static void addWFReminderAlarm(Publication pub)
pub
- the publicationpublic static void removeWFReminderAlarm(Publication pub)
pub
- the publicationpublic static void addWFExpressAlarm(Publication pub)
pub
- the publicationpublic static void removeWFExpressAlarm(Publication pub)
pub
- the publicationpublic static java.util.Comparator<Workflow> getAlphabeticalComparator()
Copyright © 2001-2010 Jalios SA. All Rights Reserved.