0

I am curently developing a java/jee application using Alfresco as ECM. I want to know what is the best way to communicate with alfresco in a Java/jee app.Which is better using the web script or java api ?

4
  • Use webscripts to remote call like you are calling REST services. Use Java API to build own HTTP services... Commented Feb 26, 2017 at 16:15
  • i think while i am developing a java/jee app it would be better to use the java api.I think i have the same capabelities as web script.Am i right ? Commented Feb 26, 2017 at 16:28
  • Using CMIS is a way more easier with java you will find plannty of methods to help you Commented Feb 26, 2017 at 20:05
  • i found this it could be helpfull github.com/Alfresco/alfresco-client-sdk Commented Feb 26, 2017 at 20:12

2 Answers 2

3

"Web scripts" and "Java" are not mutually exclusive. A web script controller can be coded using Java, JavaScript, or, with a little work, other languages.

So the question you are really asking is: "Should I embed Alfresco in my J2EE application, which would require using the Java API, or should I interact with Alfresco remotely?"

The answer to that is almost certainly that you should interact with it remotely. I don't think anyone is embedding Alfresco in their apps at this point.

Assuming that you are going to interact with Alfresco remotely, the first choice for API should be CMIS, and to do that you should use an existing client library such as OpenCMIS from Apache Chemistry. However, it is unlikely that you will be able to do everything you need to with CMIS, so you can also look at the Alfresco Public REST API. If there are still things you need to be able to do that aren't addressed by either of these, then you can write your own RESTful end points using Web Scripts.

Avoid calling out-of-the-box web scripts unless they are clearly marked as "public".

Sign up to request clarification or add additional context in comments.

2 Comments

I agree. You should not embed your application in Alfresco, this is not a good strategy. For the remote part, I would prefer to use REST api than CMIS, since this last one offers less functionnality, and I would not bet on alfresco supporting it for the long run (this last one is just an opinion).
ok.in my application i am not going to host alfresco and the app on the same serveur so to avoid traffic i d rather using cmis and if i need other functionalities i will be obliged to use also webscript.so what do you think about that Mr Jeff ? I also found the alfresco client sdk but it is beta version :/
1

I would recommend you to use CMIS which is a standard to communicate with ECM solution. One of the advantage is you can replace Alfresco by any other CMIS-compliant solutions. CMIS offers you to connect via REST API or Java (http://chemistry.apache.org/java/opencmis.html)

However, it depends what you really want to do in your application. CMIS don't cover all capabilities offered by Alfresco.

3 Comments

ok thanks.do you an idea which is better webscript or lafresco java api ?
It depends of your project and what you want to do with Alfresco :) CMIS will provide you standard ECM capabilities (CreateDocument, CreateFolder, EditProperties, GetDocument, GetFolder...). Look at OpenCMIS and check if it covers your requirements.
i found this it could be helpfull github.com/Alfresco/alfresco-client-sdk

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.