From WebLab Wiki
Jump to navigationJump to search
Resource Container using file system
Service Interfaces ResourceContainer
Exchange model: WebLab 1.2.2
Versions: <ListSubPages />
Licence LGPL 2.1
Supported OS Windows/Linux/MacOS
Binary file-repository-1.7.2.war
Sources file-repository-1.7.2-sources.jar
Javadoc file-repository-1.7.2-javadoc.jar
SVN file-repository
Maven Artifact



Release Note

It's a file system implementation of the ResourceContainer interface aka Repository. It enables to save any kind of WebLab resource as XML file and then to get it back. It is in charge of maintaining the URI unity, i.e. it replace every new upcoming resource URI by a uniform one, unique in the context of this repository. Then, every subsequent save of the resource (possibly updated by a processing chain) while update the current stored version. It has also a specific capability enabling the loading and update of sub resources (for instance you can get a specific mediaUnit in a stored document and save it back).

It can be configured through it's constructor, i.e. through CXF bean loading capability.


The configuration is done through the use of custom constructors. Four constructors exist, from the more specific to the default one:

  • public FileRepositoryService(final String pathToTheRepository, final int numberOfFilePerFolder, final String repoId, final String filePrefix)
  • public FileRepositoryService(final String pathToTheRepository, final int numberOfFilePerFolder)
  • public FileRepositoryService(final String pathToTheRepository)
  • public FileRepositoryService()

Here are the parameter that can be set and their default values:

  • pathToTheRepository: This is the path to the folder that will be used as root of the repository. The best is to use an absolute path given your specific installation, other wise it might change given the way the server is started. Default value is: repository which leads to the creation of a repository folder in the tomcat/bin directory in most of the cases.
  • numberOfFilePerFolder: This is the number of XML files that can be stored in a subfolder of pathToTheRepository. Each type this value is reached, a new folder is created under pathToTheRepository. The default value is 1000.
  • repoId : This is the simple string that will be used as producedName when adapting URIs to be specific to this repository (the new URI are line: "weblab:repoId/subFolderTimestamp/filePrefixN). Default value is fileRepository.
  • filePrefix: This the prefix to be used in file names and in URIs before the number. By default it is res_.

UsageContext effects

Not used in current implementation.

Examples of SOAP Input/Output

  • SaveResource Request:
    • The input contains an optional usageContext and a required resource of any type. One best practice is to use WebLab URI for resource URIs.
<soapenv:Envelope xmlns:soapenv="" xmlns:res="">
         <resource xsi:type="ns13:Document" uri="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:xsi="" xmlns:ns13="">
            <annotation uri="weblab://example-made-document/anyuri/1327592136291/-784092873#a0">
               <data xmlns:ns10="" xmlns:ns11="" xmlns:ns12="" xmlns:ns2="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns8="" xmlns:ns9="">
                  <rdf:RDF xmlns:rdf="" xmlns:wp="">
                     <rdf:Description rdf:about="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:dc="">
                        <dc:title>Document Title</dc:title>
            <mediaUnit xsi:type="ns13:Text" uri="weblab://example-made-document/anyuri/1327592136291/-784092873#t1">
               <content>any text</content>
  • SaveResource Result:
    • The output is the URI of the resource stored. It is either the same than the input (if the resource had already been stored before) or a new one. In this case, it follows the WebLab URI scheme.
<soap:Envelope xmlns:soap="">
      <ns10:saveResourceReturn xmlns:ns2="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns7="" xmlns:ns8="" xmlns:ns9="" xmlns:ns10="" xmlns:ns11="">
  • LoadResource Request:
    • The input contaisn an optional usageContext and the URI of the resource to be retrieved. It should be a valid WebLab URI.
<soapenv:Envelope xmlns:soapenv="" xmlns:res="">
  • LoadResource Result:
<soap:Envelope xmlns:soap="">
      <ns10:loadResourceReturn xmlns:ns2="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns7="" xmlns:ns8="" xmlns:ns9="" xmlns:ns10="" xmlns:ns11="">
         <resource xsi:type="ns13:Document" uri="weblab://fileRepository/1307691313823/res_0" xmlns:xsi="" xmlns:ns13="">
            <annotation uri="weblab://fileRepository/1307691313823/res_0#a0">
               <data xmlns:ns10="" xmlns:ns11="" xmlns:ns12="" xmlns:ns2="" xmlns:ns3="" xmlns:ns4="" xmlns:ns5="" xmlns:ns6="" xmlns:ns8="" xmlns:ns9="">
                  <rdf:RDF xmlns:rdf="" xmlns:wp="">
                     <rdf:Description rdf:about="weblab://fileRepository/1307691313823/res_0" xmlns:dc="">
                        <dc:title>Document Title</dc:title>
            <mediaUnit xsi:type="ns13:Text" uri="weblab://fileRepository/1307691313823/res_0#t1">
               <content>any text</content>

Known Limitations

  • The sub resource loading is not working for every kind of super and of sub resource. For instance, it is not feasible to store a ComposedResource and to get back one of its part. See


List off all dependencies of this service:

+- log4j:log4j:jar:1.2.16:test
+- org.ow2.weblab.core.helpers:rdf-helper-jena:jar:1.3.2:test
|  \- com.hp.hpl.jena:jena:jar:2.6.4:test
|     +- com.hp.hpl.jena:iri:jar:0.8:test
|     +-
|     +- xerces:xercesImpl:jar:2.7.1:test
|     +- org.slf4j:slf4j-api:jar:1.5.8:test
|     \- org.slf4j:slf4j-log4j12:jar:1.5.8:test
+- commons-io:commons-io:jar:2.0.1:compile
+- org.ow2.weblab.core:model:jar:1.2.2:compile
+- org.ow2.weblab.core:extended:jar:1.2.2:compile
+- org.ow2.weblab.core:annotator:jar:1.2.4:compile
|  \- joda-time:joda-time:jar:1.6.2:compile
+- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.4.0:compile
|  +- xml-resolver:xml-resolver:jar:1.2:compile
|  +- asm:asm:jar:3.3:compile
|  +- org.apache.cxf:cxf-api:jar:2.4.0:compile
|  |  +- org.apache.cxf:cxf-common-utilities:jar:2.4.0:compile
|  |  +-
|  |  \- org.apache.neethi:neethi:jar:3.0.0:compile
|  |     +- wsdl4j:wsdl4j:jar:1.6.2:compile
|  |     \- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.1:compile
|  |        \- org.codehaus.woodstox:stax2-api:jar:3.0.2:compile
|  +- org.apache.cxf:cxf-rt-core:jar:2.4.0:compile
|  |  +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
|  |  \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
|  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.4.0:compile
|  |  +- org.apache.cxf:cxf-tools-common:jar:2.4.0:compile
|  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.4.0:compile
|  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.4.0:compile
+- org.apache.cxf:cxf-rt-transports-http:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-transports-common:jar:2.4.0:compile
|  \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
|     +- aopalliance:aopalliance:jar:1.0:compile
|     +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
|     +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
|     |  +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
|     |  +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
|     |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
|     \- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
+- xalan:xalan:jar:2.7.1:compile
|  \- xalan:serializer:jar:2.7.1:compile
|     \- xml-apis:xml-apis:jar:1.3.04:compile
+- commons-logging:commons-logging:jar:1.1.1:compile
+- junit:junit:jar:4.8.2:test
\- javax.servlet:servlet-api:jar:2.4:provided