Package org.apache.xindice.xml

Examples of org.apache.xindice.xml.NodeSource


            if ( rec == null )
               continue;
           
            Key key = rec.getKey();
            Document doc = new DocumentImpl(rec.getValue().getData(), symbols, new NodeSource(collection, key));
            try {
               new SAXHandler(key, doc, ACTION_CREATE, list);
            }
            catch ( Exception e ) {
               if (log.isDebugEnabled()) {
View Full Code Here


                  if ( doc == lastDoc )
                     continue; // We only have to process it once
                  else
                     lastDoc = doc;
                 
                  NodeSource source = node.getSource();

                  Node contextNode = doc.getDocumentElement();
                  execute(contextNode);

                  col.setDocument(source.getKey(), doc);
               }
            }
         }
      }
   }
View Full Code Here

   public short getSymbolID() {
      return symbolID;
   }

   public void expandSource() {
      NodeSource src = getSource();
      if ( src != null ) {
         setAttribute(SRC_NS, NodeSource.SOURCE_NS);
         setAttribute(SRC_COL, src.getCollection().getCanonicalName());
         Key k = src.getKey();
         if ( k != null )
            setAttribute(SRC_KEY, k.toString());
      }
   }
View Full Code Here

      try {
         doc = DOMParser.toDocument(xml);

         // Have to move it to Xindice DOM for XMLObject AutoLinking
         byte[] b = DOMCompressor.Compress(doc, symbols);
         doc = new DocumentImpl(b, symbols, new NodeSource(this, key));

         if ( documentCache != null )
            documentCache.putDocument(this, key, b);
      }
      catch ( Exception e ) {
View Full Code Here

      if ( document instanceof DBDocument ) {
         // This is a shitty shitty hack... Kill immediately
         DBDocument dbDoc = (DBDocument)document;
         if ( dbDoc.getSource() == null )
            dbDoc.setSource(new NodeSource(this, key));
      }

      Value value =  null;
      if ( compressed ) {
         try {
            byte[] b = DOMCompressor.Compress(document, symbols);
            value = new Value(b);

            document = new DocumentImpl(b, symbols, new NodeSource(this, key));
         }
         catch ( Exception e ) {
            throw new DBException(FaultCodes.COL_CANNOT_STORE, "Error storing Document '"+key+"'", e);
         }
      } else {
View Full Code Here

            return null;

         Value value = record.getValue();

         if ( compressed ) {
            doc = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));

            if ( documentCache != null )
               documentCache.putDocument(this, key, value.getData());
         }
         else
View Full Code Here

            Key key = rec.getKey();
            Value val = rec.getValue();
            if ( val.getData() != null ) {
               try {
                  if ( compressed ) {
                     Document doc = new DocumentImpl(val.getData(), symbols, new NodeSource(Collection.this, key));
                     return new ColContainer(key, doc);
                  }
                  else
                     return new ColContainer(key, DOMParser.toDocument(val));
               }
View Full Code Here

      if ( v instanceof Document )
         doc = (Document)v;
      else if ( v instanceof byte[] ) {
         try {
            SymbolTable s = col.getSymbols();
            NodeSource ns = new NodeSource(col, key);
            doc = new DocumentImpl((byte[])v, s, ns);
         }
         catch ( Exception e ) {
         }
      }
View Full Code Here

        }

        if (inlineMetaService == null || metaMap.get("type").equals(ResourceTypeReader.XML)) {
            Document document;
            if (compressed) {
                document = new DocumentImpl(value.getData(), symbols, new NodeSource(this, key));
                flushSymbolTable();
                if (log.isTraceEnabled()) {
                    log.trace(localDebugHeader +
                              "Compressed XML document=<" + TextWriter.toString(document) + ">");
                }
View Full Code Here

        try {
            doc = DOMParser.toDocument(xml);

            // Have to move it to Xindice DOM for XMLObject AutoLinking
            byte[] b = DOMCompressor.Compress(doc, symbols);
            doc = new DocumentImpl(b, symbols, new NodeSource(this, key));

            if (documentCache != null) {
                documentCache.putDocument(this, key, b);
            }
        } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.apache.xindice.xml.NodeSource

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.