Using Admin Tool Commands

The following sections describe the available commands. For each command, the synopsis and the descriptions of the options and operands observe the following typographical conventions:

Anything else is literal text that you must include when running the command.

add association

Adds an Association object to the Registry.

Synopsis

add association -type association-type sourceURN targetURN 

Description

The add association command adds an Association object of the specified type to the Registry. You can use any of the following types:

Options

-type 
 

The type of the Association object.

Operands

sourceURN 
 

The URN of the source object.

targetURN

The URN of the target object.

Example

The following command (all on one line) creates a RelatedTo relationship between the objects with the two specified URNs.

admin> add association -type RelatedTo \ 
urn:uuid:ab80d8f7-3bea-4467-ad26-d04a40045446 \ 
urn:uuid:7a54bbca-2131-4a49-8ecc-e7b4ac86c4fd 

add user

Adds a user to the Registry.

Synopsis

add user [-edit] [-load file] [-firstName string] [-lastName 
string] [-middleName string] [-alias string] [-keypass string] 
[-post1.type string] [-post1.city string] [-post1.country 
string] [-post1.postalcode string] [-post1.stateOrProvince 
string] [-post1.street string] [-post1.streetNumber string] 
[-post2.type string] [-post2.city string] [-post2.country 
string] [-post2.postalcode string] [-post2.stateOrProvince 
string] [-post2.street string] [-post2.streetNumber string] 
[-post3.type string] [-post3.city string] [-post3.country 
string] [-post3.postalcode string] [-post3.stateOrProvince 
string] [-post3.street string] [-post3.streetNumber string] 
[-telephone1.type string] [-telephone1.areaCode string] 
[-telephone1.countryCode string] [-telephone1.extension 
string] [-telephone1.number string] [-telephone1.URL string] 
[-telephone2.type string] [-telephone2.areaCode string] 
[-telephone2.countryCode string] [-telephone2.extension 
string] [-telephone2.number string] [-telephone2.URL string] 
[-telephone3.type string] [-telephone3.areaCode string] 
[-telephone3.countryCode string] [-telephone3.extension 
string] [-telephone3.number string] [-telephone3.URL string] 
[-email1.type string] [-email1.address string] [-email2.type 
string] [-email2.address string] [-email3.type string] 
[-email3.address string] 

Description

The add user command adds a User object. A User object contains at least one PostalAddress, TelephoneNumber, and EmailAddress object. The information that you provide is checked for validity using the same criteria as when you add a new user using the Web Console or the JAXR API.

Specify the information about the user either on the command line itself or by using the -load option to specify a Java properties file with the information. The information options and the -load option are evaluated in the order they appear on the command line. For example, you can specify some properties on the command line, load others from a properties file, and then override information in the properties file with later command-line options.

Specify at least one postal address, telephone number, and email address for the new user. You can specify up to three of each type. If you need more, you can add them later using the Web Console or JAXR.

When you specify a postal address, telephone number, or email address, you must provide a value for its type: for example, -emailType OfficeEmail.

You can use shorthand options (such as -fn) on the command line for some of the common information that is required for every user, but you must use the longer form when providing the information in a properties file. For example, you can specify the user's first email address on the command line using either -email1.address, -emailAddress, or -email, but when you specify it in a properties file, you must use email1.address=. Because there is only one option for the user's second email address, you must use -email2.address on the command line and email2.address= in a properties file.

If you specify the -edit option, the Admin Tool launches an editor so that you can edit the new user's information. See the option description for details.

The properties files that you load with -load or edit with -edit use the IS0-8859-1 charset, as do all Java properties files. See the documentation for java.util.Properties.load(InputStream) for details on how to represent other characters not in ISO-8859-1 in properties files.

Options

-edit 
 

Causes the Admin Tool to launch an editor so that you can edit the new user's information. The tool launches the editor after evaluating the other command-line parameters, so editing starts with the result of evaluating any information specified on the command line or with a properties file. The editing program must terminate without error before the command can continue. (At the time of this writing, -edit currently works with emacsclient and the NetBeans command bin/runide.sh --open (but not very well), has not been shown to work with vi, and has not been tested on Windows.)

-load

