public class CustomPortalServiceHandler extends Object
Constructor and Description |
---|
CustomPortalServiceHandler() |
Modifier and Type | Method and Description |
---|---|
static void |
changeUserProfile(com.liferay.portal.model.User oldUser,
ProfileForm newProfile,
org.springframework.validation.BindingResult result)
Validates a given form object and changes user settings accordingly
|
static void |
checkInit(long groupId,
long userId)
Provides an entry point to initialize basic settings and data-structures.
|
static com.liferay.portal.model.Role |
checkRole(long userId,
long companyId,
E_Role role)
Check for a specific role name and create a regular role if not existent
|
static com.liferay.portal.model.Role |
checkRole(long userId,
long companyId,
String roleName,
int roleType)
Check for a specific role name and create a regular role if not existent
|
static void |
createOrganisationLogoFolder(long groupId,
long userId) |
static com.liferay.portal.model.User |
createPortalUser(String firstName,
String lastName,
String mail,
long companyId,
long groupId,
Locale locale,
boolean sendMail)
Creates a new portal user
|
static com.liferay.portal.model.User |
createPortalUser(String firstName,
String lastName,
String mail,
long companyId,
long groupId,
Locale locale,
boolean sendMail,
String password,
boolean isAdmin) |
static com.liferay.portal.model.User |
createPortalUser(String firstName,
String lastName,
String mail,
long companyId,
long groupId,
Locale locale,
boolean sendMail,
String password,
boolean isAdmin,
E_Role defaultRole)
Creates a new portal user
|
static String |
getConfigValue(E_ConfigKey key)
Gets the value for a given configuration key (or the default setting if not found)
This method may either access the portlet data-source for local settings or the portal properties for global configuration settings
|
static String |
getRoleName(E_Role role)
Get actual/dynamic role name of a role containing a configuration reference
|
static boolean |
hasUser(long companyId,
String mail)
Check whether a given user exists
|
static boolean |
isConfigEnabled(E_ConfigKey key)
Checks if a configuration key that holds a boolean setting is set to true
|
static boolean |
isSystemInitialized()
Checks if is system initialized.
|
static E_Role |
matchesRole(com.liferay.portal.model.Role cmpRole)
Check whether a Liferay-Role matches any role defined by this enum
|
static void |
saveConfig(javax.portlet.ActionRequest request)
Save a set of configuration changes right from the portlet request
The request is parsed for configuration values with names out of
E_ConfigKey
As a result, social media plugins and messagec composers will be reinitialized to address the changes |
static void |
setConfig(E_ConfigKey key,
String value)
Set a given configuration value
|
public static void changeUserProfile(com.liferay.portal.model.User oldUser, ProfileForm newProfile, org.springframework.validation.BindingResult result)
oldUser
- the old Liferay user modelnewProfile
- the profile containing new valuesresult
- the message handler to bind validation errors topublic static void checkInit(long groupId, long userId)
themeDisplay
- the theme display of the administratorpublic static void createOrganisationLogoFolder(long groupId, long userId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException
public static E_Role matchesRole(com.liferay.portal.model.Role cmpRole)
cmpRole
- the Liferay rolepublic static String getRoleName(E_Role role)
role
- The rolepublic static com.liferay.portal.model.Role checkRole(long userId, long companyId, E_Role role)
companyId
- the company Id of the given rolerole
- the role enumpublic static com.liferay.portal.model.Role checkRole(long userId, long companyId, String roleName, int roleType)
companyId
- the company Id of the given roleroleName
- the role namepublic static com.liferay.portal.model.User createPortalUser(String firstName, String lastName, String mail, long companyId, long groupId, Locale locale, boolean sendMail)
firstName
- the first namelastName
- the last namemail
- the email addresscompanyId
- the company idlocale
- the user's localepublic static com.liferay.portal.model.User createPortalUser(String firstName, String lastName, String mail, long companyId, long groupId, Locale locale, boolean sendMail, String password, boolean isAdmin)
public static com.liferay.portal.model.User createPortalUser(String firstName, String lastName, String mail, long companyId, long groupId, Locale locale, boolean sendMail, String password, boolean isAdmin, E_Role defaultRole)
firstName
- the first namelastName
- the last namemail
- the email addresscompanyId
- the company idlocale
- the user's localepublic static String getConfigValue(E_ConfigKey key)
key
- the configuration keypublic static boolean isConfigEnabled(E_ConfigKey key)
key
- the configuration keypublic static boolean hasUser(long companyId, String mail)
companyId
- the company idmail
- the email address of the user in questionpublic static boolean isSystemInitialized()
#checkInit()) checkInit
was called before.#checkInit()) checkInit
was successfully called beforepublic static void saveConfig(javax.portlet.ActionRequest request)
E_ConfigKey
As a result, social media plugins and messagec composers will be reinitialized to address the changesrequest
- the portlet requestpublic static void setConfig(E_ConfigKey key, String value)
key
- the configuration keyvalue
- the configuration valueCopyright © 2016 Fraunhofer FOKUS. All rights reserved.