Skip navigation links


oracle.webcenter.spaces.ws.client
Class GroupSpaceWSClient

java.lang.Object
  extended by oracle.webcenter.spaces.ws.client.GroupSpaceWSClient


public class GroupSpaceWSClient
extends java.lang.Object

This class provides the utility methods to perform commonly used Group Space operations. The consumers of this class are expected to initialize the context class, and then instantiate the group space ws client by passing the context. After this, they can start calling individual APIs. This client uses "SAML base token passing with message emcryption" policy. It uses OWSM libraries internally. The GroupSpaceWSClient is mainly dependent upon the keystore configuration and encryption key for message protection and client authorization. It also requires SAML issuer token name from the server. Certificate generated at the server side can be used by the client to sign the SOAP message with its signature. This certifcate must go in the keystore file which can be of type JKS or Oracle Wallet. Consumer can either set the end point URL [the URL where the web service is running] by explicitly calling setSpacesWebServicesEndPointURL() through the client API call or he can set it up on connections.xml The entry in connections.xml would look like this:

 <?xml version = '1.0' encoding = 'UTF-8'?>
 <ns2:References xmlns:ns2="http://xmlns.oracle.com/adf/jndi">
    <Reference name="SpacesWebServiceEndpoint"
    classname="oracle_adf_model_connection_url_HttpURLConnection">
       <Factory classname="oracle_adf_model_connection_url_URLConnectionFactory"/>
       <RefAddresses>
          <XmlRefAddr addrType="SpacesWebServiceEndpoint">
             <Contents>
                <urlconnection name="SpacesWebServiceEndpoint"
                url="http://stapl68.us.oracle.com:8890/webcenter"/>
             </Contents>
          </XmlRefAddr>
       </RefAddresses>
    </Reference>
 </ns2:References>
 

When client runs as a J2EE application in the Oracle container for Java, it does not require all the configuration parameters. It requires the path to policy location where OWSM policies are specified, SAML issuer name, the currently logged in user and the webservice endpoint.

Once the client is initialized. One can call the the APIs to get the metadata about the group space. The API throws GroupSpaceWSException if the call to Spaces WebService does not go through.

The call from a J2EE application looks like following:

 GroupSpaceWSContext context = new GroupSpaceWSContext();
 context.setEndPoint("http://host:port/webcenter/SpacesWebService");
 context.setSamlIssuerName(<issuer-name>);
 
 GroupSpaceWSClient client = new GroupSpaceWSClient(context); 
 //call APIs
 client.set....()

 

The rest of the details will be picked up by the container from container level keystore and wallet file. The end point can be alternatively set in the connections.xml file which goes as a part of the project.


Field Summary
protected static java.lang.String CLASS_NAME
           
protected static java.lang.String ERROR_RES_BUNDLE_NAME
           
protected  ADFLogger LOGGER
           
protected  oracle.webcenter.spaces.internal.ws.client.SpacesWebService proxyClient
           
protected  java.lang.String RESOURCE_BUNDLE_CLASS
           

 

Constructor Summary
GroupSpaceWSClient(GroupSpaceWSContext newContext)
          This is the constructor for the the client APIs.

 