Specifies a Java properties file whose contents specify properties for the user. The property names are the same as those of the long form of the add user command options (for example, lastName and post1.type).

-fn | -firstName

Specifies the first name of a user.

-ln | -lastName

Specifies the last name of a user. A last name is required; it must be specified either on the command line or in a properties file.

-mn | -middleName

Specifies the middle name of a user.

-alias

The alias to use when accessing the user's certificate in the keystore.

-keypass

The password to use when accessing a user's certificate in the keystore.

-postalType | -post1.type

The type of the first PostalAddress. The type is required; it must be specified either on the command line or in a properties file. It is an arbitrary string (for example, Office or Home).

-city | -post1.city

The city of the first PostalAddress.

-country | -post1.country

The country of the first PostalAddress.

-postalcode | -postcode | -zip | -post1.postalcode

The postal code of the first PostalAddress.

-stateOrProvince | -state | -province | -post1.stateOrProvince

The state or province of the first PostalAddress.

-street | -post1.street

The street name of the first PostalAddress. The street is required; it must be specified either on the command line or in a properties file.

-streetNumber | -number | -post1.streetNumber

The street number of the first PostalAddress.

-post2.type

The type of the second PostalAddress. If a second PostalAddress is specified, the type is required; it must be specified either on the command line or in a properties file. It is an arbitrary string (for example, Office or Home).

-post2.city

The city of the second PostalAddress.

-post2.country

The country of the second PostalAddress.

-post2.postalcode

The postal code of the second PostalAddress.

-post2.stateOrProvince

The state or province of the second PostalAddress.

-post2.street

The street name of the second PostalAddress. If a second PostalAddress is specified, the street is required; it must be specified either on the command line or in a properties file.

-post2.streetNumber

The street number of the second PostalAddress.

-post3.type

The type of the third PostalAddress. If a third PostalAddress is specified, the type is required; it must be specified either on the command line or in a properties file. It is an arbitrary string (for example, Office or Home).

-post3.city

The city of the third PostalAddress.

-post3.country

The country of the third PostalAddress.

-post3.postalcode

The postal code of the third PostalAddress.

-post3.stateOrProvince

The state or province of the third PostalAddress.

-post3.street

The street name of the third PostalAddress. If a third PostalAddress is specified, the street is required; it must be specified either on the command line or in a properties file.

-post3.streetNumber

The street number of the third PostalAddress.

-phoneType | -telephone1.type

The type of the first TelephoneNumber. The type is required; it must be specified either on the command line or in a properties file. It can have any of the following values: Beeper, FAX, HomePhone, MobilePhone, or OfficePhone.

-areaCode | -telephone1.areaCode

The area code of the first TelephoneNumber.

-countryCode | -telephone1.countryCode

The country code of the first TelephoneNumber.

-extension | -telephone1.extension

The extension of the first TelephoneNumber.

-number | -telephone1.number

The telephone number suffix, not including the country or area code, of the first TelephoneNumber. The number is required; it must be specified either on the command line or in a properties file.

-URL | -telephone1.URL

The URL of the first TelephoneNumber (the URL that can dial this number electronically).

-telephone2.type

The type of the second TelephoneNumber. If a second TelephoneNumber is specified, the type is required; it must be specified either on the command line or in a properties file. It can have any of the following values: Beeper, FAX, HomePhone, MobilePhone, or OfficePhone.

-telephone2.areaCode

The area code of the second TelephoneNumber.

-telephone2.countryCode

The country code of the second TelephoneNumber.

-telephone2.extension

The extension of the second TelephoneNumber.

-telephone2.number

The telephone number suffix, not including the country or area code, of the second TelephoneNumber. If a second TelephoneNumber is specified, the number is required; it must be specified either on the command line or in a properties file.

-telephone2.URL

The URL of the second TelephoneNumber (the URL that can dial this number electronically).

-telephone3.type

The type of the third TelephoneNumber. If a third TelephoneNumber is specified, the type is required; it must be specified either on the command line or in a properties file. It can have any of the following values: Beeper, FAX, HomePhone, MobilePhone, or OfficePhone.

-telephone3.areaCode

The area code of the third TelephoneNumber.

