@@ -136,15 +136,10 @@ export async function serverActions(): Promise<void> {
136
136
const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ${
137
137
classname ? "&CLASSNAME=" + classnameEncoded : ""
138
138
} `;
139
- const soapWizardPath = "/isc/studio/templates/%25ZEN.Template.AddInWizard.SOAPWizard.cls" ;
140
139
const project = new URLSearchParams ( uriOfWorkspaceFolder ( ) ?. query ) . get ( "project" ) || "" ;
141
140
let extraLinks = 0 ;
142
- let hasSOAPWizard = false ;
143
141
for ( const title in links ) {
144
142
const rawLink = String ( links [ title ] ) ;
145
- if ( rawLink . includes ( soapWizardPath ) ) {
146
- hasSOAPWizard = true ;
147
- }
148
143
// Skip link if it requires a classname and we don't currently have one
149
144
if ( classname == "" && ( rawLink . includes ( "${classname}" ) || rawLink . includes ( "${classnameEncoded}" ) ) ) {
150
145
continue ;
@@ -191,13 +186,11 @@ export async function serverActions(): Promise<void> {
191
186
label : "Open Class Reference" + ( classname ? ` for ${ classname } ` : "" ) ,
192
187
detail : serverUrl + classRef ,
193
188
} ) ;
194
- if ( ! hasSOAPWizard ) {
195
- actions . push ( {
196
- id : "openSOAPWizard" ,
197
- label : "Open SOAP Wizard" ,
198
- detail : `${ serverUrl } ${ soapWizardPath } ?$NAMESPACE=${ nsEncoded } ` ,
199
- } ) ;
200
- }
189
+ actions . push ( {
190
+ id : "openStudioAddin" ,
191
+ label : "Open Studio Add-in..." ,
192
+ detail : "Select a Studio Add-in to open" ,
193
+ } ) ;
201
194
if (
202
195
! vscode . window . activeTextEditor ||
203
196
vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_SCHEMA ||
@@ -234,11 +227,34 @@ export async function serverActions(): Promise<void> {
234
227
vscode . env . openExternal ( vscode . Uri . parse ( `${ serverUrl } ${ classRef } &CSPCHD=${ token } ` ) ) ;
235
228
break ;
236
229
}
237
- case "openSOAPWizard" : {
238
- const token = await getCSPToken ( api , soapWizardPath ) ;
239
- vscode . env . openExternal (
240
- vscode . Uri . parse ( `${ serverUrl } ${ soapWizardPath } ?$NAMESPACE=${ nsEncoded } &CSPCHD=${ token } ` )
241
- ) ;
230
+ case "openStudioAddin" : {
231
+ const addins : ServerAction [ ] = await api
232
+ . actionQuery (
233
+ "SELECT Name AS label, Description AS detail, Url AS id FROM %CSP.StudioTemplateMgr_Templates('ADDIN')" ,
234
+ [ ]
235
+ )
236
+ . then ( ( data ) => data . result . content )
237
+ . catch ( ( error ) => {
238
+ let message = "Failed to fetch list of Studio Add-ins." ;
239
+ if ( error && error . errorText && error . errorText !== "" ) {
240
+ outputChannel . appendLine ( "\n" + error . errorText ) ;
241
+ outputChannel . show ( true ) ;
242
+ message += " Check 'ObjectScript' output channel for details." ;
243
+ }
244
+ vscode . window . showErrorMessage ( message , "Dismiss" ) ;
245
+ return undefined ;
246
+ } ) ;
247
+ if ( addins != undefined ) {
248
+ const addin = await vscode . window . showQuickPick ( addins , {
249
+ placeHolder : `Select Studio Add-In for server: ${ connInfo } ` ,
250
+ } ) ;
251
+ if ( addin ) {
252
+ const token = await getCSPToken ( api , addin . id ) ;
253
+ vscode . env . openExternal (
254
+ vscode . Uri . parse ( `${ serverUrl } ${ addin . id } ?$NAMESPACE=${ nsEncoded } &CSPCHD=${ token } ` )
255
+ ) ;
256
+ }
257
+ }
242
258
break ;
243
259
}
244
260
case "openDockerTerminal" : {
0 commit comments