Alfresco RESTful client

A client library based on OpenFeign to communicate with Alfresco RESTful services.

License

License

Categories

Categories

CLI User Interface Dex General Purpose Libraries Utility
GroupId

GroupId

pl.dexterxx.dev.alfresco
ArtifactId

ArtifactId

alfresco-restclient
Last Version

Last Version

1.3.0
Release Date

Release Date

Type

Type

jar
Description

Description

Alfresco RESTful client
A client library based on OpenFeign to communicate with Alfresco RESTful services.
Project URL

Project URL

https://github.com/dexterxx-pl/alfresco-restclient/
Source Code Management

Source Code Management

https://github.com/dexterxx-pl/alfresco-restclient

Download alfresco-restclient

How to add to project

<!-- https://jarcasting.com/artifacts/pl.dexterxx.dev.alfresco/alfresco-restclient/ -->
<dependency>
    <groupId>pl.dexterxx.dev.alfresco</groupId>
    <artifactId>alfresco-restclient</artifactId>
    <version>1.3.0</version>
</dependency>
// https://jarcasting.com/artifacts/pl.dexterxx.dev.alfresco/alfresco-restclient/
implementation 'pl.dexterxx.dev.alfresco:alfresco-restclient:1.3.0'
// https://jarcasting.com/artifacts/pl.dexterxx.dev.alfresco/alfresco-restclient/
implementation ("pl.dexterxx.dev.alfresco:alfresco-restclient:1.3.0")
'pl.dexterxx.dev.alfresco:alfresco-restclient:jar:1.3.0'
<dependency org="pl.dexterxx.dev.alfresco" name="alfresco-restclient" rev="1.3.0">
  <artifact name="alfresco-restclient" type="jar" />
</dependency>
@Grapes(
@Grab(group='pl.dexterxx.dev.alfresco', module='alfresco-restclient', version='1.3.0')
)
libraryDependencies += "pl.dexterxx.dev.alfresco" % "alfresco-restclient" % "1.3.0"
[pl.dexterxx.dev.alfresco/alfresco-restclient "1.3.0"]

Dependencies

compile (11)

Group / Artifact Type Version
io.github.openfeign : feign-core jar 9.5.1
io.github.openfeign : feign-jackson jar 9.5.1
io.github.openfeign : feign-jaxrs jar 9.5.1
io.github.openfeign : feign-slf4j jar 9.5.1
io.github.openfeign : feign-annotation-error-decoder jar 1.0.3
io.github.openfeign.form : feign-form jar 3.0.3
com.fasterxml.jackson.core : jackson-databind jar 2.9.3
org.apache.commons : commons-lang3 jar 3.7
org.slf4j : slf4j-api jar 1.7.9
org.apache.tika : tika-core jar 1.16
commons-io : commons-io jar 2.6

Project Modules

There are no modules declared in this project.

alfresco-restclient

Rest client written in Java 8 with OpenFeign to consume Alfresco RESTful services.

It's fork of techblue/alfresco-restclient project which:

  • Migrates from RestEasy to OpenFeign
  • Migrates from JDK7 to JDK8
  • Updates Jackson Mapper from 1.9 to 2.9
  • Changes JBoss logging to SFL4J bridge
  • [TODO] Migrates test to real unit tests
  • Makes some freshness, cleanup etc. ;)

It may not be compatible with base project and don't expect it will ever be.

Tested (and used right now) only with Alfresco 4.2 version.

Dependency

It's still in early development progress so remember - use at own risk!

Maven

<dependency>
    <groupId>pl.dexterxx.dev.alfresco</groupId>
    <artifactId>alfresco-restclient</artifactId>
    <version>1.3.0</version>
</dependency>

Gradle

compile 'pl.dexterxx.dev.alfresco:alfresco-restclient:1.3.0'

How to use (beta)

final String alfrescoUrl = "http://my-alfresco-host";

final String alfrescoUser = "alfresco-user";

final String alfrescoPass = "alfresco-password";

private void makeSomeStuff() {

    Credentials credentials = new Credentials(alfrescoUser, alfrescoPass);

    // Create AuthService which logins and logouts in Alfresco
    AuthService authService = new AuthService(alfrescoUrl, credentials);

    AuthResponse authResponse = authService.login();
    String token = authResponse.getAuthenticationData().getAuthenticationToken();

    // Let's get node content with our token
    String filePath = "workspace://SpacesStore/6cffe1dd-d4aa-4770-b371-7c9b4c808cc9";
    AlfrescoUtils.AlfrescoStorePath alfPath = AlfrescoUtils.extractPath(filePath);

    DocumentContent nodeContent = new ContentService(alfrescoUrl, token)
        .getNodeContent(alfPath.storeType, alfPath.storeId, alfPath.nodeId);
    
    // so easy!
}

What works and what not

Class / Module Method Status / Does work?
Auth login Works!
Auth logout Works!
Auth validateTicket Works!
Content getNodeContent Works!
Content uploadDocument Probably NOT!
Content getNodeMetadata Maybe
Content storeNodeMetadata ⚠️ Should
Content advancedSearch Probably NOT!
Content deleteDocument ⚠️ Should
Folder createFolder ⚠️ Should
Folder searchFolder Maybe
Folder createFolderByCmisAtomEntry ⚠️ Should
Group getGroups Partial
Group getGroup Works!
Group getRootGroups Probably NOT!
Group getChildAuthorities Probably NOT!
Group getParentAuthorities Probably NOT!
Group deleteGroup ⚠️ Should
Permission setPermissions ⚠️ Should
Permission readPermissions ⚠️ Should
Permission setPermissions ⚠️ Should
User getUsers Works!
User getUser Works!
User createUser ⚠️ Should
User changePassword ⚠️ Should
User deleteUser ⚠️ Should
User updateUser ⚠️ Should
User getUserHome Probably NOT!

Changelog

v1.3.0 - 2017-12-20

  • First public release after fork
  • TODO more info to place here

Contribute

Feel free to pull requests ;).

Versions

Version
1.3.0