留言板

custom service

Michele Boato,修改在8 年前。

custom service

New Member 帖子: 7 加入日期: 15-10-9 最近的帖子
Hi,
I would like connect this portlet with a mobile app with a framework. I have a portlet that using jdbc standard not service builder, so i can t use service builder.

Is it possible to create a service that is not tied to a local service but on logical "custom" (custom service?) and authenticate with the public service?.
i would like to extend the functionality of the portlet that if i expose a class i can call them as a web service "automatically" by the standard path Liferay API / jsonws / portlet / ...

Regards
Michele
thumbnail
Andrew Jardine,修改在8 年前。

RE: custom service

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Michele,

Hmm... you're really making you life more difficult than you need to with this approach. Out of curiosity, why do you have an non-service builder implementation?

Having said that, one idea that comes to mind might be to use a struts action hook. You can create this hook such that a particular URL will invoke your action, and provided you don't make it part of the auth.public.paths accessing the url will require credentials. You can pass credentials as part of accessing this URL of course (I've done this before using curl for example). You hook then could access your JAR that contains the service that you use with your external JDBC implementation. You portlet would, I assume, access the same jar. It does mean, if you haven't already, splitting out the classes that do the actual JDBC work into a separate library (something SB does for you automatically).

That might be something to try -- though I am always curious to know why people opt out of SB, so please share if you have time emoticon
Michele Boato,修改在8 年前。

RE: custom service

New Member 帖子: 7 加入日期: 15-10-9 最近的帖子
Andrew Jardine:
Hi Michele,

Hmm... you're really making you life more difficult than you need to with this approach. Out of curiosity, why do you have an non-service builder implementation?


:-) Only because it was a old portlet. The "backend" of the portlet is a mantis outside, then does not use the service of Liferay to access the data (because they are on another Demoticon but jdbc standard.
thumbnail
Andrew Jardine,修改在8 年前。

RE: custom service

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Is there an option to turn it into a Service Builder portlet but continue to use the external database? This is possible with SB -- you just need to specify a data-source attribute at the entity level and provide some configurations to tell it where and how to connect to the external data store.
Shiva Krishna Goud,修改在8 年前。

RE: custom service

Regular Member 帖子: 110 加入日期: 15-1-2 最近的帖子
Yes we can map to external database at entity level by using data-source attribute and also we can whole Service Builder portlet entities in hibernate-spring.xml to external datatbase