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+).
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.
This script corresponds to the following alogorith:
For each line of the CSV file:
The CSV file contains the information needed to execute the batch script.
CSV file format:
Line 1 Names of the global variables. Global variables are the variables that have
the same value for each user to be created (for example, the codes of the model portfolios to be
instanciated, a program code or a semester). In the batch script, references to global variables
must be prefixed by //.
model_code is a reserved word: it is the code of the portfolio that contains the batch
script to be executed.
Line 2 Values of the global variables. In the exemple above, the value of
model_code is createStudents: it is the code of the portfolio that
contains the batch script.
Line 3 Names of the local variables. Local variables are the variables that have
different values for each user to be created (for example, the student's name, email, etc).
Lines 4+ Values of the local variables, usually one user per line.
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 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+).
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!)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.