Skip to Content

UWL Custom Connector Approach (Part 2)

This blog is a continuation of my previous blog [UWL Custom Connector Approach | ] (Part1) which gives the complete technical details regarding the development & integration steps involved in the UWL custom connectors.

*Procedure to Develop custom connector: </p><p align=”justify”>In NWDS, create a project of type UWL Custom Connector as shown in the following figure. </p><p align=”justify”>!|height=469|alt=Project Creation|width=472|src=|border=0!</p><p align=”justify”> </p><p align=”justify”>After creating the project Project is created and the default skeleton of the code along with UWL Configuration (xml) file will be created as shown in the following figure.</p><p align=”justify”>!|height=375|alt=Code Skeleton|width=603|src=|border=0!</p><p align=”justify”>Place the 3<sup>rd</sup> party provider files in the lib folder of the project shown below. </p><p align=”justify”>!|height=355|alt=Add Libraries|width=329|src=|border=0</p><p align=”justify”>Define the types, views and actions in the UWL Configuration file as below.</p><p align=”justify”> </p><p align=”justify”><View name=”ConnectorView” selectionMode=”MULTISELECT” width=”98%” supportedItemTypes=”uwl.task.mytask” columnOrder=”detailIcon, subject, creatorId, createdDate, status” sortby=”creatorId:ascend, createdDate:descend” tableDesign=”STANDARD” visibleRowCount=”10″ headerVisible=”yes” queryRange=”undefined” tableNavigationFooterVisible=”yes” tableNavigationType=”CUSTOMNAV” actionRef=”” refresh=”-1″ dueDateSevere=”0″ dueDateWarning=”0″ emphasizedItems=”new” displayOnlyDefinedAttributes=”yes” dynamicCreationAllowed=”yes” actionPosition=”bottom”></p><p align=”left”><Descriptions default=”Connector View”/></p><p align=”left”><DisplayAttributes/></p><p align=”left”></View></p><p align=”justify”> </p><p align=”justify”> </p><p align=”justify”>UWL Connector Implementation:</p><p align=”justify”> </p><p align=”justify”>public class UwlConnector implements IProviderConnector {</p><p align=”left”>private static final String CONNECTOR_ID = “ConnectorName”;</p><p align=”left”>public String getId() {</p><p align=”left”>return ConnectorName.CONNECTOR_ID;</p><p align=”left”>}</p><p align=”left”>}</p><p align=”justify”> </p><p align=”justify”>public ConnectorResult getItems(…) throws ConnectorException {</p><p align=”left”>ConnectorResult result = null;</p><p align=”left”>List items = null;</p><p align=”left”>if(ItemType.matchType(CONNECTOR_ITEM_TYPE,itemType)){</p><p align=”left”>Hashtable feeds = getTasks(context.getUserId()); // In this function definition implement the //logic to fetch the tasks from the provider </p><p align=”left”>// and map to UWL Item types</p><p align=”left”>items = …; // fetch items from backend and map them …</p><p align=”left”>} else if(ItemType.matchType(COMPLETED_ITEM_TYPE,itemType)){</p><p align=”left”>items = new ArrayList();</p><p align=”left”>}</p><p align=”left”>ProviderStatus status = new ProviderStatus(true, system,</p><p align=”left”>UwlConnector.CONNECTOR_ID);</p><p align=”justify”> </p><p align=”justify”>When the UWL tries to fetch the tasks from the connector above getItems() method will be called. So we have to implement our logic here to fetch the tasks from the provider application and map the provider tasks to the UWL Item type.</p><p align=”justify”> </p><p align=”justify”>Item uwlItem = new Item(</p><p align=”left”>UwlRssConnector.CONNECTOR_ID, //connectorId</p><p align=”left”>system, //systemId</p><p align=”left”>entry.getUri(), //externalId</p><p align=”left”>context.getUserId(), //userId</p><p align=”left”>-1, //attachment count</p><p align=”left”>entry.getPublishedDate(), //date created</p><p align=”left”>entry.getAuthor(), //creator id</p><p align=”left”>null, //due date</p><p align=”left”>null, //external object id</p><p align=”left”>ITEM_TYPE, //external type</p><p align=”left”>ITEM_TYPE, //item type</p><p align=”left”>PriorityEnum.LOW, //priority</p><p align=”left”>(itemStatus==null) ? StatusEnum.NEW : itemStatus, //status</p><p align=”left”>entry.getTitle() //subject</p><p align=”left”>);</p><p align=”justify”> </p><p align=”justify”>Build and Deployment:</p><p align=”justify”>After implementing the logic, build the project and export the project as a PAR. Deploy the exported PAR file into the portal. </p><p align=”justify”>! Deploy.JPG|height=229|alt=Deploy PAR|width=690|src= Deploy.JPG|border=0!</body>

You must be Logged on to comment or reply to a post.
  • I have also a similar requirement of implementing the UWL for non SAP items.Your blog is very helpful but i am stuck after creation of the UWL connector project since the details for library files and logic to fetch the work items is not clear.Kindly throw some light on those areas.It would be great if you could share the source code of custom connector built by you.Many Thanks in advance.

    amit bagati

  • Hi,Shyam,

    Thanks for blog,it is very helpful.
    We are now developing a connector,but after successfully deploying par file into portal,there are no items exist.We have regeisted the connector,and the connector status in uwl is successful.Below is the code of getItems(..).We didn't connect the provider but use the hard code.
              List items =  new ArrayList();     
              Item item = new Item(
              getId(), //connectorId
              system, //systemId
              "dfdfdf", //externalId
              "context.getUserId()", //userId
              -1, //attachment count
              null, //date created
              null, //creator id
              null, //due date
              null, //external object id
              "uwl.task.pms", //external type
              "uwl.task.pms", //item type
              PriorityEnum.HIGH, //priority
              StatusEnum.NEW, //status
              "my subject" //subject
              item.setDescription("to do item");


    Very appreciate your help.THanks in advance.

      • Hi,Shyam,
        Thanks for your reply.
        I found the reason through adding log to defaulttrace file.The reason is I wrongly added quote in this parameter:

        But now there is another question:
        I create a web service system in portal->system administration->system configuration,and relate this system to my custom connector in UWL administration.Then how can I get the WSDL of web service system in getItems(..) function? The parameter "system" is only the alias of the system.
        Thanks in advance.

  • Hi,shyam,

    You mentioned about "Place the 3rd party provider files in the lib folder of the project".
    Except that,which configuration file we should modify to let the portal runtime know the location of jar files?

    Thanks in advance.