cancel
Showing results for 
Search instead for 
Did you mean: 

portlet alfresco (jsr 168)

jeandev
Champ in-the-making
Champ in-the-making
How can i develop a portlet alfresco (jsr 168)? There is any tutorial.
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
If Alfresco is running in the same application server of the portal, you could try to implement your portlets with WebScriptPortlet class.
In this way you only need to implement Alfresco WebScripts and then you only need to declare the webscript as a portlet in the portlet.xml of the alfresco.war. More information here:

http://wiki.alfresco.com/wiki/Web_Script_Runtimes#JSR-168_Runtime_.28Portlet_Access.29

Otherwise you can implement your own portlet using one of the APIs exposed by Alfresco:
  • CMIS

  • WebScripts

  • SOAP
The CMIS protocol allows you to implement your client application that can be considered usable with any CMIS-compliant repository.
The Apache reference implementation of this protocol is the Apache Chemistry project. You can download the OpenCMIS client library, then import it in your classpath and then start to invoke remote calls against the repository following the examples:

http://chemistry.apache.org/java/examples/index.html

If you need some specific features of Alfresco then you have to point on WebScripts that is the extensible RESTful API of Alfresco (HTTP + XML/JSON), here some samples about how to extend the REST API of Alfresco:

http://wiki.alfresco.com/wiki/Web_Scripts_Examples
http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples

Extending the Alfresco API means that you can embed more operations in an unique HTTP transactional request. If you try to use the out-of-the-box methods you can see that for some custom operation you need to execute more than one HTTP request.

The last possibility is to use the SOAP API, Alfresco provides you a precompiled Java stub client (alfresco-web-service-client.jar) that you can import in your Java classpath and you can start to invoke remote calls to the repository.

Hope this helps.