public class ShareableCourseStatusHelper extends AbstractLogEnabled implements Component, Serviceable
Modifier and Type | Class and Description |
---|---|
static class |
ShareableCourseStatusHelper.ShareableStatus
Enumeration for the shareable course status
|
Modifier and Type | Field and Description |
---|---|
private static String |
__NOTIFICATION_RIGHT_ID
The notification right id
|
private static String |
__PROPOSE_RIGHT_ID
The propose right id
|
private static String |
__PROPOSED_AUTHOR_METADATA
The metadata name for the author of the "proposed" state
|
private static String |
__PROPOSED_DATE_METADATA
The metadata name for the date of the "proposed" state
|
private static String |
__REFUSE_RIGHT_ID
The refusal right id
|
private static String |
__VALIDATE_RIGHT_ID
The validate right id
|
private static String |
__VALIDATED_AUTHOR_METADATA
The metadata name for the author of the "validated" state
|
private static String |
__VALIDATED_DATE_METADATA
The metadata name for the date of the "validated" state
|
protected ContentHelper |
_contentHelper
The content helper
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected I18nUtils |
_i18nUtils
The i18n utils
|
protected ObservationManager |
_observationManager
The observation manager
|
protected RightManager |
_rightManager
The right manager
|
protected UserManager |
_userManager
The user manager
|
static String |
ROLE
The component role.
|
static String |
SHAREABLE_COURSE_COMPOSITE_METADATA
The metadata name for the shareable course composite
|
static String |
SHAREABLE_COURSE_STATUS_METADATA
The metadata name for the shareable course status
|
Constructor and Description |
---|
ShareableCourseStatusHelper() |
Modifier and Type | Method and Description |
---|---|
protected List<String> |
_getBodyI18nParams(User user,
Content content)
Get the i18n parameters of mail body text
|
protected String |
_getContentUri(Content content)
Get the content uri
|
protected String |
_getMailBody(String bodyI18nKey,
User user,
Content content)
Get the text body of mail
|
protected String |
_getMailSubject(String subjectI18nKey,
Content content)
Get the subject of mail
|
protected String |
_getRequestUri()
Get the request URI.
|
protected List<String> |
_getSubjectI18nParams(Content content)
Get the i18n parameters of mail subject
|
protected void |
_notifyShareableCourseWorkflowModification(Content content)
Send a notification with the content modified event.
|
protected void |
_sendNotificationMail(Content content,
Set<UserIdentity> usersNotified,
String mailSubjectKey,
String mailBodyKey)
Send mail to users
|
UserIdentity |
getProposedStateAuthor(Content content)
Get 'proposed' state author
|
ShareableCourseStatusHelper.ShareableStatus |
getShareableStatus(Content content)
Get the shareable status of the course
|
boolean |
removeShareableWorkflow(ModifiableContent content)
Remove the shareable course workflow metadata.
|
void |
service(ServiceManager manager) |
boolean |
setProposedStateAttribute(ModifiableContent content,
LocalDate proposeDate,
UserIdentity user)
Set the attribute for 'proposed' state
|
boolean |
setValidatedStateAttribute(ModifiableContent content,
LocalDate validationDate,
UserIdentity user)
Set the attribute for 'validated' state
|
void |
setWorkflowStateAttribute(ModifiableContent content,
LocalDate validationDate,
UserIdentity user,
ShareableCourseStatusHelper.ShareableStatus status,
boolean ignoreRights)
Set the workflow state attribute (date, login) to the content
|
getLogger, setLogger
public static final String SHAREABLE_COURSE_COMPOSITE_METADATA
public static final String SHAREABLE_COURSE_STATUS_METADATA
private static final String __PROPOSED_DATE_METADATA
private static final String __PROPOSED_AUTHOR_METADATA
private static final String __VALIDATED_DATE_METADATA
private static final String __VALIDATED_AUTHOR_METADATA
private static final String __NOTIFICATION_RIGHT_ID
private static final String __PROPOSE_RIGHT_ID
private static final String __VALIDATE_RIGHT_ID
private static final String __REFUSE_RIGHT_ID
protected CurrentUserProvider _currentUserProvider
protected ObservationManager _observationManager
protected RightManager _rightManager
protected UserManager _userManager
protected I18nUtils _i18nUtils
protected ContentHelper _contentHelper
public ShareableCourseStatusHelper()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public ShareableCourseStatusHelper.ShareableStatus getShareableStatus(Content content)
content
- the contentpublic void setWorkflowStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user, ShareableCourseStatusHelper.ShareableStatus status, boolean ignoreRights)
content
- the contentvalidationDate
- the validation dateuser
- the userstatus
- the shareable course statusignoreRights
- true to ignore user rightspublic boolean removeShareableWorkflow(ModifiableContent content)
content
- The content to cleantrue
if the content has changedpublic boolean setProposedStateAttribute(ModifiableContent content, LocalDate proposeDate, UserIdentity user)
content
- the contentproposeDate
- the proposed dateuser
- the usertrue
if the content has changed.public boolean setValidatedStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user)
content
- the contentvalidationDate
- the validation dateuser
- the logintrue
if the content has changed.public UserIdentity getProposedStateAuthor(Content content)
content
- the contentprotected void _notifyShareableCourseWorkflowModification(Content content)
content
- The content to notify onprotected void _sendNotificationMail(Content content, Set<UserIdentity> usersNotified, String mailSubjectKey, String mailBodyKey)
content
- the course modifiedusersNotified
- the list of user to notifymailSubjectKey
- the mail subject i18n keymailBodyKey
- the mail body i18n keyprotected String _getMailSubject(String subjectI18nKey, Content content)
subjectI18nKey
- the i18n key to use for subjectcontent
- the contentprotected List<String> _getSubjectI18nParams(Content content)
content
- the contentprotected String _getMailBody(String bodyI18nKey, User user, Content content)
bodyI18nKey
- the i18n key to use for bodyuser
- the callercontent
- the contentprotected List<String> _getBodyI18nParams(User user, Content content)
user
- the callercontent
- the contentprotected String _getContentUri(Content content)
content
- the contentprotected String _getRequestUri()