org.ow2.weblab.service.exposer
Class LocalFileExposer
java.lang.Object
org.ow2.weblab.service.exposer.LocalFileExposer
- All Implemented Interfaces:
- org.ow2.weblab.core.services.Analyser
public class LocalFileExposer
- extends java.lang.Object
- implements org.ow2.weblab.core.services.Analyser
This service is used in conjunction with an Apache Tomcat or Apache server.
The purpose is to annotate documents in input with an "exposition URL" i.e. an URL that can be used in a web browser to access this document.
This service only works when processed file are exposed using the server and have the same naming pattern than the read annotation on the document (in most
of the case, we use dc:source).
Some parameter can be set using the deployment file.
- sourceUri: The predicate's URI of the statement that contains the original source of the Document to be modified. Default value is
http://purl.org/dc/elements/1.1/source.
- sourceIsResource: Sometimes the object of the statement containing the original source of the Document is a Resource (since an URL might
be an URI); in this case this parameter has to be true. Default value is
false.
- exposedAsUri: The predicate's URI of the statement that will contain the exposed URL of the Document. Default value is
http://weblab-project.org/core/model/property/isExposedAs.
- nbStartCharToReplace: The number of character to be remove at the beginning of the String to replace; in most of the case it's the path
to the whole folder that will be exposed. Default value is
0.
- byString: The String to be added at the beginning of the String to replace; in most of the case it's
protocol://host:port/exposition_pattern/. Default value is
"".
- annotateAsUri: Whether the URL shall be annotated as Resource. If not it will be a literal statement. Default value is
false
.
- urlEncodeBetweenSlashes: Whether the URL shall be annotated as Resource. If not it will be a literal statement. Default value is
false.
- urlEncoding: When encoding a URL it's needed to use the encoding used by the server for URL encoding; otherwise some file might never be
exposed (especially files containing accent in their name or other complex characters). Default value is
ISO-8859-1.
- replacementForSpace: The java method for URL encoding replaces spaces by '+'. But servers like Tomcat or Apache are using "%20" (in UTF-8
and ISO-8859-1 for instance) as replacement String. Default value is
%20.
- serviceUri: The URI of the service to be added in the created annotation (with a produced by statement) or
null if nothing
should be added.
- Author:
- ymombrun
- Date:
- 2008-10-04
|
Method Summary |
org.ow2.weblab.core.services.analyser.ProcessReturn |
process(org.ow2.weblab.core.services.analyser.ProcessArgs args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LocalFileExposer
public LocalFileExposer(ExposerConfigBean configuration)
- Constructors
process
public org.ow2.weblab.core.services.analyser.ProcessReturn process(org.ow2.weblab.core.services.analyser.ProcessArgs args)
throws org.ow2.weblab.core.services.UnexpectedException,
org.ow2.weblab.core.services.InvalidParameterException
- Specified by:
process in interface org.ow2.weblab.core.services.Analyser
- Throws:
org.ow2.weblab.core.services.UnexpectedException
org.ow2.weblab.core.services.InvalidParameterException
Copyright © 2004-2012. All Rights Reserved.