Examples of XmlOutputContext


Examples of com.lyncode.xoai.dataprovider.xml.XmlOutputContext

        for (String col : item.getCommunities())
            doc.addField("item.communities", col);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XmlOutputContext context = XmlOutputContext.emptyContext(out, Second);
        item.getMetadata().write(context);
        context.getWriter().flush();
        context.getWriter().close();
        doc.addField("item.compile", out.toString());

        return doc;
    }
View Full Code Here

Examples of com.lyncode.xoai.dataprovider.xml.XmlOutputContext

        for (String f : getFileFormats(item)) {
            doc.addField("metadata.dc.format.mimetype", f);
        }

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XmlOutputContext context = XmlOutputContext.emptyContext(out, Second);
        retrieveMetadata(item).write(context);
        context.getWriter().flush();
        context.getWriter().close();
        doc.addField("item.compile", out.toString());

        if (verbose) {
            println("Item with handle " + handle + " indexed");
        }
View Full Code Here

Examples of com.lyncode.xoai.dataprovider.xml.XmlOutputContext

    @Override
    public void store(String requestID, OAIPMH response) throws IOException {
        ByteArrayOutputStream output = new ByteArrayOutputStream();
        try {
            XmlOutputContext context = XmlOutputContext.emptyContext(output, Second);
            response.write(context);
            context.getWriter().flush();
            context.getWriter().close();

            String xoaiResponse = output.toString();

            // Cutting the header (to allow one to change the response time)
            String end = "</responseDate>";
View Full Code Here

Examples of com.lyncode.xoai.dataprovider.xml.XmlOutputContext

    @Override
    public void put(Item item, Metadata metadata) throws IOException {
        FileOutputStream output = new FileOutputStream(getMetadataCache(item));
        try {
            XmlOutputContext context = XmlOutputContext.emptyContext(output, Second);
            metadata.write(context);
            context.getWriter().flush();
            context.getWriter().close();
           
            output.close();
        } catch (XMLStreamException e) {
            throw new IOException(e);
        } catch (WritingXmlException e) {
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.