Skip to main content
sberic
Legend
Jan 30, 2018 6:09 PM UTC
Question

Is there an API for getting the current version of the extension?

We have to put extension version information into the manifest.xml file. Is there a way to access this programmatically from within panel extensions or would it require loading and parsing the XML directly?

This topic is closed to new replies. Start a new post to keep the conversation going.

1 reply

Loic.Aigon
Legend
Jan 31, 2018 3:54 PM UTC

Probably need refinement (extension id per say) but here is a starting point. It consists in loading the manifest as XML file and read the version value:

var xmlDoc = new window.XMLHttpRequest();

        var xmlFilePath = csInterface.getSystemPath(SystemPath.EXTENSION)+"/CSXS/manifest.xml";

        xmlDoc.open("GET",xmlFilePath,false);

        xmlDoc.send("");

        xmlDoc = xmlDoc.responseXML;

        var ext = xmlDoc.getElementsByTagName('Extension')[0];

        var version = ext.getAttribute ("Version");

HTH

Loic

Ozalto | Productivity Oriented - Loïc Aigon

Translate