13.07.2015 Views

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

Using Caché Studio - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

For example, we could create a simple template that returns the current date and time (using the $ZDTfunction) in an HTML (boldface) tag:#($ZDT($H,3))#17.3.2.4 Troubleshooting a Simple <strong>Studio</strong> TemplateIf you have problems developing a custom template, one way to debug it is to view your template CSPpage in a browser with View > Web Page while editing your CSP. Use a browser capable of displayingXML text; the value returned by a template is wrapped in XML.For example, you can display the output of the template defined earlier in this section by entering aURL in a browser (or using File > Open URL), such as:http://localhost:8972/csp/user/MyTemplate.cspThis results in the following XML response:The response is contained in a element. The body of the response is delimited usingthe ##www.intersystems.com:template_delimiter## delimiter.17.3.3 Interactive <strong>Studio</strong> TemplatesMaking Your Own <strong>Studio</strong> TemplatesAn interactive template is a set of one or more CSP files that display a dialog window (using HTML)requesting user input. The interactive template's final page inserts a block of text into the current documentat the cursor point, as a simple template does.When you select an interactive template, <strong>Studio</strong> displays a dialog window containing a Web browser.The first page (or pages) of an interactive template returns an HTML form that solicits user input.The first page of an interactive template starts with the tag. Theattributes of this tag are identical to those of the simple template tag. The final page (the one returningoutput to <strong>Studio</strong>) starts with the tag. Any intermediate pages (perhapsyou are creating a multiple page wizard) do not need any special tags. The penultimate page containsa SUBMIT button that invokes the final page.For example, suppose you want to create an interactive template, MyScript, that solicits script contentand script type from a user and inserts a tag into a CSP document. The first page,MyScript.csp, contains a simple HTML form:<strong>Using</strong> <strong>Caché</strong> <strong>Studio</strong> 103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!