Oracle® Database Lite Administration and Deployment Guide Release 10.3 Part Number E12089-02 |
|
|
View PDF |
You can use the scripting language saved in an INI file and used by the WSH tool to perform batch processing tasks on the Mobile Server that are performed frequently by the administrator.
The following sections describe the scripting language for the Mobile Server:
The following sections describe the parameters and syntax available in the scripting language:
Using the following syntax, you can create users.
[USER] NAME=<User Name> PASSWORD=<User Password> EXTERNALUSER=<True or False> ENCRYPTED=<True or False; True if the password is encrypted, False if not> FULLNAME=<User Full Name> PRIVILEGE=<User privilege level as A, O, U, M, or null>
By default, this value is false for a user with password that is authenticated by the Mobile Server. If you are creating an external user that will be authenticated by an external authenticator class, set to True. If true, you do not provide a password in the INI script file with PASSWORD as the user is authenticated by the external authenticator. See Chapter 8, "Customizing Oracle Database Security" in the Oracle Database Lite Developer's Guide for information on the external authenticator.
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.
Note:
You cannot add a member user to a 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.
Note:
You cannot add a member user to an existing 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>
The WSH
tool is a command-line tool that you can use to execute batch commands on the Mobile Server or to connect to the Oracle Lite database on the client and issue commands remotely.
The following sections describe the command line options for the WSH
tool:
Section C.2.1, "Execute Batch Command Script File on the Mobile Server"
Section C.2.2, "Inspect Files on Web-to-Go or Branch Office Client"
Use the -c
option to execute the commands you developed in the script INI file on the Mobile Server. The syntax for this option is as follows:
wsh –c <path_and_filename.ini> <username>/<password>[@<jdbc_url>]
Where:
<path_and_filename.ini>
: The INI file contains the batch commands for the Mobile Server. Provide the name and absolute path for the desired INI file.
<username>/<password>
: The Mobile Server repository administrator username and password.
<jdbc_url>
: If the optional JDBC URL for the Oracle database that contains the Mobile repository is specified in the command line, then WSH
will use this URL, else it defaults to use the URL configured in the webtogo.ora
file. You can specify the JDBC URL of a single Oracle database or an Oracle RAC database.
The JDBC URL for a single Oracle database has the structure of jdbc:oracle:thin:@<host>:<port>:<SID>
.
The JDBC URL for an Oracle RAC database can have more than one address in it for multiple Oracle databases in the cluster and follows this URL structure:
jdbc:oracle:thin:@(DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=PRIMARY_NODE_HOSTNAME)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=SECONDARY_NODE_HOSTNAME)(PORT=1521)) ) (CONNECT_DATA=(SERVICE_NAME=DATABASE_SERVICENAME)))
The following example executes the WSH
tool on the sample6.ini
file using the Mobile Server repository username and password of mobileadmin/manager
and the JDBC URL of <host>:<port>:<SID>
of myhost:1521:mySID
:
wsh -c C:\OliteR3\scripts\sample6.ini mobileadmin/manager@jdbc:oracle:thin:@myhost:1521:mySID
You can use the WSH
tool to inspect and modify a Web-to-Go or Branch Office client interactively. After synchronization on the Web-to-Go or Branch Office client, the user can check the application files (html, class, gifs).
On the Mobile client machine, use the WSH tool to browse application files. The syntax for this is as follows:
wsh –l <system>/<user_pwd>@<DSN>
For example:
wsh –l system/john@webtogo
Once you connect using the the -l
option of the wsh
tool, you can use the commands listed in Table C-1 for inspecting and altering the Mobile client.
Table C-1 Commands to Inspect and Alter the Mobile Server Repository
Command | Definition |
---|---|
|
Displays a list of files in a directory. |
|
Copies one or more files to another location. |
|
Copies one or more files to another location. |
|
Launches Notepad for editing a file. |
|
Deletes one or more files. |
|
Deletes one or more files. |
|
Displays the name or changes the current directory. |
|
Creates a directory. |
|
Removes (deletes) a directory. Use the option |
|
Displays the contents of a text file or files. |
|
Quits the command shell. |
|
Quits the command shell. |
|
Provides help information for shell commands. |
|
Synchronizes the file system with the database. |
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