Liferay 7.0-ce-b4

com.liferay.portal.service.http
Class RoleServiceSoap

java.lang.Object
  extended by com.liferay.portal.service.http.RoleServiceSoap

@ProviderType
public class RoleServiceSoap
extends Object

Provides the SOAP utility for the 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.

See Also:
RoleServiceHttp, RoleSoap, RoleServiceUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated.

Constructor Summary
RoleServiceSoap()
           
 
Method Summary
static RoleSoap addRole(String className, long classPK, String name, String[] titleMapLanguageIds, String[] titleMapValues, String[] descriptionMapLanguageIds, String[] descriptionMapValues, int type, String subtype, ServiceContext serviceContext)
          Adds a role.
static RoleSoap addRole(String name, String[] titleMapLanguageIds, String[] titleMapValues, String[] descriptionMapLanguageIds, String[] descriptionMapValues, int type)
          Deprecated. As of 6.2.0, replaced by #addRole(String, long, String, Map, Map, int, String, ServiceContext)
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 RoleSoap fetchRole(long roleId)
           
static RoleSoap[] getGroupRoles(long groupId)
          Returns all the roles associated with the group.
static RoleSoap getRole(long roleId)
          Returns the role with the primary key.
static RoleSoap getRole(long companyId, String name)
          Returns the role with the name in the company.
static RoleSoap[] getRoles(int type, String subtype)
           
static RoleSoap[] getRoles(long companyId, int[] types)
           
static RoleSoap[] getUserGroupGroupRoles(long userId, long groupId)
          Returns all the user's roles within the user group.
static RoleSoap[] getUserGroupRoles(long userId, long groupId)
          Returns all the user's roles within the user group.
static RoleSoap[] getUserRelatedRoles(long userId, GroupSoap[] groups)
          Returns the union of all the user's roles within the groups.
static 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 RoleSoap updateRole(long roleId, String name, String[] titleMapLanguageIds, String[] titleMapValues, String[] descriptionMapLanguageIds, String[] descriptionMapValues, String subtype, ServiceContext serviceContext)
          Updates the role with the primary key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleServiceSoap

public RoleServiceSoap()
Method Detail

addRole

public static RoleSoap addRole(String className,
                               long classPK,
                               String name,
                               String[] titleMapLanguageIds,
                               String[] titleMapValues,
                               String[] descriptionMapLanguageIds,
                               String[] descriptionMapValues,
                               int type,
                               String subtype,
                               ServiceContext serviceContext)
                        throws RemoteException
Adds a role. The user is reindexed after role is added.

Parameters:
className - the name of the class for which the role is created
classPK - the primary key of the class for which the role is created (optionally 0)
name - the role's name
titleMap - 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.
Returns:
the role
Throws:
RemoteException

addRole

@Deprecated
public static RoleSoap addRole(String name,
                                          String[] titleMapLanguageIds,
                                          String[] titleMapValues,
                                          String[] descriptionMapLanguageIds,
                                          String[] descriptionMapValues,
                                          int type)
                        throws RemoteException
Deprecated. As of 6.2.0, replaced by #addRole(String, long, String, Map, Map, int, String, ServiceContext)

Adds a role. The user is reindexed after role is added.

Parameters:
name - the role's name
titleMap - the role's localized titles (optionally null)
descriptionMap - the role's localized descriptions (optionally null)
type - the role's type (optionally 0)
Returns:
the role
Throws:
RemoteException

addUserRoles

public static void addUserRoles(long userId,
                                long[] roleIds)
                         throws RemoteException
Adds the roles to the user. The user is reindexed after the roles are added.

Parameters:
userId - the primary key of the user
roleIds - the primary keys of the roles
Throws:
RemoteException

deleteRole

public static void deleteRole(long roleId)
                       throws RemoteException
Deletes the role with the primary key and its associated permissions.

Parameters:
roleId - the primary key of the role
Throws:
RemoteException

fetchRole

public static RoleSoap fetchRole(long roleId)
                          throws RemoteException
Throws:
RemoteException

getGroupRoles