-telephone3.countryCode

The country code of the third TelephoneNumber.

-telephone3.extension

The extension of the third TelephoneNumber.

-telephone3.number

The telephone number suffix, not including the country or area code, of the third TelephoneNumber. If a third TelephoneNumber is specified, the number is required; it must be specified either on the command line or in a properties file.

-telephone3.URL

The URL of the third TelephoneNumber (the URL that can dial this number electronically).

-emailType | -email1.type

The type of the first EmailAddress. The type is required; it must be specified either on the command line or in a properties file. It can have either of the following values: HomeEmail or OfficeEmail.

-emailAddress | -email | -email1.address

The first email address. The first email address is required.

-email2.type

The type of the second EmailAddress. If a second EmailAddress is specified, the type is required; it must be specified either on the command line or in a properties file. It can have either of the following values: HomeEmail or OfficeEmail.

-email2.address

The second email address.

-email3.type

The type of the second EmailAddress. If a third EmailAddress is specified, the type is required; it must be specified either on the command line or in a properties file. It can have either of the following values: HomeEmail or OfficeEmail.

-email3.address

The third email address.

Examples

The following command loads the User properties from the file JaneSmith.properties in the user's home directory.

admin> add user -load ~/JaneSmith.properties 

The following command (all on one line) specifies the minimum properties required to create a User.

admin> add user -ln Smith -postaltype Office \
-street "Smith Street" -phonetype Office \
-number 333-3333 -emailtype OfficeEmail \
-emailaddress JaneSmith@JaneSmith.com 

cd

Changes the RegistryPackage location.

Synopsis

cd {locator | URN} 

Description

Change directory (metaphorically) to the RegistryPackage at the specified path or with the specified URN.

Change to a specified URN when there are multiple RegistryPackage objects with the same path (for the current locale).

Operands

locator 
 

The path of names of registry objects from the root of the repository to an object in the repository, with each name preceded by a forward slash (/).

For example, the locator for the userData RegistryPackage that is a member of the registry RegistryPackage (which is not itself a member of any RegistryPackage) is /registry/userData, and the locator for the folder1 RegistryPackage that is a member of the userData RegistryPackage is /registry/userData/folder1.

If you used the -root option to specify the RegistryPackage locator when you started the Admin Tool, the locator value is relative to that root.

URN

The URN of the RegistryPackage, which must be a URN starting with urn:.

Examples

The following command changes the directory to the RegistryPackage with the URN urn:uuid:92d3fd01-a929-4eba-a5b4-a3f036733017.

admin> cd urn:uuid:92d3fd01-a929-4eba-a5b4-a3f036733017 

The following command changes the directory to the location /registry/userData/myData.

admin> cd /registry/userData/myData 

chown

Changes the owner of a RegistryObject.

Synopsis

chown {URN | %index} 

Description

The chown command changes the ownership of the objects selected with a preceding select command to the user specified by either the URN or the reference to the user's URN when listed by a preceding users command.

Only a user with the role of administrator can execute this command successfully.

Operands

URN 
 

The User specified by the URN.

%index

A numerical reference to a URN for a user listed in a preceding users command.

Examples

The following command changes the ownership of the selected objects to the user specified by the URN urn:uuid:26aa17e6-d669-4775-bfe8-a3a484d3e079.

admin> chown urn:uuid:26aa17e6-d669-4775-bfe8-a3a484d3e079 

The following command changes the ownership of the selected objects to the user with the number 2 in a preceding users command.

admin> chown %2 

cp

Copies files and folders into the Registry.

Synopsis

cp [-owner {URN | %index}] [-exclude pattern]... pattern... 

Description

The cp command copies files and folders into the Registry as RegistryPackage and ExtrinsicObject objects, respectively.

The local directory on the local file system from which to copy files and folders defaults to the current directory from which you started the Admin Tool. You can use the -localdir option to change the local directory when you start the Admin Tool, or you can use the lcd command to change it after the Admin Tool has started. You can get the absolute path of the current local directory using the show localdir command.

The command is recursive. That is, if you specify a directory, the command copies all the files and folders under the directory.

Options

-owner 
 

