Simple-file-repository/1.4.0

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

<groupId>org.ow2.weblab.webservices</groupId>

<artifactId>simple-file-repository</artifactId>

<version>1.4.0</version>
Release Note


This is a file system based repository of WebLab XML resources. You just have to configure the file system folder and the component will save and load resources from files in this folder.

When a resource is saved, the component check if the resource's uri exists and if it exists, the existing resource is overwritten.

This service never changes uris of received resources.


Configuration

Configuration is done in through constructor args injection in cxf-servlet.xml file. There are two available constructors. The first one only takes as argument the path to the system folder where to save resources (here simple-repo which is a relative path. It is better to use an absolute path). The second constructor takes two additional boolean parameters to activate/deactivate the XSD validation of resources when reading/writing using the WebLabMarshaller. The first constructor activates the validation by default.

	<bean id="simple-constructor" class="org.ow2.weblab.service.SimpleRepo">
		<constructor-arg value="simple-repo" index="0" />
	</bean>
 
	<bean id="data" class="org.ow2.weblab.service.SimpleRepo">
		<constructor-arg value="simple-repo" index="0" />
		<constructor-arg value="true" index="1" />
		<constructor-arg value="true" index="2" />
	</bean>

UsageContext effects

Usage context has no effect on this service.

Examples of SOAP Input/Output

  • SaveResource Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://weblab.ow2.org/core/1.2/services/resourcecontainer">
   <soapenv:Header/>
   <soapenv:Body>
      <res:saveResourceArgs>
         <resource xsi:type="wl:Document" uri="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wl="http://weblab.ow2.org/core/1.2/model#">
            <annotation uri="weblab://example-made-document/anyuri/1327592136291/-784092873#a0">
               <data>
                  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                     <rdf:Description rdf:about="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:dc="http://purl.org/dc/elements/1.1/">
                        <dc:source>http://weblab-project.org</dc:source>
                        <dc:title>Document Title</dc:title>
                        <dc:date>2012-01-26T16:35:48+0100</dc:date>
                     </rdf:Description>
                  </rdf:RDF>
               </data>
            </annotation>
            <mediaUnit xsi:type="wl:Text" uri="weblab://example-made-document/anyuri/1327592136291/-784092873#t1">
               <content>any text</content>
            </mediaUnit>
         </resource>
      </res:saveResourceArgs>
   </soapenv:Body>
</soapenv:Envelope>
  • SaveResource Result:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <res:saveResourceReturn xmlns:res="http://weblab.ow2.org/core/1.2/services/resourcecontainer">
         <resourceId>weblab://example-made-document/anyuri/1327592136291/-784092873</resourceId>
      </res:saveResourceReturn>
   </soap:Body>
</soap:Envelope>
  • LoadResource Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://weblab.ow2.org/core/1.2/services/resourcecontainer">
   <soapenv:Header/>
   <soapenv:Body>
      <res:loadResourceArgs>
         <resourceId>weblab://example-made-document/anyuri/1327592136291/-784092873</resourceId>
      </res:loadResourceArgs>
   </soapenv:Body>
</soapenv:Envelope>
  • LoadResource Result:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <res:loadResourceReturn  xmlns:res="http://weblab.ow2.org/core/1.2/services/resourcecontainer">
         <resource xsi:type="wl:Document" uri="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wl="http://weblab.ow2.org/core/1.2/model#">
            <annotation uri="weblab://example-made-document/anyuri/1327592136291/-784092873#a0">
               <data>
                  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                     <rdf:Description rdf:about="weblab://example-made-document/anyuri/1327592136291/-784092873" xmlns:dc="http://purl.org/dc/elements/1.1/">
                        <dc:source>http://weblab-project.org</dc:source>
                        <dc:title>Document Title</dc:title>
                        <dc:date>2012-01-26T16:35:48+0100</dc:date>
                     </rdf:Description>
                  </rdf:RDF>
               </data>
            </annotation>
            <mediaUnit xsi:type="wl:Text" uri="weblab://example-made-document/anyuri/1327592136291/-784092873#t1">
               <content>any text</content>
            </mediaUnit>
         </resource>
      </res:loadResourceReturn>
   </soap:Body>
</soap:Envelope>

Known Limitations

N/A

Dependencies

List off all dependencies of this service:

org.ow2.weblab.webservices:simple-file-repository:war:1.4.0
+- commons-codec:commons-codec:jar:1.9:compile
+- log4j:log4j:jar:1.2.17:runtime
+- org.ow2.weblab.core:model:jar:1.2.5:compile
+- org.ow2.weblab.core:extended:jar:1.2.5:compile
|  \- commons-io:commons-io:jar:2.4:compile
+- org.ow2.weblab.core:annotator:jar:1.2.6:compile
|  \- joda-time:joda-time:jar:2.3:compile
+- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.6.11:compile
|  +- xml-resolver:xml-resolver:jar:1.2:compile
|  +- asm:asm:jar:3.3.1:compile
|  +- org.apache.cxf:cxf-api:jar:2.6.11:compile
|  |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.0:compile
|  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.1:compile
|  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0.3:compile
|  |  +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
|  |  \- wsdl4j:wsdl4j:jar:1.6.3:compile
|  +- org.apache.cxf:cxf-rt-core:jar:2.6.11:compile
|  |  \- com.sun.xml.bind:jaxb-impl:jar:2.2.5.1:compile
|  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.6.11:compile
|  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.6.11:compile
|  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.6.11:compile
|  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.6.11:compile
|  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.6.11:compile
|     \- org.apache.cxf:cxf-rt-ws-policy:jar:2.6.11:compile
|        \- org.apache.neethi:neethi:jar:3.0.2:compile
+- org.apache.cxf:cxf-rt-transports-http:jar:2.6.11:compile
+- org.apache.cxf:cxf-rt-management:jar:2.6.11:compile
+- org.springframework:spring-web:jar:3.0.7.RELEASE:compile
|  +- aopalliance:aopalliance:jar:1.0:compile
|  +- org.springframework:spring-beans:jar:3.0.7.RELEASE:compile
|  +- org.springframework:spring-context:jar:3.0.7.RELEASE:compile
|  |  +- org.springframework:spring-aop:jar:3.0.7.RELEASE:compile
|  |  +- org.springframework:spring-expression:jar:3.0.7.RELEASE:compile
|  |  \- org.springframework:spring-asm:jar:3.0.7.RELEASE:compile
|  \- org.springframework:spring-core:jar:3.0.7.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.3:compile
+- junit:junit:jar:4.11:test
|  \- org.hamcrest:hamcrest-core:jar:1.3:test
\- javax.servlet:servlet-api:jar:2.5:provided