001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.components.repository.helpers;
018:
019: import java.util.List;
020: import java.util.Map;
021: import java.util.Set;
022:
023: import org.apache.cocoon.ProcessingException;
024: import org.apache.cocoon.components.source.helpers.SourceProperty;
025: import org.w3c.dom.Node;
026:
027: /**
028: * A property helper interface intended to be used
029: * by flowscripts or corresponding wrapper components.
030: */
031: public interface RepositoryPropertyHelper {
032:
033: /**
034: * get a single property
035: *
036: * @param uri the uri of the resource.
037: * @param name the name of the property.
038: * @param namespace the namespace of the property.
039: * @return the property.
040: * @throws ProcessingException
041: */
042: SourceProperty getProperty(String uri, String name, String namespace)
043: throws ProcessingException;
044:
045: /**
046: * get multiple properties
047: *
048: * @param uri the uri of the resource.
049: * @param propNames a Set containing the property names.
050: * @return a Map containing the property values.
051: * @throws ProcessingException
052: */
053: Map getProperties(String uri, Set propNames)
054: throws ProcessingException;
055:
056: /**
057: * get all properties
058: *
059: * @param uri the uri of the resource.
060: * @return a List containing the property values.
061: * @throws ProcessingException
062: */
063: List getAllProperties(String uri) throws ProcessingException;
064:
065: /**
066: * set a single property to a String value
067: *
068: * @param uri the uri of the resource.
069: * @param name the name of the property.
070: * @param namespace the namespace of the property.
071: * @param value the String value to set the property to.
072: * @return a boolean indicating success.
073: * @throws ProcessingException
074: */
075: boolean setProperty(String uri, String name, String namespace,
076: String value) throws ProcessingException;
077:
078: /**
079: * set a single property to a W3C Node value
080: *
081: * @param uri the uri of the resource.
082: * @param name the name of the property.
083: * @param namespace the namespace of the property.
084: * @param value the DOM value to set the property to.
085: * @return a boolean indicating success.
086: * @throws ProcessingException
087: */
088: boolean setProperty(String uri, String name, String namespace,
089: Node value) throws ProcessingException;
090:
091: /**
092: * set multiple properties
093: *
094: * @param uri the uri of the resource.
095: * @param properties a Map containing the properties to set.
096: * @return a boolean indicating success.
097: * @throws ProcessingException
098: */
099: boolean setProperties(String uri, Map properties)
100: throws ProcessingException;
101:
102: }
|