Method Summary
 void addMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members)
          Using this API, bulk users can be added to the Group Space.
 GroupSpaceWSMetadata createGroupSpace(java.lang.String spaceName, java.lang.String displayName, java.lang.String description, java.lang.String keywords, java.lang.String baseTemplateName)
          Create API creates a new Space object from an existing Space template.
 GroupSpaceWSMetadata createGroupSpaceTemplate(java.lang.String templateName, java.lang.String templateDisplayName, java.lang.String templateDescription, java.lang.String baseSpaceName)
          Create a Group Space Template CreateGroupSpaceTemplate API creates a new SpaceTempalte object from an existing SpaceName.
 boolean deleteGroupSpace(java.lang.String spaceName)
          Deletes the given group space from WebCenter application
 GroupSpaceWSMetadata getGroupSpaceMetadata(java.lang.String groupSpaceName)
          Gets the spaces metadata for given group space name.
 GroupSpaceWSMetadata getGroupSpaceMetadataByGuid(java.lang.String groupSpaceGUID)
          Gets the spaces metadata for given group space name given the GUID of Group Space.The details about the GUID can be obtained by passing the spacename to the API getGroupSpaceMetadata() which returns the GroupSPaceMetadata which contains the GUID details about the template.
 java.util.List<java.lang.String> getGroupSpaces(java.lang.String queryString)
          Gets the list of spaces for a given query string.
 GroupSpaceWSMetadata getGroupSpaceTemplateMetadata(java.lang.String templateName)
          Gets the spaces metadata for given group space name.
 GroupSpaceWSMetadata getGroupSpaceTemplateMetadataByGuid(java.lang.String templateGUID)
          Using this API the template metadata can be obtained by passin the Guid of the template.
 java.util.List<java.lang.String> getGroupSpaceTemplates(java.lang.String queryString)
          Gets the list of space template for a given query string.
 java.lang.String getGroupSpaceURL(java.lang.String groupSpaceName)
          This API returns the access URL of Group Space name Gets the Group Spaces URL for the group space name passed to this API
 java.util.List<java.lang.String> getPublicGroupSpaces(java.lang.String queryPattern)
          Returns a list of public Group Spaces matching a specified query pattern.
 java.util.List<java.lang.String> getRoles(java.lang.String groupSpaceName)
          This API returns all the Roles for a given Group Space like moderator,viewer etc.
protected  java.lang.String getTranslatedMessage(java.lang.String key, java.lang.Object[] args)
          This API gets the translated message
 java.lang.String getWebCenterSpacesURL()
          This API returns the access URL of WebCenter Application deployment Gets the WebCenter pplication URL on which the current client is working upon
 void inviteMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members)
          Invites the List members to the Group Space Group Space
 void removeMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members)
          Using this API, bulk users can be removed from the Group Space.
 void setCustomAttribute(java.lang.String groupSpaceName, java.lang.String name, java.lang.String description, java.lang.String type, java.lang.Object value)
          This API creates custom metadata attributes for a current Group Space.
 void setGroupSpacesWebServiceEndPoint(java.lang.String endPoint)
          This API sets the end point of the Group Spaces WebService for current client.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

proxyClient

protected oracle.webcenter.spaces.internal.ws.client.SpacesWebService proxyClient

RESOURCE_BUNDLE_CLASS

protected final java.lang.String RESOURCE_BUNDLE_CLASS
See Also:
Constant Field Values

ERROR_RES_BUNDLE_NAME

protected static final java.lang.String ERROR_RES_BUNDLE_NAME
See Also:
Constant Field Values

CLASS_NAME

protected static final java.lang.String CLASS_NAME

LOGGER

protected final ADFLogger LOGGER

Constructor Detail

GroupSpaceWSClient

public GroupSpaceWSClient(GroupSpaceWSContext newContext)
                   throws GroupSpaceWSException
This is the constructor for the the client APIs. It requires an instance of GroupSpaceWSContext to be passed by the clients after setting the required context properties.
Parameters:
newContext - The new configuration context which is required by the web service proxy client
Throws:
GroupSpaceWSException - if an error occurs during instantiation process

Method Detail

getTranslatedMessage

protected java.lang.String getTranslatedMessage(java.lang.String key,
                                                java.lang.Object[] args)
This API gets the translated message

setGroupSpacesWebServiceEndPoint

public void setGroupSpacesWebServiceEndPoint(java.lang.String endPoint)
                                      throws GroupSpaceWSException
This API sets the end point of the Group Spaces WebService for current client. This API is useful in the situations where the URL end point is not known or it needs to be set dynamically. It throws UnsupportedOperationException if the end point is already set through connections.xml. Following example shows how an add member operation can be performed: GroupSpaceWSClient client = new GroupSpaceWSClient(context); client.setGroupSpacesWebServicesEndPointURL("http://stacj02.abc.com:7878/webcenter");
Parameters:
endPoint - End point URL
Throws:
GroupSpaceWSException

