Scripting

Scripting is used by Actors , in Concept permissions and in Visual elements . The main goal is to provide an advanced way to check permissions, roles, social groups and entity related attributes.

User functions

Methods related to currently authenticated user. The scripting context initializes the variable user.

Function

Description

user.isAdmin(), user.isWorker(), user.isStudent(), user.isHhrr(), user.isResponsible(), user.isInNetworking(), user.isInternal(), user.isCompany(), user.isCenter()

True or false indicating user different statuses.

user.getBusiness()

User preferred business. Accepts the same functions as user.

user.getProfileMap().isInRole(role)

True or false if user conform the syntaxis specified in Security .

user.isActor(actor)

True or false if user is actor.

user.isActor(entity, actor)

True or false if user is actor for the given entity.

Helping functions

Function

Description

pfunc.isUser()

True or false if there is an authenticated user.

pfunc.anyOfSyndications(user, csvSyndications)

True or false if user is assigned to any of the comma separated list of syndications. See Social groups .

pfunc.anyOfGroupings(user, csvGroupings)

True or false if user is assigned to any of the comma separated list of groupings.

Per module functions

Per module attributes address those features unique to the entities in this module. Per module attributes sum to the generic attributes.

Issue, Dossier and Category

Dossier context initializes the variables dpl and issue, dossier or category. Notice that when applying constraints that uniquely refer to a project, the dossier must be of type project.

Function

Description

dossier.isDirectOwner(user), category.isDirectOwner(user)

True or false value indicating whether the user is directly assigned as owner.

dpl.isParticipant(user), dpl.isShowAllAttachments(user), dpl.isShowParticipants(user), dpl.isShowAllIssues(user),
dpl.isReceiveAllEmails(user), dpl.isBindingVote(user), dpl.isDriver(user), dpl.isCoordinator(user), dpl.isBeneficiary(user), dpl.isOfferer(user), dpl.isResearch(user), dpl.isFunding(user), dpl.isSupport(user), dpl.isConsortium(user), dpl.isAdmin(user)

True or false indicating the dossier/category participation attribute with the same name.

dpl.isOwner(user), dpl.isSubject(user)

True or false indicating the dossier/category participation attribute with the same name.

dpl.isResporter(user), dpl.isResponsible(user), dpl.isQA(user), dpl.isAssistant(user)

True or false indicating the issue participation attribute with the same name.

Helping functions

Function

Description

dfunc.anyParticipation(Object user)

True or false if the given user participates in any dossier or category.

dfunc.anyOfCategories(dossier, csvCategories)

True or false if issue, dossier or category is in any of the comma separated list of category IDs.

dfunc.anyOfPhases(dossier, csvIndexes)

True or false if issue's dossier or dossier is in any of the comma separated list of phase indexes.

dfunc.anyOfPhaseTypes(dossier, csvTypes)

True or false if issue's dossier or dossier is in any of the comma separated list of phase types, being those CREATION, INCUBATOR, VOTES, DECISION, PROPOSALS, EXECUTION and ARCHIVE.

dfunc.anyOfRoles(dpl, user, csvRoles)

True or false if user is assigned to any of the comma separated list of roles, being those PARTICIPANT_OWNER, PARTICIPANT_ASSISTANT and PARTICIPANT_SUBJECT.

dfunc.anyOfExtRoles(dpl, user, csvRoles)

True or false if user is assigned to any of the comma separated list of roles, being those showAllAttachments, showParticipants, showAllIssues, receiveAllEmails, bindingVote, driver, coordinator, beneficiary, offerer, research, funding, support, consortium, admin.

dfunc.anyOfDiscriminators(dpl, user, csvDiscriminators)

True or false if user is assigned to any of the comma separated list of discriminators.

dfunc.anyOfRoles(user, csvRoles)

True or false if user is assigned to any of the comma separated list of roles in any dossier or category, being those PARTICIPANT_OWNER, PARTICIPANT_ASSISTANT and PARTICIPANT_SUBJECT.

dfunc.anyOfExtRoles(user, csvRoles)

True or false if user is assigned to any of the comma separated list of roles in any dossier or category, being those showAllAttachments, showParticipants, showAllIssues, receiveAllEmails, bindingVote, driver, coordinator, beneficiary, offerer, research, funding, support, consortium, admin.

Script files

It is possible to use scripting files with the directive file:file_name. Scripting files are located in /WEB-INF/elephant/scripts.

Combining directives

When using file with other directives, like debug, they must be placed in the script file.

Debugging

Scripts generate no logs with errors. Starting the script with debug: indicates the Scripting API to write any error in the log file.

Printer version
English11/21/21 16:46Lluís Turró Cutiller
English12/01/21 13:46Lluís Turró Cutiller
English12/06/21 16:50Lluís Turró Cutiller
English05/12/22 00:37Lluís Turró Cutiller
English06/10/22 11:24Lluís Turró Cutiller
English06/14/22 14:59Lluís Turró Cutiller
English06/25/22 07:24Lluís Turró Cutiller
English07/05/22 07:23Lluís Turró Cutiller