VMware {code} Community
nishtek
Contributor
Contributor

alternative for action script(mediator class) for a html plugin


I am working on a sample html plugin (solution application) for which i created a custom template with an attachment point. now when i am trying to load the application workspace from shortcut then the extension which is hosted by the attachment point of the template is opening a action script(.as file), which in turn will open the whole workspace. but since we cant action scripts directly from extensions , how to do it in HTML plugin. i am providing some code part.


<!--defining a custom template>


<template id="company.project.categoryExtensionPointsTemplate">


      <variable name="namespace" required="true"/>


      <variable name="attachmentPoint" required="false"


         defaultValue="company.project.categoryViews"/>


      <variable name="summaryHeaderView" required="false"/>


&lt;!some extensions and extension points defined here&gt;

<template id="proximaldata.autocache.templates.categoryExtensionPointsTemplate">



      <variable name="namespace" required="true"/>



      <variable name="attachmentPoint" required="false"



         defaultValue="proximaldata.autocache.categoryViews"/>



      <variable name="summaryHeaderView" required="false"/>




</template>


<!-- the main application-->


<extension id="company.project.domainView">


      <extendedPoint>vise.global.views</extendedPoint>


      <hostedPoint>company.project.categoryViews</hostedPoint>


      <object>


         <name>applicatinName</name>


         <icon>#{small.icon}</icon>


         <componentClass className="com.company.project.views.MainView"/> 


      </object>


   </extension>


 


the component class here is provided the name of a action script which will load the workspace in the main area. but in html plugin how to do this.


any help or direction in this regard will be appreciated


thanks

0 Kudos
4 Replies
laurentsd
VMware Employee
VMware Employee

See the HTML bridge documentation for Global Views at  [SDK DIR]/html-bridge/docs/html-bridge.html#global-views, you must use HtmlView as your componentClass, and set the <url> to the HTML resource to load in that view:

<!-- Global app main view -->

  <extension id="com.vmware.samples.h5.globalview.mainView">

    <extendedPoint>vise.global.views</extendedPoint>

    <object>

      <name>#{app.name}</name>
      <componentClass className="com.vmware.vsphere.client.htmlbridge.HtmlView">

        <object>

          <root>
            <url>/vsphere-client/globalview/resources/mainView.html</url>

          </root>

        </object>

      </componentClass>

    </object>

  </extension>

0 Kudos
nishtek
Contributor
Contributor


thanks @laurentsd,


but my problem is: i dont want to load any html page over here. i want to load object workspace with tabs lik getting started, summary monitor etc for my application, for which i have already created a template. now to load that object workspace in html plugin from home shortcut or object navigator panel. i want to create an application plugin like vCO(vCenter Orchestrator)  or vCloud Air where when you click on the shortcut an workspace will appear with the above mentioned tabs. i can't follow chassis app sample is because the workspace is object specific which is not in my case.


my query : when i click on some shortcut or navigation panel node , where should i code in order to load a workspace in main area. i have already tried directly pointing the shortcut to the getting started tab's extension id but looks like it is not working.


if you want any other info please comment.

0 Kudos
laurentsd
VMware Employee
VMware Employee

There are no differences between a Flex plugin and an HTML plugin as far as navigating to an object workspace, or setting up the plugin.xml extensions.  The only difference is that the views will be all using HtmlView instead of a custom Flex view. Sorry,  I don't have any ready made sample for that but you can follow what the other plugins do if you access their plugin.xml

0 Kudos
nishtek
Contributor
Contributor


hi @laurentsd,


i followed the vCO plugin .xml code. i want to create a similar application but with html pages under the monitor and manage tabs. here the main application extension "domain view" is refering to "mainView" action scritp. which is loading the workspace(i guess). so now on the click event of my shortcut how can i load the workspace(the shortcut extension is pointing to $.view ). so how can i load the workspace on clicking the shortcut just like vCO in a html plugin. 


if my query is not clear, can you please guide me that which direction i should proceed to create a custom vCO like solution plugin(object independent). 


thanks

0 Kudos