Package org.exist.memtree

Examples of org.exist.memtree.MemTreeBuilder.startDocument()


      if (!targetDir.isAbsolute()) {
        File home = context.getBroker().getConfiguration().getExistHome();
        targetDir = new File(home, target);
      }
     
      output.startDocument();
      output.startElement(new QName("sync", FileModule.NAMESPACE_URI), null);
      output.addAttribute(new QName("collection", FileModule.NAMESPACE_URI), collectionPath);
      output.addAttribute(new QName("dir", FileModule.NAMESPACE_URI), targetDir.getAbsolutePath());
     
      saveCollection(XmldbURI.create(collectionPath), targetDir, startDate, output);
View Full Code Here


            final String[] fields = LuceneUtil.extractFields(query, searcher.getIndexReader());

            final PlainTextHighlighter highlighter = new PlainTextHighlighter(query, searcher.getIndexReader());

            final MemTreeBuilder builder = new MemTreeBuilder();
            builder.startDocument();

            // start root element
            final int nodeNr = builder.startElement("", "results", "results", null);

            // Perform actual search
View Full Code Here

    private ElementImpl createReport(int exitValue, List<String> output, List<String> cmdArgs) {
        MemTreeBuilder builder = context.getDocumentBuilder();
        AttributesImpl attribs = new AttributesImpl();
        attribs.addAttribute("", "exitCode", "exitCode", "CDATA", Integer.toString(exitValue));
        builder.startDocument();
        int nodeNr = builder.startElement(RESULT_QNAME, attribs);

        // print command line
        StringBuilder cmdLine = new StringBuilder();
        for (String param : cmdArgs) {
View Full Code Here

  {
    Sequence    xmlResult     = Sequence.EMPTY_SEQUENCE;
   
    MemTreeBuilder builder = context.getDocumentBuilder();
         
    builder.startDocument();
      builder.startElement( new QName( "dsml", DSML_NAMESPACE, DSML_PREFIX ), null );
    builder.addAttribute( new QName( "dn", null, null ), dn );
    builder.startElement( new QName( "directory-entries", DSML_NAMESPACE, DSML_PREFIX ), null );
   
    while( results.hasMore() ) {
View Full Code Here

            ftp.changeWorkingDirectory(remoteDirectory);

            FTPFile[] ftpFiles = ftp.listFiles();
               
            MemTreeBuilder builder = context.getDocumentBuilder();
            builder.startDocument();
            builder.startElement(new QName("list", FTPClientModule.NAMESPACE_URI), null);
               
            for(FTPFile ftpFile : ftpFiles) {
                if (ftpFile.getType() == FTPFile.FILE_TYPE) {
                    builder.startElement(new QName("file", FTPClientModule.NAMESPACE_URI), null);
View Full Code Here

            logger.debug("Listing matching files in directory: " + baseDir);
        }

        MemTreeBuilder builder = context.getDocumentBuilder();

        builder.startDocument();
        builder.startElement(new QName("list", NAMESPACE_URI, PREFIX), null);
        builder.addAttribute(new QName("directory", null, null), baseDir.toString());

        for (SequenceIterator i = patterns.iterate(); i.hasNext();) {
            String pattern = i.nextItem().getStringValue();
View Full Code Here

        }


        MemTreeBuilder builder = context.getDocumentBuilder();

        builder.startDocument();
        builder.startElement(new QName("list", null, null), null);

        for (File entry : scannedFiles) {
            if (logger.isDebugEnabled()) {
                logger.debug("Found: " + entry.getAbsolutePath());
View Full Code Here

          }
        }     
       
        if(resultSetPos != 0) {
          // iterate through the result set building an XML document
          builder.startDocument();
           
          builder.startElement(new QName("result", OracleModule.NAMESPACE_URI, OracleModule.PREFIX), null);
          builder.addAttribute(new QName("count", null, null), String.valueOf(-1 ));
           
          resultSet = (ResultSet)statement.getObject(resultSetPos);
View Full Code Here

            return getNode(context.getBroker(), (XMLResource)obj);
        } else if (obj instanceof Node) {
            final DOMStreamer streamer = (DOMStreamer) SerializerPool.getInstance().borrowObject(DOMStreamer.class);
            try {
                final MemTreeBuilder builder = new MemTreeBuilder(context);
                builder.startDocument();
                final DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(
                        builder);
                streamer.setContentHandler(receiver);
                streamer.serialize((Node) obj, false);
                return builder.getDocument().getNode(1);
View Full Code Here

            return seq;
        } else if (obj instanceof NodeList) {
            final DOMStreamer streamer = (DOMStreamer) SerializerPool.getInstance().borrowObject(DOMStreamer.class);
            try {
                final MemTreeBuilder builder = new MemTreeBuilder();
                builder.startDocument();
                final DocumentBuilderReceiver receiver = new DocumentBuilderReceiver(
                        builder);
                streamer.setContentHandler(receiver);
                final ValueSequence seq = new ValueSequence();
                final NodeList nl = (NodeList) obj;
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.