Developing Web Views for VMware vCenter Orchestrator vCenter Orchestrator 5.5 This document supports the version of each product listed and supports all subsequent versions until the document is replaced by a new edition. To check for more recent editions of this document, see http://www.vmware.com/support/pubs.
Developing Web Views for VMware vCenter Orchestrator You can find the most up-to-date technical documentation on the VMware Web site at: http://www.vmware.com/support/ The VMware Web site also provides the latest product updates. If you have comments about this documentation, submit your feedback to: docfeedback@vmware.com Copyright © 2008–2013 VMware, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws.
Contents Developing Web Views for VMware vCenter Orchestrator 5 1 Web View Overview 7 2 Weboperator Web View 9 Start the Weboperator Web View 9 3 Web View Development Tasks to Perform in Orchestrator 11 Create a Web View Skeleton 11 Export a Web View as a Template 12 Create a Web View from a Template 13 Define a Web View Template as a Resource Element 14 Create a Web View from a Resource Element Template 14 Export Web View Files to a Working Folder 15 Configure the Server for Web View Development 16 I
Developing Web Views for VMware vCenter Orchestrator vco:Login Component 37 vco:PageAccessControl Component 37 vco:TaskAction Component 38 vco:WebformContainer Component 39 vco:WorkflowLink Component 40 7 Accessing Server Objects from URLs 43 Running Actions from URLs 43 Run an Action from a URL 44 Accessing Resource Elements from URLs 45 Obtain a Resource Element from a URL 45 8 Create a Simple Web View Using the Default Template 47 Import the Default Web View Template 48 Export the Virtual Machine
Developing Web Views for VMware vCenter Orchestrator Developing Web Views for VMware vCenter Orchestrator provides information about developing Web views for ® VMware vCenter Orchestrator. Orchestrator Web views are Web 2.0 frontends that allow users to access Orchestrator workflows and objects in the Orchestrator inventory by using a Web browser rather than by using the Orchestrator client. Orchestrator provides a standard Web view that users can use to run workflows, called weboperator.
Developing Web Views for VMware vCenter Orchestrator 6 VMware, Inc.
Web View Overview 1 A Web view is a package of Web pages, style sheets, icons, and banners that represent a complete Web site. Web views can contain special Java Web Components (JWC) that add Orchestrator functions to the pages of the Web views. For example, you can add components that allow users to run workflows from a browser. Orchestrator Web views update content dynamically without obliging users to reload complete pages. Orchestrator provides a library of Tapestry Framework 4.
Developing Web Views for VMware vCenter Orchestrator 8 VMware, Inc.
Weboperator Web View 2 Orchestrator provides a standard Web view called weboperator that allows users to run workflows from a browser. The weboperator Web view provides an example of the orchestration functions that Web views can provide to end users in browsers, without requiring that those users use the Orchestrator client. Start the Weboperator Web View You start the weboperator Web view from the Orchestrator client. Procedure 1 From the drop-down menu in the Orchestrator client, select Administer.
Developing Web Views for VMware vCenter Orchestrator You can use the weboperator Web view to run workflows on objects in your inventory from a Web browser rather than from the Orchestrator client. What to do next If you only need a Web view to access the inventory and run workflows, the standard weboperator Web view should meet your requirements.
Web View Development Tasks to Perform in Orchestrator 3 You create the Web pages and Web view components that form an Orchestrator Web view by using Web development tools. You also use the Orchestrator client and configuration interface to perform many of the steps of Web view development.
Developing Web Views for VMware vCenter Orchestrator 5 Right-click the Web view in the Web view list and select Edit. The Web view editor opens. 6 On the General tab, set the URL folder value to include a suffix for the URL on which Orchestrator will publish the Web view.
Chapter 3 Web View Development Tasks to Perform in Orchestrator What to do next Create a new Web view from the template. Create a Web View from a Template You can reduce the amount of development work by creating a Web view from a template. A Web view template is a ZIP file that contains all the files and components of an existing Web view that you can use as the basis from which to create a new Web view.
Developing Web Views for VMware vCenter Orchestrator 10 On the General tab, type a description of the Web view in the Description text box . 11 Click Save and close to close the Web view editor. You created a new Web view from a Web view template. What to do next Export the contents of the new Web view to a working folder to modify them, and edit the Web view settings and attributes in the Orchestrator client.
Chapter 3 Web View Development Tasks to Perform in Orchestrator 4 Press the Enter key in the Filter text box to display a list of all the resource elements that the Orchestrator server defines. 5 Select the Web view template ZIP file from the list of resource elements and click Select. 6 Provide an appropriate name for the new Web view in the Create Web View dialog box and click OK. 7 Right-click the Web view in the Web view list and select Edit. The Web view editor opens.
Developing Web Views for VMware vCenter Orchestrator What to do next You can edit and adapt the Web view files by using Web development tools. NOTE To preview the Web view from the working folder while you develop it, set the Orchestrator server to Web view development mode. Configure the Server for Web View Development During the Web view development process, you can configure the Orchestrator server to publish the Web view from a working folder rather than from the Orchestrator server.
Chapter 3 Web View Development Tasks to Perform in Orchestrator 10 Right-click the Web view and select Publish. You set the Orchestrator server to Web view development mode, in which you can preview a Web view from your working folder while you develop it. Import Web View Files from a Working Folder After you edit the files of a Web view in the working folder, you must import them back to the Web view in the Orchestrator server.
Developing Web Views for VMware vCenter Orchestrator 5 Right-click in the Attributes tab and select Add attribute. 6 Click the attribute name and type a name. 7 Click the attribute Type link and select the attribute type from the list. 8 Click the attribute Value link and type or select the value of the attribute. You type or select the attribute value depending on the type of the attribute. 9 Click Save and Close to exit the Web view editor.
Chapter 3 Web View Development Tasks to Perform in Orchestrator 11 From the proposed list, select the resource element or a folder containing resource elements and click Select. 12 Click Save and close to exit the editor. You added a resource element or folder of resource elements as an attribute in a Web view.
Developing Web Views for VMware vCenter Orchestrator 20 VMware, Inc.
File Structure of a Web View 4 When you develop a Web view, you must save the collection of Web pages and Web view components that comprise the Web view to a working folder. The Web view working folder must conform to basic filenaming and file-structuring rules. You can name the working folder in which you develop the Web view pages and components any name that is appropriate. The working folder must contain the following file and folder at its root. Table 4‑1.
Developing Web Views for VMware vCenter Orchestrator 22 VMware, Inc.
5 Web View Home Page All Web views must contain a file named default.html, that you must save at the root of the Web view working folder. The default.html file is the home page of the Web view. The default.html file is the point of entry to a Web view. The default Web view template that Orchestrator provides contains a skeleton default.html file that you can adapt and extend. The following code extract shows the contents of the default.html file from the default Web view template.
Developing Web Views for VMware vCenter Orchestrator 24 VMware, Inc.
Web View Components 6 Web view components add Orchestrator functions to Web pages. For example, you can add Web view components to Web pages that allow users to run workflows from a Web page in a browser. You build Orchestrator Web views by adding JWC components to HTML Web pages. Orchestrator provides a library of JWC Web view components that add predefined orchestration functions to Web views. The JWC Web view components that Orchestrator provides conform to the Tapestry Framework 4.0 standard.
Developing Web Views for VMware vCenter Orchestrator Add a Tapestry Component in an HTML Page You add Tapestry components to a Web view by adding a jwcid attribute to an HTML tag in a Web page. The jwcid attribute references a Web view component. You can add a jwcid attribute to any HTML tag. You can add references to components from the Orchestrator Web view component library, to components from the Tapestry Standard, or to custom components that you create.
Chapter 6 Web View Components You must save the component files in the components folder in the Web view file structure. If you create subfolders in the components folder, you must specify the full path to a component when you set the jwcid attribute in HTML pages. For example, if you include a MyBorder component in a \components\layout\ subfolder, you must set the jwcid attribute, as the following example shows: You can precede the @ character with a unique
Developing Web Views for VMware vCenter Orchestrator Example: Web View Template Access.jwc File The following example shows a component specification file that implements the WebviewComponent Java interface. PAGE 29Chapter 6 Web View Components Table 6‑1. Methods of the WebviewComponent class (Continued) Method Returns Description getWebVisitor() ch.dunes.web.webview.WebVisitor The WebVisitor object contains information about the Web view user for the server to use. getParameter(java.lang.String parameterName) java.lang.Object Returns a query parameter value, or null if no query parameter is provided in the request. If multiple values are provided, it returns the first value. getParameters(java.lang.
Developing Web Views for VMware vCenter Orchestrator Constructor public WebviewComponent() WebviewPage Class The ch.dunes.web.webview.WebviewPage class provides methods that you call in OGNL expressions in Web view component template HTML files. The WebviewPage class extends the Tapestry class org.apache.tapestry.html.BasePage. The WebviewPage class defines the following methods: Table 6‑2. Methods of the WebviewPage class 30 Method Returns Description addQueryParameter( boolean condition, java.lang.
Chapter 6 Web View Components Table 6‑2. Methods of the WebviewPage class (Continued) Method Returns Description getPageUrl() java.lang.String Returns the URL of the current page without the URL parameters. getPageUrlWithQuerryString() java.lang.String Returns the URL of the current page with the URL parameters. getParameter(java.lang.String parameterName) java.lang.Object Returns a query parameter value, or null if no query parameter is provided in the request.
Developing Web Views for VMware vCenter Orchestrator The WebObjectComponent class inherits the following methods from class java.lang.Object: clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString,wait, wait, wait Constructor WebObjectComponent() Example: Using WebObjectComponent to Display Object Information The following vmo:ListPane component displays information about the objects it lists in an HTML page called panel.
Chapter 6 Web View Components vco:DisplayProperty Component The vco:DisplayProperty component displays the names and values of the properties of objects in the Orchestrator inventory. Properties The vco:DisplayProperty component defines the following properties.
Developing Web Views for VMware vCenter Orchestrator Properties The vco:IncludeJavascript component defines the following properties. Name Type Description src String The path to a Javascript file, with or without the .js extension Example: vco:IncludeJavascript Component The .js file extension is optional. The following example code lines both return the same src value.