Batch

How It Works

Set of script commands allowing you to automate the creation, modification and deletion of portfolios, as well as creation or deletion of user accounts.

Using one or more portfolio models, a batch script and a CSV file, Karuta creates the user accounts and their portfolios. The CSV file contains the data for each user account to be created. The batch script contains each step to execute: create the user account, create one or more portfolios from the portfolio models, share the new portfolios with the user accounts in specified roles, update user data in the portfolios, etc.

Batch Script Example

This script corresponds to the following alogorith:

For each line of the CSV file:

CSV File Example

The CSV file contains the information needed to execute the batch script.

CSV file format:

The Commands

Execution command:

User account commands:

Portfolio commands:

Portfolio group commands:

User group commands:

Commands to add an element to a portfolio:

Commands to update the value of a portfolio element:

Metadata update commands:

ForEachLine

ForEachLine is a loop. It is generally the starting point of a batch script. The commands inside the ForEachLine element are executed for each line of the CSV file (lines 4+).

CreatePerson

Create a user account. Don't forget to replace the default local variable names by your own (line 3 of your CSV file).

Fields to populate:

  • Identifier Unique identifier for the user. Will be used as login to Karuta. (For example student ID number or email.)
  • First Name User's first name.
  • Last Name User's last name.
  • Email User's email.
  • Password Password for the user in Karuta.
  • Creator? Does the user account being created need Karuta Designer rights? (Usually, no!)

DeletePerson

Delete a user account. (Important note: deleting a user does NOT delete their portfolios!)

Fields to populate:

  • Identifier Unique identifier of the user account to delete (the login). Add a select element to draw the identifier from a global or local variable in your CSV file, or a value element to specify the identifier directly.

JoinUserGroup

Add a user to a user group.

Fields to populate:

  • Person User identifier (the login). Add a select element to draw the identifier from a global or local variable in your CSV file, or a value element to specify the identifier directly.
  • UserGroup User group name (example: teachers2017). Add a select element to draw the name from a global or local variable in your CSV file, or a value element to specify the name directly.

LeaveUserGroup

Remove a user from a user group.

Fields to populate:

  • Person User identifier (the login). Add a select element to draw the identifier from a global or local variable in your CSV file, or a value element to specify the identifier directly.
  • UserGroup Name of the user group (example: teachers2017). Add a select element to draw the name from a global or local variable in your CSV file, or a value element to specify the name directly.

CreateTree

Create a portfolio instance from a portfolio model.

Fields to populate:

  • ID Assign an ID which will be used in subsequent commands to reference this portfolio (for example to share the new portfolio with a user).
  • Model Code of the portfolio model to instanciate. Format: project code.portfolio model code. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.
  • Code Code of the portfolio to be created. Format: project code.portfolio code. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.
  • Label Label of the portfolio to be created. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

ShareTree

Share a portfolio with a user account in a specified role.

Fields to populate:

  • Tree Select Select the ID of the portfolio to be shared. The ID has previously been assigned either in a CreateTree command or in a SelectTree command.
  • Person User identifier (the login). Add a select element to draw the identifier from a global or local variable in your CSV file, or a value element to specify the identifier directly.
  • Role User's role in the portfolio (example: student). Add a select element to draw the role from a global or local variable in your CSV file, or a value element to specify the role directly.

SelectTree

Select a portfolio to be able to reference it in subsequent commands.

Fields to populate:

  • ID Assign an ID which will be used in subsequent commands to reference this portfolio.
  • Code Code of the portfolio to select. Format: project code.portfolio code. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

DeleteTree

Delete a portfolio.

Fields to populate:

  • Code Code of the portfolio to delete. Format: project code.portfolio code. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

JoinPortfolioGroup

Add a portfolio to a portfolio group.

Fields to populate:

  • Tree Select Select the ID of the portfolio to be shared. The ID has previously been assigned either in a CreateTree command or in a SelectTree command.
  • PortfolioGroup Name of the portfolio group (example: geography2017). Add a select element to draw the name from a global or local variable in your CSV file, or a value element to specify the name directly.

ShareUserGroup

Share a portfolio with a user group in a specified role.

Fields to populate:

  • Tree Select Select the ID of the portfolio to be shared. The ID has previously been assigned either in a CreateTree command or in a SelectTree command.
  • UserGroup Name of the user group (example: teachers2017). Add a select element to draw the name from a global or local variable in your CSV file, or a value element to specify the name directly.
  • Role Role of the users in the portfolio. Add a select element to draw the role from a global or local variable in your CSV file, or a value element to specify the role directly.

UnshareUserGroup

Unshare a portfolio from a user group in a specified role.

Fields to populate:

  • Tree Select Select the ID of the portfolio to be shared. The ID has previously been assigned either in a CreateTree command or in a SelectTree command.
  • UserGroup Name of the user group (example: teachers2017). Add a select element to draw the name from a global or local variable in your CSV file, or a value element to specify the name directly.
  • Role Role of the users in the portfolio. Add a select element to draw the role from a global or local variable in your CSV file, or a value element to specify the role directly.

ImportNode

Import an element in a portfolio.

Fields to populate:

  • Destination Select Structural element where to import the node (parent of the new node). Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the structural element where to import the node.
  • Source select Element to import into the portfolio. Format: portfolio code.semantic tag.

MoveUp

Move an element up by one position in the XML tree.

Fields to populate:

  • Select Node to move. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to move.

UpdateField

Update a Short Text resource in a portfolio instance.

Fields to populate:

  • Select Resource to update. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the resource element to be updated in the portfolio.
  • Field Value Value to update to. Add a select element to draw the value from a global or local variable in your CSV file (example: studentName), or a value element to specify the value directly.

UpdateProxy

Update the target of a Proxy element.

Fields to populate:

  • Proxy Select Proxy resource to update. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the Proxy element to update.
  • Source Select Target node the Proxy element should point to. Format: portfolio code.semantic tag. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateDashboard

Update the code of the portfolio that contains the report script in a Dashboard element.

Fields to populate:

  • Select Dashboard resource to update. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the Dashboard resource element to be updated in the portfolio.
  • Dashboard Code The code of the portfolio that contains the report script. Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateTreeRoot

Update a portfolio's code and label.

Fields to populate:

  • Old Code Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.
  • New Code Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.
  • Label Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateNodeResource

Update any resource in a portfolio instance.

Fields to populate:

  • Select The resource to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Code Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.
  • Label Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateMetadataQuery

Update the Query metadata of an element.

Fields to populate:

  • Select The element to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Query Value Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateMetadataMenu

Update the Menu attribute of an element.

Fields to populate:

  • Select The element to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Menu Value Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateMetadataInline

Update the Inline Editing attribute of an element.

Fields to populate:

  • Select The element to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Inline Value (Y/N) Add a select element to draw the value from a global or local variable in your CSV file, or a value element to specify the value directly.

UpdateMetadata

This command is more general than the previous ones and allows you to update any metadata attribute of an element.

Fields to populate:

  • Select The element to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Attribute Name of the attribute to be updated.
  • Attribute Value Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.

UpdateMetadataWad

This command is more general than the previous ones and allows you to update any metadataWad attribute of an element.

Fields to populate:

  • Select The element to be updated. Format: ID.semantic tag. The ID has previously been assigned either in a CreateTree command or in a SelectTree command, and the semantic tag is that of the element to update.
  • Attribute Name of the attribute to be updated.
  • Attribute Value Add select elements for global or local variables in your CSV file, and/or value elements to specify values directly.