Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
How to create back-end for JS portlet
Hi, what is the "correct" approach, for devoloping back-end for JS portlet?
We are currently working with Liferay 7.1 GA4. I installed Liferay JS Portlet Extender and created porltet using Vue. So far everything seems to work just fine. Now I need to to create some kind of REST service on Liferay. And that is where I am hitting the wall.I tried JAX-RS service, this i can deploy and call if I disable authentication. But it's only js, so no safe storing of basic auth or secret for oauth client credentials. We have large number of portlets and using oauth and asking user to aprove applications is nonsense. So I tried to use portalSession, but no luck there. There are some hints on forum, but no final example/steps to follow or I didn't find them.
My next step was to try Service Builder. But Service Builder automaticaly generates persistance layer and we don't need that. Our applications has their own databases on separate server from Liferay database. So I tried, according some post on forum, to create service with empy entity. Code looks ok, but I have to manualy update exports and server throws error. Probably because he expects some kind of persistance and tables to be there. But this let me to this question. I am just blindly trying everything in hope, that something will work.
We are working with Liferay users, organizations, custom fields, etc in our appliaction. For that reason we want to create back-end on Liferay and not on standalone server.
Can somebody push me in the right direction?
We are currently working with Liferay 7.1 GA4. I installed Liferay JS Portlet Extender and created porltet using Vue. So far everything seems to work just fine. Now I need to to create some kind of REST service on Liferay. And that is where I am hitting the wall.I tried JAX-RS service, this i can deploy and call if I disable authentication. But it's only js, so no safe storing of basic auth or secret for oauth client credentials. We have large number of portlets and using oauth and asking user to aprove applications is nonsense. So I tried to use portalSession, but no luck there. There are some hints on forum, but no final example/steps to follow or I didn't find them.
My next step was to try Service Builder. But Service Builder automaticaly generates persistance layer and we don't need that. Our applications has their own databases on separate server from Liferay database. So I tried, according some post on forum, to create service with empy entity. Code looks ok, but I have to manualy update exports and server throws error. Probably because he expects some kind of persistance and tables to be there. But this let me to this question. I am just blindly trying everything in hope, that something will work.
We are working with Liferay users, organizations, custom fields, etc in our appliaction. For that reason we want to create back-end on Liferay and not on standalone server.
Can somebody push me in the right direction?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™