DPS API & How to use it | Community
Skip to main content
October 16, 2015
Solved

DPS API & How to use it

  • October 16, 2015
  • 11 replies
  • 2936 views

Is there an example of how to use the DPS API's or a community article? I want to be able to push out articles and folios using these API's.

 

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JohnFa6

Creating and invoking workflows are already documented and should help with what you are trying to do.

The DPS Upload workflow can be seen at;

http://localhost:4502/libs/cq/workflow/admin/console/content/models.html/etc/workflow/models

http://localhost:4502/cf#/%252Fetc%252Fworkflow%252Fmodels%252Fdps%252Fupload-content.html

That workflow can be edited or copied depending on what you need.

It contains/users 2 steps 'Upload HTMLResources to DPS' and 'Upload to DPS' which can also be reused in your own workflow if needed.

You can invoke this workflow from http://localhost:4502/libs/cq/workflow/admin/console/content/models.html/etc/workflow/models which is the same workflow the DPS console uses.  Workflows can also be invoked via workflow apis or post operations.

John

11 replies

October 16, 2015

JohnFait wrote...

btw, AEM's DPS2015 integration uses individual post operations rather than a workflow. Reuse and automation will be easier with DPS2015 as a result.

 

 

I'm currently on AEM 6.0, don't have the 6.1 upgrade just yet. The links you provided me earlier don't work possibly because it's a 6.1 local instance?

Anywho, I managed to work something up with the following code here but I keep getting a null point exceptions even though my password & username is correct:

 

public class DpsBuilder{ private static DPSSessionService sessionService; private static DPSSession dpsSession = null; private static DPSFolioProducerService folioProducer; public static void main(String[] argv){ try { dpsSession = sessionService.createSession("username", "password"); String url = dpsSession.getServiceURL(); System.out.println(url); folioProducer = dpsSession.adaptTo(DPSFolioProducerService.class); folioProducer.deleteFolio("test"); sessionService.deleteSession(dpsSession); } catch (DPSSessionServiceException ex) { System.out.println("ERROR"); } catch (DPSFolioProducerServiceException e) { System.out.println("Delete Folio failed"); } } }

Thanks!