Using CMIS in JavaScript and web application pages
We have already seen how the Browser binding can be used to manage folders and documents directly from HTML forms. However, we did not go into how we can use JavaScript to call a CMIS service via the Browser binding and then process the JSON response.
Now let's see how easy it is to use the Browser binding and JSON to navigate through the repository and populate data trees and data lists. First thing first though, we need to get hold of the Alfresco repository ID so that we can use it in our service calls. If you remember, the Browser binding-based URL for Alfresco Version 4 is http://localhost:8080/alfresco/cmisbrowser
, and it will return information about the repository, such as the ID.
Note
If you are using Alfresco Version 4.2.d Community, 4.2.0 Enterprise, or newer, then the correct CMIS browser binding URL is http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/browser
.
Let's set up a web page that makes a service call to this...