setCustomAttribute

public void setCustomAttribute(java.lang.String groupSpaceName,
                               java.lang.String name,
                               java.lang.String description,
                               java.lang.String type,
                               java.lang.Object value)
                        throws GroupSpaceWSException
This API creates custom metadata attributes for a current Group Space.

Creates custom metadata for given Space name. The metadata created for one group space should not be used for other group space. Each custom a support following attributes: name, description, type, value. To instantiate CustomLetadata.Attribute class, a user would need to call:
GroupSpaceWSClient client = new GroupSpaceWSClient(context);
wsClient.createCustomAttribute("attribute_name", "description", "java.lang.String", "value");

This attribute object should be used only at the time of creating the a Group Space.

Parameters:
groupSpaceName - Name of the Group Space
name - Name of the custom attribute
description - Description of the custom attribute
type - The type of the attribute. Should be the Canonical name of the class
value - Object value, It will be stored in the form of String. This API class internally calls toString() method on this object while storing the value
Throws:
GroupSpaceWSException

getWebCenterSpacesURL

public java.lang.String getWebCenterSpacesURL()
                                       throws GroupSpaceWSException
This API returns the access URL of WebCenter Application deployment Gets the WebCenter pplication URL on which the current client is working upon
Returns:
URL in String format
Throws:
GroupSpaceWSException - Throws Exception if it can't resolve the URL

getGroupSpaceURL

public java.lang.String getGroupSpaceURL(java.lang.String groupSpaceName)
                                  throws GroupSpaceWSException
This API returns the access URL of Group Space name Gets the Group Spaces URL for the group space name passed to this API
Parameters:
groupSpaceName - Name of the GroupSpace
Returns:
URL in String format
Throws:
GroupSpaceWSException - Throws Exception if it can't resolve the URL

getGroupSpaceTemplates

public java.util.List<java.lang.String> getGroupSpaceTemplates(java.lang.String queryString)
                                                        throws GroupSpaceWSException
Gets the list of space template for a given query string. Gets the list of Group Space Template for a given query String. A search string can be a regular expression. This API would fail to return the more than 500 group spaces
Parameters:
queryString - Query string for which the spaces template needed to be searched
Returns:
Returns list of string. Every string is a group space template name
Throws:
GroupSpaceWSException - Throws Exception if getting list of group spaces fails

getGroupSpaces

public java.util.List<java.lang.String> getGroupSpaces(java.lang.String queryString)
                                                throws GroupSpaceWSException
Gets the list of spaces for a given query string. Gets the list of Group Spaces for a given query String. A search string can be a regular expression. This API would fail to return the more than 500 group spaces
Parameters:
queryString - Query string for which the group spaces needed to be searched
Returns:
Returns list of string. Every string is a group space name
Throws:
GroupSpaceWSException - Throws Exception if getting list of group spaces fails

getPublicGroupSpaces

public java.util.List<java.lang.String> getPublicGroupSpaces(java.lang.String queryPattern)
                                                      throws GroupSpaceWSException
Returns a list of public Group Spaces matching a specified query pattern.
Parameters:
queryPattern - string that matches whole or part of the names of the public group spaces to be returned
Returns:
list of names of public group spaces matching the specified query pattern.
Throws:
GroupSpaceWSException

getGroupSpaceTemplateMetadata

public GroupSpaceWSMetadata getGroupSpaceTemplateMetadata(java.lang.String templateName)
                                                   throws GroupSpaceWSException
Gets the spaces metadata for given group space name. This API returns the bean object which providers getters for Group Space metadata. This bean is immutable and provides no setters.
Parameters:
templateName - Name of the group Space
Returns:
Returns GroupSpaceWSMetadata
Throws:
GroupSpaceWSException - Throws Exception if getting metadata fails

getGroupSpaceMetadata

