Package com.dbxml.xml.dtsm

Examples of com.dbxml.xml.dtsm.DocumentTable


   }

   public String insertDocumentAsText(String document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.textToTable(document, col.getSymbols());
         return col.insertDocument(tx, dt).toString();
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
View Full Code Here


   }

   public void setDocument(String docKey, Document document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.documentToTable(document, col.getSymbols());
         col.setDocument(tx, docKey, dt);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
View Full Code Here


   public void setDocumentAsText(String docKey, String document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.textToTable(document, col.getSymbols());
         col.setDocument(tx, docKey, dt);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
View Full Code Here

   }

   private void write() {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.documentToTable(doc, sysObj.getSymbols());
         sysObj.setDocument(tx, docKey, dt);
      }
      catch ( Exception e ) {
         try {
             tx.cancel();
View Full Code Here

   public static final String REST_CONTENT_TYPE_getDocument = Headers.TYPE_TEXT_XML;

   public String getDocument(String docKey) throws DBException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = col.getDocument(tx, docKey);
         if ( dt == null )
            throw new DBException(FaultCodes.COL_CANNOT_RETRIEVE, "Document '"+docKey+"' not found");

         return DTSMHelper.tableToText(dt);
      }
View Full Code Here

   public static final String[] PARAMS_insertDocument = {"document"};

   public String insertDocument(String document) throws DBException {
      Transaction tx = new Transaction();
      try {
         DocumentTable doc = DTSMHelper.textToTable(document, col.getSymbols());
         return col.insertDocument(tx, doc).toString();
      }
      catch ( DBException e ) {
         tx.cancel();
         throw e;
View Full Code Here

   public static final String[] PARAMS_setDocument = {"docKey", "document"};

   public void setDocument(String docKey, String document) throws DBException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.textToTable(document, col.getSymbols());
         col.setDocument(tx, docKey, dt);
         tx.commit();
      }
      catch ( DBException e ) {
         tx.cancel();
View Full Code Here

    * @return a DOM Document
    * @throws DBException If a Database Exception occurs
    */
   public void getDocument(Transaction tx, Object key, ContentHandler handler) throws DBException {
      try {
         DocumentTable dt = col.getDocument(tx, key);
         if ( dt != null )
            DTSMHelper.tableToSAX(dt, handler);
      }
      catch ( DTSMException e ) {
         throw new DBException(FaultCodes.COL_CANNOT_RETRIEVE, "Error retrieving object '" + key + "'", e);
View Full Code Here

         this.key = key;
      }

      public void complete() {
         try {
            DocumentTable dt = getTableBuilder().buildDocumentTable();
            col.setDocument(tx, key, dt);
         }
         catch ( DBException e ) {
            /** @todo Uh-oh... What do we do? */
            e.printStackTrace(System.err);
View Full Code Here

      ProcessingInstruction pi = doc.createProcessingInstruction(CLASSNAME, obj.getClass().getName());
      doc.appendChild(pi);
      Node node = obj.streamToXML(doc);
      doc.appendChild(node);

      DocumentTable dt;
      try {
         dt = DTSMHelper.documentToTable(doc, col.getSymbols());
      }
      catch ( DTSMException e ) {
         throw new DBException(FaultCodes.COL_CANNOT_STORE, "Error storing object '" + key + "'", e);
View Full Code Here

TOP

Related Classes of com.dbxml.xml.dtsm.DocumentTable

Copyright © 2018 www.massapicom. 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.