Start of Content Area

Background documentation Tutorial: Creating a Collaboration Service  Locate the document in its SAP Library structure

A collaboration service enables a specific way of collaborating online with other portal users. Examples:

      Send e-mail

      Share application

      Dial phone

Collaboration services can be made available in the following applications:

      Collaboration Launch Pad

      Room member lists

      User details dialog

      Context menu for a user or user group (using the PeopleRenderer control)

If you need an additional collaboration service, you can write it as described below and make it available using the configuration.

Technical View

The collaboration service uses the ContextContainer to store the users involved in the collaborative activity that the service enables. When an application launches a collaboration service, it creates a container and places the respective users or groups in the container. When a user launches the collaboration service, it retrieves the users or groups from the container and uses them in its application logic.

Example

This section gives you source code examples and explains the configuration for making a new collaboration service available to users.

Source Code

The portal component implementing the collaboration service is a HTMLB DynPage application. Therefore, the following two classes are to be implemented:

      PageProcessorComponent

Example: PageProcessorComponent of sample.collaborationservice (the PageProcessorComponent implementation returns the DynPage):

package sample.collaborationservice;

 

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.portal.htmlb.page.PageProcessorComponent;

 

public class SampleCollaborationService extends PageProcessorComponent {

    public DynPage getPage() {

        return new SampleCollaborationServicePage();

    }

}

      DynPage

Example: DynPage of sample.collaborationservice

package sample.collaborationservice;

 

import java.util.ArrayList;

 

import com.sap.netweaver.kmc.people.shared.ctx.ContextContainer;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.htmlb.rendering.IPageContext;

import com.sapportals.portal.prt.component.IPortalComponentRequest;

 

public class SampleCollaborationServicePage extends DynPage {

 

public void doProcessBeforeOutput() throws PageException {

         IPageContext pc = getPageContext();

         IPortalComponentRequest request = (IPortalComponentRequest)pc.getRequest();

 

         // Use the PortalComponentRequest to create the ContextContainer.

         ContextContainer container = new ContextContainer(request);

         try {

                 // Retrieve flat list of UniqueIds of Principals

                 ArrayList peopleIdList = container.getResolvedPeopleList();

 

                 // @TODO put your application logic here

 

         } catch (Exception e) {

                 throw new PageException(e);

         }

}

 

public void doInitialization()    throws PageException {}

public void doProcessAfterInput() throws PageException {}

}

To work with the principals (users, groups, roles) provided by either the Collaboration launch pad or the PeopleRenderer, you need to instantiate a ContextContainer. You can then call the methods on the ContextContainer to get an ArrayList that contains all principals. For more information, see Javadoc.

Configuration of the Collaboration Service

This section describes the steps necessary to create the configurable items for your collaboration service. See also the Making Services Available section of the Collaboration Administration Guide.

      Configuration Path

The configurable items must be deployed to the configuration path Collaboration ® Properties ® LinkCommand.

      LinkCommands

For each collaboration service, you need to create two configurable items of type LinkCommand. The configurable items differ only in the Java implementation used:

Usage

JavaImplementationClass

PeopleRenderer control
(user context menu),

user details dialog

com.sap.netweaver.coll.coreui.api.uicommands.UILaunchCommand

Collaboration Launch Pad,

Team Member List

com.sap.ip.collaboration.coreui.api.people.flexibleui.CLPUICommand

Note

Even if your collaboration service can only deal with a single user, you should create two Configurables because otherwise the collaboration service cannot be launched for individual users that are selected on the Collaboration Launch Pad.

      LinkCommand Details

In the table below, you can see all attributes of a LinkCommand configurable:

Attribute

Value description (sample values in bold type)

javaClass

Use one of the following Java classes:

      com.sap.netweaver.coll.coreui.api.uicommands. UILaunchCommand

      com.sap.ip.collaboration.coreui.api.people. flexibleui.CLPUICommand

reference

Reference to the fully-qualified name of the portal application as specified in the portalapp.xml file prefixed with 'portal:', for example: portal:sample.portal.app.CollaborationService

resourceBundle

Name of the resource bundle file as registered with the CRT, for example: sample.collaborationservice.MyBundle

labelKey

Key of label in resource bundle file

tooltipKey

Key of label in resource bundle file

positionType

center or custom

height, width

Integer value specifying the window dimension

top, left

Integer value specifying the window position, only relevant if positionType equals custom

valueFactoryKey

LinkCommandValueFactory (fixed)

launchType

modalPopup (fixed)

ridPathName

Uri (fixed)

windowName

Not used, empty value (fixed)

applicationParameters

Not used, empty value (fixed)

urlParameters

Not used, empty value (fixed)

portalRoles

See documentation of collaboration services

Note

Fixed means that you cannot change the attributes.

      Example of a LinkCommand Configurable

Find below a complete example of a LinkCommand configurable:

<?xml version="1.0"  encoding="UTF-8" ?>

<Configurable configclass="LinkCommand">

   <property name="name" value="MyCollaborationService"/>

   <property name="javaClass"

              value="com.sap.netweaver.coll.coreui.api.uicommands.UILaunchCommand"/>

   <property name="reference"

              value="portal:sample.portal.app.CollaborationService"/>

   <property name="resourceBundle"  value="sample.collaborationservice.MyBundle"/>

   <property name="labelKey"        value="XLAB_COLL_SERVICE"/>

   <property name="tooltipKey"      value="XTOL_COLL_SERVICE"/>

   <property name="positionType"    value="custom"/>

   <property name="height"          value="340"/>

   <property name="width"           value="200"/>

   <property name="top"             value="20"/>

   <property name="left"            value="20"/>

   <property name="valueFactoryKey" value="LinkCommandValueFactory"/>

   <property name="launchType"      value="modalPopup"/>

   <property name="ridPathName"     value="Uri"/>

   <property name="windowName" />

   <property name="applicationParameters" />

   <property name="urlParameters" />

   <property name="portalRoles" />

</Configurable>

Attribute values in bold type will differ in your configurable.

Note

You must adhere to the naming conventions for configurable file names.

Internationalization

The context menu entry of your collaboration service can be internationalised using standard Java technology. You need to add two properties for the label and the tooltip of the collaboration service to a resource bundle. These properties are referenced in the configurable as described in the previous section.

Note

The resource bundle files must be registered with the CRT.

See also:

Making Services Available (Collaboration Administration)

End of Content Area