public GroupSpaceWSMetadata getGroupSpaceMetadata(java.lang.String groupSpaceName)
                                           throws GroupSpaceWSException
Gets the spaces metadata for given group space name. This API returns the bean object which providers getters for Group Space metadata. This bean is immutable and provides no setters.
Parameters:
groupSpaceName - Name of the group Space
Returns:
Returns GroupSpaceWSMetadata
Throws:
GroupSpaceWSException - Throws Exception if getting metadata fails

addMember

public void addMember(java.lang.String groupSpaceName,
                      java.util.List<GroupSpaceWSMembers> members)
               throws GroupSpaceWSException

Using this API, bulk users can be added to the Group Space. In order to user this API, you need to pass List of GroupSpaceWSMembers. For each member an object of type GroupSpaceWSMembers has to be created List<GroupSpaceWSMembers> addMem = new ArrayList();
GroupSpaceWSMembers mem1 = new GroupSpaceWSMembers("pat","viewer");
GroupSpaceWSMembers mem2 = new GroupSpaceWSMembers("vicki","viewer");
addMem.add(mem1);
addMem.add(mem2);
client.addMember("DeepthiGS2",addMem);

Parameters:
members - List<GroupSpaceWSMembers> -The list of members who have to be added to Group Space, the list should not be more than 50. If it more than 50 then it throws IllegalArgumentException
groupSpaceName - name of the space to which the user needs to be subscribed
Throws:
java.lang.Exception - if an exception occurs during adding a user as a member of a group space
GroupSpaceWSException

removeMember

public void removeMember(java.lang.String groupSpaceName,
                         java.util.List<GroupSpaceWSMembers> members)
                  throws GroupSpaceWSException

Using this API, bulk users can be removed from the Group Space. In order to user this API, you need to pass List of GroupSpaceWSMembers. For each member an object of type GroupSpaceWSMembers has to be created List<GroupSpaceWSMembers> remMem = new ArrayList();
GroupSpaceWSMembers mem1 = new GroupSpaceWSMembers("pat");
GroupSpaceWSMembers mem2 = new GroupSpaceWSMembers("vicki");
remMem.add(mem1);
remMem.add(mem2);
client.removeMember("DeepthiGS2",addMem);

Parameters:
members - List<GroupSpaceWSMembers> List of members who have to be removed- THe list should not be more than 50, if it is more than 50 then it throws IllegalArgumentException exception
groupSpaceName - name of the space from which the user needs to be deleted
Throws:
java.lang.Exception - if an exception occurs during deleting a user as a member of a group space
GroupSpaceWSException

createGroupSpace

public GroupSpaceWSMetadata createGroupSpace(java.lang.String spaceName,
                                             java.lang.String displayName,
                                             java.lang.String description,
                                             java.lang.String keywords,
                                             java.lang.String baseTemplateName)
                                      throws GroupSpaceWSException
Create API creates a new Space object from an existing Space template. It calls the template's clone method to get the clone of the template and then constructs the Space Object out of it. It automatcally creates the MDS location for given Space name.
Parameters:
spaceName - The name of the new Space. Throws IllegalArgumentException if its NULL
displayName - The displayName of the Group Space Throws IllegalArgumentException if its NULL
description - The description of the Group Space
keywords - Keyword list that best describes this Group Space
baseTemplateName - The template based on which the Group Space needs to be created.
Returns:
GroupSpaceWSMetadata Group Space Metadata
Throws:
GroupSpaceWSException - if the Group Space creation failed

createGroupSpaceTemplate

public GroupSpaceWSMetadata createGroupSpaceTemplate(java.lang.String templateName,
                                                     java.lang.String templateDisplayName,
                                                     java.lang.String templateDescription,
                                                     java.lang.String baseSpaceName)
                                              throws GroupSpaceWSException
