Forums de discussion

RE: Problem to cosume Liferay 7 service in JSF portlet

Yidnekachew Worku, modifié il y a 6 années.

RE: Problem to cosume Liferay 7 service in JSF portlet

New Member Publications: 8 Date d'inscription: 25/03/15 Publications récentes
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, modifié il y a 6 années.

RE: RE: Problem to cosume Liferay 7 service in JSF portlet

New Member Publications: 8 Date d'inscription: 25/03/15 Publications récentes
Hello Guys,
Im waiting, is there anybody online?
Or may I create a new thread?
thumbnail
Neil Griffin, modifié il y a 6 années.

RE: Problem to cosume Liferay 7 service in JSF portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
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
thumbnail
Neil Griffin, modifié il y a 6 années.

RE: Problem to cosume Liferay 7 service in JSF portlet

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Also wanted to mention that test1.zip uses older versions of Liferay Faces jar modules in pom.xml -- please visit liferayfaces.org to see the latest version numbers.