Package org.ametys.odf.course
Class ShareableCourseStatusHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.odf.course.ShareableCourseStatusHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
- Direct Known Subclasses:
WebShareableCourseStatusHelper
public class ShareableCourseStatusHelper
extends AbstractLogEnabled
implements Component, Serviceable
Helper for shareable course status
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumEnumeration for the shareable course status -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentHelperThe content helperprotected CurrentUserProviderThe current user providerprotected I18nUtilsThe i18n utilsprotected ObservationManagerThe observation managerprotected AmetysObjectResolverThe ametys object resolverprotected RightManagerThe right managerprotected UserManagerThe user managerstatic final StringThe component role. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_getBodyI18nParams(User user, Content content) Get the i18n parameters of mail body textprotected String_getContentUri(Content content) Get the content uriprotected String_getFiltersText(Content content) Get the list of filter as text for the mail body_getFooterI18nParams(User user, Content content) Get the i18n parameters of mail footer textprotected StringGet the text body of mailprotected String_getMailSubject(String subjectI18nKey, Content content) Get the subject of mailprotected StringGet the request URI._getSubjectI18nParams(Content content) Get the i18n parameters of mail subjectprotected voidSend a notification with the content modified event.protected void_sendNotificationMail(Content content, Set<UserIdentity> usersNotified, String comment, String mailSubjectKey, String mailBodyKey, String mailFooterKey) Send mail to usersgetProposedStateAuthor(Content content) Get 'proposed' state authorgetShareableStatus(Content content) Get the shareable status of the coursebooleanremoveShareableWorkflow(ModifiableContent content) Remove the shareable course workflow metadata.voidservice(ServiceManager manager) booleansetProposedStateAttribute(ModifiableContent content, LocalDate proposeDate, UserIdentity user) Set the attribute for 'proposed' statebooleansetRefusedStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user, String comment) Set the attribute for 'validated' statebooleansetValidatedStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user) Set the attribute for 'validated' statevoidsetWorkflowStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user, ShareableCourseStatusHelper.ShareableStatus status, String comment, boolean ignoreRights) Set the workflow state attribute (date, login) to the contentMethods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role. -
_currentUserProvider
The current user provider -
_observationManager
The observation manager -
_rightManager
The right manager -
_userManager
The user manager -
_i18nUtils
The i18n utils -
_contentHelper
The content helper -
_resolver
The ametys object resolver
-
-
Constructor Details
-
ShareableCourseStatusHelper
public ShareableCourseStatusHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
setProposedStateAttribute
public boolean setProposedStateAttribute(ModifiableContent content, LocalDate proposeDate, UserIdentity user) Set the attribute for 'proposed' state- Parameters:
content- the contentproposeDate- the proposed dateuser- the user- Returns:
trueif the content has changed.
-
setValidatedStateAttribute
public boolean setValidatedStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user) Set the attribute for 'validated' state- Parameters:
content- the contentvalidationDate- the validation dateuser- the login- Returns:
trueif the content has changed.
-
setRefusedStateAttribute
public boolean setRefusedStateAttribute(ModifiableContent content, LocalDate validationDate, UserIdentity user, String comment) Set the attribute for 'validated' state- Parameters:
content- the contentvalidationDate- the validation dateuser- the logincomment- the comment. Can be null- Returns:
trueif the content has changed.
-
getProposedStateAuthor
Get 'proposed' state author- Parameters:
content- the content- Returns:
- the 'proposed' state author
-
_sendNotificationMail
protected void _sendNotificationMail(Content content, Set<UserIdentity> usersNotified, String comment, String mailSubjectKey, String mailBodyKey, String mailFooterKey) Send mail to users- Parameters:
content- the course modifiedusersNotified- the list of user to notifycomment- the comment. Can be nullmailSubjectKey- the mail subject i18n keymailBodyKey- the mail body i18n keymailFooterKey- the i18n key for footer body
-
_getMailSubject
Get the subject of mail- Parameters:
subjectI18nKey- the i18n key to use for subjectcontent- the content- Returns:
- the subject
-
_getSubjectI18nParams
Get the i18n parameters of mail subject- Parameters:
content- the content- Returns:
- the i18n parameters
-
_getMailBody
protected String _getMailBody(String bodyI18nKey, String footerI18nKey, User user, Content content, String comment) Get the text body of mail- Parameters:
bodyI18nKey- the i18n key to use for bodyfooterI18nKey- the i18n key to use for footer bodyuser- the callercontent- the contentcomment- the comment. Can be null- Returns:
- the text body
-
_getBodyI18nParams
Get the i18n parameters of mail body text- Parameters:
user- the callercontent- the content- Returns:
- the i18n parameters
-
_getFiltersText
Get the list of filter as text for the mail body- Parameters:
content- the content- Returns:
- the list of filter as text
-
_getContentUri
Get the content uri- Parameters:
content- the content- Returns:
- the content uri
-
_getRequestUri
Get the request URI.- Returns:
- the full request URI.
-