• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Enthusiast ,
Jan 30, 2018 Jan 30, 2018

Copy link to clipboard

Copied

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?

Views

388

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jan 31, 2018 Jan 31, 2018

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines