How to get alfresco version number programmatically

I am using Alfresco. I know how to see the installed Alfresco vesrion number, but I need to get this version number programmatically, for example via API access or some kind of HTTP request. Is it possible to do this?

+3


source to share


3 answers


REST API that uses Share to get data from a repo (for example):

http://localhost:8081/share/proxy/alfresco/api/server

      

This returns:



{
   data: {
      edition: "Enterprise",
      version: "5.0.0",
      schema: "8002"
   }
}

      

This website looks like this: https://github.com/Alfresco/community-edition/blob/master/projects/remote-api/config/alfresco/templates/webscripts/org/alfresco/repository/server.get. desc.xml

+5


source


In JavaScript code, you can use the server object:

server.version
server.versionMajor
server.versionMinor
server.versionRevision
server.edition

      



In Java, you can use DescriptorService like:

serviceRegistry.getDescriptorService().getCurrentRepositoryDescriptor().getVersion()

      

+2


source


You can use the Browser Interface API for the CMIS protocol.

In particular, read this property:

productVersion

      

Link: http://docs.oasis-open.org/cmis/CMIS/v1.1/cs01/CMIS-v1.1-cs01.html#x1-1660002 paragraph 2.2.2.2.2

Advantage over other methods: CMIS is standard, so this operation will always be available, as opposed to Share web scripts, which can change. Also, your code will be compatible with any other CMIS implementation.

Here's an example of how CMIS works through JavaScript .

+1


source







All Articles