|
1 | 1 | # InterSystems Server Manager
|
2 | 2 |
|
3 |
| -This is a VS Code helper extension for defining connections to [InterSystems®](https://www.intersystems.com/) servers. These connection definitions can used by other VS Code extensions when they make connections. One example is the [ObjectScript extension](https://github.com/intersystems-community/vscode-objectscript). |
| 3 | + |
| 4 | +InterSystems Server Manager is a Visual Studio Code extension for defining connections to [InterSystems](https://www.intersystems.com/) servers. These definitions can used by other VS Code extensions when they make connections. One example is the [ObjectScript extension](https://github.com/intersystems-community/vscode-objectscript) for code editing. |
| 5 | + |
| 6 | +# New in 2.0 - April 2021 |
| 7 | + |
| 8 | +> We are pleased to publish version 2.0 of this extension, adding a tree-style user interface. This significant new release is competing in the April 2021 InterSystems Programming Contest for Developer Tools. If you like the new 2.0 features please visit the [contest page](https://openexchange.intersystems.com/contest/13) no later than April 25 and vote for us. |
| 9 | +
|
| 10 | +> Thanks to [George James Software](https://georgejames.com) for backing this development effort. |
| 11 | +
|
| 12 | +## The Server Tree |
| 13 | + |
| 14 | +Server Manager displays connection definitions as a tree on an InterSystems Tools view: |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | +In this tree you can: |
| 19 | + |
| 20 | +- Launch the InterSystems Management Portal, either in a VS Code tab or in your default browser. |
| 21 | +- List namespaces. |
| 22 | +- Add namespaces to your VS Code workspace for viewing or editing code on the server with the [ObjectScript extension](https://github.com/intersystems-community/vscode-objectscript). |
| 23 | +- Tag favorite servers. |
| 24 | +- Set icon colors. |
| 25 | +- Focus on recently used connections. |
| 26 | +- Manage stored passwords. |
| 27 | +- Add new servers, and edit existing ones. |
4 | 28 |
|
5 | 29 | In common with the rest of VS Code, Server Manager stores your connection settings in JSON files. VS Code settings are arranged in a hierarchy that you can learn more about [here](https://code.visualstudio.com/docs/getstarted/settings).
|
6 | 30 |
|
7 |
| -Using Server Manager you can store connection passwords in the native keystore of your workstation's operating system instead of as plaintext in JSON files. |
| 31 | +Server Manager can store connection passwords in the native keystore of your workstation's operating system. This is a more secure alternative to you putting them as plaintext in your JSON files. |
| 32 | + |
| 33 | +On Windows, Server Manager can create connection entries for all connections you previously defined with the original Windows app called InterSystems Server Manager. This action is available from the '`...`' menu at the top right corner of Server Manager's tree. |
| 34 | + |
| 35 | +## Defining a New Server |
| 36 | + |
| 37 | +1. Click the '`+`' button on Server Manager's title bar. |
| 38 | +2. Complete the sequence of prompts. |
| 39 | +3. Expand `All Servers` to see your new entry in the tree. |
| 40 | + |
| 41 | +The server definition is added to your [user-level](https://code.visualstudio.com/docs/getstarted/settings) `settings.json` file. |
| 42 | + |
| 43 | +Optionally use its context menu to store the password for the username you entered when defining the server. You can also set the color of the server icon. |
8 | 44 |
|
9 |
| -On Windows you can run `Import Servers from Registry` from [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) to create connection entries for all connections you previously defined with the InterSystems Server Manager. |
| 45 | +The 'star' button that appears when you hover over the row lets you add the server to the `Favorites` list at the top of the tree. |
10 | 46 |
|
11 |
| -## Defining a new connection |
| 47 | +## Launching Management Portal |
12 | 48 |
|
13 |
| -1. Open the VS Code [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) by typing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (<kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> on macOS) or <kbd>F1</kbd>. |
14 |
| -2. Start typing "Server Manager" to locate `InterSystems Server Manager: Store Password in Keychain`. |
15 |
| -3. Type the '+' character into the quickpick input field. Alternatively click the '+' button on the top right of the quickpick. |
16 |
| -4. Complete the prompts. By the time you reach the password prompt your connection definition has already been saved in **user-level** JSON. If you prefer to enter your password whenever a VS Code extension connects via Server Manager for the first time in a session, press <kbd>Esc</kbd> here. |
| 49 | +When you hover over a server entry in the tree, two command buttons let you launch InterSystems Management Portal. |
17 | 50 |
|
18 |
| -## Amending and removing definitions |
| 51 | +The first button uses VS Code's Simple Browser feature, which creates a tab alongside any documents you may have open. The second button opens Portal in your workstation's default web browser. |
19 | 52 |
|
20 |
| -To manage your definitions, [edit the relevant JSON file](https://code.visualstudio.com/docs/getstarted/settings). VS Code offers several routes to these files. One way is to type "json" into the Command Palette. |
| 53 | +### Notes About Simple Browser |
| 54 | +- There is only ever a single Simple Browser tab. Launching another server's Management Portal in it will replace the previous one. |
| 55 | +- If the server version is InterSystems IRIS 2021.1.1 or later you will need to change a setting on the suite of web applications that implement Management Portal. This is a consequence of change [SGM031 - Support SameSite for CSP session and user cookies](https://docs.intersystems.com/iris20201/csp/docbook/relnotes/index.html#SGM031). Simple Browser will not be permitted to store Portal's session management cookies, so Portal must be willing to fall back to using the CSPCHD query parameter mechanism. |
| 56 | + - Locate the five web applications whose path begins with `/csp/sys` |
| 57 | +  |
| 58 | + |
| 59 | + - Alter the `Use Cookie for Session` setting on each of them so it is `Autodetect` instead of `Always`. |
| 60 | +  |
| 61 | + Remember to save the change. The change is not thought to have any adverse effects on the usage of Portal from ordinary browsers, which will continue to use session cookies. |
| 62 | +- When a 2020.1.1+ Portal has resorted to using CSPCHD (see above) a few inter-page links fail because they don't add the CSPCHD queryparam. One specific case is the breadcrumb links. Pending the arrival of an InterSystems correction (JIRA DP-404817) these links will take you to the login page. Either enter your credentials to proceed, or launch Simple Browser again from the Server Manager tree. |
| 63 | + |
| 64 | +## Amending and Removing Servers |
| 65 | + |
| 66 | +To manage your server definitions, including changing the username it connects with, [edit the relevant JSON file](https://code.visualstudio.com/docs/getstarted/settings). |
| 67 | + |
| 68 | +1. From a server's context menu, or from Server Manager's top-right '`...`' menu, choose `Edit Settings`. This opens VS Code's Settings Editor and filters its contents. |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +2. Click the `Edit in settings.json` link. |
21 | 73 |
|
22 | 74 | In this example two connections have been defined:
|
23 | 75 |
|
@@ -48,33 +100,45 @@ In this example two connections have been defined:
|
48 | 100 |
|
49 | 101 | The JSON editor offers the usual [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) as you work in this structure.
|
50 | 102 |
|
51 |
| -Notice how you can add a `description` property to each connection. This will be shown alongside its entry in the server quickpick. |
| 103 | +Notice how you can add a `description` property to each connection. This will be shown in the hover in Server Manager's tree, and alongside the entry if a server quickpick is used. |
52 | 104 |
|
53 | 105 | Servers are displayed in the quickpick in the order they are defined in the JSON file. The exception is that if a server name is set as the value of the `/default` property (see example above) it will be shown first in the list.
|
54 | 106 |
|
55 |
| -A set of embedded servers with names beginning `default~` will appear at the end of the quickpick unless you add the property `"/hideEmbeddedEntries": true` to your `intersystems.server` object (see above). |
| 107 | +A set of embedded servers with names beginning `default~` will appear at the end of the lists unless you add the property `"/hideEmbeddedEntries": true` to your `intersystems.server` object to hide them (see above). |
| 108 | + |
| 109 | +## Removing a Stored Password |
| 110 | + |
| 111 | +Use the server's context menu. Alternatively, run `InterSystems Server Manager: Clear Password from Keychain` from Command Palette. |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## Technical Notes |
| 116 | + |
| 117 | +### Colors, Favorites and Recents |
| 118 | + |
| 119 | +These features use VS Code's extension-private global state storage. Data is not present in your `settings.json` file. |
| 120 | + |
| 121 | +### The 'All Servers' Folder |
56 | 122 |
|
57 |
| -## Removing a stored password |
| 123 | +The `All Servers` tree respects the optional `/default` and `/hideEmbeddedEntries` settings in the `intersystems.servers` JSON. |
58 | 124 |
|
59 |
| -The command `InterSystems Server Manager: Clear Password from Keychain` removes a stored password. |
| 125 | +If a server has been named in `/default` it is promoted to the top of the list, which is otherwise presented in alphabetical order. |
60 | 126 |
|
61 |
| -**Usage:** |
| 127 | +Embedded entries (built-in default ones) are demoted to the end of the list, or omitted completely if `/hideEmbeddedEntries` is true. |
62 | 128 |
|
63 |
| -1. Bring up the [Command Palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) by typing Ctrl+Shift+P (Cmd+Shift+P on Mac) or F1. |
64 |
| -2. Start typing "Server Manager" to locate the `InterSystems Server Manager: Clear Password from Keychain` command. |
65 |
| -3. Pick a server. |
| 129 | +--- |
66 | 130 |
|
67 |
| -## For VS Code Extension Developers: Use By Other Extensions |
| 131 | +## Information for VS Code Extension Developers - How To Leverage Server Manager |
68 | 132 |
|
69 |
| -An extension XYZ needing to connect to InterSystems servers can define this extension as a dependency in its `package.json` |
| 133 | +An extension XYZ needing to connect to InterSystems servers can define Server Manager as a dependency in its `package.json` like this: |
70 | 134 |
|
71 | 135 | ```json
|
72 | 136 | "extensionDependencies": [
|
73 | 137 | "intersystems-community.servermanager"
|
74 | 138 | ],
|
75 | 139 | ```
|
76 | 140 |
|
77 |
| -Alternatively the `activate` method of XYZ can detect if the extension is already available, then offer to install it if necessary: |
| 141 | +Alternatively the `activate` method of XYZ can detect whether the extension is already available, then offer to install it if necessary: |
78 | 142 |
|
79 | 143 | ```ts
|
80 | 144 | const extId = "intersystems-community.servermanager";
|
|
0 commit comments