Package org.apache.cocoon.jcr.source

Examples of org.apache.cocoon.jcr.source.JCRNodeSource


    protected void load() {

        this.key2values = new HashMap();
        SourceResolver resolver = null;
        JCRNodeSource source = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            source = (JCRNodeSource) resolver.resolveURI(this.sourceUri);

            Node node = source.getNode();
            String prefix = node.getSession()
                    .getWorkspace()
                    .getNamespaceRegistry()
                    .getPrefix(this.namespace);
            if (!prefix.equals("")) {
View Full Code Here


        }
    }

    public void save() throws MetaDataException {
        SourceResolver resolver = null;
        JCRNodeSource source = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            source = (JCRNodeSource) resolver.resolveURI(this.sourceUri);

            if (!source.exists()) {
                OutputStream stream = source.getOutputStream();
                stream.flush();
                stream.close();
            }

            Node node = source.getNode();
            String prefix = node.getSession()
                    .getWorkspace()
                    .getNamespaceRegistry()
                    .getPrefix(this.namespace);
            if (!prefix.equals("")) {
View Full Code Here

    public long getLastModified() throws MetaDataException {
        long lastModified = 0;
        try {
            SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            JCRNodeSource source = (JCRNodeSource) resolver.resolveURI(this.sourceUri);
            lastModified = source.getLastModified();
        } catch (Exception e) {
            throw new MetaDataException("Error resolving meta data source", e);
        }
        return lastModified;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.jcr.source.JCRNodeSource

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.