Package org.apache.cocoon.components.source.helpers

Examples of org.apache.cocoon.components.source.helpers.SourceProperty


                try {
                    processor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);

                    NodeList nodelist = processor.selectNodeList(doc.getDocumentElement(), this.xpath);

                    SourceProperty property = new SourceProperty(this.propertynamespace, this.propertyname);
                    property.setValue(nodelist);

                    return property;
                } catch (ComponentException ce) {
                    this.getLogger().error("Could not retrieve component", ce);
                } finally {
View Full Code Here


        return null
    }

    public SourceProperty[] getSourceProperties(Source source) throws SourceException {

        SourceProperty property = getSourceProperty(source, this.propertynamespace, this.propertyname);
        if (property!=null)
            return new SourceProperty[]{property};
        return null;
    }
View Full Code Here

        if ((namespace.equals(PROPERTY_NS)) &&
            ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))) &&
            (source.getURI().endsWith(".jpg")) && (isJPEGFile(source))) {

            if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME,
                                          String.valueOf(getJpegSize(source)[0]));
            if (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME,
                                          String.valueOf(getJpegSize(source)[1]));
        }
        return null
    }
View Full Code Here

        if ((source.getURI().endsWith(".jpg")) &&
            (isJPEGFile(source))) {
            int[] size = getJpegSize(source);
            return new SourceProperty[] {
                new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, String.valueOf(size[0])),
                new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME, String.valueOf(size[1]))
            };
        }
        return null;
    }
View Full Code Here

        if ((namespace.equals(PROPERTY_NS)) &&
            ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))) &&
            (source.getURI().endsWith(".gif")) && (isGIFFile(source))) {

            if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME,
                                          String.valueOf(getGifSize(source)[0]));
            if (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME,
                                          String.valueOf(getGifSize(source)[1]));
        }
        return null
    }
View Full Code Here

        if ((source.getURI().endsWith(".gif")) &&
            (isGIFFile(source))) {

            int[] size = getGifSize(source);
            return new SourceProperty[] {
                new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, String.valueOf(size[0])),
                new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME, String.valueOf(size[1]))
            };
        }
        return null;
    }
View Full Code Here

            while (responses.hasMoreElements()) {
                ResponseEntity response = (ResponseEntity) responses.nextElement();
                props = response.getProperties();
                if (props.hasMoreElements()) {
                    prop = (Property) props.nextElement();
                    return new SourceProperty(prop.getElement());
                }
            }
        } catch (Exception e) {
            throw new SourceException("Error getting property: "+name, e);
        }
View Full Code Here

                 ResponseEntity response = (ResponseEntity)responses.nextElement();
                 props = response.getProperties();
                 while (props.hasMoreElements()) {
                     prop = (Property) props.nextElement();
                     SourceProperty srcProperty = new SourceProperty(prop.getElement());
                     sourceproperties.addElement(srcProperty);
                 }
             }

         } catch (Exception e) {
View Full Code Here

        if ((namespace.equals(PROPERTY_NS)) &&
            ((name.equals(IMAGE_WIDTH_PROPERTY_NAME)) || (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))) &&
            (source.getURI().endsWith(".gif")) && (isGIFFile(source))) {

            if (name.equals(IMAGE_WIDTH_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME,
                                          String.valueOf(getGifSize(source)[0]));
            if (name.equals(IMAGE_HEIGHT_PROPERTY_NAME))
                return new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME,
                                          String.valueOf(getGifSize(source)[1]));
        }
        return null
    }
View Full Code Here

        if ((source.getURI().endsWith(".gif")) &&
            (isGIFFile(source))) {

            int[] size = getGifSize(source);
            return new SourceProperty[] {
                new SourceProperty(PROPERTY_NS, IMAGE_WIDTH_PROPERTY_NAME, String.valueOf(size[0])),
                new SourceProperty(PROPERTY_NS, IMAGE_HEIGHT_PROPERTY_NAME, String.valueOf(size[1]))
            };
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.components.source.helpers.SourceProperty

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.