|
2 | 2 | layout: default
|
3 | 3 | title: Configuration
|
4 | 4 | permalink: /configuration/
|
5 |
| -nav_order: 5 |
| 5 | +nav_order: 3 |
6 | 6 | ---
|
7 | 7 | # Configuration
|
8 | 8 |
|
9 |
| -The settings that define an InterSystems IRIS server and the connection to the server are crucial to the functioning of VS Code in developing in ObjectScript. |
| 9 | +VS Code settings enable you to customize various aspects of its function. The InterSystems-provided extensions enable you to define InterSystems IRIS servers and the connections to those servers. |
10 | 10 |
|
11 |
| -## Configuring a Server |
| 11 | +## Settings |
| 12 | + |
| 13 | +Many available settings are general to VS Code, and you can learn about them in the [Visual Studio Code Documentation](https://code.visualstudio.com/docs). The InterSystems Server Manager and InterSystems ObjectScript extensions supply specific settings used to configure VS Code for ObjectScript development. |
| 14 | +There are several levels on which settings are stored and used: |
| 15 | + |
| 16 | +- **User** - User settings are stored in a file location specific to you and apply globally to any instance of VS Code or any VS Code workspace that you open. |
| 17 | +- **Workspace** - Workspace settings are stored in a file inside the workspace and apply to anyone who opens the workspace. |
| 18 | +- **Folder** - If more than one folder is present in the workspace, you can select the folder where the settings file is stored by selecting from the Folder drop down list. |
12 | 19 |
|
13 |
| -First, configure one or more servers. Open the settings editor by selecting **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) from the menu. Select the **User** or **Workspace** settings level by selecting it at the top of the settings window. For example, the following screen shot shows Workspace selected: |
| 20 | +For example, the following screen shot shows Workspace selected: |
14 | 21 |
|
15 | 22 | 
|
16 | 23 |
|
17 |
| -Find Extensions in the list in the left pane of the editor window, click to open, then select InterSystems Server Manager from the list to find the correct place in the settings UI. The following screen shot shows InterSystems Server Manager selected: |
| 24 | +See the VS Code documentation section [User and Workspace Settings](https://code.visualstudio.com/docs/getstarted/settings). |
18 | 25 |
|
19 |
| - |
| 26 | +## Configuring a Server |
20 | 27 |
|
21 |
| -And this screen shot shows Server Manager area of the edit pane: |
| 28 | +First, configure one or more servers. Select **View > Command Palette > InterSystems Server Manager: Store Password in Keychain**. This command lets you define a new server, as well as storing a password. Click the plus sign in the upper right corner of the dialog, as shown: |
22 | 29 |
|
23 |
| - |
| 30 | + |
24 | 31 |
|
25 |
| -You need to edit the server configuration in the settings.json file, so your only option is to click *Edit in settings.json*. |
| 32 | +Provide the following values when prompted: |
26 | 33 |
|
27 |
| -To configure a server, enter code something like this: |
| 34 | +- **Name of new server definition** - an arbitrary name to identify this server |
| 35 | +- **Hostname or IP address of web server** - the host for this server |
| 36 | +- **Port of web server** - the WebServer port number for this server |
| 37 | +- **Username** - the username to use in logging in to this server. |
| 38 | +- **Confirm connection type** - the protocol used for connections, possible values are **http** and **https**. |
28 | 39 |
|
29 |
| -```js |
30 |
| -"intersystems.servers": { |
31 |
| - "test": { |
32 |
| - "webServer": { |
33 |
| - "scheme": "http", |
34 |
| - "host": "localhost", |
35 |
| - "port": 52774, |
36 |
| - }, |
37 |
| - "username": "_SYSTEM", |
38 |
| - }, |
39 |
| -}, |
40 |
| -``` |
| 40 | +Once you have entered these values, the server definition is stored in your user settings. At that point another prompt appears, asking for a password to store in the system Keychain. Enter the password for the username supplied earlier to complete the process. |
| 41 | + |
| 42 | +## Editing a Server Configuration |
41 | 43 |
|
42 |
| -The components of this server definition are: |
| 44 | +If you need to modify a server configuration select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) from the menu. Select the **User** settings level. Find **Extensions** in the list in the left pane of the editor window, click to open, then select **InterSystems Server Manager** from the list to find the **InterSystems Server Manager** area of the edit pane, as illustrated in the following screen shot: |
43 | 45 |
|
44 |
| -- **test** - an arbitrary name to identify this server |
45 |
| -- **webServer** - The collection of properties that define the web server. |
46 |
| -- **scheme** - The protocol used for connections. |
| 46 | + |
| 47 | + |
| 48 | +Click *Edit in settings.json*. |
| 49 | + |
| 50 | +The server configuration in *settings.json* looks similar to the following, with the values you entered when you configured the server: |
| 51 | + |
| 52 | +```json |
| 53 | +{ |
| 54 | + "intersystems.servers": { |
| 55 | + "iris-1": { |
| 56 | + "webServer": { |
| 57 | + "scheme": "http", |
| 58 | + "host": "localhost", |
| 59 | + "port": 52773 |
| 60 | + }, |
| 61 | + "username": "_SYSTEM" |
| 62 | + } |
| 63 | + } |
| 64 | +} |
| 65 | +``` |
| 66 | +The components of the server definition are as follows: |
| 67 | + |
| 68 | +- **iris-1** - An arbitrary name to identify this server |
| 69 | +- **webServer** - The collection of properties that define the web server |
| 70 | +- **scheme** - The protocol used for connections |
47 | 71 | - **host** - the host for this server
|
48 | 72 | - **port** - the WebServer port number for this server
|
49 |
| -- **username** - the username to use in logging in to this server. |
| 73 | +- **username** - the username to use in logging in to this server |
50 | 74 | - **password** - password for the specified username. Entering the password in this file is acceptable only in limited situations with very low need for security.
|
51 | 75 |
|
52 |
| -If you do not add a password to the server definition, anyone using the server needs to supply the password. Or, you can store the password securely in the system Keychain. The InterSystems Server Manager adds the following commands for managing stored passwords to the Command Palette: |
| 76 | +If you do not store the password securely in the system Keychain or add it to the server definition, anyone using the server needs to supply the password. The InterSystems Server Manager provides the following commands for managing stored passwords in the Command Palette: |
53 | 77 |
|
54 |
| -- **InterSystems Server Manager: Clear Password from Keychain** - remove password for selected server |
55 |
| -- **InterSystems Server Manager: Store Password in Keychain** - select a server and enter a password |
56 |
| -- **InterSystems Server Manager: Test Server Selection** |
57 |
| -- **InterSystems Server Manager: Test Server Selection (flush cached credentials)** |
58 |
| -- **InterSystems Server Manager: Test Server Selection with Details** |
| 78 | +- **InterSystems Server Manager: Clear Password from Keychain** - remove the password for a selected server |
| 79 | +- **InterSystems Server Manager: Store Password in Keychain** - select a server or create a new one and enter a password |
59 | 80 |
|
60 | 81 | ## Configuring a Server Connection
|
61 | 82 |
|
62 |
| -Select InterSystems ObjectScript from the settings editor extensions list. You need to edit the server configuration in the settings.json file, so your click *Edit in settings.json* under the heading **Objectscript: conn**. |
| 83 | +Open the folder where you want client-side files to be located. Select the **ObjectScript Explorer** button which has been added to the Activity Bar. Select the **Choose Server and Namespace** button. This action opens a dialog that lets you select a server, or create a new one. Once you have selected a server and namespace, connection configuration is complete. |
| 84 | + |
| 85 | +## Editing a Server Connection |
| 86 | + |
| 87 | +If you need to modify a server connection select **File > Preferences > Settings** (**Code > Preferences > Settings** on Mac) from the menu. Select the **Workspace** settings level. Search for **objectscript: conn**, and click on *Edit in settings.json*. |
63 | 88 |
|
64 |
| -You should enter code something like this: |
| 89 | +The connection configuration looks like this: |
65 | 90 |
|
66 |
| -```js |
| 91 | +```json |
67 | 92 | "objectscript.conn": {
|
68 | 93 | "ns": "USER",
|
69 |
| - "server": "tst", |
| 94 | + "server": "iris-1", |
70 | 95 | "active": true,
|
71 | 96 | },
|
72 | 97 | ```
|
73 |
| -The components of this server definition are: |
| 98 | + |
| 99 | +The components of this configuration are: |
74 | 100 |
|
75 | 101 | - **ns** - namespace to use on the server
|
76 | 102 | - **server** - server name as specified in the server configuration
|
77 |
| -- **active** - specifies whether the connection is active. |
78 |
| - |
79 |
| -## Configuring Export from Server |
80 |
| - |
81 |
| -Select InterSystems ObjectScript from the settings editor extensions list. Find the section labeled **Objectscript: export**. You can edit many of the export settings in the settings editor. For others you need to edit the settings.json file. |
82 |
| - |
83 |
| -You export configuration looks something like this: |
84 |
| - |
85 |
| -```js |
86 |
| -"objectscript.export": { |
87 |
| - "folder": "", |
88 |
| - "addCategory": true, |
89 |
| - "atelier": true, |
90 |
| - "generated": false, |
91 |
| - "filter": "", |
92 |
| - "category": "*", |
93 |
| - "noStorage": false, |
94 |
| - "dontExportIfNoChanges": false, |
95 |
| - "maxConcurrentConnections": 0 |
96 |
| -}, |
97 |
| -``` |
98 |
| -The components of this export definition are: |
99 |
| - |
100 |
| -- **folder** - Folder for source code. |
101 |
| -- **addCategory** - Add a category folder to the export path. |
102 |
| -- **atelier** - Export source code as Atelier does, with packages placed in subfolders. |
103 |
| -- **generated** - Export generated source code files. |
104 |
| -- **filter** - An SQL filter that can be used to match the names. |
105 |
| -- **category** - Specifies a category of source code to export: CLS = classes; RTN = routines; CSP = csp files; OTH = other. The default is *, export everything. |
106 |
| -- **noStorage** - Strip the storage XML on export. This is useful for multiple systems. |
107 |
| -- **dontExportIfNoChanges** - Don't update the local file if the content is identical to what is on the server. |
108 |
| -- **maxConcurrentConnections** - The maximum number of export connections. (0 = Unlimited) |
| 103 | +- **active** - specifies whether the connection is active. |
0 commit comments