Package com.jamesmurty.utils

Examples of com.jamesmurty.utils.XMLBuilder.e()


         SortedMap<ResourceType, String> virtualHardwareQuantity) {
      XMLBuilder productSectionBuilder = instantiationParamsBuilder.e("ProductSection").a("xmlns:q1", ns)
            .a("xmlns:ovf", "http://schemas.dmtf.org/ovf/envelope/1");
      if (propLocal.get() != null) {
         for (Entry<String, String> entry : propLocal.get().entrySet()) {
            productSectionBuilder.e("Property").a("xmlns", "http://schemas.dmtf.org/ovf/envelope/1")
                  .a("ovf:key", entry.getKey()).a("ovf:value", entry.getValue());
         }
         propLocal.set(null);
      }
      if (virtualHardwareQuantity.size() > 0) {
View Full Code Here


         XMLBuilder virtualHardwareSectionBuilder = instantiationParamsBuilder.e("VirtualHardwareSection").a(
               "xmlns:q1", ns);
         for (Entry<ResourceType, String> entry : virtualHardwareQuantity.entrySet()) {
            XMLBuilder itemBuilder = virtualHardwareSectionBuilder.e("Item").a("xmlns",
                  "http://schemas.dmtf.org/ovf/envelope/1");
            itemBuilder.e("InstanceID")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(virtualHardwareToInstanceId.get(entry.getKey()));
            itemBuilder.e("ResourceType")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(entry.getKey().value());
View Full Code Here

            XMLBuilder itemBuilder = virtualHardwareSectionBuilder.e("Item").a("xmlns",
                  "http://schemas.dmtf.org/ovf/envelope/1");
            itemBuilder.e("InstanceID")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(virtualHardwareToInstanceId.get(entry.getKey()));
            itemBuilder.e("ResourceType")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(entry.getKey().value());
            itemBuilder.e("VirtualQuantity")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(entry.getValue());
View Full Code Here

                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(virtualHardwareToInstanceId.get(entry.getKey()));
            itemBuilder.e("ResourceType")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(entry.getKey().value());
            itemBuilder.e("VirtualQuantity")
                  .a("xmlns", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData")
                  .t(entry.getValue());
         }
      }
   }
View Full Code Here

   protected String generateXml(Map<String, Object> postParams) throws ParserConfigurationException,
         FactoryConfigurationError, TransformerException {
      XMLBuilder rootBuilder = XMLBuilder.create("NodeService").a("xmlns", ns).a("xmlns:xsi",
            "http://www.w3.org/2001/XMLSchema-instance").a("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
      rootBuilder.e("Name").t(checkNotNull(postParams.get("name"), "name").toString());
      rootBuilder.e("Enabled").t(checkNotNull(postParams.get("enabled"), "enabled").toString());
      if (postParams.containsKey("description") && postParams.get("description") != null)
         rootBuilder.e("Description").t((String) postParams.get("description"));
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
View Full Code Here

   protected String generateXml(Map<String, Object> postParams) throws ParserConfigurationException,
         FactoryConfigurationError, TransformerException {
      XMLBuilder rootBuilder = XMLBuilder.create("NodeService").a("xmlns", ns).a("xmlns:xsi",
            "http://www.w3.org/2001/XMLSchema-instance").a("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
      rootBuilder.e("Name").t(checkNotNull(postParams.get("name"), "name").toString());
      rootBuilder.e("Enabled").t(checkNotNull(postParams.get("enabled"), "enabled").toString());
      if (postParams.containsKey("description") && postParams.get("description") != null)
         rootBuilder.e("Description").t((String) postParams.get("description"));
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      return rootBuilder.asString(outputProperties);
View Full Code Here

      XMLBuilder rootBuilder = XMLBuilder.create("NodeService").a("xmlns", ns).a("xmlns:xsi",
            "http://www.w3.org/2001/XMLSchema-instance").a("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
      rootBuilder.e("Name").t(checkNotNull(postParams.get("name"), "name").toString());
      rootBuilder.e("Enabled").t(checkNotNull(postParams.get("enabled"), "enabled").toString());
      if (postParams.containsKey("description") && postParams.get("description") != null)
         rootBuilder.e("Description").t((String) postParams.get("description"));
      Properties outputProperties = new Properties();
      outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
      return rootBuilder.asString(outputProperties);
   }
View Full Code Here

      XMLBuilder rootBuilder = buildRoot(vApp, name);

      XMLBuilder sectionBuilder = rootBuilder.e("Section").a("xsi:type", "VirtualHardwareSection_Type").a("xmlns",
               "http://schemas.dmtf.org/ovf/envelope/1").a("xmlns:q2", "http://www.vmware.com/vcloud/v1");
      sectionBuilder.e("Info").t("Virtual Hardware");

      addProcessorItem(sectionBuilder, vApp, configuration);
      addMemoryItem(sectionBuilder, vApp, configuration);
      addDiskItems(sectionBuilder, vApp, configuration);
View Full Code Here

      itemBuilder.e("VirtualQuantity").a("xmlns", RESOURCE_ALLOCATION_NS).t(quantity + "");
   }

   private XMLBuilder addDiskWithQuantity(XMLBuilder sectionBuilder, ResourceAllocationSettingData disk) {
      XMLBuilder itemBuilder = sectionBuilder.e("Item");
      itemBuilder.e("AddressOnParent").a("xmlns", RESOURCE_ALLOCATION_NS).t(disk.getAddressOnParent() + "");
      for (String hostResource : disk.getHostResources())
         itemBuilder.e("HostResource").a("xmlns", RESOURCE_ALLOCATION_NS).t(hostResource);
      addCommonElements(itemBuilder, disk, disk.getVirtualQuantity());
      return itemBuilder;
   }
View Full Code Here

   private XMLBuilder addDiskWithQuantity(XMLBuilder sectionBuilder, ResourceAllocationSettingData disk) {
      XMLBuilder itemBuilder = sectionBuilder.e("Item");
      itemBuilder.e("AddressOnParent").a("xmlns", RESOURCE_ALLOCATION_NS).t(disk.getAddressOnParent() + "");
      for (String hostResource : disk.getHostResources())
         itemBuilder.e("HostResource").a("xmlns", RESOURCE_ALLOCATION_NS).t(hostResource);
      addCommonElements(itemBuilder, disk, disk.getVirtualQuantity());
      return itemBuilder;
   }

   protected XMLBuilder buildRoot(VApp vApp, String name) throws ParserConfigurationException,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.