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
RE: Programatically Publish Journal Article in Remote Staging Liferay 7.1
Hi,
I am using Liferay 7.1 and I want to publish journal article programatically in remote staging. I have checked source code of Liferay and they are using Export Import ChangeSet portlet and use remote publish as back ground task. Now when I writing my own code to remote publish Journal Article I can see I need get Remote site detail with below code.
Group liveGroup = GroupServiceHttp.getGroup( httpPrincipal, liveGroupId);
But I guest GroupServiceHttp is not available out site of OOTB Liferay. I can not create it's objects and get remote site detail.
Can anyone give input here how to get remote site detail progaramatically and publish Journal Article ?
Thanks,
Sandip Patel
I am using Liferay 7.1 and I want to publish journal article programatically in remote staging. I have checked source code of Liferay and they are using Export Import ChangeSet portlet and use remote publish as back ground task. Now when I writing my own code to remote publish Journal Article I can see I need get Remote site detail with below code.
Group liveGroup = GroupServiceHttp.getGroup( httpPrincipal, liveGroupId);
But I guest GroupServiceHttp is not available out site of OOTB Liferay. I can not create it's objects and get remote site detail.
Can anyone give input here how to get remote site detail progaramatically and publish Journal Article ?
Thanks,
Sandip Patel
Sandip Patel
Can anyone give input here how to get remote site detail progaramatically and publish Journal Article ?
Even though you can fetch the remote site detail using the existing JSON web services API, the methods you need for publishing aren't exposed to anything outside of Liferay. As a result, I don't think it's easy to do what you want in an out of box Liferay installation unless you give up on elegant API calls and instead write a web client that acts like a web scraping tool by navigating to the existing portlet and submitting the form.
If you're doing automated content creation, there's no real reason to use remote staging, which is more for content administrators who are doing things manually. However, if you really want to use remote staging anyway, your best bet is to create a new remote service (whether it's a servlet, a portlet, or a new web service) that your client code can call, and since that new remote service code lives inside of Liferay, it can (probably) make necessary calls directly.