Chapter 1. Context management

Table of Contents

1.1 createcontext
1.1.1 Parameters
1.1.2 Extra parameters when authentication is enabled
1.1.3 Return value
1.1.4 Mandatory parameters
1.1.5 Command output
1.1.6 Example
1.2 deletecontext
1.2.1 Parameters
1.2.2 Extra parameters when authentication is enabled
1.2.3 Return value
1.2.4 Mandatory parameters
1.2.5 Command output
1.2.6 Example
1.3 listcontext
1.3.1 Parameters
1.3.2 Extra parameters when authentication is enabled
1.3.3 Return value
1.3.4 Mandatory parameters
1.3.5 Command output
1.3.6 Example
1.4 disablecontext
1.4.1 Parameters
1.4.2 Extra parameters when authentication is enabled
1.4.3 Return value
1.4.4 Mandatory parameters
1.4.5 Command output
1.4.6 Example
1.5 disableallcontexts
1.5.1 Parameters
1.5.2 Extra parameters when authentication is enabled
1.5.3 Return value
1.5.4 Mandatory parameters
1.5.5 Command output
1.5.6 Example
1.6 enablecontext
1.6.1 Parameters
1.6.2 Extra parameters when authentication is enabled
1.6.3 Return value
1.6.4 Mandatory parameters
1.6.5 Command output
1.6.6 Example
1.7 enableallcontexts
1.7.1 Parameters
1.7.2 Extra parameters when authentication is enabled
1.7.3 Return value
1.7.4 Mandatory parameters
1.7.5 Command output
1.7.6 Example
1.8 changecontext
1.8.1 Parameters
1.8.2 Extra parameters when authentication is enabled
1.8.3 Return value
1.8.4 Mandatory parameters
1.8.5 Command output
1.8.6 Example
1.9 getAdminId
1.10 existscontext
1.10.1 Parameters
1.10.2 Return value
1.10.3 Mandatory parameters
1.10.4 Command output
1.10.5 Example

The CLT for createcontext and changecontext contain dynamic attribute setters. A dynamic attribute consists of a namespace, a name and a value. Attributes have to be specified in the form --namespace/name=value or, for removal --remove-namespace/name. For example:

	createcontext -i [someid] -A ... -P ... ... 
	--com.openexchange.some.feature/someAttr=someValue

or

createcontext -i [someid] -A ... -P ... ... 
--remove-com.openexchange.some.feature/someAttr 

1.1. createcontext

createcontext is the tool to create new contexts. A context is an independent instance within the createcontext Open-Xchange system and holds users, groups and resources and all their objects. Data from one context is not visible to other contexts. Module access (calendar, tasks, email) can be set via predefined "access combination names". These names can be configured on the server side. All users which are created during later use of the "createuser" tool will inherit the module access rights from the context. If you do not specify any access rights on createcontext minimal access rights will be granted. Currently, these are Webmail and Contacts access rights.

1.1.1. Parameters

-h,--helpPrints a help text
--environmentShow info about commandline environment
--nonlRemove all newlines (\n) from output
-c,--contextid <integer>The id of the context, when starting with 0, 0 is deleted
-q,--quota <integer>Context wide filestore quota in MB
-u,--username <string>Username for the new context admin user
-d,--displayname <string>Displayname for the new context admin user
-g,--givenname <string>Given name for the new context admin user
-s,--surname <string>Surname/last name for the new context Admin user
-p,--password <string>Password for the new context Admin user
-e,--email <string>Primary E-Mail address for the new context Admin user
-l,--lang <lang>Language for the new context Admin user
-t,--timezone <timezone>Timezone for the new context Amin user
-N,--contextname <string>Context name
-L,--addmapping <string>Add login mappings separated by ","
--access-combination-name <access-combination-name>Access combination name
--access-denied-portal <on/off>Denies portal access (Default is off)
--csv-import <CSV file> Full path to CSV file with user data to import. This option makes mandatory options obsolete, except credential options (if needed).

1.1.1.1. --csv-import <CSV file>

Full path to CSV file with user data to import. This option makes mandatory command line options obsolete, except credential options (if needed). But they have to be set in the CSV file.

With this option you can specify a csv file (a full pathname must be given) with the data which should be imported. The columnnames in the CSV file must be the same as the long-options of the command line tools, without the prefix "--".

This option will normally be used to fill new large installations with the new data. So instead of calling the command line tools in a shell script every time, just a csv file needs to be created, containing the whole data.

Note that the credentials of the masteradmin in the createcontext call must be given on the command line with the -A and -P options nevertheless - if authentication is enabled. If the createuser command line tool is used, the credentials are part of the csv file, and cannot be set as options on the command line itself. The reason for this different behavior is that different contexts have different credentials for the admin user, so they must be set in every line of the csv file. Opposed to this the credentials of the masteradmin are always the same.

1.1.2. Extra parameters when authentication is enabled

-A,--adminuser <string>Master Admin user name
-P,--adminpass <string>Master Admin password

1.1.3. Return value

0 on success

>0 on failure

1.1.4. Mandatory parameters

contextid {adminuser adminpass} quota username displayname givenname surname password email

1.1.5. Command output

On success:

context <contextid> created

On failure:

context <contextid> could not be created: <reason from server>

1.1.6. Example

root@oxhe~# /opt/open-xchange/sbin/createcontext -c 123 -q 1000 -N CompanyA -u "admin" -d "Admin of CompanyA" -g John -s Example -p newpw -e john@example.com

context 123 created