# Software description

The software is divided into three main sections:

-   Script

-   DB user + RIS schema

-   Command line mode

The software has been designed so that it can also be used on servers with VGA resolution, `640x480`.

## INI file

Example of the `PDSTOOL.INI` file:

\[PDSTOOL\]

Fileserver=CADSERV1

DBServer=CADSERV2

Projdir=D:\\pds\\proj\\

Schemafile=w:\\pdsdef\\schema

dbname=ORCL

osuser=oracle.password

DBdir=d:\\orant

TCPIP=192.168.1.100

user_tablespace=USER_DATA

temporary_tablespace=TEMPORARY_DATA

svrmgr_path=d:\\orant\\bin\\svrmgr30.exe

svrmgr_connectString=system/manager

seedproj=hangzhou

scriptfile=c:\\pdstool\\pdstool.scr

projname=hangzhou

risdmpdir=C:\\TEMP\\rkl\\ris

uservar1=02_520

uservar2=01_4711

\[Programm\]

Lizenz=145061

editor=notepad

uservartext1=Seed Projekt

uservartext2=Neues Projekt

A number of settings must be defined before the software can be used, as it needs to know the location of the database, Oracle, and other important files, such as the schema file and script file.

All variables required for operation can be entered in a user-friendly form. For standard use, it is not necessary to edit the INI file in a text editor. A brief explanation of the variables is also provided as a tooltip. Hold the mouse pointer briefly over the text box and a yellow help box is displayed.

<img src="./media/PDS AdminTool_image6.png" width="555" height="431">

The file is structured as a typical Windows INI file, for example `Win.ini`. It must always be located in the same folder as `PDSTOOL.EXE` and must be named `PDSTOOL.INI`.

The file consists of two sections:

-   `[PDSTOOL]`  
    Contains the settings required for `PDSTOOL`.

-   `[Programm]`  
    Contains the internal settings.

Additional user-defined variables are also permitted in the `PDSTOOL` section. These can then also be used in the script.

## Variables in the PDSTOOL section

### Fileserver

Specifies the server on which the PDS project files are located.

### DBServer

Specifies the server on which the Oracle database is located.

### Projdir

Specifies the PDS root folder containing the database.

### Schemafile

This variable points to the RIS schema folder.

### Dbname

Specifies the Oracle database name, `SID`.

### Osuser

Windows user authorised to access Oracle, authorised to perform a local logon on the database server, together with the password, separated by a full stop.

### Dbdir

Database root folder.

### TCPIP

TCP/IP address of the database server.

### user_tablespace

User tablespace of the Oracle database.

### temporary_tablespace

Temporary tablespace of the Oracle database.

### svrmgr_path

Path to the Oracle server manager.

### svrmgr_connectString

Oracle administrator and password, separated by `/`. The administrator must be authorised to create and delete users.

### Scriptfile

Current script file. This is selected on the main screen.

### Projname

Current project name. This is selected via the main screen.

All the commands can be used for this project name (delete/load user or
schema). Click on the \"Select Project\" button to select an existing
project or enter a new one.

<img src="./media/PDS AdminTool_image8.png" width="357" height="27">

### Risdmpdir

Folder in which the RIS dump files are stored temporarily. This folder is used whenever RIS dump files are loaded or unloaded.

### Uservar1, uservar2, etc.

Contents of the selected user variables. The corresponding values are entered on the main screen. Labels are assigned to the variables in the `[Programm]` section of the INI file.

## Variables in the Programm section

### Lizenz

Enter the licence number here. The licence number is supplied by ITC-Schlegel. The licence applies to the entire domain, that is, the program can be used throughout the entire network.

### Editor

This variable specifies the text editor used to open files for editing.

### uservartext1

Descriptive text for the user variable. This text has no effect on program execution. It is used only to describe the user variable on the main screen.

<img src="./media/PDS AdminTool_image9.png" width="338" height="54">

## Script

This is a powerful but easy-to-use script language. With only a small number of commands, it is possible to perform most tasks required in PDS.

Possible uses:

-   Create PDS project with just a few mouse clicks.

-   Copy projects.

-   Back up, zip or e-mail projects or project components.

-   Rename libraries in all projects.  
    For example, your libraries may always have started with your company name, such as `company_labels.l`. If your company name changes, you may want to rename these libraries in all projects.

-   Etc.

## Example script

This script can be used to copy any PDS project.

! Creates a Risunload of all schemas in the seed project

