public class PilotageStatusHelper extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Class and Description |
---|---|
static class |
PilotageStatusHelper.PilotageStatus
Enumeration for the pilotage status
|
Modifier and Type | Field and Description |
---|---|
private static String |
__CFVU_MCC_VALIDATION_AUTHOR_METADATA
The metadata name for the author of the CFVU MCC validation
|
private static String |
__CFVU_MCC_VALIDATION_COMMENT_METADATA
The metadata name for the comment of the CFVU MCC validation
|
private static String |
__CFVU_MCC_VALIDATION_DATE_METADATA
The metadata name for the date of the CFVU MCC validation
|
private static String |
__CFVU_VALIDATION_AUTHOR_METADATA
The metadata name for the author of the CFVU validation
|
private static String |
__CFVU_VALIDATION_COMMENT_METADATA
The metadata name for the comment of the CFVU validation
|
private static String |
__CFVU_VALIDATION_DATE_METADATA
The metadata name for the date of the CFVU validation
|
private static String |
__MENTION_VALIDATION_AUTHOR_METADATA
The metadata name for the author of the mention validation
|
private static String |
__MENTION_VALIDATION_COMMENT_METADATA
The metadata name for the comment of the mention validation
|
private static String |
__MENTION_VALIDATION_DATE_METADATA
The metadata name for the date of the mention validation
|
private static String |
__ORGUNIT_VALIDATION_AUTHOR_METADATA
The metadata name for the author of the orgUnit validation
|
private static String |
__ORGUNIT_VALIDATION_COMMENT_METADATA
The metadata name for the comment of the orgUnit validation
|
private static String |
__ORGUNIT_VALIDATION_DATE_METADATA
The metadata name for the date of the orgUnit validation
|
private static String |
__PILOTAGE_COMPOSITE_METADATA
The metadata name for the pilotage composite
|
private static String |
__PILOTAGE_STATUS_METADATA
The metadata name for the pilotage status
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ObservationManager |
_observationManager
The observation manager
|
protected ODFHelper |
_odfHelper
The odf helper
|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected RightManager |
_rightManager
The right manager
|
static String |
MENTION_VALIDATION_SUPER_RIGHT_ID
The super right for mention validation state
|
static String |
ORGUNIT_VALIDATION_SUPER_RIGHT_ID
The super right for orgunit validation state
|
static String |
ROLE
The component role.
|
Constructor and Description |
---|
PilotageStatusHelper() |
Modifier and Type | Method and Description |
---|---|
protected void |
_notifyPilotageWorkflowModification(Content content)
Send a notification with the content modified event.
|
int |
comparePilotageStatus(Program program1,
Program program2)
Compare two programs depends on their pilotage status
Pilotage status order : NONE lower than MENTION_VALIDATED lower than ORGUNIT_VALIDATED lower than CFVU_VALIDATED lower than CFVU_VALIDATED lower than CFVU_MCC_VALIDATED
-1 if pilotage status of program 1 is lower than pilotage status of program 2
0 if they have the same pilotage status
1 if pilotage status of program 1 is higher than pilotage status of program 2
-2 if we don't know
|
UserIdentity |
getCFVUMCCValidationAuthor(Content content)
Get CFVU MCC validation author
|
String |
getCFVUMCCValidationComment(Content content)
Get CFVU MCC validation comment
|
Date |
getCFVUMCCValidationDate(Content content)
Get CFVU MMC validation date
|
UserIdentity |
getCFVUValidationAuthor(Content content)
Get CFVU validation author
|
String |
getCFVUValidationComment(Content content)
Get CFVU validation comment
|
Date |
getCFVUValidationDate(Content content)
Get CFVU validation date
|
UserIdentity |
getMentionValidationAuthor(Content content)
Get mention validation author
|
String |
getMentionValidationComment(Content content)
Get mention validation comment
|
Date |
getMentionValidationDate(Content content)
Get mention validation date
|
UserIdentity |
getOrgUnitValidationAuthor(Content content)
Get orgUnit validation author
|
String |
getOrgUnitValidationComment(Content content)
Get orgUnit validation comment
|
Date |
getOrgUnitValidationDate(Content content)
Get orgUnit validation date
|
Set<Program> |
getParentPrograms(ProgramItem programItem)
Get all program parent from the program item
|
Set<Program> |
getParentProgramsWithPilotageStatus(ProgramItem programItem)
Get all program parent with a pilotage status from the program item
|
Program |
getParentProgramWithHigherPilotageStatus(ProgramItem programItem)
Get parent program from program item with higher pilotage status
Can be null if there are no program with pilotage status
|
Map<String,Object> |
getPilotageButtonInfo(String contentId)
Get the pilotage information map
|
PilotageStatusHelper.PilotageStatus |
getPilotageStatus(Content content)
Get the pilotage status of the content
|
boolean |
hasSuperRight(Program program)
Return true if the current user has the super right depend on the pilotage status of the program
|
boolean |
removeCFVUMCCValidationAttribute(ModifiableContent content)
Remove validation attribute for 'CFVU MCC validated' state
|
boolean |
removeCFVUValidationAttribute(ModifiableContent content)
Remove validation attribute for 'CFVU validated' state
|
boolean |
removeMentionValidationAttribute(ModifiableContent content)
Remove validation attribute for 'mention validated' state
|
boolean |
removeOrgUnitValidationAttribute(ModifiableContent content)
Remove validation attribute for 'orgunit validated' state
|
void |
removePilotageStatus(ModifiableContent content,
PilotageStatusHelper.PilotageStatus status)
Remove the validation attribute from the content
|
boolean |
removePilotageWorkflow(ModifiableContent content)
Remove the pilotage workflow metadata.
|
void |
service(ServiceManager manager) |
boolean |
setCFVUMCCValidationAttribute(ModifiableContent content,
Date validationDate,
UserIdentity user,
String comment)
Set the validation attribute for 'CFVU MCC validated' state
|
boolean |
setCFVUValidationAttribute(ModifiableContent content,
Date validationDate,
UserIdentity user,
String comment)
Set the validation attribute for 'CFVU validated' state
|
boolean |
setMentionValidationAttribute(ModifiableContent content,
Date validationDate,
UserIdentity user,
String comment)
Set the validation attribute for 'mention validated' state
|
boolean |
setOrgUnitValidationAttribute(ModifiableContent content,
Date validationDate,
UserIdentity user,
String comment)
Set the validation attribute for 'orgunit validated' state
|
void |
setValidationAttribute(ModifiableContent content,
Date validationDate,
UserIdentity user,
String comment,
PilotageStatusHelper.PilotageStatus status)
Set the validation attribute (date, login, comment) to the content
|
getLogger, setLogger
public static final String MENTION_VALIDATION_SUPER_RIGHT_ID
public static final String ORGUNIT_VALIDATION_SUPER_RIGHT_ID
private static final String __PILOTAGE_COMPOSITE_METADATA
private static final String __PILOTAGE_STATUS_METADATA
private static final String __MENTION_VALIDATION_DATE_METADATA
private static final String __MENTION_VALIDATION_AUTHOR_METADATA
private static final String __MENTION_VALIDATION_COMMENT_METADATA
private static final String __ORGUNIT_VALIDATION_DATE_METADATA
private static final String __ORGUNIT_VALIDATION_AUTHOR_METADATA
private static final String __ORGUNIT_VALIDATION_COMMENT_METADATA
private static final String __CFVU_VALIDATION_DATE_METADATA
private static final String __CFVU_VALIDATION_AUTHOR_METADATA
private static final String __CFVU_VALIDATION_COMMENT_METADATA
private static final String __CFVU_MCC_VALIDATION_DATE_METADATA
private static final String __CFVU_MCC_VALIDATION_AUTHOR_METADATA
private static final String __CFVU_MCC_VALIDATION_COMMENT_METADATA
protected ODFHelper _odfHelper
protected AmetysObjectResolver _resolver
protected RightManager _rightManager
protected CurrentUserProvider _currentUserProvider
protected ObservationManager _observationManager
public PilotageStatusHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Set<Program> getParentPrograms(ProgramItem programItem)
programItem
- the program itempublic Set<Program> getParentProgramsWithPilotageStatus(ProgramItem programItem)
programItem
- the program itempublic boolean hasSuperRight(Program program)
program
- the programpublic int comparePilotageStatus(Program program1, Program program2)
program1
- program 1program2
- progam 2public Program getParentProgramWithHigherPilotageStatus(ProgramItem programItem)
programItem
- the program itempublic Map<String,Object> getPilotageButtonInfo(String contentId)
contentId
- the content idpublic PilotageStatusHelper.PilotageStatus getPilotageStatus(Content content)
content
- the contentprotected void _notifyPilotageWorkflowModification(Content content)
content
- The content to notify onpublic void setValidationAttribute(ModifiableContent content, Date validationDate, UserIdentity user, String comment, PilotageStatusHelper.PilotageStatus status)
content
- the contentvalidationDate
- the validation dateuser
- the usercomment
- the commentstatus
- the pilotage statuspublic void removePilotageStatus(ModifiableContent content, PilotageStatusHelper.PilotageStatus status)
content
- the contentstatus
- the pilotage statuspublic boolean setMentionValidationAttribute(ModifiableContent content, Date validationDate, UserIdentity user, String comment)
content
- the contentvalidationDate
- the validation dateuser
- the usercomment
- the commenttrue
if the content has changed.public boolean removeMentionValidationAttribute(ModifiableContent content)
content
- the contenttrue
if the content has changed.public boolean setOrgUnitValidationAttribute(ModifiableContent content, Date validationDate, UserIdentity user, String comment)
content
- the contentvalidationDate
- the validation dateuser
- the usercomment
- the commenttrue
if the content has changed.public boolean removeOrgUnitValidationAttribute(ModifiableContent content)
content
- the contenttrue
if the content has changed.public boolean setCFVUValidationAttribute(ModifiableContent content, Date validationDate, UserIdentity user, String comment)
content
- the contentvalidationDate
- the validation dateuser
- the logincomment
- the commenttrue
if the content has changed.public boolean removeCFVUValidationAttribute(ModifiableContent content)
content
- the contenttrue
if the content has changed.public boolean setCFVUMCCValidationAttribute(ModifiableContent content, Date validationDate, UserIdentity user, String comment)
content
- the contentvalidationDate
- the validation dateuser
- the usercomment
- the commenttrue
if the content has changed.public boolean removeCFVUMCCValidationAttribute(ModifiableContent content)
content
- the contenttrue
if the content has changed.public Date getMentionValidationDate(Content content)
content
- the contentpublic String getMentionValidationComment(Content content)
content
- the contentpublic UserIdentity getMentionValidationAuthor(Content content)
content
- the contentpublic Date getOrgUnitValidationDate(Content content)
content
- the contentpublic String getOrgUnitValidationComment(Content content)
content
- the contentpublic UserIdentity getOrgUnitValidationAuthor(Content content)
content
- the contentpublic Date getCFVUValidationDate(Content content)
content
- the contentpublic String getCFVUValidationComment(Content content)
content
- the contentpublic UserIdentity getCFVUValidationAuthor(Content content)
content
- the contentpublic Date getCFVUMCCValidationDate(Content content)
content
- the contentpublic String getCFVUMCCValidationComment(Content content)
content
- the contentpublic UserIdentity getCFVUMCCValidationAuthor(Content content)
content
- the contentpublic boolean removePilotageWorkflow(ModifiableContent content)
content
- The content to cleantrue
if the content has changed