summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk
diff options
context:
space:
mode:
authorlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2011-04-20 06:43:58 +0000
committerlresende <lresende@13f79535-47bb-0310-9956-ffa450edef68>2011-04-20 06:43:58 +0000
commit262f8d0af220051c2d8cc23a09553feba8647ac0 (patch)
tree3b176b8db998feaf4e8b76b9a4eec78766f5d406 /sca-java-2.x/trunk
parent2073adbd9dc265a4c06ade800258af2d27919bb3 (diff)
Adding support to serve dojo dijit artifacts
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1095294 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk')
-rw-r--r--sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml2
-rw-r--r--sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java3
-rw-r--r--sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java16
3 files changed, 19 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml b/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml
index bcfa3c134d..b1e645c261 100644
--- a/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml
+++ b/sca-java-2.x/trunk/modules/web-javascript-dojo/build-dojo.xml
@@ -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>
diff --git a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
index 8bbffff9f9..f3021b3c63 100644
--- a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
+++ b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoResourceServlet.java
@@ -51,7 +51,8 @@ public class DojoResourceServlet extends HttpServlet {
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
diff --git a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
index 8b8eb2b61e..b90545d65d 100644
--- a/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
+++ b/sca-java-2.x/trunk/modules/web-javascript-dojo/src/main/java/org/apache/tuscany/sca/web/javascript/dojo/DojoWidgetJavascriptProvider.java
@@ -39,6 +39,9 @@ public class DojoWidgetJavascriptProvider implements WidgetImplementationJavascr
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 DojoWidgetJavascriptProvider implements WidgetImplementationJavascr
}
}
+ 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 {