0

Can you provide any sample code available to access out-of-box web scripts( provided by Alfresco) from web application (login to alfresco, create folders, upload documents) Web-Scripts is new for me. I am used to code using plain java API (Example Filenet API). Does Alfresco provide JAR files containing JAVA API which I can use for all repository operations like login,create folder,upload/download documents etc…….. My requirement is to create folders(spaces) in Alfresco through custom web application and upload documents to those spaces.

4 Answers 4

1

You can access out-of-the-box web scripts using the following URL (use your own host and port).

http://localhost:8080/alfresco/s/index

You can refer docs.alfresco.com for more Java, JavaScript APIs and all about Alfresco development.

Thanks

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

Comments

1

Can you provide any sample code available to access out-of-box web scripts( provided by Alfresco) from web application

As @Kintu said you can access the list of the Alfresco's out of the box webscripts using this URL:

/alfresco/service/index/all

And to make you own web script This tutorial is a good way to get started. From your web application you can consume them like any other plain old REST API.

Does Alfresco provide JAR files containing JAVA API

Alfresco provides a rich set of services that you can use in your web scripts.

My requirement is to create folders(spaces) in Alfresco through custom web application and upload documents to those spaces

- To create a folder you can use this endpoint:

POST /alfresco/service/api/site/folder/{site}/{container}/{path}

The minimum request body is of the form:

{ "name": "NewNodeName" }

The full set of parameters accepted in the request is of the form:

{  
   "name": "NewNodeName",
   "title": "New Node Title",
   "description": "A shiny new node",
   "type": "cm:folder"
}

- To upload files you can use this endpoint (HTML form data):

POST /alfresco/service/api/upload

Check the docs for more informations about this endpoint.

Comments

0

I suggest starting with API Explorer, later on you can always use something not documented as nicely as this is.

https://api-explorer.alfresco.com/api-explorer/

Comments

0

As someone who is already familiar with Filenet maybe you are already familiar with CMIS? That is probably the easiest way to create folders and documents in Alfresco. There are a number of CMIS clients available at Apache Chemistry, including OpenCMIS, which is a Java client.

You can find a bunch of code samples at the Apache Chemistry web site as well.

One advantage of using CMIS to do this is that CMIS works on a variety of repositories, not just Alfresco. Why go to the trouble of learning an Alfresco-specific REST API when there is already an industry standard? Learn it once and use it often.

Comments

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.