Class UserImportService
java.lang.Object
io.meeds.social.core.identity.service.UserImportService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddUserMemberships(org.exoplatform.services.organization.idm.UserImpl user, org.json.JSONObject userObject, io.meeds.social.core.identity.model.UserImportResult userImportResult) voidcleanUsersImportResult(String uploadId) computeFields(io.meeds.social.core.identity.model.UserImportResult userImportResult, List<String> fields) computeUserProfileProperties(List<String> fieldsToRemove, org.json.JSONObject userObject) io.meeds.social.core.identity.model.UserImportResultgetUsersImportResult(String uploadId) protected StringimportUser(io.meeds.social.core.identity.model.UserImportResult userImportResult, String modifierUsername, Locale locale, String url, List<String> fields, List<String> fieldsToRemove, String userCSVLine) protected voidimportUsers(String fileLocation, io.meeds.social.core.identity.model.UserImportResult userImportResult, String modifierUsername, Locale locale, String url) voidimportUsers(String uploadId, String modifierUsername, Locale locale, String url, boolean sync) protected voidimportUsersAsync(String fileLocation, io.meeds.social.core.identity.model.UserImportResult userImportResult, String modifierUsername, Locale locale, String url) protected voidimportUsersTransactional(String fileLocation, io.meeds.social.core.identity.model.UserImportResult userImportResult, String modifierUsername, Locale locale, String url) voidinit()protected booleanisEmailAlreadyExists(String username, String email) protected voidlinkMembership(org.exoplatform.services.organization.idm.UserImpl user, org.exoplatform.services.organization.Group groupObject, org.exoplatform.services.organization.MembershipType mType, io.meeds.social.core.identity.model.UserImportResult userImportResult) protected voidprotected voidsendOnBoardingEmail(org.exoplatform.services.organization.idm.UserImpl user, String modifierUsername, String url) voidstop()protected voidupdateProfileField(org.exoplatform.social.core.identity.model.Profile profile, String name, Object value, boolean save, String modifierUsername) Sets one property of an imported user's profile, refusing the properties an import may not write: a non-editable property to a non-administrator, the external flag, the account kind and the user name to anyone, and a property an account kind keeps for administrators to a non-administrator on an account of that kind.protected voidupdateUserProfileProperties(io.meeds.social.core.identity.model.UserImportResult userImportResult, String modifierUsername, List<String> fieldsToRemove, org.json.JSONObject userObject, String userName) protected StringvalidateUser(org.json.JSONObject userObject, Locale locale, List<String> fields)
-
Field Details
-
importUsersProcessing
-
importExecutorService
-
-
Constructor Details
-
UserImportService
public UserImportService()
-
-
Method Details
-
init
@PostConstruct public void init() -
stop
@PreDestroy public void stop() -
getUsersImportResult
-
cleanUsersImportResult
-
importUsers
-
importUsersAsync
-
importUsersTransactional
-
importUsers
-
importUser
-
updateUserProfileProperties
-
computeUserProfileProperties
-
addUserMemberships
protected void addUserMemberships(org.exoplatform.services.organization.idm.UserImpl user, org.json.JSONObject userObject, io.meeds.social.core.identity.model.UserImportResult userImportResult) -
linkMembership
protected void linkMembership(org.exoplatform.services.organization.idm.UserImpl user, org.exoplatform.services.organization.Group groupObject, org.exoplatform.services.organization.MembershipType mType, io.meeds.social.core.identity.model.UserImportResult userImportResult) -
computeFields
-
saveProfile
protected void saveProfile(String username, Map<String, Object> profileProperties, String modifierUsername) throws org.exoplatform.commons.exception.ObjectNotFoundException, IllegalAccessException, IOException- Throws:
org.exoplatform.commons.exception.ObjectNotFoundExceptionIllegalAccessExceptionIOException
-
updateProfileField
protected void updateProfileField(org.exoplatform.social.core.identity.model.Profile profile, String name, Object value, boolean save, String modifierUsername) throws IllegalAccessException, IOException Sets one property of an imported user's profile, refusing the properties an import may not write: a non-editable property to a non-administrator, the external flag, the account kind and the user name to anyone, and a property an account kind keeps for administrators to a non-administrator on an account of that kind.- Parameters:
profile- the profile to updatename- the property namevalue- the property value, or the upload id of an avatar or a bannersave- whether to save the profile once the property is setmodifierUsername- the user who runs the import- Throws:
IllegalAccessException- when the property may not be written by the modifierIOException- when an uploaded avatar or banner cannot be read
-
validateUser
-
sendOnBoardingEmail
protected void sendOnBoardingEmail(org.exoplatform.services.organization.idm.UserImpl user, String modifierUsername, String url) throws IllegalAccessException, IOException - Throws:
IllegalAccessExceptionIOException
-
isEmailAlreadyExists
-