Using Alfresco REST API with the Java SDK (Out Of Process)

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Alfresco REST API with the Java SDK (Out Of Process)

angelborroy
Alfresco Employee
0 1 3,842

Alfresco provides a REST API that exposes different services from the Repository.

Details on the API are provided in Official Alfresco Documentation:

https://docs.alfresco.com/content-services/latest/develop/rest-api-guide/

In addition to the existent Alfresco Maven SDK (4.x), oriented to extend the product features by creating AMP or JAR modules, a new Alfresco Java SDK (5,x) has been introduced in Alfresco 7 to provide integrations with the repository Out Of Process. When using this new SDK, both REST API and ActiveMQ sources can be used to adapt the use of the platform to a given use case.

Alfresco REST API can be consumed from many different types of clients. However, Alfresco Java SDK provides a reference implementation for a Java native client for the REST API.

Details on the use of this native client is available in Alfresco Official Documentation:

https://docs.alfresco.com/content-services/latest/develop/oop-ext-points/rest-api-java-wrapper/

Discover how to use this new SDK with the REST API in the following video.

 

1 Comment
4535992
Senior Member

 

Hi Angel, a question I would like to use the user set in "application.properties" as the application user to generate individual user tickets using the rest api service "generateTicket", .

To make a simple use case, I have an alfresco username and ticket map (or jwt token) "Map<String,String> tickets" and I want to invoke the rest api's "getNode" method with the user name XXX

1) Retrieve the TickeId (or jwt Token) from the map with the specific user XXX: tickets.get("XXX")

2) Prepare the component to use the service "nodesApi.getNode()"

How can I set at the java code level to invoke the restApi with the ticket of the user XXX ? I guess I have to add a header, but is there this possibility at the java code level ?