|
Oracle Fusion Middleware Java API Reference for Oracle WebCenter 11g Release 1 (11.1.1.4.0) E15995-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.webcenter.spaces.ws.client.GroupSpaceWSClient
public class GroupSpaceWSClient
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:
//Call this once in the init() method of your class i.e. once in a lifecycle FactoryFinder.init(); GroupSpaceWSContext context = new GroupSpaceWSContext(); context.setEndPoint("http://host:port/webcenter/SpacesWebService"); context.setSamlIssuerName(<issuer-name>); GroupSpaceWSClient.setContext(context);
Now the actual code //call APIs
SpacesManagerFactory mgrFact = (SpacesManagerFactory) FactoryFinder.getFactory( SpacesManagerFactory.class.getName()); SpacesManager mgr = mgrFact.getSpacesManager(); Space mySpace = mgr.getSpace("FinanceProject"); GSMetadata gsm = mySpace.getGSMetadata(); ...
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 | |
---|---|
static java.lang.String |
ANNOUNCEMENT_SERVICE_ID A String to represent the Announcement Service ID |
protected static java.lang.String |
CLASS_NAME |
static java.lang.String |
DISCUSSION_FORUM_SERVICE_ID A String to represent Discussion Forum Service ID |
protected static java.lang.String |
ERROR_RES_BUNDLE_NAME |
static java.lang.String |
LIST_SERVICE_ID A String to represent List Service ID |
protected oracle.adf.share.logging.ADFLogger |
LOGGER |
protected oracle.webcenter.spaces.internal.ws.client.SpacesWebService |
proxyClient |
static java.lang.String |
RECENT_ACTIVITY_SERVICE_ID A String to represent the Recent Activity Service ID |
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 SpaceTemplate object from an existing SpaceName. |
boolean |
deleteGroupSpace(java.lang.String spaceName) Deletes the given group space from WebCenter application |
java.util.List<java.lang.String> |
getDiscoverableGroupSpaces(java.lang.String queryPattern) Returns a list of discoverable Group Spaces matching a specified query pattern. |
java.util.List<GroupSpaceWSMembers> |
getGroupSpaceMembersInfo(java.lang.String groupSpaceName) Gets the information about the members in a group space. |
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> |
getGroupSpaceRoles(java.lang.String groupSpaceName) This API returns all the Roles for a given Group Space like moderator,viewer etc. |
java.util.List<java.lang.String> |
getGroupSpaces(java.lang.String queryString) Gets the list of spaces for a given query string. |
java.util.List<GroupSpaceWSMetadata> |
getGroupSpacesWithMetadata(java.util.List<java.lang.String> groupSpaceNames) Gets all the spaces metadata for a list of space name. |
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> |
getGroupSpaceTemplateRoles(java.lang.String groupSpaceTemplateName) This API returns all the Roles for a given Group Space template like Group Project, Comuninity of Interest. |
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 for a group space Gets the group Spaces URL, given an internal group space name. |
java.util.List<java.lang.String> |
getPublicGroupSpaces(java.lang.String queryPattern) Returns a list of public Group Spaces matching a specified query pattern. |
java.lang.String |
getServiceRSSFeedURL(java.lang.String groupSpaceName, java.lang.String serviceID) This API returns the RSS Feed URL for a given Group Space and a Service ID. |
java.lang.String |
getServiceRSSFeedURLByGuid(java.lang.String groupSpaceGUID, java.lang.String serviceID) This API returns the RSS Feed URL for a given Group Space GUID and a Service ID. |
static oracle.webcenter.spaces.internal.ws.client.SpacesWebService |
getSpacesWebService() This API returns SpacesWebService |
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 |
init(GroupSpaceWSContext context) |
void |
inviteMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members) Invites the List members to the Group Space Group Space |
boolean |
isGroupSpaceMember(java.lang.String groupSpaceName) This method returns true or false if the current login user is a member of a given group space Sample usage: GroupSpaceWSClient client = new GroupSpaceWSClient(groupSpaceWSContext); boolean isGroupSpaceMember = client.isGroupSpaceMember("Finance Project"); |
void |
removeMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members) Using this API, bulk users can be removed from the Group Space. |
static void |
setContext(GroupSpaceWSContext ctx) Set the context for the Group Space instance for the current run |
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 |
---|
protected oracle.webcenter.spaces.internal.ws.client.SpacesWebService proxyClient
protected static final java.lang.String ERROR_RES_BUNDLE_NAME
protected static final java.lang.String CLASS_NAME
protected final oracle.adf.share.logging.ADFLogger LOGGER
public static final java.lang.String ANNOUNCEMENT_SERVICE_ID
public static final java.lang.String RECENT_ACTIVITY_SERVICE_ID
public static final java.lang.String DISCUSSION_FORUM_SERVICE_ID
public static final java.lang.String LIST_SERVICE_ID
Constructor Detail |
---|
public GroupSpaceWSClient(GroupSpaceWSContext newContext) throws GroupSpaceWSException
newContext
- The new configuration context which is required by the web service proxy clientGroupSpaceWSException
- if an error occurs during instantiation processMethod Detail |
---|
protected java.lang.String getTranslatedMessage(java.lang.String key, java.lang.Object[] args)
public static void setContext(GroupSpaceWSContext ctx) throws GroupSpaceWSException
ctx
- The context of the Group SpaceGroupSpaceWSException
- Throwx exception if it failspublic void setGroupSpacesWebServiceEndPoint(java.lang.String endPoint) throws GroupSpaceWSException
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");
endPoint
- End point URLGroupSpaceWSException
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
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.
groupSpaceName
- Name of the Group Spacename
- Name of the custom attributedescription
- Description of the custom attributetype
- The type of the attribute. Should be the Canonical name of the classvalue
- Object value, It will be stored in the form of String. This API class internally calls toString() method on this object while storing the valueGroupSpaceWSException
public java.lang.String getWebCenterSpacesURL() throws GroupSpaceWSException
GroupSpaceWSException
- Throws Exception if it can't resolve the URLpublic java.lang.String getGroupSpaceURL(java.lang.String groupSpaceName) throws GroupSpaceWSException
groupSpaceName
- Internal name for a group space. Do not specify a group space display name that includes spaces. WebCenter Spaces converts spaces to underscores in the internal name. For example, a group space named My Group, has the internal name My_Group.GroupSpaceWSException
- Throws Exception if unable to resolve the URLpublic java.util.List<java.lang.String> getGroupSpaceTemplates(java.lang.String queryString) throws GroupSpaceWSException
queryString
- Query string for which the spaces template needed to be searchedGroupSpaceWSException
- Throws Exception if getting list of group spaces failspublic java.util.List<java.lang.String> getGroupSpaces(java.lang.String queryString) throws GroupSpaceWSException
queryString
- Query string for which the group spaces needed to be searchedGroupSpaceWSException
- Throws Exception if getting list of group spaces failspublic java.util.List<java.lang.String> getPublicGroupSpaces(java.lang.String queryPattern) throws GroupSpaceWSException
queryPattern
- string that matches whole or part of the names of the public group spaces to be returnedGroupSpaceWSException
public java.util.List<java.lang.String> getDiscoverableGroupSpaces(java.lang.String queryPattern) throws GroupSpaceWSException
queryPattern
- string that matches whole or part of the names of the discoverable group spaces to be returnedGroupSpaceWSException
public GroupSpaceWSMetadata getGroupSpaceTemplateMetadata(java.lang.String templateName) throws GroupSpaceWSException
templateName
- Name of the group SpaceGroupSpaceWSMetadata
GroupSpaceWSException
- Throws Exception if getting metadata failspublic GroupSpaceWSMetadata getGroupSpaceMetadata(java.lang.String groupSpaceName) throws GroupSpaceWSException
groupSpaceName
- Name of the group SpaceGroupSpaceWSMetadata
GroupSpaceWSException
- Throws Exception if getting metadata failspublic java.util.List<GroupSpaceWSMembers> getGroupSpaceMembersInfo(java.lang.String groupSpaceName) throws GroupSpaceWSException
groupSpaceName
- Name of the group SpaceGroupSpaceWSMembers
GroupSpaceWSException
- Throws Exception if getting metadata failspublic 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);
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 IllegalArgumentExceptiongroupSpaceName
- name of the space to which the user needs to be subscribedjava.lang.Exception
- if an exception occurs during adding a user as a member of a group spaceGroupSpaceWSException
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);
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 exceptiongroupSpaceName
- name of the space from which the user needs to be deletedjava.lang.Exception
- if an exception occurs during deleting a user as a member of a group spaceGroupSpaceWSException
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
spaceName
- The name of the new Space. Throws IllegalArgumentException
if its NULLdisplayName
- The displayName of the Group Space Throws IllegalArgumentException
if its NULLdescription
- The description of the Group Spacekeywords
- Keyword list that best describes this Group SpacebaseTemplateName
- The template based on which the Group Space needs to be created.GroupSpaceWSException
- if the Group Space creation failedpublic GroupSpaceWSMetadata createGroupSpaceTemplate(java.lang.String templateName, java.lang.String templateDisplayName, java.lang.String templateDescription, java.lang.String baseSpaceName) throws GroupSpaceWSException
templateName
- The name of the new Tempalte. Throws IllegalArgumentException
if its NULLtemplateDisplayName
- Template Display NametemplateDescription
- Template DescriptionbaseSpaceName
- The space from which the template is based upon Throws IllegalArgumentException
if its NULLGroupSpaceWSException
- if the Group Space creation failedpublic boolean deleteGroupSpace(java.lang.String spaceName) throws GroupSpaceWSException
spaceName
- name of the group space to be deletedjava.lang.Exception
- if an exception occurs during space deletionGroupSpaceWSException
public void inviteMember(java.lang.String groupSpaceName, java.util.List<GroupSpaceWSMembers> members) throws GroupSpaceWSException
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();
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.
GroupSpaceWSMembers mem1 = new GroupSpaceWSMembers("pat","viewer");
GroupSpaceWSMembers mem2 = new GroupSpaceWSMembers("vicki","participant");
inviteMem.add(mem1);
inviteMem.add(mem2);
client.inviteMember("DeepthiGS2",inviteMem);
members
- List<GroupSpaceWSMembers> List of members, the number of members should not exceed 50groupSpaceName
- name of the space to which the user needs to be subscribedjava.lang.Exception
- if an exception occurs during adding a user as a member of a group spaceGroupSpaceWSException
public GroupSpaceWSMetadata getGroupSpaceTemplateMetadataByGuid(java.lang.String templateGUID) throws GroupSpaceWSException
templateGUID
- GUID of the templateGroupSpaceWSMetadata
GroupSpaceWSException
- Throws Exception if getting metadata failspublic GroupSpaceWSMetadata getGroupSpaceMetadataByGuid(java.lang.String groupSpaceGUID) throws GroupSpaceWSException
groupSpaceGUID
- The Guid of the Grou Space.GroupSpaceWSMetadata
GroupSpaceWSException
- Throws Exception if getting metadata failspublic java.util.List<java.lang.String> getGroupSpaceRoles(java.lang.String groupSpaceName) throws GroupSpaceWSException
groupSpaceName
- The Name of the Group Space whose roles are to be listedGroupSpaceWSException
public java.util.List<java.lang.String> getGroupSpaceTemplateRoles(java.lang.String groupSpaceTemplateName) throws GroupSpaceWSException
groupSpaceTemplateName
- The Name of the Group Space Template whose roles are to be listedGroupSpaceWSException
public java.util.List<GroupSpaceWSMetadata> getGroupSpacesWithMetadata(java.util.List<java.lang.String> groupSpaceNames) throws GroupSpaceWSException
GroupSpaceWSClient client = new GroupSpaceWSClient(groupSpaceWSContext); List<String> groupSpaceNames = new ArrayList(); groupSpaceNames.add("Finance Project"); groupSpaceNames.add("HR Project"); List<GroupSpaceWSMetadata> metadataList = client.getGroupSpacesWithMetadata(groupSpaceNames);
groupSpaceNames
- List of the space name that used to retrieve the the list of space metadataGroupSpaceWSException
- Throws Exception if getting metadata failspublic boolean isGroupSpaceMember(java.lang.String groupSpaceName) throws GroupSpaceWSException
GroupSpaceWSClient client = new GroupSpaceWSClient(groupSpaceWSContext); boolean isGroupSpaceMember = client.isGroupSpaceMember("Finance Project");
groupSpaceName
- - The exact name of the Group Space as a StringgroupSpaceName
- of the group spaceGroupSpaceWSException
public java.lang.String getServiceRSSFeedURL(java.lang.String groupSpaceName, java.lang.String serviceID) throws GroupSpaceWSException
GroupSpaceWSClient client = new GroupSpaceWSClient(groupSpaceWSContext); String recentActivityURL = client.getServiceRSSFeedURL("Finance Project", GroupSpaceWSClient.RECENT_ACTIVITY_SERVICE_ID);
groupSpaceName
- - The exact name of the Group Space as a StringserviceID
- - the exact serviceID as retrieved fromGroupSpaceWSException
public java.lang.String getServiceRSSFeedURLByGuid(java.lang.String groupSpaceGUID, java.lang.String serviceID) throws GroupSpaceWSException
GroupSpaceWSClient client = new GroupSpaceWSClient(groupSpaceWSContext); String recentActivityURL = client.getServiceRSSFeedURLByGuid("s88b17951_8784_4555_8b7b_b2c2e4c2ef95", GroupSpaceWSClient.RECENT_ACTIVITY_SERVICE_ID);
groupSpaceGUID
-serviceID
-GroupSpaceWSException
public static oracle.webcenter.spaces.internal.ws.client.SpacesWebService getSpacesWebService()
public void init(GroupSpaceWSContext context)
|
Oracle Fusion Middleware Java API Reference for Oracle WebCenter 11g Release 1 (11.1.1.4.0) E15995-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |