Report

How It Works

Set of script commands allowing you to build reports. Reports generally present data mined from one or multiple portfolios.

There are three ways to execute a report:

The commands:

ForEachPortfolio

The commands inside this element are executed for each portfolio that corresponds to the criteria in Select Portfolios.

Fields to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset for each new portfolio. The variables may have been previously declared in another command or may be declared for the first time here.
  • Select Portfolios jQuery test allowing you to select portfolios amongst all those visible to the user. Examples:
    • code*='2015_work' Selects the portfolios where the code contains "2015_work".
    • code*=portfolio_code Selects the portfolios where the code contains the value of the variable porfolio_code.
  • Sort - Semantic Tag Optional: semantic tag of the node to be used to sort the portfolios. If not used, the portfolios are presented in the natural order of the portfolio codes.
  • Sort - Element Value of the selected node to be used to sort the portfolios. The options are: node lable, resource value, node code or value of an Item element (drop-down menu of available options).

ForEachPortfolioNode

The commands inside this element are executed for each portfolio that corresponds to the criteria in Select Portfolios. Contrary to the previous command, only a specified node (Tag sémantique) is loaded rather than the entire portfolio. This leads to faster execution in the case of large portfolios.

Fields to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset for each new portfolio. The variables may have been previously declared in another command or may be declared for the first time here.
  • Select Portfolios jQuery test allowing you to select portfolios amongst all those visible to the user. Examples:
    • code*='2015_work' Selects the portfolios where the code contains "2015_work".
    • code*=portfolio_code Selects the portfolios where the code contains the value of the variable porfolio_code.
  • Sort - Semantic Tag Optional: semantic tag of the node to be used to sort the portfolios. If not used, the portfolios are presented in the natural order of the portfolio codes.
  • Sort - Element Value of the selected node to be used to sort the portfolios. The options are: node lable, resource value, node code or value of an Item element (drop-down menu of available options).
  • Semantic Tag Semantic tag of the node(s) to load for execution.

ForEachPerson

The commands inside this element are executed for each user that corresponds to the criteria in Select Persons.

Fields to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset for each new user. The variables may have been previously declared in another command or may be declared for the first time here.
  • Select Persons Jquery test allowing you to select users amongst all in the system. Examples:
    • username='olivier' Selects the user with Karuta login "olivier".
    • username=identifier Selects the user with Karuta login equal to the value of the variable identifier.

ForEachNode

The commands inside this element are executed for each portfolio element that corresponds to the criteria in Node Type, Semantic Tag and Test.

Fields to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset for each new portfolio element. The variables may have been previously declared in another command or may be declared for the first time here.
  • Node Type Type of elements to select (drop-down menu of available options).
  • Semantic Tag Semantic Tag of elements to select.
  • Test Optional: jQuery test allowing you to select elements amongst those that correspond to the two previous criteria. If not used, all elements that correspond to the two previous criteria are processed.

Karuta Predefined Tests:

  • .sort() Sorts the list of nodes on their label, ascending order.
  • .invsort() Sorts the list of nodes on their label, descending order.
  • .filename_not_empty() Checks whether a Document element contains a file (checks the element is not empty).
  • .url_not_empty() Checks whether a URL element contains a hyperlink (checks the element is not empty).
  • .text_not_empty() Checks whether a TextField or Field element contains text (checks the element is not empty).

Karuta predefined tests may be combined. For example: .sort().first() returns the first element of the sorted list.

Examples jQuery functions:

  • .first() Returns the first element of the list.
  • .not(':eq(0)') Returns the list without it's first element.
  • .last() Returns the last element of the list.
  • .has("code:contains('2')") Returns the elements where the code contains "2".
  • .siblings().has("metadata[semantictag*=job-title]") Returns the elements of the same hierarchical level (in the XML tree) with semantic tag "job-title".
  • .has("metadata-wad[submitted='Y']").last() Returns the last submitted element.
  • .has("metadata-wad[private='N']").last() Returns the last visible element.
  • .has('asmContext:has("metadata[semantictag*=visibility-cv-short]"):has ("code:contains(@1)")') Returns elements that have a child (in the hierarchy of the XML tree) with semantic tag "visibility-cv-short" and whose code contains "@1".
  • .sortElements(function(a, b){ return $("code",$("asmResource[xsi_type=Get_Resource]",a)) .text() > $("code",$("asmResource[xsi_type=Get_Resource]",b)).text() ? 1 : -1; }) Sorts on the Get_Resource code.

ForEachLine

The commands inside this element are executed for each line of the CSV file. This element must contain at least one of the following elements: ForEachPerson, ForEachPortfolio or ForEachPortfolioNode.

In the case of a ForEachPerson element:
in the attribute Select Persons, if the value is "username=identifier" (without quotes), Karuta will replace "identifier" by the value of the local variable identifier of the CSV file.

