Vsphere Web Client SDK Documentation
Total Page:16
File Type:pdf, Size:1020Kb
vSphere Web Client SDK Documentation VMware vSphere Web Client SDK 6.5.1 VMware ESXi 6.5.1 vCenter Server 6.5.1 vSphere Web Client SDK Documentation You can find the most up-to-date technical documentation on the VMware website at: https://docs.vmware.com/ If you have comments about this documentation, submit your feedback to [email protected] VMware, Inc. 3401 Hillview Ave. Palo Alto, CA 94304 www.vmware.com Copyright © 2013–2017 VMware, Inc. All rights reserved. Copyright and trademark information. VMware, Inc. 2 Contents 1 vSphere Web Client SDK Documentation 8 Revision History 9 About vSphere Web Client SDK 10 Knowledge Requirements for Using the vSphere Web Client SDK 10 vSphere Web Client SDK Contents 11 SDK Versions and Compatibility 12 Naming Convention for vSphere Objects in the vSphere Web Client SDK 13 2 About the vSphere Web Client and the vSphere Client 14 Introduction to the vSphere Web Client 14 Understanding the vSphere Web Client Architecture 14 Overview of the vSphere Web Client User Interface Layer Components 16 Introduction to the vSphere Client 21 Understanding the vSphere Client Architecture 21 Overview of the User Interface Layer Components 22 Understanding Extensibility in the vSphere Client and the vSphere Web Client 23 Extending the User Interface Layer 24 Extending the Java Service Layer 24 3 vSphere Web Client SDK Installation and Setup Guide 26 Software Requirements 26 Development Environment Requirements Overview 27 Setting Up for HTML-Based Plug-In Development 27 Download the vSphere Web Client SDK 28 Set Up for Java Development 29 Automate the Plug-In Build Process 30 Set Up the Eclipse Integrated Development Environment 31 Install the vSphere Web Client Tools Eclipse Plug-In 32 Register Your Local vSphere Client with the vCenter Server Instance 33 Configure the Virgo Server in Your Eclipse IDE 35 Set Up the Adobe Flex 4.6 Software Development Kit 36 4 vSphere Web Client SDK Upgrade 37 Upgrading Plug-Ins Created with the vSphere Web Client SDK 6.0 Update 2 37 Upgrading Plug-Ins Created with the vSphere Web Client SDK 6.0 Update 1 39 Upgrading Plug-Ins Created with the vSphere Web Client SDK 6.0 39 VMware, Inc. 3 vSphere Web Client SDK Documentation Upgrading Plug-Ins Created with the vSphere Web Client SDK 5.5.x 40 5 Quick Startup Guide for Developing HTML-Based Plug-Ins 41 Before Creating an HTML Plug-In 41 Creating an HTML Plug-In Project 41 Generate an HTML Plug-In Project with a Script 42 Create an HTML Plug-In Project with Eclipse 42 Contents of the HTML Plug-In Project Template 43 Building a Plug-In Package from the Project Template 45 Testing the Generated Plug-Ins 46 Deploy the Plug-In on a Local vSphere Client 46 Deploy Your Plug-In on a Local vSphere Web Client 47 Deploying Your Plug-In on a Remote vSphere Client or vSphere Web Client 48 6 Developing Flex-Based User Interface Extensions 51 Understanding the User Interface Layer 52 User Interface Plug-In Module Manifest 52 XML Elements in the Manifest File 53 Specifying Dynamic Resources 54 Defining Extensions 55 Extension Definition XML Schema 56 Ordering Extensions 58 Filtering Extensions 59 Using Templates to Define Extensions 62 Types of User Interface Extensions 62 Global View Extensions 62 Object Workspace Extensions 63 Object Navigator Extensions 63 Action Extensions 63 Relation Extensions 64 Home Screen Shortcut Extensions 64 Object List View Extensions 64 Adding Global View Extensions 64 Properties of the GlobalViewSpec Extension Object 65 Extending the vCenter Object Workspaces 67 Extending an Existing Object Workspace 67 Creating an Object Workspace for a Custom Object 70 Creating Data View Extensions 73 Understanding the Frinje Framework 74 Using the Data Access Manager Library 83 Extending the Object Navigator 91 Defining an Object Navigator Extension 92 VMware, Inc. 4 vSphere Web Client SDK Documentation Using a Template to Create an Object Collection Node Extension 97 Adding Custom Icons and Labels to an Object Collection Node 97 Creating Action Extensions 99 Actions Framework Overview 99 Defining an Action Set 100 Defining Individual Actions for Flex-Based Action Extensions 100 Handling Actions with Flex Command Classes 102 Performing Action Operations on the vSphere Environment 104 Organizing Your Actions in the User Interface 105 Creating Relation Extensions 111 Defining a Relation Extension 112 Describing a Relation by Using the RelationSpec Object 113 Creating Home Screen Shortcuts 115 Properties of the ShortcutSpec Extension Object 115 Creating Object List View Extensions 117 Defining Object List View Extensions 118 7 Developing HTML-Based User Interface Extensions 121 Overview 122 Global View Extensions 122 Properties of the HtmlView Extension Object 123 Adding a vCenter Server Selector 124 Extending the vCenter Object Workspace 125 Extending an Existing Object Workspace 126 Creating an Object Workspace for a Custom Object 128 Creating Data View Extensions 131 Creating Object List View Extensions 133 Creating Actions Extensions 134 Actions Framework Overview 135 Defining an Action Set 135 Defining Individual Actions for HTML-Based Action Extensions 135 Handling Actions for HTML-Based Action Extensions 139 Handling Locales 140 Guidelines for Creating Plug-Ins Compatible with the vSphere Client 143 Hybrid Plug-Ins 145 vSphere Client JavaScript APIs 146 Mapping the JavaScript to the Flex APIs 149 8 Developing Extensions to the Service Layer 151 Understanding the vSphere Web Client Data Service 151 Extending the Service Layer with Custom Components 152 Custom Component Types 154 VMware, Inc. 5 vSphere Web Client SDK Documentation Interfaces to the Service Layer 155 Communications with the Virgo Service Layer 155 Overview of Data Service Queries 156 When To Use Data Service Queries 156 RequestSpec Data Structure in Data Service Queries 156 ResultSet Data Structure in Data Service Queries 159 Extending the Data Service with a Data Service Adapter 159 Advantages of Providing a Data Service Adapter 159 Designing a Data Service Adapter 160 Property Provider Adapters 162 Data Provider Adapters 164 Creating a Custom Java Service 170 Make Java Services Available to the UI Components in the vSphere Web Client and the vSphere Client 170 Creating the Java Interface and Classes 171 Persisting Data from Your Plug-Ins to the vCenter Server Appliance and the vCenter Server System 171 Packaging and Exposing the Service 172 Importing a Service in a User Interface Plug-In Module 173 9 Creating and Deploying Plug-In Packages 176 Plug-In Package Overview 176 XML Elements of the Plug-In Package Manifest File 177 Plug-Ins Compatibility Matrix 179 Deploying a Plug-In Package 180 Deploying a Plug-In Package From a Remote Server 181 Register a Plug-In Package as a vCenter Server Extension 181 Creating the vCenter Server Extension Data Object 182 Verifying Your Plug-In Package Deployment 184 Unregister a Plug-In Package 185 10 Sample Plug-Ins Overview 186 HTML Sample Plug-Ins 187 11 Best Practices for Developing Extensions for the vSphere Web Client 190 Best Practices for Creating Plug-In Packages 190 Best Practices for Plug-In Modules Implementation 192 Best Practices for Developing HTML-Based Extensions 193 Best Practices for Extending the User Interface Layer 194 Best Practices for Extending the Service Layer 195 OSGi-Specific Recommendations 196 DataService -Specific Best Practices 198 VMware, Inc. 6 vSphere Web Client SDK Documentation Best Practices for Deploying and Testing Your vSphere Web Client Extensions 200 12 List of Extension Points 202 Global Extension Points 203 Object Navigator Extension Points 206 Object Workspace Extension Points 208 Actions Extension Points 215 Extension Templates 218 Custom Object Extension Points 219 VMware, Inc. 7 vSphere Web Client SDK Documentation 1 ® The VMware vSphere Web Client SDK is a collection of Java, Flex, and JavaScript libraries, utility tools, code samples, and documentation to help you create extensions to the vSphere Web Client and the vSphere Client . VMware, Inc. 8 Revision History This vSphere Web Client SDK Documentation is updated with each release of the product or when necessary. This table provides the update history of the vSphere Web Client SDK Documentation. Revision Description 13NOV2017 Improvements to SDK version compatibility information. Corrections to deprecated extension points. 11MAY2017 Initial release for vSphere 6.5 Update 1. VMware, Inc. 9 About vSphere Web Client SDK The vSphere Web Client SDK Documentation provides information about developing extensions to the ® ® VMware vSphere Web Client and the VMware vSphere Client in vSphere 6.5. VMware provides many APIs and SDKs for different applications and goals. This documentation provides information about the extensibility framework of the vSphere Web Client and the vSphere Client for developers that are interested in extending the Web applications with custom functionality. Intended Audience This information is intended for anyone who wants to extend the vSphere Web Client and the vSphere Client with custom functionality in vSphere 6.5. Users typically are software developers who use Flex or ActionScript, or HTML and JavaScript, to create graphical user interface components that work ® with VMware vSphere . VMware Technical Publications Glossary VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions of terms as they are used in VMware technical documentation, go to http://www.vmware.com/support/pubs. Knowledge Requirements for Using the vSphere Web Client SDK Developing extensions for the vSphere Client and the vSphere Web Client by using the vSphere Web Client SDK, requires expertise with MXML and ActionScript, or HTML and JavaScript, and Java. n The vSphere Web Client SDK provides a custom Model-View-Controller framework, also called Frinje framework. Understanding how the Frinje framework implements the MVC pattern is essential to developing data view extensions. The graphic elements of the View component of the MVC framework are implemented in MXML classes and the logic elements of the View component are implemented in ActionScript classes.