Package org.apache.xindice.client.xmldb.resources

Examples of org.apache.xindice.client.xmldb.resources.XMLResourceImpl


             * If we get a Hashtable back then the result is compressed.
             */
            if ( result instanceof Hashtable ) {
               Hashtable compressed = (Hashtable) result;
               SymbolDeserializer symbolDeserial = new SymbolDeserializer();
               return new XMLResourceImpl(id, id, this,
                                          symbolDeserial.getSymbols(compressed),
                                          (byte []) compressed.get("document"));
            }
            else {
               return new XMLResourceImpl(id, (String) result, this);
            }
           
        } catch (Exception e) {          
            return null;
        }
View Full Code Here


               
                Node n = nodes.item(i);
           
                String documentId = ((Element) n).getAttributeNS(
                        QUERY_NS, "key");          
                XMLResourceImpl resource = new XMLResourceImpl(null,
                        documentId, this, TextWriter.toString(n));
                rs.addResource(resource);
            }
        
            return rs;
View Full Code Here

        checkOpen();
        try {           
            Document doc = col.getDocument(id);

            // This should probably just pass the document.
            return new XMLResourceImpl(id, id, this,
                                       ((DocumentImpl) doc).getSymbols(),
                                       ((DocumentImpl) doc).getDataBytes());           
        } catch (Exception e) {          
            return null;
        }
View Full Code Here

                  ( ( DBNode ) n ).expandSource();
               }

               String documentId = ((Element) n).getAttributeNS(QUERY_NS, "key");

               XMLResourceImpl resource = new XMLResourceImpl(null, documentId, this,
                    TextWriter.toString( n ));
               rs.addResource(resource);
            }
        
            return rs;
View Full Code Here

            name = createId();
        } else if ( name.indexOf('/') != -1 ) {
            throw new XMLDBException( ErrorCodes.INVALID_RESOURCE, "Name cannot contain '/'" );
        }
       
        return new XMLResourceImpl(name, this);
    }
View Full Code Here

               DocumentImpl doc = new DocumentImpl();
               doc.setSymbols(symbols);
               doc.importNode(n, true);
               doc.appendChild(n);
               byte[] b = DOMCompressor.Compress(doc, symbols);
               resource = new XMLResourceImpl(null, documentId, collection,
                  symbols, b);
            }
            else {
               resource = new XMLResourceImpl(null, documentId, collection,
                  TextWriter.toString(n));
            }

            i++;
            resources.add(resource);
View Full Code Here

         set.appendChild(resource);

         i++;
      }

      XMLResource result = new XMLResourceImpl(null, null,
         collection, TextWriter.toString(doc));

      return result;
   }
View Full Code Here

                    DocumentImpl doc = new DocumentImpl();
                    doc.setSymbols(symbols);
                    doc.importNode(n, true);
                    doc.appendChild(n);
                    byte[] b = DOMCompressor.Compress(doc, symbols);
                    resource = new XMLResourceImpl(null, documentId, collection,
                                                   symbols, b);
                } else {
                    resource = new XMLResourceImpl(null, documentId, collection,
                                                   TextWriter.toString(n));
                }

                i++;
                resources.add(resource);
View Full Code Here

            set.appendChild(resource);

            i++;
        }

        XMLResource result = new XMLResourceImpl(null, null,
                                                 collection, TextWriter.toString(doc));

        return result;
    }
View Full Code Here

                // No resource found
                return null;
            } else if (result instanceof Hashtable) {
                Hashtable compressed = (Hashtable) result;
                SymbolDeserializer symbolDeserial = new SymbolDeserializer();
                return new XMLResourceImpl(id, id, this, symbolDeserial.getSymbols(compressed), (byte[]) compressed.get("document"));
            } else if (result instanceof byte[]) {
                return new BinaryResourceImpl(id, this, (byte[]) result);
            } else {
                return new XMLResourceImpl(id, this, (String) result);
            }

        } catch (XMLDBException x) {

            throw x;  // propagate any xmldb exception.
View Full Code Here

TOP

Related Classes of org.apache.xindice.client.xmldb.resources.XMLResourceImpl

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.