I am trying to apply a EQUALS_ANY_OF condition in plugin.xml file. but this condition is not working due to which my portlet is not appearing in plugin mode.
While on same extension when i am using only EQUALS condition it is working fine and appearing in plugin mode.
Here is code below.
<extension id="mycompany.testPortlet">
<extendedPoint>vsphere.core.datastore.summarySectionViews</extendedPoint>
<object>
<name>#{PortletName}</name>
<contentSpec>
<url>/ui/index.html?view=portlet-view</url>
<metadata><entry><key>hasTitle</key><value>false</value></entry></metadata>
</contentSpec>
</object>
<metadata>
<objectType>Datastore</objectType>
<propertyConditions>
<com.vmware.data.query.CompositeConstraint>
<nestedConstraints>
<com.vmware.data.query.PropertyConstraint>
<propertyName>summary.type</propertyName>
<comparator>EQUALS_ANY_OF</comparator>
<comparableValue>
<String>VVOL,NFS,NFS41,NAS,VMFS</String>
</comparableValue>
</com.vmware.data.query.PropertyConstraint>
</nestedConstraints>
</com.vmware.data.query.CompositeConstraint>
</propertyConditions>
</metadata>
</extension>
Please provide inputs on this.
Thanks in Advance.
Hi dharmeshj,
On which vCenter version is this problem occurring ?
Cheers,
Martin
Hi Stoevm,
Thanks for replying, I am getting this issue in vcenter 6.5 version.
Regards
Dharmesh
To be specific we are using vSphere v6.5U2
Could you please provide the working sample of plugin.xml?
Hi,
The problem in the upper snippet are the following lines:
<comparator>EQUALS_ANY_OF</comparator>
<comparableValue>
<String>VVOL,NFS,NFS41,NAS,VMFS</String>
</comparableValue>
They should be written as
<comparator>EQUALS_ANY_OF</comparator>
<comparableValue>
<Array>
<String>VVOL</String>
<String>NFS</String>
<String>NFS41</String>
<String>NAS</String>
<String>VMFS</String>
</Array>
</comparableValue>
Sorry for the delay.
Martin
Thanks. We will try and let you know.
But as per vSphere Client SDK documentation Online Documentation - Developing Local Plug-ins with the vSphere Client SDK - VMware {code} it is mentioned as comma seperated.
"You use the <comparator> element to choose how the property is compared against the value you specify in the filter. You can use values of EQUALS, NOT_EQUALS, GREATER, SMALLER, CONTAINS, EQUALS_ANY_OF or CONTAINS_ANY_OF. If you use the CONTAINS operator, you must provide an array of values. If you use the operators EQUALS_ANY_OF or CONTAINS_ANY_OF, you must provide a string containing multiple values in the <comparableValue> element, each separated by a comma."
I saw that too while testing.
Noted. We should fix this documentation bug.
Thanks kumartade,
Martin
Hi,
I applied your suggestion and its working as expected.
Thanks a lot.
Regards
Dharmesh