risunload (\'pd\_§seedproj§\', \'c:\\temp\\pd\_§seedproj§.dmp\')

risunload (\'dd\_§seedproj§\', \'c:\\temp\\dd\_§seedproj§.dmp\')

risunload (\'ra\_§seedproj§\', \'c:\\temp\\ra\_§seedproj§.dmp\')

!risunload (\'pid\_§seedproj§\', \'c:\\temp\\pid\_§seedproj§.dmp\')

!

! Changes the first line in the DMP file to\'default schema
??\_projname\'

edrisdmp (\'c:\\temp\\pd\_§seedproj§.dmp\')

edrisdmp (\'c:\\temp\\dd\_§seedproj§.dmp\')

edrisdmp (\'c:\\temp\\ra\_§seedproj§.dmp\')

!edrisdmp (\'c:\\temp\\pid\_§seedproj§.dmp\')

!

! Creates the database users for the new project

cre_dbuser (\'pd\_§projname§\')

cre_dbuser (\'dd\_§projname§\')

cre_dbuser (\'ra\_§projname§\')

cre_dbuser (\'pid\_§projname§\')

!

! Creates the schema for the new project

cre_schema (\'pd\_§projname§\')

cre_schema (\'dd\_§projname§\')

cre_schema (\'ra\_§projname§\')

cre_schema (\'pid\_§projname§\')

!

! Renames the RISDMP files to projname.dmp

doscmd (\'move c:\\temp\\pd\_§seedproj§.dmp
c:\\temp\\pd\_§projname§.dmp\')

doscmd (\'move c:\\temp\\dd\_§seedproj§.dmp
c:\\temp\\dd\_§projname§.dmp\')

doscmd (\'move c:\\temp\\ra\_§seedproj§.dmp
c:\\temp\\ra\_§projname§.dmp\')

doscmd (\'move c:\\temp\\pid\_§seedproj§.dmp
c:\\temp\\pid\_§projname§.dmp\')

!

! The complete texts (project name) are searched and replaced in the

! Risdmpfiles

change (\'c:\\temp\\pd\_§projname§.dmp\', \'§seedproj§\' ,
\'§projname§\' )

change (\'c:\\temp\\dd\_§projname§.dmp\', \'§seedproj§\' ,
\'§projname§\' )

change (\'c:\\temp\\ra\_§projname§.dmp\', \'§seedproj§\' ,
\'§projname§\' )

change (\'c:\\temp\\pid\_§projname§.dmp\', \'§seedproj§\' ,
\'§projname§\' )

!

! The schemas are loaded from the new project

risload (\'c:\\temp\\pd\_§projname§.dmp\')

risload (\'c:\\temp\\dd\_§projname§.dmp\')

risload (\'c:\\temp\\ra\_§projname§.dmp\')

risload (\'c:\\temp\\pid\_§projname§.dmp\')

!

! Copies the entire seed folder to the project folder

doscmd (\'xcopy §projdir§§seedproj§ §projdir§§projname§ /REISCH\')

!

! Replaces the project name in the Isogen Defaults File

change (\'§projdir§\\p3\\isodat\\§Projname§.def\', \'§seedproj§\' ,
\'§projname§\' )

## Script structure

The program processes the script line-by-line.

Comment lines begin with \"!\". Such lines are not processed.

The individual passed parameters are enclosed in single quotes (\').

## Variables

Variables in the script file are enclosed by the \"§\" character.

All the variables entered in the \[PDSTOOL\] section of the INI file can
be processed, including user-defined variables.

## Commands

### cre_dbuser

Creates a database user. Example:

cre_dbuser (\'pd\_§projname§\')

### cre_schema

Creates an RIS schema. Example:

cre_schema (\'pd\_§projname§\')

### del_schema 

Deletes an RIS schema.

del_schema (\'pd\_§projname§\')

### del_dbuser

Deletes a database user.

del_dbuser (\'pd\_§projname§\')

### change

In a text file, first value, replaces one string, second value, with another string, third value.

change (\'c:\\temp\\xx.txt\', \'textold\' , \'textnew\' )

### risunload

Unloads an RIS schema, first value, to an RIS dump file, second value.

risunload (\'pd\_§Projname§\', \'c:\\temp\\pd\_§projname§.dmp\')

### edrisdmp

Changes the first line in the dump file to `default schema ??_projname`.

edrisdmp (\'c:\\temp\\pd\_§projname§.dmp\')

### risload

Loads an RIS dump file into an RIS schema.

risload (\'c:\\temp\\pd\_§projname§.dmp\')

### doscmd

Runs a DOS command.

doscmd (\'dir §projdir§ \> c:\\temp\\§DBSERVER§.txt\')

###  append_text

Appends text to a text file if the entry does not already exist in the file.

append_text (\'c:\\temp\\§projname§.txt\', \'§projname§\')

## DB User + RIS Schema

<img src="./media/PDS AdminTool_image10.png" width="640" height="488">
In this tab, all functions relating to database users and RIS schemas can be controlled from a single user interface.

The screen is divided into three areas:

-   Select database user or RIS schema.  

     <img src="./media/PDS AdminTool_image11.png" width="612" height="110">
    
    Here you select the RIS schemas or database users for which commands can then be entered.

-   Target directory or source for RIS dump files.  

    <img src="./media/PDS AdminTool_image12.png" width="585" height="35">
    
    When you click the text box, a folder-selection list opens. Choose the folder in which the RIS dump files are located, or the folder to which they should be written during a `RISunload`.

-   Command buttons  

    <img src="./media/PDS AdminTool_image13.png" width="615" height="213">
    
    Click these buttons to run the corresponding
    commands. The command functionality should be self-evident.\
    The \"Show existing DB-User\" and \"Show free Tablespace\" only work
    if the program is running directly on the database server.

## Command line mode

In order to save the PDS database contents, it is advisable to unload **all** schemas to text files by using `risunload`.

If you want to use this command in a batch process, call `PDSTOOL` with a command-line parameter.

`Pdstool.exe /risunloadall`
