tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1095294 - in /tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo: ./ src/main/java/org/apache/tuscany/sca/web/javascript/dojo/
Date Wed, 20 Apr 2011 06:43:59 GMT
Author: lresende
Date: Wed Apr 20 06:43:58 2011
New Revision: 1095294

URL: http://svn.apache.org/viewvc?rev=1095294&view=rev
Log:
Adding support to serve dojo dijit artifacts

Modified:
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
    tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java

Modified: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml?rev=1095294&r1=1095293&r2=1095294&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml Wed Apr 20 06:43:58
2011
@@ -49,7 +49,7 @@
             <patternset>
                 <include name="dojo-${dojo.version}/dojo/**"/>
                 <exclude name="dojo-${dojo.version}/dojo/tests/**"/>
-                <exclude name="dojo-${dojo.version}/dijit/**"/>
+                <include name="dojo-${dojo.version}/dijit/**"/>
                 <include name="dojo-${dojo.version}/dojox/**"/>
                 <exclude name="dojo-${dojo.version}/util/**"/>
             </patternset>

Modified: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java?rev=1095294&r1=1095293&r2=1095294&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
Wed Apr 20 06:43:58 2011
@@ -51,7 +51,8 @@ public class DojoResourceServlet extends
         String path = URLDecoder.decode(request.getRequestURI(), HTTPConstants.CHARACTER_ENCODING_UTF8);
 
         if( path.startsWith(contextRoot + "/dojo")||
-            path.startsWith(contextRoot + "/dojox")) {
+            path.startsWith(contextRoot + "/dojox")||
+            path.startsWith(contextRoot + "/dijit")) {
             if( ! path.contains("tuscany/")) {
                 //this is a workaround where we need to have dojo files in its own folder
                 //to avoid clean target to clean other non dojo resources

Modified: tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java?rev=1095294&r1=1095293&r2=1095294&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
Wed Apr 20 06:43:58 2011
@@ -39,6 +39,9 @@ public class DojoWidgetJavascriptProvide
     private static final String dojoxBaseUri = URI.create("/dojox").toString();
     private static final String dojoxUri = URI.create("/dojox/*").toString();
 
+    private static final String dijitBaseUri = URI.create("/dijit").toString();
+    private static final String dijitUri = URI.create("/dijit/*").toString();
+    
     private static final String tuscanyBaseUri = URI.create("/tuscany").toString();
     private static final String tuscanyUri = URI.create("/tuscany/*").toString();
 
@@ -84,6 +87,19 @@ public class DojoWidgetJavascriptProvide
             }
         }
 
+        servlet = servletHost.getServletMapping(dijitBaseUri);
+        if(servlet == null) {
+            try {
+                DojoResourceServlet baseResourceServlet = new DojoResourceServlet();
+                servletHost.addServletMapping(dijitBaseUri, baseResourceServlet);
+
+                DojoResourceServlet resourceServlet = new DojoResourceServlet();
+                servletHost.addServletMapping(dijitUri, resourceServlet);
+            } catch (ServletMappingException me ) {
+                logger.warning("Dijit already registered at :" + dijitBaseUri);
+            }
+        }
+        
         servlet = servletHost.getServletMapping(tuscanyBaseUri);
         if(servlet == null) {
             try {



Mime
View raw message