Question

I am developing Liferay portal and I have one portlet which handles the administrator side of the portal and one the client side. The thing is that the clients cannot see the administrator page (including the portlet). Also I have created custom DataBase for the portal (I included my own tables in the Liferay database using Service Builder). Now I want to use the same database so I can take info from it using the client portlet.

Any ideas?

I am using Liferay 6.1 with Tomcat and Liferay SDK plugin for Eclipse.

Was it helpful?

Solution

You can copy the [portlet name]-service.jar from Web-Inf/lib, and paste it to any other portlet's lib folder. Even better if you can do this with maven and add this jar as a dependency. This way you can have access to the Util Classes that your service provides, to any other Portlet

OTHER TIPS

All portlets in a plugin project share the service builder service made by that plugin (because they end up in one war file and thus share runtime context). So you could just put both your portlets in the same plugin and they can both access that plugin's service builder services/tables. I think you will find this is a commonly used approach. The permission and visibility issues you mention are not impacted by this organization.

Doing it this way keeps the deployment simple -- just deploy the plugin's war, done.

If there are reasons beyond your control that require the portlets to be in separate plugins, then it becomes harder -- yannicuLar's approach is one way.

If you have two portlets sharing same tables/entities , you can copy the service.jar to tomcat-7.0.27\lib\ext a common location where these two portlets can access this .jar at runtime.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top