Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Dave Weitzel
How to set status to approved for Web Service loaded items?
October 10, 2013 9:18 PM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 203

Join Date: November 18, 2009

Recent Posts

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

.
Ahmed Hasan
RE: How to set status to approved for Web Service loaded items?
October 10, 2013 11:04 PM
Answer

Ahmed Hasan

Rank: Expert

Posts: 306

Join Date: April 13, 2007

Recent Posts

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
Dave Weitzel
RE: How to set status to approved for Web Service loaded items?
October 11, 2013 9:21 AM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 203

Join Date: November 18, 2009

Recent Posts

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
RE: How to set status to approved for Web Service loaded items?
October 11, 2013 11:36 AM
Answer

Lan Zhang

Rank: New Member

Posts: 16

Join Date: May 16, 2011

Recent Posts

try to set
serviceContext.setWorkflowAction(1)
Dave Weitzel
RE: How to set status to approved for Web Service loaded items?
October 16, 2013 7:56 PM
Answer

Dave Weitzel

Rank: Regular Member

Posts: 203

Join Date: November 18, 2009

Recent Posts

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!