be.re.repo
Interface ExchangeProperties


public interface ExchangeProperties

The interface for external modules to extract and update meta-properties in a document. The DublinCore properties can correspond to DublinCore elements or terms. The name of the former starts with "dc:" and of the latter with "dcterms:". DublinCore properties are localized. Pincette also supports the localized properties "re:company", "re:keyword", "re:manager" and "re:status" and properties with the "atom:" prefix.

Such modules are declared in /configuration/maps.xml using the exchange-properties element as in the following example:

 <exchange-properties>
   <mime-type>application/pdf</mime-type>
   <!-- Additional mime-type elements can come here. -->
   <!-- Several path elements can come here. -->
   <class>
     <name>be.re.repo.mod.ExchangePropertiesPDF</name>
     <!-- Optional URL relative to maps.xml.
     <jar>modules/my_module.jar</jar>
   </class>
 </exchange-properties>
 
 

Author:
Werner Donné

Method Summary
 InputStream get(String vcr, String version, InputStream in, Set<Property> properties, String mimeType, Context context)
          The method should return a stream the system can read from.
 InputStream set(String vcr, String version, InputStream in, Set<Property> newProperties, Set<Property> oldProperties, String mimeType, Context context)
          The method should return a stream the system can read from.
 

Method Detail

get

InputStream get(String vcr,
                String version,
                InputStream in,
                Set<Property> properties,
                String mimeType,
                Context context)
                throws IOException
The method should return a stream the system can read from. The in parameter contains the original document stream. The method is supposed to fill properties with the extracted document properties. The properties should be of type be.re.repo.Property.

Parameters:
vcr - the local path of the resource.
version - the version URL of the resource.
in - the original document stream.
properties - the property set that is to be filled.
mimeType - the MIME type of the resource. A module could several types of document.
context - the repository context.
Returns:
The module has the opportunity to modify the original document. If it doesn't it should just return in. Note that if in has been consumed it can no longer just be returned. The module could for example insert a filter that extracts the properties from the original document stream.
Throws:
IOException
See Also:
Property

set

InputStream set(String vcr,
                String version,
                InputStream in,
                Set<Property> newProperties,
                Set<Property> oldProperties,
                String mimeType,
                Context context)
                throws IOException
The method should return a stream the system can read from. The in parameter contains the original document stream. The method is supposed to update the document properties with those found in newProperties. The properties are of type be.re.repo.Property. A module may have some validation policy and change the set of properties.

Parameters:
vcr - the local path of the resource.
version - the version URL of the resource.
in - the original document stream.
newProperties - the complete set of properties that is to be updated in the document. A module is allowed to modify this set according to its validation rules. The repository will then use the modified set.
oldProperties - the properties the document currently has. This may be usefull for the validation of newProperties.
mimeType - the MIME type of the resource. A module could several types of document.
context - the repository context.
Returns:
The document stream of the updated document. If the module returns null the repository will not update the contents of the resource.
Throws:
IOException