Package org.nuxeo.ecm.user.invite
Class UserInvitationComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.user.invite.UserInvitationComponent
- All Implemented Interfaces:
UserInvitationService,Adaptable,Component,Extensible,TimestampedService
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classprotected classprotected classprotected classprotected classprotected classprotected classNested classes/interfaces inherited from interface org.nuxeo.ecm.user.invite.UserInvitationService
UserInvitationService.ValidationMethod -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, UserRegistrationConfiguration> static final Stringstatic final Stringprotected Stringprotected RenderingHelperprotected StringFields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, nameFields inherited from interface org.nuxeo.ecm.user.invite.UserInvitationService
REGISTRATION_CONFIGURATION_NAME, REGISTRATION_DATA_DOC, REGISTRATION_DATA_USER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) accept the registration requestprotected StringbuildEnterPasswordUrl(UserRegistrationConfiguration configuration) voidcheckRequestId(String requestId) The method checks if the request id is a valid one.protected booleancheckUserFromRegistrationExistence(DocumentModel registrationDoc) createUser(CoreSession session, DocumentModel registrationDoc) voiddeleteRegistrationRequests(CoreSession session, List<DocumentModel> registrationDocs) Delete a registration documentprotected voidgenerateMail(String destination, String copy, String title, String content) getConfiguration(String name) Return specific configuration for the specified namegetConfiguration(DocumentModel requestDoc) List all registered onfiguration namegetOrCreateRootDocument(CoreSession session, String configurationName) getRegistrationRules(String configurationName) Get registration rules adaptergetRegistrationRulesDocument(CoreSession session, String configurationName) Get documentmodel that stores request configuration using RegistrationConfiguration facet.getRegistrationsForUser(String docId, String username, String configurationName) Retrieve registrations for a document givent the usernameprotected InvitationUserFactorygetRegistrationUserFactory(UserRegistrationConfiguration configuration) protected StringgetUserRegistrationModel(String configurationName) Create a document model for the UserRegistration doctype.protected static booleanisEmailExist(UserRegistrationConfiguration configuration, DocumentModel userRegistration) protected static booleanvoidregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor) voidrejectRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) reject the registration requestprotected voidreviveRegistrationRequest(CoreSession session, DocumentModel registrationDoc, Map<String, Serializable> additionalInfos) voidreviveRegistrationRequests(CoreSession session, List<DocumentModel> registrationDocs) Send a mail to the invited user to revive his invitation If an error occured while sending an email, it logs it and continue.protected voidsendEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc, String emailTemplatePath, String emailTitle) protected EventContextsendEvent(CoreSession session, DocumentModel source, String evName) protected voidsendValidationEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc) submitRegistrationRequest(String configurationName, DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Stores a resgitration request like submitRegistrationRequest with Document informationsubmitRegistrationRequest(DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Stores a registration request and return a unique ID for itprotected booleanuserAlreadyExists(UserRegistrationInfo userRegistrationInfo) validateRegistration(String requestId, Map<String, Serializable> additionnalInfo) Validate a registration request and generate the target UservalidateRegistrationAndSendEmail(String requestId, Map<String, Serializable> additionnalInfo) Validate a registration request and generate the target UserMethods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterContribution, unregisterExtensionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
PARAM_ORIGINATING_USER
- See Also:
-
NUXEO_URL_KEY
- See Also:
-
repoName
-
testRendering
-
rh
-
configurations
-
-
Constructor Details
-
UserInvitationComponent
public UserInvitationComponent()
-
-
Method Details
-
getTestedRendering
-
getTargetRepositoryName
-
userAlreadyExists
-
getUserRegistrationModel
Description copied from interface:UserInvitationServiceCreate a document model for the UserRegistration doctype.- Specified by:
getUserRegistrationModelin interfaceUserInvitationService- Parameters:
configurationName- The name of the configuration.- Returns:
- The document model
-
getRegistrationRulesDocument
Description copied from interface:UserInvitationServiceGet documentmodel that stores request configuration using RegistrationConfiguration facet.- Specified by:
getRegistrationRulesDocumentin interfaceUserInvitationService
-
getOrCreateRootDocument
-
sendEvent
protected EventContext sendEvent(CoreSession session, DocumentModel source, String evName) throws UserRegistrationException - Throws:
UserRegistrationException
-
sendValidationEmail
protected void sendValidationEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc) -
sendEmail
protected void sendEmail(Map<String, Serializable> additionnalInfo, DocumentModel registrationDoc, String emailTemplatePath, String emailTitle) -
isTestModeSet
protected static boolean isTestModeSet() -
checkUserFromRegistrationExistence
-
generateMail
protected void generateMail(String destination, String copy, String title, String content) throws jakarta.mail.MessagingException - Throws:
jakarta.mail.MessagingException
-
submitRegistrationRequest
public String submitRegistrationRequest(DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Description copied from interface:UserInvitationServiceStores a registration request and return a unique ID for it- Specified by:
submitRegistrationRequestin interfaceUserInvitationService
-
getRegistrationsForUser
public DocumentModelList getRegistrationsForUser(String docId, String username, String configurationName) Description copied from interface:UserInvitationServiceRetrieve registrations for a document givent the username- Specified by:
getRegistrationsForUserin interfaceUserInvitationService
-
isEmailExist
protected static boolean isEmailExist(UserRegistrationConfiguration configuration, DocumentModel userRegistration) -
submitRegistrationRequest
public String submitRegistrationRequest(String configurationName, DocumentModel userRegistrationModel, Map<String, Serializable> additionnalInfo, UserInvitationService.ValidationMethod validationMethod, boolean autoAccept) Description copied from interface:UserInvitationServiceStores a resgitration request like submitRegistrationRequest with Document information- Specified by:
submitRegistrationRequestin interfaceUserInvitationService- Returns:
- a unique ID for it
-
buildEnterPasswordUrl
-
acceptRegistrationRequest
public void acceptRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationServiceaccept the registration request- Specified by:
acceptRegistrationRequestin interfaceUserInvitationService- Throws:
UserRegistrationException
-
rejectRegistrationRequest
public void rejectRegistrationRequest(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationServicereject the registration request- Specified by:
rejectRegistrationRequestin interfaceUserInvitationService- Throws:
UserRegistrationException
-
validateRegistration
public Map<String,Serializable> validateRegistration(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationServiceValidate a registration request and generate the target User- Specified by:
validateRegistrationin interfaceUserInvitationService- Throws:
UserRegistrationException
-
validateRegistrationAndSendEmail
public Map<String,Serializable> validateRegistrationAndSendEmail(String requestId, Map<String, Serializable> additionnalInfo) throws UserRegistrationExceptionDescription copied from interface:UserInvitationServiceValidate a registration request and generate the target User- Specified by:
validateRegistrationAndSendEmailin interfaceUserInvitationService- Throws:
UserRegistrationException
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor) - Overrides:
registerContributionin classDefaultComponent
-
getRegistrationUserFactory
protected InvitationUserFactory getRegistrationUserFactory(UserRegistrationConfiguration configuration) -
createUser
public NuxeoPrincipal createUser(CoreSession session, DocumentModel registrationDoc) throws UserRegistrationException - Specified by:
createUserin interfaceUserInvitationService- Throws:
UserRegistrationException
-
getConfiguration
- Specified by:
getConfigurationin interfaceUserInvitationService
-
getConfiguration
- Specified by:
getConfigurationin interfaceUserInvitationService
-
getConfiguration
Description copied from interface:UserInvitationServiceReturn specific configuration for the specified name- Specified by:
getConfigurationin interfaceUserInvitationService- Parameters:
name- configuration name
-
getRegistrationRules
Description copied from interface:UserInvitationServiceGet registration rules adapter- Specified by:
getRegistrationRulesin interfaceUserInvitationService
-
reviveRegistrationRequests
Description copied from interface:UserInvitationServiceSend a mail to the invited user to revive his invitation If an error occured while sending an email, it logs it and continue.- Specified by:
reviveRegistrationRequestsin interfaceUserInvitationService
-
reviveRegistrationRequest
protected void reviveRegistrationRequest(CoreSession session, DocumentModel registrationDoc, Map<String, Serializable> additionalInfos) -
deleteRegistrationRequests
Description copied from interface:UserInvitationServiceDelete a registration document- Specified by:
deleteRegistrationRequestsin interfaceUserInvitationService
-
getConfigurationsName
Description copied from interface:UserInvitationServiceList all registered onfiguration name- Specified by:
getConfigurationsNamein interfaceUserInvitationService
-
checkRequestId
Description copied from interface:UserInvitationServiceThe method checks if the request id is a valid one.- Specified by:
checkRequestIdin interfaceUserInvitationService- Parameters:
requestId- The value of the request id.- Throws:
UserRegistrationException
-
getNameEventRegistrationSubmitted
- Specified by:
getNameEventRegistrationSubmittedin interfaceUserInvitationService- Returns:
- The name of the event when the registration is submitted.
-
getNameEventRegistrationAccepted
- Specified by:
getNameEventRegistrationAcceptedin interfaceUserInvitationService- Returns:
- The name of the event when the registration is accepted.
-
getNameEventRegistrationRejected
- Specified by:
getNameEventRegistrationRejectedin interfaceUserInvitationService- Returns:
- The name of the event when the registration is rejected.
-
getNameEventRegistrationValidated
- Specified by:
getNameEventRegistrationValidatedin interfaceUserInvitationService- Returns:
- The name of the event when the registration is validated.
-