@@ -136,15 +136,10 @@ export async function serverActions(): Promise<void> {
136136 const classRef = `/csp/documatic/%25CSP.Documatic.cls?LIBRARY=${ nsEncoded } ${
137137 classname ? "&CLASSNAME=" + classnameEncoded : ""
138138 } `;
139- const soapWizardPath = "/isc/studio/templates/%25ZEN.Template.AddInWizard.SOAPWizard.cls" ;
140139 const project = new URLSearchParams ( uriOfWorkspaceFolder ( ) ?. query ) . get ( "project" ) || "" ;
141140 let extraLinks = 0 ;
142- let hasSOAPWizard = false ;
143141 for ( const title in links ) {
144142 const rawLink = String ( links [ title ] ) ;
145- if ( rawLink . includes ( soapWizardPath ) ) {
146- hasSOAPWizard = true ;
147- }
148143 // Skip link if it requires a classname and we don't currently have one
149144 if ( classname == "" && ( rawLink . includes ( "${classname}" ) || rawLink . includes ( "${classnameEncoded}" ) ) ) {
150145 continue ;
@@ -191,13 +186,11 @@ export async function serverActions(): Promise<void> {
191186 label : "Open Class Reference" + ( classname ? ` for ${ classname } ` : "" ) ,
192187 detail : serverUrl + classRef ,
193188 } ) ;
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+ } ) ;
201194 if (
202195 ! vscode . window . activeTextEditor ||
203196 vscode . window . activeTextEditor . document . uri . scheme === FILESYSTEM_SCHEMA ||
@@ -234,11 +227,34 @@ export async function serverActions(): Promise<void> {
234227 vscode . env . openExternal ( vscode . Uri . parse ( `${ serverUrl } ${ classRef } &CSPCHD=${ token } ` ) ) ;
235228 break ;
236229 }
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+ }
242258 break ;
243259 }
244260 case "openDockerTerminal" : {
0 commit comments