Sets the owner of the copied registry objects to the user specified by the URN or %index argument. See the description of the chown command for a description of these arguments. You must have the role of administrator to specify an owner other than yourself.

-exclude

Copies all files except those whose names contain the specified pattern, where pattern is a pattern comprising literal characters and the special characters asterisk (*) (representing zero or more characters) and question mark (?) (representing one and only one character).

You can specify this option more than once.

Operands

pattern 
 

The files or folders to be copied, specified by a pattern comprising literal characters and the special characters asterisk (*) (representing zero or more characters) and question mark (?) (representing one and only one character). You can specify more than one pattern.

Examples

The following command copies the directory mydir to the Registry, to be owned by the user with the number 4 in a preceding users command.

admin> cp -owner %4 mydir 

The following command copies the directory mydir to the Registry, excluding files and directories that end with the string .z or .c.

admin> cp mydir -exclude \.z -exclude \.c 

echo

Echoes a string.

Synopsis

echo string 

Description

The echo command echoes the specified string to the output. It is most useful when you specify it in the -command option when you run the Admin Tool in batch mode.

Operand

string 
 

A sequence of characters.

Example

The following command prints the date and the result of the ls command into a log file.

registry-admin.sh -command "echo `date`; ls" > admin.log 

help

Displays information about commands.

Synopsis

help [command_name] 

Description

The help command displays information about the available commands or a specified command.

For commands with subcommands, such as add and show, the help command displays information about the subcommands.

If you do not specify an argument, the help command displays usage information for all commands.

Operand

command_name 
 

The name of an Admin Tool command.

Examples

The following command displays usage information for all commands.

admin> help 

The following command displays usage information for the lcd command.

admin> help lcd 

The following command displays usage information for the add subcommands.

admin> help add 

lcd

Changes the current directory on the local file system.

Synopsis

lcd [path_name] 

Description

The lcd command changes the current local directory on the local file system.

If you do not specify an argument, the lcd command changes the current directory to your default home directory.

Operand

path_name 
 

A directory name, which may be absolute or relative.

Examples

The following command changes the current local directory to the /usr/share directory.

admin> cd /usr/share 

The following command changes the current local directory to your default home directory on the local file system.

admin> lcd 

ls

Lists the objects in the current RegistryPackage.

Synopsis

ls [{pattern | URN}...] 

Description

The ls command lists the objects in the current RegistryPackage or, when a pattern or URN is provided, list the objects in the current RegistryPackage whose names (in the current locale) or unique identifiers match pattern or URN.

Operands

pattern 
 

A pattern comprising literal characters and the special characters asterisk (*) (representing zero or more characters) and question mark (?) (representing one and only one character). You can specify more than one pattern.

URN

A URN starting with urn:, for example, urn:uuid:4a6741e7-4be1-4cfb-960a-e5520356c4fd. You can specify more than one URN.

Examples

The following command lists all the objects in the current RegistryPackage.

admin> ls 

The following command lists all the objects whose name matches the pattern urn:bird:poultry:chicken or whose ID is urn:bird:poultry:chicken.

admin> ls urn:bird:poultry:chicken  

The following command lists all the objects whose name matches the pattern *bird*. (It would also list the objects whose ID is *bird*, if *bird* were a valid ID.)

admin> ls *bird*  

The following command lists all the objects whose name matches the pattern *bird* or whose name matches the pattern urn:bird:poultry:chicken or whose ID is urn:bird:poultry:chicken.

admin> ls *bird* urn:bird:poultry:chicken 

pwd

Displays the path to the current RegistryPackage.

Synopsis

pwd 

Description

The pwd command displays the path (or paths) to the current RegistryPackage using the best-matching names for the current locale. Also displays the locale for the path.

Example

admin> pwd
(en_US) /registry/userData 

quit

Exits the Admin Tool.

Synopsis

quit 

Description

The quit command exits the Admin Tool.

Example

admin> quit 

rm

Removes objects from a RegistryPackage.

Synopsis

rm [-d] [-r] {pattern | URN}... 

Description

The rm command removes the member objects of the current RegistryPackage whose names (in the current locale) match the patterns specified by a pattern or URN.

