Foros de discusión

How to set status to approved for Web Service loaded items?

thumbnail
Dave Weitzel, modificado hace 10 años.

How to set status to approved for Web Service loaded items?

Regular Member Mensajes: 208 Fecha de incorporación: 18/11/09 Mensajes recientes
Hi,
I am writing a java client in eclipse to migrate data from an old web site to new Liferay 6.1 based system
I am using portal-client.jar and associated SOAP services and models to upload images and documents to the DocmentLibrary as well as JournalArticles and Users.

Having now got most calls I need working (at least creating the new objects in Liferay) I find that they are all "Draft" in status.

In Document Library I have the portal property dl.file.entry.drafts.enabled=false and no workflow setup. I am using DLAppServiceSoap to upload the bytes even tried updating (yes copying the file twice) to no avail.

In JournalArticle I do not have access to the updateStatus() method through SOAP even though it is in the ServiceUtil code on the server it isn't available for web service calls.

Is there a serviceContext property to be set to achieve this?

Is there a way to call the Service methods not in the portal-client jar file or wsdl?

For users I would like to be able to update them simply as we have a listener to monitor custom fields and move users into the right user groups.

Help/pointers much appreciated

Dave

.
thumbnail
Ahmed Hasan, modificado hace 10 años.

RE: How to set status to approved for Web Service loaded items?

Expert Mensajes: 306 Fecha de incorporación: 13/04/07 Mensajes recientes
Hi Dave,

For the methods that are required, you can write your own service layer and expose them. Once they are exposed, you can consume through the Java client that you've written to perform the additional functionality. How to create those remote API's through Liferay's Service Layer is covered in my book (chapter 8). You can download a free copy and refer there. For any more queries you can get in touch with me.

Yours Truly,
Ahmed Hasan
Author, Liferay Portlet Cookbook
thumbnail
Dave Weitzel, modificado hace 10 años.

RE: How to set status to approved for Web Service loaded items?

Regular Member Mensajes: 208 Fecha de incorporación: 18/11/09 Mensajes recientes
Thanks Ahmed
I have your book and we already have our own service builder objects exposed so I guess I can try to add something f necessary.
I cannot believe though that there is no simple way (through serviceContext settings perhaps) to achieve this.
I imagine that web services are used quite a lot for these sort of tasks.

It isnt directly obvious how to change the draft status on documentLibrary objects as the property has been set to not allow them!

Dave
Lan Zhang, modificado hace 10 años.

RE: How to set status to approved for Web Service loaded items?

New Member Mensajes: 21 Fecha de incorporación: 16/05/11 Mensajes recientes
try to set
serviceContext.setWorkflowAction(1)
thumbnail
Dave Weitzel, modificado hace 10 años.

RE: How to set status to approved for Web Service loaded items?

Regular Member Mensajes: 208 Fecha de incorporación: 18/11/09 Mensajes recientes
Thanks, that worked

I wasn't sure it would work for Document Library items as well as journal content but it seems to.

Dave
See other posts for new issues!