Foren

OSGi and Portlets (preferably JSF)

Patrick Warnecke, geändert vor 9 Jahren.

OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
Hello,
my company wants to make use of OSGi in out portlets and I'm doing the research for that, but I can hardly find any information on how to get started with it all.
I would appreciate it if someone could point me in the right direction.

Regards
thumbnail
Juan Gonzalez, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Patrick Warnecke, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
Maybe I'm just blind, but I can't find an example portlet using OSGi ... ?
Patrick Warnecke, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
So no one can help me out on this subject?

I tried to deploy the sample-metrics-portlet in tomcat (sample-metrics-core-shared was installed in the OSGi framework), but it didn't work (_metricsProdiver is always null). Couldn't find any other portlet that tries to work with OSGi.
Additionally there seems to be an error with the sample-metrics-portlet, as it floods my console again and again with stuff like "portlet ready to use" etc.
thumbnail
Ray Augé, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

Liferay Legend Beiträge: 1197 Beitrittsdatum: 08.02.05 Neueste Beiträge
Our portlet support is very experimental in 6.2, and as you've probably noticed, not documented.

I would try to figure out what is missing from your env to make it work. Gogo shell has good tools to help with that. You need to have all the right bits deployed, resolved and active in order for it to work.
Patrick Warnecke, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
Hey,
thanks for the reply. I understand that it is experimental, but as I understood it until now, it should be possible to have a service in the framework and access it from a portlet.

I don't think my problem is on the OSGi part, in the gogo shell I have several bundles up and running that are publishing services one way or the other. My main problem ist, how to access these services from the portlet.
Maybe you can find the time to answer some questions:
1) Is my approach correct that I'm still deploying a "normal" portlet, except it has more information in the META-INF/MANIFEST.MF or do I deploy the portlet in the framework?
I tried deploying a portlet directly in the framework, but then I couldn't find it in the "Add to page"-Dialog.
2) Is there a Utility class to get a service (com.liferay.portal.kernel.util.ServiceLoader ? => returns 0 services, com.liferay.portal.kernel.bean.PortalBeanLocatorUtil ? => returns null)
3) Do I need to use the "FreemarkerPortlet" or is it already possible to use normal JSF-Portlets?

Again, I understand that in the future there will be docs etc, but we want to start a new version of our product soon and want to use Liferay and hopefully OSGi for modularity.

Thanks in advance!
Patrick Warnecke, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
Well maybe someone can at least answer the following:
I have the sample-metrics-portlet deployed in my OSGi-framework, but it requires "com.liferay.httpservice.servlet". No problemo, i simply add the http-service-shared bundle. But this bundle needs the "com.liferay.portal.apache.bridges.struts" service. I could only find the implementation of this service in the portal-impl.jar residing in tomcats ROOT/WEB-INF/lib/. Tried to deploy this jar in the framework but I noticed two things. First the portal-impl.jar doesn't export the bridges.struts service, secondly it has quite a lot of it's own dependencies which seem hard to fullfill as I couldn't find any of them as OSGi-read jars (don't know if I can simply add the MANIFEST.MF entries to fullfill the requirements ...)

So my question is, how do I satisfy the "com.liferay.portal.apache.bridges.struts" dependency?
If it is through the portal-impl.jar, do I "simply" add all the required "Export-package" entries that are missing in the jars required by portal-impl?
Patrick Warnecke, geändert vor 9 Jahren.

RE: OSGi and Portlets (preferably JSF)

New Member Beiträge: 20 Beitrittsdatum: 30.11.12 Neueste Beiträge
Is really noone interested in using OSGi with portlets? Or is just noone sharing his/her knowledge?