In the case of a ForEachPortfolio or ForEachPortfolioNode element:
in the attribute Select Portfolios, if the value is "code=portfolio_code" (without quotes), Karuta will replace "portfolio_code" by the value of the local variable portfolio_code of the CSV file.

Table

Draws an HTML Table element.

Field to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset. The variables may have been previously declared in another command or may be declared for the first time here.

Row

Draws an HTML Row element.

Field to populate:

  • References to Init Optional: list of variable (separated by a forward slash) to reset. The variables may have been previously declared in another command or may be declared for the first time here.

Cell

Draws an HTML Cell element. Usually contains either a Node element, a Text element or a Table element (to draw complex tables).

Text

Displays hard-coded text: fixed text that does not depend on the values contained in the portfolio (for example column headers). Usually used in a Cell element.

Fields to populate:

  • Reference Optional: variable used in aggregates. If used, the variable records the value obtained by the attribute Text to Display.
  • Text to Display The text to display.

Node

Displays text mined from a portfolio element (for example the value entered by a user in the element). Usually used in a Cell element.

Fields to populate:

  • Reference Optional: variable used in aggregates. If used, the variable records the value obtained by the attribute To Display.
  • Node Type Type of the element to select (drop-down menu of available options).
  • Semantic Tag Semantic Tag of the element to select.
  • To Display Value of the selected node to display. Options are: node label, resource value, node code or value of Item element (drop-down menu of available options).

Aggregate

Displays the sum or average of the values contained in a variable. The variable has previously been declared in the References to Init attribute of an element and has collected the values of the elements where it is referenced (attribute Reference). Usually used in a Cell element.

Fields to populate:

  • Reference Optional: variable used in aggregates. If used, the variable records the value obtained by the aggregation.
  • Aggregation Type Sum or average (drop-down menu of available options).
  • Select Reference Name of the variable that contains the values to aggregate.

URL2Unit

Inserts in the table a hyperlink to a specified page of the portfolio. The portfolio must contain only one page with the specified semantic tag.

Field to populate:

  • Semantic Tag Semantic tag of the page the link must point to.

SVG

Initiates an SVG vector drawing. The available commands (see Draw Web Axis and Draw Web Line below) allow you to build star diagrams like the one shown here:

IMPORTANT NOTE
The Table element containing the SVG element must have the following instruction in the "Other CSS" field ("CCS" tab): "width:100%;".

Fields to populate:

  • min-width Minimum width (default 100%).
  • min-height Minimum height (default 500px).

Draw Web Title

Displays the title of the SVG drawing.

Fields to populate:

  • Title - Node Type Type of the element to select (drop-down menu of available options).
  • Title - Semantic Tag Semantic Tag of the element to select.
  • Title - To Display Value of the selected node to display as drawing title. Options are: node label, resource value, node code or value of Item element (drop-down menu of available options).

Draw Web Axis

Draws the axes of the star, with their labels.

Fields to populate:

  • Reference Optional: variable used in aggregates. If used, the variable records the value obtained by the attribute Axis - To Display.
  • Axis - Node Type Type of the element to select (drop-down menu of available options).
  • Axis - Semantic Tag Semantic Tag of the element to select.
  • Axis - To Display Value of the selected node to display as axis label. Options are: node label, resource value, node code or value of Item element (drop-down menu of available options).

Draw Web Line

Positions the values on the corresponding axes and traces a line between the values (to form the star). Also displays the SVG element's caption. Multiple Draw Web Line may be defined in the same SVG element. The stars will then lay over each other on the same axes.

Fields to populate to position the values on the axes:

  • Reference Optional: variable used in aggregates. If used, the variable records the value obtained by the attribute To Display.
  • Node Type Type of the element to select (drop-down menu of available options).
  • Semantic Tag Semantic Tag of the element to select.
  • To Display Value of the selected node to position on the axis. Options are: node label, resource value, node code or value of Item element (drop-down menu of available options).

Fields to populate to graduate the axes:

  • Min Value Starting value to graduate the axes.
  • Max Value Final value to graduate the axes.

Fields to populate to build the caption:

  • Legend - Node Type Type of the element to select (drop-down menu of available options).
  • Legend - Semantic Tag Semantic Tag of the element to select.
  • Legend - Afficher Valeur du noeud sélectionné à afficher dans la légende. Les options sont : libellé du noeud, valeur de la ressource, code du noeud ou valeur d'un élément Item (liste déroulante des choix possibles).
  • Legend - Position Integer specifying the relative position of the caption (default is 0, lowest position).

Show Sharing

Displays the users shared with a portfolio (with the role they are shared in). Usually used in a Cell element.

Go Parent

Backs up one level to the parent of the current node in the XML tree.

QR Code

Displays the QR Code for the BubbleMap element present in the portfolio. The BubbleMap element is identified automatically by Karuta (this only works if there is only one BubbleMap element in the portfolio).

Mise en forme

Édition