You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by re...@apache.org on 2013/04/08 22:45:30 UTC

svn commit: r1465777 - in /stanbol/trunk/development/archetypes: statefull-webmodule/src/main/resources/archetype-resources/ statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ statefull-webmodule/src/main/resources/archetype-reso...

Author: reto
Date: Mon Apr  8 20:45:30 2013
New Revision: 1465777

URL: http://svn.apache.org/r1465777
Log:
STANBOL-1018: using relative path and artifact-name depended location of css

Added:
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/styles/
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/styles/resource-resolver.css
      - copied unchanged from r1465660, stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/example-service/styles/resource-resolver.css
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/styles/
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/__artifactId__/styles/multi-enhancer.css
      - copied unchanged from r1465705, stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/META-INF/resources/example-service/styles/multi-enhancer.css
Modified:
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/pom.xml
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ResourceResolver.java
    stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/ResourceResolver.ftl
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/MultiEnhancer.java
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/Enhancements.ftl
    stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/MultiEnhancer.ftl

Modified: stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/pom.xml?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/pom.xml (original)
+++ stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/pom.xml Mon Apr  8 20:45:30 2013
@@ -81,19 +81,21 @@
             <artifactId>rdf.utils</artifactId>
             <version>0.13-incubating</version>
         </dependency>
- 
+        <dependency>
+            <groupId>org.apache.clerezza</groupId>
+            <artifactId>jaxrs.utils</artifactId>
+            <version>0.6-incubating</version>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
             <version>4.3.1</version>
         </dependency>
-
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.scr.annotations</artifactId>
             <version>1.7.0</version>
         </dependency>
-
     </dependencies>
-
+    
 </project>

Modified: stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java (original)
+++ stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java Mon Apr  8 20:45:30 2013
@@ -12,7 +12,7 @@ import org.apache.stanbol.commons.web.ba
 public class ExampleMenuItem extends NavigationLink {
     
     public ExampleMenuItem() {
-        super("${artifactId}", "Example:${artifactId}", "An Example Service", 300);
+        super("${artifactId}/", "Example:${artifactId}", "An Example Service", 300);
     }
     
 }

Modified: stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ResourceResolver.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ResourceResolver.java?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ResourceResolver.java (original)
+++ stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/java/ResourceResolver.java Mon Apr  8 20:45:30 2013
@@ -14,6 +14,7 @@ import javax.ws.rs.Path;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
 import org.apache.clerezza.rdf.core.BNode;
 import org.apache.clerezza.rdf.core.MGraph;
 import org.apache.clerezza.rdf.core.UriRef;
@@ -106,6 +107,9 @@ public class ResourceResolver {
     public RdfViewable serviceEntry(@Context final UriInfo uriInfo, 
             @QueryParam("iri") final UriRef iri, 
             @HeaderParam("user-agent") String userAgent) throws Exception {
+        //this maks sure we are nt invoked with a trailing slash which would affect
+        //relative resolution of links (e.g. css)
+        TrailingSlash.enforcePresent(uriInfo);
         final String resourcePath = uriInfo.getAbsolutePath().toString();
         //The URI at which this service was accessed accessed, this will be the 
         //central serviceUri in the response

Modified: stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/ResourceResolver.ftl
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/ResourceResolver.ftl?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/ResourceResolver.ftl (original)
+++ stanbol/trunk/development/archetypes/statefull-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/ResourceResolver.ftl Mon Apr  8 20:45:30 2013
@@ -6,7 +6,7 @@
 <html>
   <head>
     <title>Example Application - Apache Stanbol</title>
-    <link type="text/css" rel="stylesheet" href="example-service/styles/resource-resolver.css" />
+    <link type="text/css" rel="stylesheet" href="styles/resource-resolver.css" />
   </head>
 
   <body>

Modified: stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java (original)
+++ stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/ExampleMenuItem.java Mon Apr  8 20:45:30 2013
@@ -12,7 +12,7 @@ import org.apache.stanbol.commons.web.ba
 public class ExampleMenuItem extends NavigationLink {
     
     public ExampleMenuItem() {
-        super("${artifactId}", 
+        super("${artifactId}/", 
                 "Example: ${artifactId}", 
                 "An stateless service example", 300);
     }

Modified: stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/MultiEnhancer.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/MultiEnhancer.java?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/MultiEnhancer.java (original)
+++ stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/java/MultiEnhancer.java Mon Apr  8 20:45:30 2013
@@ -10,6 +10,7 @@ import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
+import org.apache.clerezza.jaxrs.utils.TrailingSlash;
 import org.apache.clerezza.jaxrs.utils.form.FormFile;
 import org.apache.clerezza.jaxrs.utils.form.MultiPartBody;
 import org.apache.clerezza.rdf.core.MGraph;
@@ -78,6 +79,9 @@ public class MultiEnhancer {
     @GET
     public RdfViewable serviceEntry(@Context final UriInfo uriInfo, 
             @HeaderParam("user-agent") String userAgent) throws Exception {
+        //this maks sure we are nt invoked with a trailing slash which would affect
+        //relative resolution of links (e.g. css)
+        TrailingSlash.enforcePresent(uriInfo);
         final String resourcePath = uriInfo.getAbsolutePath().toString();
         //The URI at which this service was accessed accessed, this will be the 
         //central serviceUri in the response

Modified: stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/Enhancements.ftl
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/Enhancements.ftl?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/Enhancements.ftl (original)
+++ stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/Enhancements.ftl Mon Apr  8 20:45:30 2013
@@ -4,7 +4,7 @@
 <html>
   <head>
     <title>Enhancements</title>
-    <link type="text/css" rel="stylesheet" href="example-service/styles/multi-enhancer.css" />
+    <link type="text/css" rel="stylesheet" href="styles/multi-enhancer.css" />
   </head>
 
   <body>

Modified: stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/MultiEnhancer.ftl
URL: http://svn.apache.org/viewvc/stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/MultiEnhancer.ftl?rev=1465777&r1=1465776&r2=1465777&view=diff
==============================================================================
--- stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/MultiEnhancer.ftl (original)
+++ stanbol/trunk/development/archetypes/stateless-webmodule/src/main/resources/archetype-resources/src/main/resources/templates/html/MultiEnhancer.ftl Mon Apr  8 20:45:30 2013
@@ -6,7 +6,7 @@
 <html>
   <head>
     <title>Multi-Enhancer Example Application - Apache Stanbol</title>
-    <link type="text/css" rel="stylesheet" href="example-service/styles/multi-enhancer.css" />
+    <link type="text/css" rel="stylesheet" href="styles/multi-enhancer.css" />
   </head>
 
   <body>