The following sections describe the scripting language for the Mobile Server. You can use scripting to perform batch processing tasks that are performed frequently by the administrator. You can write scripts for the Mobile Server in an INI text file and use the WSH
tool to run your INI script.
The following sections describe the parameters and syntax available in the scripting language:
Using the following syntax, you can create users to be included in a group.
[USER] NAME=<User Name> PASSWORD=<User Password> ENCRYPTED=<True or False; True if the password is encrypted, False if not> FULLNAME=<User Full Name> PRIVILEGE=<User privilege level as P, C, S, or null>
There are four options for setting the PRIVILEGE
value for users. They are:
P
- Publishing an application
C
- Connecting to Web-to-Go
S
- Manage Web-to-Go
Null
- No privileges
Using the [GROUP]
script, you can create a new group (if this group does not already exist) and add listed users to the group. If you use this entry and specify the name of a group that exists, all the users in the existing group will be removed and users who are listed will be added to this group.
The following syntax enables you to create a group.
[GROUP] NAME=<Group Name> USER=<User name you want to add to this group> USER=<User name you want to add to this group> USER=<User name you want to add to this group>
Using the [ADDUSERTOGROUP]
script, you can create a new group (if this group does not already exist) and add listed users to this group. You can also use this entry to add users to an existing group.
[ADDUSERTOGROUP] NAME=<Group Name> USER=<User name you want to add to this group> USER=<User name you want to add to this group>
Using the [REMOVEUSERFROMGROUP]
script, you can remove listed users from a specified group.
NAME=<Group Name> USER=<User name you want to remove from this group> USER=<User name you want to remove from this group>
Using the [ACL]
script, you can create a new ACL (if this ACL does not already exist). After creating the ACL, all the existing users will be removed and all the listed users will be added to this ACL.
Using the [GRANTACCESS]
script, you can add users to the existing ACL.
The following syntax enables you to create access privileges for users and groups.
[ACL]APPLICATION=<Name of the application you want to creat ACL for> ROLE=<Role of the user; set the value as DEFAULT ROLE or ADMINISTRATIVE ROLE> USER=<User's name> ACCESS=<Set access status as ENABLED> ROLE=<Role of the user> USER=<User name> ACCESS=<Set access status as ENABLED> ROLE=<Role of the group> GROUP=<Groups name> ACCESS=<Set access status as ENABLED>
Using the [GRANTACCESS]
script, you can create a new ACL (if this ACL does not already exist) and add listed users to this ACL.
[GRANTACCESS] APPLICATION=<Name of the application you want to add ACL for> ROLE=<Role of the user> USER=<User name> ACCESS=<Access Status ENABLED/DISABLED> ROLE=<Role of the group> GROUP=<Group name>
Using the [REVOKEACCESS]
script, you can remove users that are listed in the specified ACL.
[REVOKEACCESS] APPLICATION=<Name of the application you want to revoke ACL for> ROLE=<Role of the user> USER=<User name> ACCESS=<Access Status> ROLE=<Role of the group> GROUP=<Groups name>
Using the [REGISTRY]
script, you can create registries.
[REGISTRY] APPLICATION=<Name of the application> NAME=<Registry Variable Name> VALUE=<Value for this variable>
Using the [SNAPSHOTVAR]
script, you can create snapshot variables.
[SNAPSHOTVAR] NAME=<Name of the publication item> PLATFORM=<Platform for which this publication item is> VIRTUALPATH=<Virtual path of the application this publication item belongs to> USER=<Name of the user who subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter> USER=<Name of the user who subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter> GROUP=<Name of the group which subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter>
Using the [DROPUSER]
script, you can delete a user.
[DROPUSER] NAME=<User Name>
Using the [DROPGROUP]
script, you can delete a group.
[DROPGROUP] NAME=<Group Name>
Using the [DROPACL]
script, you can delete access privileges provided to users.
[DROPACL] APPLICATION=<Name of the application you want to delete ACL for> ROLE=<Role of the user; set the value as DEFAULT ROLE or ADMINISTRATIVE ROLE> USER=<User name> ACCESS=<Set access status as DISABLED> ROLE=<Role of the group; set the value as DEFAULT ROLE or ADMINISTRATIVE ROLE> GROUP=<Groups name> ACCESS=<Set access status as DISABLED>
Using the [DROPREGISTRY]
script, you can delete a registry.
[DROPREGISTRY] APPLICATION=<Name of the application> NAME=<Registry Variable Name> VALUE=<Value for this variable>
Using the following [DROPSNAPSHOTVAR]
script, you can delete snapshot variables.
[DROPSNAPSHOTVAR] NAME=<Name of the publication item> PLATFORM=<Platform for which this publication item is> VIRTUALPATH=<Virtual path of the application this publication item belongs to> USER=<Name of the user who subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter> USER=<Name of the user who subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter> GROUP=<Name of the group which subscribes to this application> VAR=<Name of the Data Subsetting parameter, value of this parameter>
To run a script INI file using the WSH
tool, use the following command:
WSH -c <filename.ini> mobileadmin/manager@webtogo.world
The following sections enable you to accomplish the following tasks and describes examples from a script file in INI format:
The following examples illustrate how to create users, groups, registries, access privileges, snapshotvar template variables, add users to a group, and add users to an ACL.
[DATABASE] TYPE=ORACLE #Creation or modification of users, groups, access privileges, registry, and snapshot variable entries using the following entries in the INI file: #[USER], [GROUP], [ACL], [REGISTRY],[SNAPSHOTVAR]. # Create user JOHN # [USER] NAME=JOHN PASSWORD=john ENCRYPTED=false FULLNAME=Sample1 User John PRIVILEGE=C # # Create group 'Sample Users' contaning JANE, JOHN, JACK # [GROUP] NAME=Sample Users USER=JANE USER=JOHN USER=JACK # # Set the ACL on the Sample3 application. # The following gives John, Jane, and Jack, plus all the users in the group # Sample Users access to the application # [ACL] APPLICATION=/sample3 ROLE=Default Role USER=JOHN ACCESS=ENABLED ROLE=Default Role USER=JANE ACCESS=ENABLED ROLE=Default Role USER=JACK ACCESS=ENABLED ROLE=Default Role GROUP=Sample Users ACCESS=ENABLED # # Add registry entry for user JOHN and a default value for the Sample3 application to the Web-to-go Repository # [REGISTRY] APPLICATION=/sample3 USER=JOHN NAME=USERCODE VALUE=1111 # # Add template variables. # You can specify user/group specific values for these variables # [SNAPSHOTVAR] NAME=RECORDINGS PLATFORM=WIN32 VIRTUALPATH=/sample3 USER=JOHN VAR=CODE, 1111 USER=JACK VAR=CODE, 1111 USER=JANE VAR=CODE, 2222 GROUP=Sample Users VAR=CODE, 2222 # #Add users to a group. # [ADDUSERTOGROUP] NAME=Sample Users USER=USER1 USER=USER2 # #Grant Access to users. # [GRANTACCESS] APPLICATION=/sample3 ROLE=Default Role USER=USER1 ACCESS=ENABLED ROLE=Default Role USER=USER2 ACCESS=ENABLED ROLE=Default Role GROUP=Sample Users
The following examples illustrate how to delete a user, group, registry and snapshotvar, remove users from a group, and revoke access.
#Deletion of users, groups, access privileges, registry and snapshot #variable entries using the following entries in the INI file: #[DROPUSER], [DROPGROUP], [DROPACL], [DROPREGISTRY],[DROPSNAPSHOTVAR]. # # Dropuser JOHN # [DROPUSER] NAME=JOHN # # Drop group 'Sample Users' # [DROPGROUP] NAME=Sample Users # # Drop the ACL on the sample3 application. # [DROPACL] APPLICATION=/sample3 ROLE=Default Role USER=JOHN ACCESS=DISABLED ROLE=Default Role GROUP=Sample Users ACCESS=DISABLED # # Drop registry entriy for user JOHN from Sample3 application. # [DROPREGISTRY] APPLICATION=/sample3 USER=JOHN NAME=USERCODE # # Drop template variables for user JOHN and group 'Sample Users' # [DROPSNAPSHOTVAR] NAME=RECORDINGS PLATFORM=WIN32 USER=JOHN VAR=CODE, 1111 GROUP=Sample Users VAR=CODE, 2222 # #Remove users from a group. # [REMOVEUSERFROMGROUP] NAME=Sample Users USER=USER1 USER=USER2 # #Revoke access. # [REVOKEACCESS] APPLICATION=/sample3 ROLE=Default Role USER=USER1 ACCESS=DISABLED ROLE=Default Role USER=USER2 ACCESS=DISABLED ROLE=Default Role GROUP=Sample Users