Wednesday 25 July 2012

Sharing service layer between Liferay's portlets

Hello,
    Sometimes you may require that portlets share their service layer among each other. This post I'll describe how it can be achived.

    There are two ways how you can share service layer beatween portlets.
    1) Simple way. Portlets should be developed in the same plugin, in this case they will be located in same project and will be builded in one war file, so service layer will be shared among them.
   
    2) In case if you can't or don't want, to put portlets in one plugin/project, you can share service layer by using liferay-plugin-package.properties.
        Simply put:
           
required-deployment-contexts=depends-portlet

        where depends-portlet portlet which services you want to share.

        Or you can use visual editor:
       
        As result you will have depend-portlet-service.jar included to your project.


BR,
Paul

No comments:

Post a Comment