When a matching RegistryObject is a member of multiple RegistryPackage objects, this command removes only the association between the current RegistryPackage and the object. The object is removed from the Registry only when the removal of the association leaves the object with no association with any other RegistryObject.

When a matching member object is itself a RegistryPackage that contains other objects, neither the object nor the association between the current RegistryPackage and the member RegistryPackage is removed unless either the -r or the -d option is specified.

When both the -d and -r options are specified, the -d option is applied recursively, so all objects that would be selected by -r (and their associations) are removed whether or not they have other associations.

Options

-d 
 

Removes the association between the current RegistryPackage and the specified RegistryPackage. Removes the specified RegistryPackage only if its only remaining associations are to its member objects. Member objects of the now-removed RegistryPackage that are not anchored by being the target of other HasMember associations are now accessible as members of the root of the Registry.

-r

Removes the specified RegistryPackage object and all its descendant objects (except when an object has other associations).

Operands

pattern 
 

A pattern comprising literal characters and the special characters asterisk (*) (representing zero or more characters) and question mark (?) (representing one and only one character). You can specify more than one pattern.

URN

A URN starting with urn:, for example, urn:uuid:4a6741e7-4be1-4cfb-960a-e5520356c4fd. You can specify more than one URN.

Examples

The following command removes all RegistryPackage objects containing the string "stat" and all their descendants.

admin> rm -r *stat* 

select

Executes an SQL select statement.

Synopsis

select [SQL] 

Description

The select command selects and lists the objects specified by evaluating the entire command as an SQL query. If no argument is specified, the command lists any objects selected by a preceding select command.

Operand

SQL 
 

An SQL select statement (without the leading select because that is already present as the name of the command).

Examples

The following command lists all ClassificationScheme objects in the Registry:

admin> select s.* from ClassificationScheme s 

set

Sets a property value.

Synopsis

set property value 

Description

The set command sets the value of a property of the Admin Tool shell.

The tool supports the following properties and values.

set debug {true | on | yes | false | off | no} 
 

Enables or disables output of debugging messages.

set editor string

Sets the command to use when the Admin Tool launches an interactive editor. The default value is /bin/vi on UNIX and Linux systems, and is notepad.exe on Windows systems.

set verbose {true | on | yes | false | off | no}

Enables or disables output of more verbose messages when executing commands.

Operands

property 
 

One of the following properties: debug, editor, verbose.

value

A supported value of the specified property. See the Description section for details.

Examples

The following command sets the editor to /usr/bin/vi instead of the default /bin/vi.

admin> set editor /usr/bin/vi 

show

Displays a property value.

Synopsis

show [property] 

Description

The show command displays the value of a property of the Admin Tool shell.

If no argument is specified, the command displays the values of all properties.

The command supports the following properties:

debug 
 

Whether or not debugging output is enabled.

editor

The editor to use when the Admin Tool launches an interactive editor.

exception

The exception stack trace, if any, from the immediately preceding executed command.

locale

The current locale.

verbose

Whether or not verbose output is enabled.

Operands

property 
 

The property whose current value is to be displayed. The properties exception and locale can be displayed, but you cannot use the set command to set them.

Example

The following command displays the exceptions from the previous command.

admin> show exception 

users

Lists the current User objects.

Synopsis

users 

Description

The users command lists the User objects currently in the Registry.

The output has the following format:

%index: URN lastname, firstname 

In the output, the index is a numeric value that you can use, including the percent sign (%), to refer to a user when you run the chown or cp command. The lastname and firstname are the first and last names of the user.

Examples

The following command displays the current users:

admin> users
%0:  urn:uuid:2702f889-3ced-4d49-82d1-e4cd846cb9e4  user, test 
%1:  urn:uuid:85428d8e-1bd5-473b-a8c8-b9d595f82728  Parker, Miles 
%2:  urn:uuid:921284f0-bbed-4a4c-9342-ecaf0625f9d7  Operator, Registry 
%3:  urn:uuid:977d9380-00e2-4ce8-9cdc-d8bf6a4157be  Brown, Arthur
%4:  urn:uuid:abfa78d5-605e-4dbc-b9ee-a42e99d5f7cf  Guest, Registry