How to use Java Public API

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Active Member

How to use Java Public API

Good morning,

I'm new with Alfresco and had readed a lot of documentation. I'm trying to build some library/api to my software to access the part of storage and management of files / folders of the Alfresco. (Integration with other systems)

Now I am using the Alfresco client (https://github.com/Alfresco/alfresco-client-sdk) but I don't know if it is the best solution because my project is in Java.
Readed about Java Public API but no mention of where I can get it (is the all in one maven archetype sdk?), and how to install. 

Can somebody give to me an expalanation and links to access Java Public API to create / manage content and if it have access to folder rules like document auto transformation (xls>pdf, etc.)?

Thanks!

7 Replies
Highlighted
Alfresco Employee

Re: How to use Java Public API

Probably this can help you to understand different Alfresco APIs:

http://beecon.buzz/2017/assets/files/H04/keensoft%20-%20Alfresco%20Learning%20-%20EN.pdf 

http://beecon.buzz/2017/assets/files/H04/keensoft%20-%20Alfresco%20Learning%20-%20ES.pdf 

In those documents you can find several ways of using Alfresco from outside Alfresco.

If you want to use Alfresco from inside Alfresco (deploying extensions to the product), you can develop Repository or Share artifacts. It's not required to use the Java Public API, but you can start learning at

https://ecmarchitect.com/alfresco-developer-series

I recommend you to start with Alfresco Maven SDK tutorial and then move your focus to specific tasks like Custom Content Types, Actions, Behaviours and Web Scripts.

Software Engineer in Alfresco Search Team.
Highlighted
Active Member

Re: How to use Java Public API

Thank you for the fast answer!

In resume, I need to create an external integration with my system, to use Alfresco for document storage (a LOT of), with folders by area. I will need use document transformations and compression. I have some questions to better understand:

1) Alfresco has any built-in file compression?

2) I've understand only that i have the 2 options, REST API and CMIS for external implementation, that is all?

3) About Alfresco Maven SDK, is for internal extensions only and it is the Public Java API or are different things?

I haven't understood that two guys yet..

Thanks!

Highlighted
Alfresco Employee

Re: How to use Java Public API

1) Storing compressed files in Alfresco is not a regular approach, as you cannot extract metadata or apply transformation operations on them. Probably is better to store compressed files on a plain filesystem. Anyway, Alfresco can compress the files for you by applying a folder rule and an action.

2) For external integration, you can use REST API (proprietary) or CMIS API (standard). You can use also any of the protocols available (FTP, CIFS, WebDAV, SMTP, IMAP).

3) Alfresco SDK is only for internal extensions and is where the Public Java API is available

Hope this helps.

Software Engineer in Alfresco Search Team.
Highlighted
Master

Re: How to use Java Public API

As Angel pointed out, compressed files should not be stored in Alfresco, but Alfresco itself can store the files managed within the Repository as compressed files in its backing storage (a plain filesystem by default). This is done via so called Content Stores, which are pluggable. In one of my addons I provide a compressing content store to actually perform "compression at rest".

Highlighted
Active Member

Re: How to use Java Public API

Sure, this is the point, Faust.

I've readed about your  implementations and it seems very interesting. I've compiled the maven project, generated the AMP but it is with some problem, maybe a wrong name? I've put properties example to generate simpleContentStores AMP:

Alf Error:

Cannot find Alfresco Repository on this server. (Does this application have access to alfresco-global.properties? Does this application have cross-context permissions?)

Example:

# enable the addon simpleContentStores.enabled=true  # define the names of stores to configure # (multiple stores can be listed in comma-separated fashion) simpleContentStores.customStores=myCompressingStore,defaultTenantFileContentStore # use the store as the global standard (instead of defaultTenantFileContentStore) simpleContentStores.rootStore=myCompressingStore  # define myCompressingStore as a compressing store simpleContentStores.customStore.myCompressingStore.type=compressingFacadeStore # store compressed content in the default fileContentStore ("facade" the defaultTenantFileContentStore) simpleContentStores.customStore.myCompressingStore.ref.backingStore=defaultTenantFileContentStore # only compress content we know is text-based simpleContentStores.customStore.myCompressingStore.list.value.mimetypesToCompress=text/*,application/json,application/xhtml+xml,image/svg+xml,application/eps,application/x-javascript,application/atom+xml,application/rss+xml,message/rfc822

What information i need provide to get this code work?

Thanks Angel Borroy and Axel Faust

Highlighted
Master

Re: How to use Java Public API

The project's wiki is a good place to start. Though since you apparently have an error starting up the Repository, I'd advise to first look in the alfresco.log file for any obvious errors that can be obtained from the output.

Highlighted
Member II

Re: How to use Java Public API

This is perfect. The best anyone can get.!