Package commonj.sdo.helper

Examples of commonj.sdo.helper.XMLHelper.save()


            XMLHelper xmlHelper = helperContext.getXMLHelper();
            QName elementName = SDOContextHelper.getElement(context);
            Document doc = DOMHelper.newDocument();
            DOMResult result = new DOMResult(doc);
            XMLDocument xmlDoc = xmlHelper.createDocument(source, elementName.getNamespaceURI(), elementName.getLocalPart());
            xmlHelper.save(xmlDoc, result, null);
            return doc.getDocumentElement();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here


        }
        try {
            HelperContext helperContext = SDOContextHelper.getHelperContext(context, true);
            XMLHelper xmlHelper = helperContext.getXMLHelper();
            StringWriter writer = new StringWriter();
            xmlHelper.save(source, writer, null);
            return writer.toString();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
    }
View Full Code Here

        }

        try {
            DOMResult domResult = new DOMResult(DOMHelper.newDocument());
            XMLDocument xmlDoc = helper.createDocument(source, null, name);
            helper.save(xmlDoc, domResult, null);
            return node2NodeInfoTransformer.transform(domResult.getNode(), context);
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

   
    DOMResult domResult = new DOMResult();
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
      helper.save(source, null, name, baos);
      baos.flush();
      baos.close();
    } catch (IOException e) {
      throw new TransformationException(e);
    }
View Full Code Here

        XMLHelper xmlHelperLocal = xmlHelper;
        if(objectOutput instanceof SDOObjectOutputStream)
        {
            xmlHelperLocal = ((SDOObjectOutputStream)objectOutput).getHelperContext().getXMLHelper();
        }
        xmlHelperLocal.save(dataObject, "commonj.sdo", "dataObject", gzipOutputStream);
        gzipOutputStream.close(); // Flush the contents

        byte[] byteArray = compressedByteArrayOutputStream.toByteArray();
        objectOutput.writeInt(byteArray.length);
        objectOutput.write(byteArray);
View Full Code Here

    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType);
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
View Full Code Here

      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));
   
    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
View Full Code Here

    assertNotNull(type.getProperty("custNum"));
    assertNotNull(type.getProperty("firstName"));
    assertNotNull(type.getProperty("lastName"));
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
View Full Code Here

      TestUtil.equalXmlFiles(
        new ByteArrayInputStream(baos.toByteArray()),
        getClass().getResource(CUSTOMER1_XML)));
   
    baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer2,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
        TestUtil.equalXmlFiles(
View Full Code Here

    assertEquals(type.getProperty("custNum").getType(), intType);
    assertEquals(type.getProperty("firstName").getType(), stringType);
    assertEquals(type.getProperty("lastName").getType(), stringType)
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    xmlHelper.save(
      customer1,
      "http://example.com/customer",
      "Customer", baos);
    assertTrue(
      TestUtil.equalXmlFiles(
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.