WebLab user interfaces/Service Access From WebLab Portlets

From WebLab Wiki
Jump to navigationJump to search

Warning this is an on going specification

Working with portlet is hard especially when it comes to the connection to the actual back-end services. Many portlets have specific interaction with some services especially the ResourceContainer, ContentContainer or the Knowledge base.

Thus the code to create service client and request as well as handling possible errors is duplicated with multiple level of maturity depending on time spend. Moreover each portlet needs to be configured so it knows the URLs of the endpoint to contact for each specific service. Finally some of them embed service WSDL in resources and thus have a dependency to WSDLs version which is not handled correctly with the model dependency (ie one can change model dependency without noticing the internal WSDLs).

The solution to these problems could be to design and implement a specific library that handle services calls. This library will offer:

  • Abstract classes which provide an API to services ;
  • Handle service "real" location by common configuration possibly making reference to service interface and service names as defined in the ESB directory;
  • Replacement for portlet specific code with generic use of the library API such as:
    • for resource container: getResourceContainer([portalUserId], [usageContext], [serviceURI]);
    • for searcher: getSearcher([portalUserId], [usageContext], [serviceURI]);

Then the porlet could exploit an instance of the service client and query the remote service easily. This library will be provided on the portal level thus each portlet relies on the exact same version and configuration is handled in a unique location (ie serviceInterface + serviceURI => service/endpoint URL). The service URI will then be used to uniquely identify a service, not only by its implemented generic interface, but more by its actual function in the service taxonomy. [portalUserId] and [usageContext] may be used by the library to apply security rules and ensure rights to access function and/or data.

The best of the best would be to have a dedicated configuration portlet, displayed on portal administration side, to display and modify the configuration of the library or a connexion to the service directory in the ESB.