Examples of DocumentInfo


Examples of net.sf.saxon.om.DocumentInfo

            String documentKey = Document.computeDocumentKey(href, expressionBaseURI, context);
            DocumentPool pool = context.getController().getDocumentPool();
            if (pool.isMarkedUnavailable(documentKey)) {
                return false;
            }
            DocumentInfo doc = pool.find(documentKey);
            if (doc != null) {
                return true;
            }
            Item item = Document.makeDoc(href, expressionBaseURI, context, this);
            if (item != null) {
View Full Code Here

Examples of net.sf.saxon.om.DocumentInfo

     * @throws Exception
     */

    public static void main(String[] args) throws Exception {
        Configuration config = new Configuration();
        DocumentInfo doc = config.buildDocument(new StreamSource(new File("c:/MyJava/samples/data/books.xml")));
        PipelineConfiguration pipe = config.makePipelineConfiguration();
        pipe.setHostLanguage(Configuration.XQUERY);
        EventIterator e = new Decomposer(new SingletonEventIterator(doc), pipe);
        e = EventStackIterator.flatten(e);
        e = new PullEventTracer(e, config);
View Full Code Here

Examples of net.sf.saxon.om.DocumentInfo

        props.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
        props.setProperty(OutputKeys.INDENT, "yes");

        final DynamicQueryContext dynamicContext = new DynamicQueryContext(config);
        final SequenceIterator iter = exp.iterator(dynamicContext);
        final DocumentInfo doc = QueryResult.wrap(iter, config);
        QueryResult.serialize(doc, new StreamResult(System.out), props, config);
    }
View Full Code Here

Examples of net.sf.saxon.om.DocumentInfo

        // First read the catalog document

        String href = argument[0].evaluateItem(context).getStringValue();

        DocumentInfo catalog =
                (DocumentInfo) Document.makeDoc(href, expressionBaseURI, context);
        if (catalog==null) {
            // we failed to read the catalogue
            dynamicError("Failed to load collection catalogue " + href, context);
            return null;
        }

        // Now return an iterator over the documents that it refers to

        SequenceIterator iter =
                catalog.iterateAxis(Axis.CHILD, NodeKindTest.ELEMENT);
        NodeInfo top = null;
        while (true) {
            top = (NodeInfo)iter.next();
            if (top == null) break;
            if (!("collection".equals(top.getLocalPart()) &&
View Full Code Here

Examples of net.sf.saxon.om.DocumentInfo

    * the transformation of the constructed document
    */

    public void close() throws XPathException {
        super.close();
        DocumentInfo doc = builder.getCurrentDocument();
        if (doc==null) {
            throw new DynamicError("No source document has been built");
        }
        doc.getNamePool().allocateDocumentNumber(doc);
        try {
            controller.transformDocument(doc, result);
        } catch (TransformerException e) {
            throw XPathException.wrap(e);
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.document.IDocumentSource.DocumentInfo

        if (docDialog != null) {
            final Job editDocJob = new Job(Messages.DocumentView_updateDocProgressMsg){
                @Override
                protected IStatus run(IProgressMonitor monitor) {
                    boolean isUpdated = false;
                    final DocumentInfo info = docDialog.getDocInfo();
                    if (source instanceof IDocumentSource) {
                        final IDocumentSource resourceDocSource = (IDocumentSource) source;
                        isUpdated = resourceDocSource.update(doc, info, monitor);
                    } else if (source instanceof IAttachmentSource) {
                        final IAttachmentSource featureDocSource = (IAttachmentSource) source;
View Full Code Here

Examples of org.locationtech.udig.catalog.document.IDocumentSource.DocumentInfo

     * after the dialog's Ok button has been clicked.
     *
     * @return document info
     */
    public DocumentInfo getDocInfo() {
        return (new DocumentInfo(getLabel(), getDescription(), getInfo(), getType(), isTemplate(),
                getParamType()));
    }
View Full Code Here

Examples of org.locationtech.udig.catalog.document.IDocumentSource.DocumentInfo

    private List<DocumentInfo> toDocInfoList(String spec) {
        if (spec != null && !spec.isEmpty()) {
            final List<DocumentInfo> docInfos = new ArrayList<DocumentInfo>();
            final String[] docInfoArray = spec.split(DELIMITER_REGEX);
            for (String docInfo : docInfoArray) {
                final DocumentInfo info = new DocumentInfo(docInfo);
                if (ContentType.FILE == info.getContentType()) {
                    info.setInfo(ShpDocUtils.getAbsolutePath(url, info.getInfo()));   
                }
                docInfos.add(info);
            }
            return docInfos;
        }
View Full Code Here

Examples of org.locationtech.udig.catalog.document.IDocumentSource.DocumentInfo

        int count = 0;
        final StringBuilder sb = new StringBuilder();
        for (DocumentInfo info : docInfos) {
            count++;
            if (ContentType.FILE == info.getContentType()) {
                final DocumentInfo writeInfo = new DocumentInfo(info.toString());
                writeInfo.setInfo(ShpDocUtils.getRelativePath(url, writeInfo.getInfo()));
                sb.append(writeInfo.toString());
            } else {
                sb.append(info.toString());
            }
            if (count < docInfos.size()) {
                sb.append(DELIMITER);
View Full Code Here

Examples of org.locationtech.udig.catalog.document.IDocumentSource.DocumentInfo

    @Test
    public void testCreateDocument() {
       
        final ShpDocFactory factory = new ShpDocFactory(null);
       
        DocumentInfo info = new DocumentInfo(LABEL, DESCRIPTION, INFO, ContentType.FILE, false, Type.LINKED);
        IDocument doc = factory.create(info);
        assertNotNull("Doc is null.", doc);
        assertTrue("Doc's type is not expected.", doc instanceof FileLinkedDocument);
       
        info = new DocumentInfo(LABEL, DESCRIPTION, INFO, ContentType.FILE, false, Type.ATTACHMENT);
        doc = factory.create(info);
        assertNotNull("Doc is null.", doc);
        assertTrue("Doc's type is not expected.", doc instanceof FileAttachmentDocument);
       
        info = new DocumentInfo(LABEL, DESCRIPTION, INFO, ContentType.WEB, false, Type.LINKED);
        doc = factory.create(info);
        assertNotNull("Doc is null.", doc);
        assertTrue("Doc's type is not expected.", doc instanceof WebLinkedDocument);
       
    }
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.