public static RoleSoap[] getGroupRoles(long groupId)
                                throws RemoteException
Returns all the roles associated with the group.

Parameters:
groupId - the primary key of the group
Returns:
the roles associated with the group
Throws:
RemoteException

getRole

public static RoleSoap getRole(long roleId)
                        throws RemoteException
Returns the role with the primary key.

Parameters:
roleId - the primary key of the role
Returns:
the role with the primary key
Throws:
RemoteException

getRole

public static RoleSoap getRole(long companyId,
                               String name)
                        throws RemoteException
Returns the role with the name in the company.

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.

Parameters:
companyId - the primary key of the company
name - the role's name
Returns:
the role with the name
Throws:
RemoteException

getRoles

public static RoleSoap[] getRoles(int type,
                                  String subtype)
                           throws RemoteException
Throws:
RemoteException

getRoles

public static RoleSoap[] getRoles(long companyId,
                                  int[] types)
                           throws RemoteException
Throws:
RemoteException

getUserGroupGroupRoles

public static RoleSoap[] getUserGroupGroupRoles(long userId,
                                                long groupId)
                                         throws RemoteException
Returns all the user's roles within the user group.

Parameters:
userId - the primary key of the user
groupId - the primary key of the group
Returns:
the user's roles within the user group
Throws:
RemoteException

getUserGroupRoles

public static RoleSoap[] getUserGroupRoles(long userId,
                                           long groupId)
                                    throws RemoteException
Returns all the user's roles within the user group.

Parameters:
userId - the primary key of the user
groupId - the primary key of the group
Returns:
the user's roles within the user group
Throws:
RemoteException

getUserRelatedRoles

public static RoleSoap[] getUserRelatedRoles(long userId,
                                             GroupSoap[] groups)
                                      throws RemoteException
Returns the union of all the user's roles within the groups.

Parameters:
userId - the primary key of the user
groups - the groups (optionally null)
Returns:
the union of all the user's roles within the groups
Throws:
RemoteException

getUserRoles

public static RoleSoap[] getUserRoles(long userId)
                               throws RemoteException
Returns all the roles associated with the user.

Parameters:
userId - the primary key of the user
Returns:
the roles associated with the user
Throws:
RemoteException

hasUserRole

public static boolean hasUserRole(long userId,
                                  long companyId,
                                  String name,
                                  boolean inherited)
                           throws RemoteException
Returns true if the user is associated with the named regular role.

Parameters:
userId - the primary key of the user
companyId - the primary key of the company
name - the name of the role
inherited - whether to include the user's inherited roles in the search
Returns:
true if the user is associated with the regular role; false otherwise
Throws:
RemoteException

hasUserRoles

public static boolean hasUserRoles(long userId,
                                   long companyId,
                                   String[] names,
                                   boolean inherited)
                            throws RemoteException
Returns true if the user has any one of the named regular roles.

Parameters:
userId - the primary key of the user
companyId - the primary key of the company
names - the names of the roles
inherited - whether to include the user's inherited roles in the search
Returns:
true if the user has any one of the regular roles; false otherwise
Throws:
RemoteException

unsetUserRoles

public static void unsetUserRoles(long userId,
                                  long[] roleIds)
                           throws RemoteException
Removes the matching roles associated with the user. The user is reindexed after the roles are removed.

Parameters:
userId - the primary key of the user
roleIds - the primary keys of the roles
Throws:
RemoteException

updateRole

public static RoleSoap updateRole(long roleId,
                                  String name,
                                  String[] titleMapLanguageIds,
                                  String[] titleMapValues,
                                  String[] descriptionMapLanguageIds,
                                  String[] descriptionMapValues,
                                  String subtype,
                                  ServiceContext serviceContext)
                           throws RemoteException
Updates the role with the primary key.

Parameters:
roleId - the primary key of the role
name - the role's new name
titleMap - the new localized titles (optionally null) to replace those existing for the role
descriptionMap - the new localized descriptions (optionally null) to replace those existing for the role
subtype - 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.
Returns:
the role with the primary key
Throws:
RemoteException

Liferay 7.0-ce-b4