5.5

Table Of Contents
Example: Web View Template Access.jwc File
The following example shows a component specification file that implements the WebviewComponent Java
interface.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE component-specification PUBLIC
"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
"http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
<component-specification class="ch.dunes.web.webview.WebviewComponent">
</component-specification>
Tapestry Component Template File
A Tapestry component template file is an HTML file that defines the layout of a Web view component.
The name of the Tapestry component template file must match the name of the component specification
JWC file.
Example: Web View Template Access.html File
The following example shows a component template file that displays the user's username and adds a
Logout link to a Web view page.
<strong>
<vco jwcid="@Insert" value="ognl:page.user.displayName" />
</strong>
<vco jwcid="@Insert" value="ognl:' (' + page.getUsername() + ')'" />
&nbsp;|&nbsp;
<a jwcid="@Any" href="ognl:page.webviewUrl + '?logout'">Logout</a>
WebviewComponent Class
The ch.dunes.web.webview.WebviewComponent class is the main class for Web view components. All Web
view component specification JWC files must implement this class.
Implementing the WebviewComponent class in an Orchestrator Web view component allows you to call
methods in a Web view page to perform various functions in the Orchestrator server, such as retrieving
attributes, making queries, getting and setting parameters and attributes, and implementing Dojo widgets in
the Web view component.
The WebviewComponent class extends the org.apache.tapestry.BaseComponent Tapestry class. The
BaseComponent class provides the implementation for all Tapestry components that implement an HTML
definition file.
The WebviewComponent class defines the following methods.
Table 61. Methods of the WebviewComponent class
Method Returns Description
getWebviewPage() ch.dunes.web.webview.WebviewPage Returns the WebviewPage object
of the page that contains this
component.
getWebview() ch.dunes.model.webview.WebView Returns the WebView object that
represents the current Web view.
getRequestCycle() org.apache.tapestry.IRequestCycle The IRequestCycle object is the
Tapestry object that controls
every access to the server.
Developing Web Views for VMware vCenter Orchestrator
28 VMware, Inc.