Liferay DXP JSF-Portlet as OSGI Component (Portlet)?

Oleksandr Meshcheryakov, modified 7 Years ago. New Member Posts: 2 Join Date: 3/26/18 Recent Posts

Hi All,

 

I have made JSF-Portlet with command shell:

mvn archetype:generate \
  -DarchetypeGroupId=com.liferay.faces.archetype \
  -DarchetypeArtifactId=com.liferay.faces.archetype.primefaces.portlet \
  -DarchetypeVersion=5.0.5 \
  -DgroupId=com.mycompany \
  -DartifactId=com.mycompany.my.primefaces.portlet

Result from mvn install was one war file - as is usual for non OSGI portlet.

 

Is there any possibility make  JSF-Portlet as OSGI Component same as MVC-Portlet?

 

Thank you

thumbnail
Kyle Joseph Stiemann, modified 7 Years ago. Liferay Master Posts: 760 Join Date: 1/14/13 Recent Posts

Hi Oleksandr,
Although it is possible to create an OSGi WAB that contains a JSF Portlet, we strongly recommend that you continue to use JavaEE WARs for your portlets. There are several pitfalls and issues that come with using OSGi to manage JSF portlets. If you are looking to obtain OSGi services in a JSF portlet, you can instead use Liferay’s static utilities or a ServiceTracker. In the future, you’ll also be able to use CDI to @Inject services.* If you are trying to use another OSGi feature in your portlet, please let us know what it is and we can look to see if it’s possible without using a Declarative Services portlet.

*For more info, check out Ray Auge’s OSGi CDI Integration Specification talk at Devcon 2018 (or wait for the recorded video).

Oleksandr Meshcheryakov, modified 7 Years ago. New Member Posts: 2 Join Date: 3/26/18 Recent Posts

Hi Kyle,

thanks for yours quick response!

 

thumbnail
Kyle Joseph Stiemann, modified 7 Years ago. Liferay Master Posts: 760 Join Date: 1/14/13 Recent Posts

Glad I could help! Let us know if you have any more questions. Thanks for using Liferay Faces!

- Kyle