Fórum

Add new methods to standard services

Jan Bub, modificado 12 Anos atrás.

Add new methods to standard services

Junior Member Postagens: 78 Data de Entrada: 02/03/11 Postagens Recentes
Hey,

after working with liferay a few month, I now want to adapt the DocumentLibrary with a protocol. Therefor I need to create some new methods to an existing service. But I have no idea how to realise it. I know that i can override existing methods with hook, but how to add new methods?

Hope you can help me. emoticon
thumbnail
Thiago Leão Moreira, modificado 12 Anos atrás.

RE: Add new methods to standard services (Resposta)

Liferay Legend Postagens: 1449 Data de Entrada: 10/10/07 Postagens Recentes
The right way to do that is create another service like ExtDocumentLibrary and call from it the original DocumentLibrary.
Jan Bub, modificado 12 Anos atrás.

RE: Add new methods to standard services

Junior Member Postagens: 78 Data de Entrada: 02/03/11 Postagens Recentes
emoticon Thanks for your help. Ok, sounds simple to me but I have more questions.
ServiceBuilder sais I have not to build the Service with ext-Plugin but with hook or standard portlet. How can I make my Service usable portalwide to use it in the ext-Plugin.
Jan Bub, modificado 12 Anos atrás.

RE: Add new methods to standard services

Junior Member Postagens: 78 Data de Entrada: 02/03/11 Postagens Recentes
I exported now a service.jar from hook plugin an put it in the ext-plugin. It's now in the folder /ext-lib/global. But nothing happens. Always i want to use MyLocalServiceUtil I get an error message: "can not resovle....". Any ideas?
Jan Bub, modificado 12 Anos atrás.

RE: Add new methods to standard services

Junior Member Postagens: 78 Data de Entrada: 02/03/11 Postagens Recentes
Im still fighting.

I tried to fix the Bug like explained in this thread.

- I loaded the files
- put it into the portal-impl.jar of tomcat
- started all new
- rebuild the service and put it in my ext-plugin/docroot/WEB-INF/ext-lib/global

But I still get the error message:

java.lang.NullPointerException
                   at. de.test.liferay.portlet.service.[b]DLLogEntryLocalServiceClp.<init>(DLLogEntryLocalService.java:568)[/b]

....
</init>


I use Liferay 6.06. CE.
thumbnail
Mauro Mariuzzo, modificado 12 Anos atrás.

RE: Add new methods to standard services

Regular Member Postagens: 142 Data de Entrada: 23/07/07 Postagens Recentes
ServiceBuilder say that services are deprecated in ext.

That's means that 'developer have to stop for a while and think if he really need to write service in ext or there are valid alternative using hook or portlets'.

To reach you goal you have to write service in ext. So you have:
  • to create the service.xml (for example ext-impl/src/com/ext/portal/service.xml)
  • change "build.xml" inside you ext plugins with the following code



    <property name="ext.impl.src" value="docroot/WEB-INF/ext-impl/src" />

    <target name="build-service-portal">
        <property name="service.file" value="${ext.impl.src}/com/ext/portal/service.xml" />
        <antcall target="build-service" />
    </target>

    <target name="build-services">
        <antcall target="build-service-portal" />
    </target>




Now you are able to invoke "ant build-services"
thumbnail
Thiago Leão Moreira, modificado 12 Anos atrás.

RE: Add new methods to standard services

Liferay Legend Postagens: 1449 Data de Entrada: 10/10/07 Postagens Recentes
Hey Jan,

For some reason Service Builder is not picking up the modifications of your EXT plugin. If you follow the steps of the thread you will succeed!
Laxman Rana, modificado 12 Anos atrás.

RE: Add new methods to standard services

Junior Member Postagens: 38 Data de Entrada: 01/03/12 Postagens Recentes
@ thiago...
can u help me on this question.....thanks in advance....

http://www.liferay.com/community/forums/-/message_boards/view_message/13039798