-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Siebel Script And Web Template Editor is a Visual Studio Code extension, which enables editing Siebel object server scripts and web templates directly in VS Code, using the Siebel REST API.
The Siebel Script And Web Template Editor can be installed from the Visual Studio Code Extensions Marketplace.
Alternatively, it can be installed with the siebelscriptandwebtempeditor-<VERSION_NUMBER>.vsix extension file, which is found in the repository. To install the extension from the .vsix file, run the following command:
code --install-extension <DOWNLOAD_PATH>\siebelscriptandwebtempeditor-<VERSION_NUMBER>.vsix
The command shall respond with:
Extension 'siebelscriptandwebtempeditor-<VERSION_NUMBER>.vsix' was successfully installed.
Some other/warning messages may be displayed, but that's OK as long as the installation is successful.
A new icon appears in the left sidebar to access the extension's UI:
IMPORTANT: Make sure to open a folder before using the extension to store the downloaded scripts and web templates. You can name this folder any way you want (in the example below it's named siebelvscodeworkspace
):
To open the extension, click on its icon in the left sidebar. To use the extension, at least one Siebel Connection must be configured. Click on the New Connection (+) button in the Datasource panel, and a dedicated GUI opens:
Where:
-
Connection Name
is a unique name to identify the connection. It is the name displayed in the extension's UI when selecting the connection. Use something that identifies the connection for you easily, such as SANDBOX, DEV, INT, etc. This cannot be changed later. -
Siebel REST API Base URI
defines access to the Siebel REST API in the following format:https://Server Name:Port/siebel/v1.0
, where:-
Server Name
is the URL of the Siebel server. -
Port
is the HTTP port where the Siebel listens for connections. - e.g. if the Siebel Server URL is
https://dev.testserver.local
, and the port is443
, then it shall behttps://dev.testserver.local:443/siebel/v1.0
.
-
-
Username
is the username used to access the Siebel with basic authentication. -
Password
is the password used to access the Siebel with basic authentication withUsername
.
Use the Test Connection button to test if the connection is working, an information message is shown if it is ok, or an error message if something is amiss. Then save with the Save Connection button, and the panel changes to the Edit Connection GUI, with three more settings appearing:
- Workspaces: You workspaces are listed here, to add a new, fill in its name in the input field, then press Enter or click Add. The workspaces have two buttons near them, Set As Default sets them to the default workspace for the connection, and for the default workspace, it is inactive and its text content is Default instead, while Delete removes them. Changes in the Workspaces setting are immediately reflected.
-
Get Workspaces From The Siebel REST API: if this checkbox is set to true, the workspaces for the connection are fetched from the Siebel REST API, without manually adding workspaces in the Workspaces setting. Only workspaces belonging to the given username and having status either Created, Checkpointed or Edit-In-Progress are available. The extension tests if the connection is eligible for this option, since the Base Workspace integration object, which enables to get information about workspaces (name, status and who created it) through the Siebel REST API is required to be present in Siebel. To use this option, do the following:
- Download the Base Workspace integration object from the GitHub repository: BaseWorkspaceIOB.sif.
- Import the integration object into a workspace in Siebel.
- Merge the workspace into the MAIN workspace.
- Default Connection: sets the connection to which the extension defaults.
You can edit any connection by selecting it from the Connection dropdown, then clicking on the Edit Connection (pencil) button. Multiple connections can be provided, which is useful if you have access to different environments/clients/etc. When changing any setting from the GUI, the Save Connection button has to be pressed to save the changes, except for the Workspaces setting. The Delete Connection button removes the connection after a confirmation dialog box.
If there is no valid certificate installed for a Siebel connection, the REST API calls result in the following error: Error using the Siebel REST API: self signed certificate in certificate chain. The recommended solution is to get and install a valid certificate for the given Siebel endpoint, other possibility is to set the following environment variable, WARNING: THIS IS HIGHLY DISCOURAGED FOR SECURITY REASONS:
NODE_TLS_REJECT_UNAUTHORIZED = 0
Settings can be opened with Settings (cogwheel) button from the Datasource panel:
Currently there are seven settings for the extension, the first and third should be only modified from the New/Edit Connection panels, see the section above:
- Connections: contains the connection data, do not modify this in the settings.json. When updating the extension from older (< 2.0.0) versions, the deprecated settings related to connection and workspace configurations are migrated here in suitable format.
- Default Connection: name of the default connection, do not modify here, set using the Default Connection checkbox on the Edit Connection GUI.
The other settings customize the behavior of the extension. Changes in them are reflected immediately:
-
Default Script Fetching: default method for fetching server scripts when clicking on a Siebel object:
- None - always ask: always asks how to fetch (default).
- Only method names: fetches only the script names of the Siebel object.
- All scripts: always downloads all scripts of the Siebel object. The behavior of already downloaded files depends on the Default Action When File Exists setting.
- Local File Extension: the default file extension for the downloaded server scripts, .js (default) or .ts. If you use explicit types in your eScript scripts, .ts is recommended, else errors are shown for using types in a .js file.
- Max Page Size: number of records to fetch from the Siebel REST API. Cannot be greater than the value of the MaximumPageSize parameter of the component EAI Object Manager (default is 100, in Siebel and in the extension as well), otherwise Siebel responds with an error.
- Single File Auto Download: if this setting is true (default is false), scripts and web templates are downloaded without asking for permission when clicking on them. The behavior when clicking on already downloaded files depends on the Default Action When File Exists.
-
Default Action When File Exists: the default action when selecting an already downloaded script or web template from the tree views:
- None - always ask: always asks what to do, if multiple scripts are downloaded, then it is asked for each existing file (default).
- Open file: opens the file from the disk, which can be refeshed manually with the pull button.
- Overwrite: pull the content from Siebel before opening it. WARNING: this overwrites files which are already downloaded!
The UI consists of six different panels, the uppermost is used for selecting the connection and workspace from where the data is fetched, the type of the Siebel object and a search bar:
This panel has three buttons in its title bar:
- New Connection (+): opens the New Connection GUI to create a new connection.
- Edit Connection (pencil): opens the Edit Connection GUI to edit the selected connection, if there are no connections, it opens the New Connection GUI as well.
- Open Settings (cogwheel): opens the Siebel Script Editor extension's settings.
The other five panels display the list of Siebel objects (Business Services, Business Components, Applets, Applications and Web Templates) and for the first four, their respective server scripts.
To get Siebel server scripts or web templates, select a connection, a workspace and an object type. Start typing the name of sought object into the search field, wildcard character *
can be used (is added automatically to the end of the search string). The matching results are shown in the corresponding panel:
Click on an object in the list in a panel, and if the Default Script Fetching setting is None - always ask
, a dialog box opens in the bottom right corner with three buttons, else one of its first two options happen instead:
-
Yes: gets and downloads all server scripts for the object (same as the
All scripts
option). -
Only method names: gets only the method names (same as the
Only method names
option) as children of the object in the list, which can be downloaded individually by clicking on their names if the Single File Auto Download setting is true, otherwise after a confirmation. - No: closes the dialog box.
A checkmark is displayed in front of each object which has at least one method downloaded, and checkmarks in front of script names indicate which ones are already on disk.
Scripts are stored in the first VS Code workspace folder (only one should be open) as javascript or typescript files with .js
or .ts
extension depending on the Local File Extension setting, in the following folder structure:
ConnectionName\WorkspaceName\ObjectType\ObjectName\MethodName.js
Refer to the folder structure chapter for complete folder layout reference.
Click on a web template, and depending on the Single File Auto Download setting, the web template gets downloaded instantly or after a confirmation. A checkmark is displayed in front of the web templates if they exist on disk. Web templates are stored in the first VS Code workspace folder (only one should be open) as html files with .html
extension in the following folder structure:
ConnectionName\WorkspaceName\webtemp\WebTemplateName.html
Refer to the folder structure chapter for complete folder layout reference.
Three command buttons are shown in top right corner of the VS Code editor when eligible files are open. The downward pointing chevrons pull the object being edited from Siebel, while the upward pointing ones push it to Siebel, and the rectangle with the two-way arrow compares the downloaded object with the ones stored in different Siebel workspaces. Pull and push must be confirmed by dialog box displayed in the bottom right corner.
- Pull: the current file is overwritten from Siebel.
- Push: the object is overwritten in Siebel and a success message is displayed.
- Compare: shows a workspace selection at the top of the screen, then after selecting a workspace to compare the current file against, a difference editor is opened, with the object from the choosen Siebel workspace on the left side, and the current file on the right, changes can be reverted in the downloaded one:
If anything goes astray, a message containing the error is displayed. When pushing server scripts, if the file name differs from the contained function name, an error is thrown by the extension, only (declarations)
is exempt from this check.
New server scripts can be created by making new files in the appropriate folder with the same file name as the future function name, and having .js or .ts extension. Subsequently pushing them to Siebel create them as new server scripts of the Siebel object. This does not work for web templates, an error is thrown if they do not already exist in Siebel.
Comparing creates a file named .compare in the Siebel VS Code workspace folder everytime, which stores the currently compared object from Siebel.
Files index.d.ts and jsconfig.json are created in the Siebel VS Code workspace folder if not present already. The index.d.ts contains type definitions and documentation for Siebel specific constants, objects and interfaces, so the Visual Studio Code has greatly improved autocompletion and semantic checking features. Errors are raised if problems are detected, e.g. using non-existing methods on a given Siebel object.
For the best experience, ensure the following setting is set to true in the Visual Studio Code preferences:
- JavaScript > Suggest > Complete Function Calls
Folder structure for the scripts and web templates:
Visual Studio Code Workspace folder
├── Connection Name
│ ├── Workspace Name
│ │ ├── service
│ │ │ ├── Business Service Name
│ │ │ │ ├── Service_PreInvokeMethod.ts
│ │ │ │ └── CustomScript1.ts
│ │ │ └── Other Business Service Name
│ │ │ └── CustomScript2.js
│ │ ├── buscomp
│ │ │ └── Business Component Name
│ │ │ ├── Buscomp_PreInvokeMethod.js
│ │ │ └── CustomScript3.js
│ │ ├── applet
│ │ │ └──Applet Name
│ │ │ ├── WebApplet_PreInvokeMethod.ts
│ │ │ └── CustomScript4.ts
│ │ ├── application
│ │ │ └───Application Name
│ │ │ └── CustomScript5.js
│ │ └── webtemp
│ │ └── Custom Web Template.html
│ └── Other Workspace Name
│ ...
├── Other Connection Name
│ └── Another Workspace Name
│ ...
├── index.d.ts
├── jsconfig.json
└── .compare