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 |
|
Auth | logout |
|
Auth | validateTicket |
|
Content | getNodeContent |
|
Content | uploadDocument |
|
Content | getNodeMetadata |
|
Content | storeNodeMetadata |
|
Content | advancedSearch |
|
Content | deleteDocument |
|
Folder | createFolder |
|
Folder | searchFolder |
|
Folder | createFolderByCmisAtomEntry |
|
Group | getGroups |
|
Group | getGroup |
|
Group | getRootGroups |
|
Group | getChildAuthorities |
|
Group | getParentAuthorities |
|
Group | deleteGroup |
|
Permission | setPermissions |
|
Permission | readPermissions |
|
Permission | setPermissions |
|
User | getUsers |
|
User | getUser |
|
User | createUser |
|
User | changePassword |
|
User | deleteUser |
|
User | updateUser |
|
User | getUserHome |
|
Changelog
v1.3.0 - 2017-12-20
- First public release after fork
- TODO more info to place here
Contribute
Feel free to pull requests ;).