Create a Group Space Template CreateGroupSpaceTemplate API creates a new SpaceTempalte object from an existing SpaceName.
Parameters:
templateName - The name of the new Tempalte. Throws IllegalArgumentException if its NULL
templateDisplayName - Template Display Name
templateDescription - Template Description
baseSpaceName - The space from which the template is based upon Throws IllegalArgumentException if its NULL
Returns:
GroupSpaceWSMetadata SpaceTemplateMetadata
Throws:
GroupSpaceWSException - if the Group Space creation failed

deleteGroupSpace

public boolean deleteGroupSpace(java.lang.String spaceName)
                         throws GroupSpaceWSException
Deletes the given group space from WebCenter application
Parameters:
spaceName - name of the group space to be deleted
Returns:
Returns true if operation executes successfully, false otherwise
Throws:
java.lang.Exception - if an exception occurs during space deletion
GroupSpaceWSException

inviteMember

public void inviteMember(java.lang.String groupSpaceName,
                         java.util.List<GroupSpaceWSMembers> members)
                  throws GroupSpaceWSException
Invites the List members to the Group Space Group Space

Using this API, bulk users can be invited to the Group Space. In order to user this API, you need to pass List of GroupSpaceWSMembers. For each member an object of type GroupSpaceWSMembers has to be created List<GroupSpaceWSMembers> inviteMem = new ArrayList();
GroupSpaceWSMembers mem1 = new GroupSpaceWSMembers("pat","viewer");
GroupSpaceWSMembers mem2 = new GroupSpaceWSMembers("vicki","participant");
inviteMem.add(mem1);
inviteMem.add(mem2);
client.inviteMember("DeepthiGS2",inviteMem);
An invite will be sent to the users and the users can accept the invite for being part of the Group Space or reject the invite if they do not intend to join the Group Space.

Parameters:
members - List<GroupSpaceWSMembers> List of members, the number of members should not exceed 50
groupSpaceName - name of the space to which the user needs to be subscribed
Throws:
java.lang.Exception - if an exception occurs during adding a user as a member of a group space
GroupSpaceWSException

getGroupSpaceTemplateMetadataByGuid

public GroupSpaceWSMetadata getGroupSpaceTemplateMetadataByGuid(java.lang.String templateGUID)
                                                         throws GroupSpaceWSException
Using this API the template metadata can be obtained by passin the Guid of the template. The details about the GUID can be obtained by passing the template name to the API getGroupSpaceTemplateMetadata() which returns the GroupSPaceMetadata which contains the GUID details about the template. This API returns the bean object which providers getters for Template metadata. This bean is immutable and provides no setters.
Parameters:
templateGUID - GUID of the template
Returns:
Returns GroupSpaceWSMetadata
Throws:
GroupSpaceWSException - Throws Exception if getting metadata fails

getGroupSpaceMetadataByGuid

public GroupSpaceWSMetadata getGroupSpaceMetadataByGuid(java.lang.String groupSpaceGUID)
                                                 throws GroupSpaceWSException
Gets the spaces metadata for given group space name given the GUID of Group Space.The details about the GUID can be obtained by passing the spacename to the API getGroupSpaceMetadata() which returns the GroupSPaceMetadata which contains the GUID details about the template. This API returns the bean object which providers getters for Group Space metadata. This bean is immutable and provides no setters.
Parameters:
groupSpaceGUID - The Guid of the Grou Space.
Returns:
Returns GroupSpaceWSMetadata
Throws:
GroupSpaceWSException - Throws Exception if getting metadata fails

getRoles

public java.util.List<java.lang.String> getRoles(java.lang.String groupSpaceName)
                                          throws GroupSpaceWSException
This API returns all the Roles for a given Group Space like moderator,viewer etc. Given a group space name, this API gets all the available roles in the group space. It returns the user friendly role names [i.e. moderator, viewer] , these roles can be used with APIs like grant/revoke etc.
Parameters:
groupSpaceName - The Name of the Group Space whose roles are to be listed
Returns:
List of Roles
Throws:
GroupSpaceWSException

Skip navigation links

Oracle Fusion Middleware Group Spaces Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1)
E14810-01


Copyright © 2009, Oracle. All rights reserved.