=========================
= Generic External Tool =
=========================

This default external tool provides a basic framework for creating users, groups, roles, profiles and projects.

In order to create an external tool based on this Generic tool, you need to create 4 files:

- config.tcl (optional) allows to override default options
- form.xml, with a baseName="Generic" attribute
- form_en.properties, where you externalise the strings displayed in the user interface (and optionally a form_fr.properties file where you translate those strings)
- execute.tcl, where you get the variables defined in form.xml and config.tcl and run your script

==============
= config.tcl =
==============
The contents of this file overrides default values, for the variable jar, commands and url:

set jar "$squore_home/client/squore-engine.jar"
set commands "DELEGATE_CREATION"
set url "http://[server]:[port]/SQuORE_Server" #dynamically obtained from the server installation

If the above default values are OK, you do not need a config.tcl file.

============
= form.xml =
============
This file is like any other form.xml, but will have to contain the credential part if the create_project pro is called.

===============
= execute.tcl =
===============

This file is normal tcl file. The following proc are predefined:

* read_err msg: sends a message to the log flagged as an error
* read_out msg: sends a message to the log flagged as an info
* create_project args: creates a project.
	The following arguments are automatically set and should not be passed to create_projet:
		-Dsquore.home.dir
		-jar
		--url
		--commands
		--login
		--password
	The proc returns 1 in case of success and 0 otherwise.
* create_group name ?profiles?
* create_user [-name user_name] [-mail email] [-locale locale] login password ?groups? ?profiles?
* create_profile name
* create_role name
* add_permission name target action

==================
= Example Script =
==================

# set "demo" as password
set pwd {ieSV55Qc+eQOaYDRSha/AjzNTJE=}

create_user -name {Augustus Hill} -mail augustus.hill@domain.com -locale en augustus $pwd [list admin users]

create_role HEAD_OF_DEPARTMENT

add_permission HEAD_OF_DEPARTMENT PROJECTS VIEW
add_permission HEAD_OF_DEPARTMENT PROJECTS MANAGE
add_permission HEAD_OF_DEPARTMENT PROJECTS BASELINE
add_permission HEAD_OF_DEPARTMENT PROJECTS VIEW_DRAFTS
add_permission HEAD_OF_DEPARTMENT ACTION_ITEMS MODIFY
add_permission HEAD_OF_DEPARTMENT ATTRIBUTES MODIFY
add_permission HEAD_OF_DEPARTMENT SOURCE_CODE VIEW
add_permission HEAD_OF_DEPARTMENT ARTEFACTS MODIFY

create_project --name=Earth --wizardId=RISK  -r type=FROMPATH,path=$squore_home/samples/c/Earth/V1 --teamUser=augustus,HEAD_OF_DEPARTMENT