Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Yidnekachew Worku
RE: Problem to cosume Liferay 7 service in JSF portlet
October 7, 2017 8:53 AM
Answer

Yidnekachew Worku

Rank: New Member

Posts: 8

Join Date: March 25, 2015

Recent Posts

Hello guys,
Im writing this here, just because it is somehow related to this thread: https://web.liferay.com/community/forums/-/message_boards/message/91034389
It seems silly, but I couldn't include a JSF portlet inside a liferay workspace
Im using Liferay 7 CE, My goal is to create a primefaces portlet which uses the service builder to interact to database,
I try to read some of the documents, and I think Im a little confused.
So here are my questions
1) Can I create a Primefaces JSF Portlet which uses Service Builder in liferay 7 like I do in 6.2?
* I had difficulty in using service builder with java 8, and I read some forums which states Service Builder should be used with java 7, and I have some other libraries which uses java 8 and I decided to shift to liferay 7 hopping that the service builder will be upgraded to use java 8. But I get the same exception when I try to create/build a plugin project with JSF portlet and Service Builder in it. So is there a fix to this issue. (the ClassNotFoundException)
2) Is it possible to add JSF portlet to liferay Workspace Project?
* I created a Liferay Workspace and able to add Service Builder Module and compiled successfully (which gave me the hope that service builder is fixed in Liferay 7, my first question), However I cannot add JSF Project or Portlet module, I downloaded Neil's portlet which is what I needed, but I cannot get it done in the IDE, Besides I cannot find any tutorial or document which fully explain this, I read the liferay documentation on OSGI service but I cannot even create the Service Tracker class (there is an exception NoSuchMethod)
3) What is the right way to create JSF Portlet which uses Service Builder in liferay 7 (actually I better say java 8)?
As you can see Im lost, please help
Thank you
Yidnekachew Worku
RE: RE: Problem to cosume Liferay 7 service in JSF portlet
October 7, 2017 6:24 AM
Answer

Yidnekachew Worku

Rank: New Member

Posts: 8

Join Date: March 25, 2015

Recent Posts

Hello Guys,
Im waiting, is there anybody online?
Or may I create a new thread?
Neil Griffin
RE: Problem to cosume Liferay 7 service in JSF portlet
October 9, 2017 2:34 PM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Hi Yidnekachew,

1) Can I create a Primefaces JSF Portlet which uses Service Builder in liferay 7 like I do in 6.2?


Yes, I just tried this and it works. You should always use JDK 8 since that is the only JDK that is supported with Liferay Portal 7.0 CE.

2) Is it possible to add JSF portlet to liferay Workspace Project?


Yes, I just tried this and it works -- however I just created an issue in JIRA since the UI could be more intuitive. Follow IDE-3514 in JIRA for more information.

After you create your Liferay Workspace, click File->New->Liferay JSF Project (Project, not Portlet). When the "New Liferay JSF Project" window appears, uncheck the "Use Default Location" checkbox. In the "Location" field, enter in the full path to the Liferay Workspace "wars/" sub-directory.
(see attached screenshot)

3) What is the right way to create JSF Portlet which uses Service Builder in liferay 7 (actually I better say java 8)?


Attached you will find a file named test1.zip which contains simple PrimeFaces based set of Maven projects that show how to use ServiceBuilder with Liferay 7. The projects were created with Liferay IDE. Note that if you want to see a more sophisticated PrimeFaces CRUD UI with lazy-loading, filtering, sorting, etc. then please take a look at our primefaces-users-portlet demo. In particular, see UserLazyDataModel.java

Kind Regards,

Neil
Attachment

Attachments: jsf-project-window.png (146.9k), test1.zip (90.2k)
Neil Griffin
RE: Problem to cosume Liferay 7 service in JSF portlet
October 10, 2017 8:23 AM
Answer

Neil Griffin

LIFERAY STAFF

Rank: Liferay Legend

Posts: 2511

Join Date: July 26, 2005

Recent Posts

Also wanted to mention that test1.zip uses older versions of Liferay Faces jar modules in pom.xml -- please visit http://www.liferayfaces.org to see the latest version numbers.

Participate in the State of Liferay Community 2017. Help the community and even win some prizes!