VMware Cloud Community
guyhanael
Contributor
Contributor
Jump to solution

vso.xml and solarSystem example

I am kind of cunfused.

In the solarSystem example I see that the is an action in VCO called getAllPlanets().

Was this action configured in the vso.xml and it is part of the .dar file or is it part of the VCO installaion ?

My main goal at the end is to be able to deploy/install my plugin and action to VCO in the easiest way possible.(For further use by clients)

Some help will be appriciated.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
admin
Immortal
Immortal
Jump to solution

Okay, I guess i got what you are asking.

The getAllPlanets action has been created when the plug-in was deployed and has been imported as an action inside a package file. Now this package file, com.vmware.samples.solarsystem.package, contains this action element, which is then shipped as a package file in the .dar file of the solarsystem plug-in. Hence, this action gets deployed automatically when you deploy your solarsystem plugin. This is not coded anywhere in the plugin code, but action is imported in the package file.

I hope this answers your query. Smiley Happy

View solution in original post

0 Kudos
4 Replies
admin
Immortal
Immortal
Jump to solution

Can you please elaborate more on "Was this action configured in the vso.xml "? Did you meant that where is the getAllPlanets method scripted in the vso.xml?

The method is not scripted in the vso.vml. Basically the flow of the plug-in installation and deployment is that the vso.xml file is an interface to communicate with your plug-in and the vCO server. The adaptor interface provides the main entry into the plugin which calls and the pluginfactory interface. Now the getAllPlanets method is being called in the find method in the pluginfactory and it has been defined in the SolarSystemRepository class.

Does this clears your confusion?

guyhanael
Contributor
Contributor
Jump to solution

I think I was not clear.

Does the scriptable action under the action folder in VCO was "manually" inserted into the VCO or was it deployed ?

Because I tried to look for the scriptting of the action below in the source code of the solarsystem example and I couldnot find.

var planets = Server.findAllForType("SolarSystem:Planet");

if(planets==null){

throw("NoPlanetException: There is no planet in this server.");

}

System.log("Find " + planets.length + " planets.");

return planets;

{/code}

0 Kudos
admin
Immortal
Immortal
Jump to solution

Okay, I guess i got what you are asking.

The getAllPlanets action has been created when the plug-in was deployed and has been imported as an action inside a package file. Now this package file, com.vmware.samples.solarsystem.package, contains this action element, which is then shipped as a package file in the .dar file of the solarsystem plug-in. Hence, this action gets deployed automatically when you deploy your solarsystem plugin. This is not coded anywhere in the plugin code, but action is imported in the package file.

I hope this answers your query. Smiley Happy

0 Kudos
guyhanael
Contributor
Contributor
Jump to solution

Thanks alot Angela

I created a package. Added the configuration and action, then exported it an added it to my vso.xml and created the dar.

It worked perfectly and deployed everything.

VCO is super user friendly (with a bit of help Smiley Happy ).

One more if I can

I added a configuration element category (koko) and configuration element (kokoSdk) :

koko--

|

--- kokoSdk

I wrote this code to fetch the attributes from kokoSdk.

Is there a faster way to do it , I found only getAllConfigurationElementCategories?

function getProperties(){

var output = new Object();

var categories = Server.getAllConfigurationElementCategories() ;

for (i=0 ; i < categories.length ; i++){

if (categories[i].name == "koko")

var configurationElements = categories[i].allConfigurationElements ;

}

for (i=0 ; i < configurationElements.length ; i++){

if (configurationElements[i].name == "kokoSdk")

var attributes = configurationElements[i].attributes ;

}

return attributes;

}

{/code}

0 Kudos