Skip to main content
sberic
Legend
January 30, 2018
Question

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

  • January 30, 2018
  • 1 reply
  • 472 views

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 has been closed for replies.

1 reply

Loic.Aigon
Legend
January 31, 2018

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