Package org.apache.cocoon.components.persistance

Examples of org.apache.cocoon.components.persistance.CastorSourceConverter


    buffer.append(".xml");
       
    String sourceURI = buffer.toString();
        SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
        Source source = null;
        CastorSourceConverter converter = null;
        try {
            source = resolver.resolveURI(sourceURI);
            converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);

      ReferenceFieldHandler.setObjectMap((Map)mapKey.get("objectmap"));
            return converter.getObject(source, profile);
        } finally {
            resolver.release(source);
            manager.release(converter);
            manager.release(resolver);
        }
View Full Code Here


    buffer.append(".xml");
       
    String sourceURI = buffer.toString();
    SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
    ModifiableSource source = null;
    CastorSourceConverter converter = null;
    try {
      source = (ModifiableSource)resolver.resolveURI(sourceURI);
      converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);

      converter.storeObject(source, profileName, profile);
    } finally {
      resolver.release(source);
      manager.release(converter);
      manager.release(resolver);
    }
View Full Code Here

    final StringBuffer buffer = this.getCompleteURI(uri, keyMap, map );

    final String sourceURI = buffer.toString();
    Source source = null;
    CastorSourceConverter converter = null;
        SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
    try {
      source = resolver.resolveURI(sourceURI);
            converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);
            ReferenceFieldHandler.setObjectMap((Map)map.get("objectmap"));

      return converter.getObject(source.getInputStream(), profile);
    } finally {
      resolver.release(source);
      manager.release(converter);
      manager.release(resolver);
    }
View Full Code Here

        final String uri = this.getURI( keyMap, map , "save");
        final String profileName = (String)map.get("profile");

        // first test: modifiable source?
        SourceResolver resolver = null;
        CastorSourceConverter converter = null;
        Source source = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            source = resolver.resolveURI(uri);
            if ( source instanceof ModifiableSource ) {
                converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);
                converter.storeObject( ((ModifiableSource)source).getOutputStream(), profileName, profile);
                return;
            }

        } finally {
            resolver.release(source);
            manager.release(converter);
            manager.release(resolver);
            source = null;
            converter = null;
            resolver = null;
        }
       
        final StringBuffer buffer = this.getCompleteURI(uri, keyMap, map );

    SAXParser parser = null;
    try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);

            ByteArrayOutputStream writer = new ByteArrayOutputStream();
       
            converter.storeObject(writer, profileName, profile);

            buffer.append("&content=");
            buffer.append(SourceUtil.encode(writer.toString()));

            source = resolver.resolveURI(buffer.toString());
View Full Code Here

    final Map keyMap = (Map) key;
       
        final String uri = this.getURI( keyMap, parameters );
       
    Source source = null;
    CastorSourceConverter converter = null;
        SourceResolver resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
    try {
      source = resolver.resolveURI(uri);
            converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);

      return converter.getObject(source.getInputStream(), parameters);
    } finally {
            if ( resolver != null ) {
                resolver.release(source);
            }
      manager.release(converter);
View Full Code Here

       
        final String uri = this.getURI( keyMap, parameters );

        // first test: modifiable source?
        SourceResolver resolver = null;
        CastorSourceConverter converter = null;
        Source source = null;
        try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            source = resolver.resolveURI(uri);
            if ( source instanceof ModifiableSource ) {
                converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);
                converter.storeObject( ((ModifiableSource)source).getOutputStream(), parameters, profile);
                return;
            }

        } finally {
            if ( resolver != null ) {
                resolver.release(source);
            }
            manager.release(converter);
            manager.release(resolver);
            source = null;
            converter = null;
            resolver = null;
        }
       
        final StringBuffer buffer = this.getSaveURI( keyMap, parameters );

    SAXParser parser = null;
    try {
            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
            converter = (CastorSourceConverter) this.manager.lookup(CastorSourceConverter.ROLE);

            ByteArrayOutputStream writer = new ByteArrayOutputStream();
       
            converter.storeObject(writer, parameters, profile);

            buffer.append("&content=");
            buffer.append(SourceUtil.encode(writer.toString()));

            source = resolver.resolveURI(buffer.toString());
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.persistance.CastorSourceConverter

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.