Configuring Exports

Each model described in the Squore Configuration may define a set of exports in the models/MODEL/Exports/Bundle.xml bundle file. Exports available in the user interface depend on the role of the currently logged-in user and the selection in the Project Portfolios and the Artefact Tree views.

Here is an example of a bundle file:

<?xml version="1.0" encoding="UTF-8"?>
<Bundle>
  <Role name="DEFAULT">
    <Export type="MODEL">
      <ExportScript name="Project Portfolio" script="${scriptDir}/sqexport.pl">
        <arg value="-f" />
        <arg value="${outputFile}" />
        <arg value="versions" />
        <arg value="-ml" />
        <arg value="-u" />
        <arg value="${idUser}" />
        <arg value="${idModel}" />
      </ExportScript>
    </Export>
    <Export type="APPLICATION">
      <ExportScript name="Functions with level G" script="${scriptDir}/sqexport.pl">
        <arg value="-f" />
        <arg value="${outputFile}" />
        <arg value="artefacts" />
        <arg value="-mR" />
        <arg value="-T" />
        <arg value="${types['FUNCTION']}" />
        <arg value="-L" />
        <arg value="LEVELG" />
        <arg value="-u" />
        <arg value="${idUser}" />
        <arg value="${idModel}" />
      </ExportScript>
    </Export>
  </Role>
</Bundle>

Supplied Export Scripts

The default Squore configuration includes the following scripts by default. Each script is described in an appendix at the end of this manual.

Using Runtime Variables

The Bundle.xml file above contains some variables that are replaced at runtime. The following is the list of variables that can be used in the ExportScript and arg XML elements.

Note that the ${outputFile} variable is mandatory.

${scriptDir}

Used to resolve the location of the addons directories on Squore Server, in which the scripts/export-scripts subdirectory contains the default scripts.

${customScriptDir}

Used to resolve the location of the configuration directories on Squore Server, in which the <MODEL_NAME>/Exports subdirectory contains the scripts you added to the product.

${serverUrl}

The base URL of the Squore server.

${outputFile}

The name of the output file where the export script writes to. The filename is guaranteed to be unique on each call.

${idUser}

The identifier of the logged in user.

${idModel}

The identifier of the model that is currently selected in the Project Portfolios.

${idApplication}

The identifier of the application that is currently selected in the Project Portfolios.

${idVersion}

The identifier of the version that is currently selected in the Project Portfolios.

${idArtefact}

The identifier of the artefact that is currently selected in the Artefact Tree.

${types['TYPENAME']}

This function resolves at runtime the type aliases of TYPENAME. That may be used to simplify bundles, as you may achieve the exact same thing by manually listing all types. The result is a coma separated list of types.