@ProviderType
public class RoleServiceSoap
extends Object
RoleServiceUtil
service utility. The
static methods of this class calls the same methods of the service utility.
However, the signatures are different because it is difficult for SOAP to
support certain types.
ServiceBuilder follows certain rules in translating the methods. For example,
if the method in the service utility returns a List
, that
is translated to an array of RoleSoap
.
If the method in the service utility returns a
Role
, that is translated to a
RoleSoap
. Methods that SOAP cannot
safely wire are skipped.
The benefits of using the SOAP utility is that it is cross platform compatible. SOAP allows different languages like Java, .NET, C++, PHP, and even Perl, to call the generated services. One drawback of SOAP is that it is slow because it needs to serialize all calls into a text format (XML).
You can see a list of services at http://localhost:8080/api/axis. Set the property axis.servlet.hosts.allowed in portal.properties to configure security.
The SOAP utility is only generated for remote services.
RoleServiceHttp
,
RoleSoap
,
RoleServiceUtil
Constructor and Description |
---|
RoleServiceSoap() |
Modifier and Type | Method and Description |
---|---|
static com.liferay.portal.kernel.model.RoleSoap |
addRole(String className,
long classPK,
String name,
String[] titleMapLanguageIds,
String[] titleMapValues,
String[] descriptionMapLanguageIds,
String[] descriptionMapValues,
int type,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
Adds a role.
|
static void |
addUserRoles(long userId,
long[] roleIds)
Adds the roles to the user.
|
static void |
deleteRole(long roleId)
Deletes the role with the primary key and its associated permissions.
|
static com.liferay.portal.kernel.model.RoleSoap |
fetchRole(long roleId) |
static com.liferay.portal.kernel.model.RoleSoap[] |
getGroupRoles(long groupId)
Returns all the roles associated with the group.
|
static com.liferay.portal.kernel.model.RoleSoap[] |
getGroupRolesAndTeamRoles(long companyId,
String keywords,
List<String> excludedNames,
int[] types,
long excludedTeamRoleId,
long teamGroupId,
int start,
int end) |
static int |
getGroupRolesAndTeamRolesCount(long companyId,
String keywords,
List<String> excludedNames,
int[] types,
long excludedTeamRoleId,
long teamGroupId) |
static com.liferay.portal.kernel.model.RoleSoap |
getRole(long roleId)
Returns the role with the primary key.
|
static com.liferay.portal.kernel.model.RoleSoap |
getRole(long companyId,
String name)
Returns the role with the name in the company.
|
static com.liferay.portal.kernel.model.RoleSoap[] |
getRoles(int type,
String subtype) |
static com.liferay.portal.kernel.model.RoleSoap[] |
getRoles(long companyId,
int[] types) |
static com.liferay.portal.kernel.model.RoleSoap[] |
getUserGroupGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group.
|
static com.liferay.portal.kernel.model.RoleSoap[] |
getUserGroupRoles(long userId,
long groupId)
Returns all the user's roles within the user group.
|
static com.liferay.portal.kernel.model.RoleSoap[] |
getUserRelatedRoles(long userId,
com.liferay.portal.kernel.model.GroupSoap[] groups)
Returns the union of all the user's roles within the groups.
|
static com.liferay.portal.kernel.model.RoleSoap[] |
getUserRoles(long userId)
Returns all the roles associated with the user.
|
static boolean |
hasUserRole(long userId,
long companyId,
String name,
boolean inherited)
Returns
true if the user is associated with the named
regular role. |
static boolean |
hasUserRoles(long userId,
long companyId,
String[] names,
boolean inherited)
Returns
true if the user has any one of the named regular
roles. |
static void |
unsetUserRoles(long userId,
long[] roleIds)
Removes the matching roles associated with the user.
|
static com.liferay.portal.kernel.model.RoleSoap |
updateRole(long roleId,
String name,
String[] titleMapLanguageIds,
String[] titleMapValues,
String[] descriptionMapLanguageIds,
String[] descriptionMapValues,
String subtype,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
Updates the role with the primary key.
|
public static com.liferay.portal.kernel.model.RoleSoap addRole(String className, long classPK, String name, String[] titleMapLanguageIds, String[] titleMapValues, String[] descriptionMapLanguageIds, String[] descriptionMapValues, int type, String subtype, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws RemoteException
className
- the name of the class for which the role is createdclassPK
- the primary key of the class for which the role is
created (optionally 0
)name
- the role's nametitleMap
- the role's localized titles (optionally
null
)descriptionMap
- the role's localized descriptions (optionally
null
)type
- the role's type (optionally 0
)subtype
- the role's subtype (optionally null
)serviceContext
- the service context to be applied (optionally
null
). Can set the expando bridge attributes for the
role.RemoteException
public static void addUserRoles(long userId, long[] roleIds) throws RemoteException
userId
- the primary key of the userroleIds
- the primary keys of the rolesRemoteException
public static void deleteRole(long roleId) throws RemoteException
roleId
- the primary key of the roleRemoteException
public static com.liferay.portal.kernel.model.RoleSoap fetchRole(long roleId) throws RemoteException
RemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getGroupRoles(long groupId) throws RemoteException
groupId
- the primary key of the groupRemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getGroupRolesAndTeamRoles(long companyId, String keywords, List<String> excludedNames, int[] types, long excludedTeamRoleId, long teamGroupId, int start, int end) throws RemoteException
RemoteException
public static int getGroupRolesAndTeamRolesCount(long companyId, String keywords, List<String> excludedNames, int[] types, long excludedTeamRoleId, long teamGroupId) throws RemoteException
RemoteException
public static com.liferay.portal.kernel.model.RoleSoap getRole(long roleId) throws RemoteException
roleId
- the primary key of the roleRemoteException
public static com.liferay.portal.kernel.model.RoleSoap getRole(long companyId, String name) throws RemoteException
The method searches the system roles map first for default roles. If a role with the name is not found, then the method will query the database.
companyId
- the primary key of the companyname
- the role's nameRemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getRoles(int type, String subtype) throws RemoteException
RemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getRoles(long companyId, int[] types) throws RemoteException
RemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getUserGroupGroupRoles(long userId, long groupId) throws RemoteException
userId
- the primary key of the usergroupId
- the primary key of the groupRemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getUserGroupRoles(long userId, long groupId) throws RemoteException
userId
- the primary key of the usergroupId
- the primary key of the groupRemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getUserRelatedRoles(long userId, com.liferay.portal.kernel.model.GroupSoap[] groups) throws RemoteException
userId
- the primary key of the usergroups
- the groups (optionally null
)RemoteException
public static com.liferay.portal.kernel.model.RoleSoap[] getUserRoles(long userId) throws RemoteException
userId
- the primary key of the userRemoteException
public static boolean hasUserRole(long userId, long companyId, String name, boolean inherited) throws RemoteException
true
if the user is associated with the named
regular role.userId
- the primary key of the usercompanyId
- the primary key of the companyname
- the name of the roleinherited
- whether to include the user's inherited roles in the
searchtrue
if the user is associated with the regular
role; false
otherwiseRemoteException
public static boolean hasUserRoles(long userId, long companyId, String[] names, boolean inherited) throws RemoteException
true
if the user has any one of the named regular
roles.userId
- the primary key of the usercompanyId
- the primary key of the companynames
- the names of the rolesinherited
- whether to include the user's inherited roles in the
searchtrue
if the user has any one of the regular roles;
false
otherwiseRemoteException
public static void unsetUserRoles(long userId, long[] roleIds) throws RemoteException
userId
- the primary key of the userroleIds
- the primary keys of the rolesRemoteException
public static com.liferay.portal.kernel.model.RoleSoap updateRole(long roleId, String name, String[] titleMapLanguageIds, String[] titleMapValues, String[] descriptionMapLanguageIds, String[] descriptionMapValues, String subtype, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws RemoteException
roleId
- the primary key of the rolename
- the role's new nametitleMap
- the new localized titles (optionally null
)
to replace those existing for the roledescriptionMap
- the new localized descriptions (optionally
null
) to replace those existing for the rolesubtype
- the role's new subtype (optionally null
)serviceContext
- the service context to be applied (optionally
null
). Can set the expando bridge attributes for the
role.RemoteException