You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devicemap.apache.org by re...@apache.org on 2013/06/05 01:00:51 UTC

svn commit: r1489667 - in /incubator/devicemap/trunk/web/webservice-java/src/main: java/org/apache/devicemapjavaservice/ java/org/apache/devicemapjavaservice/controller/ java/org/apache/devicemapjavaservice/filter/ webapp/ webapp/WEB-INF/ webapp/js/

Author: rezan
Date: Tue Jun  4 23:00:50 2013
New Revision: 1489667

URL: http://svn.apache.org/r1489667
Log:
dmap client and asf headers

Added:
    incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/
    incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/dmapclient.js
Removed:
    incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/Test.java
Modified:
    incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/controller/Service.java
    incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/filter/IdentificationFilter.java
    incubator/devicemap/trunk/web/webservice-java/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml
    incubator/devicemap/trunk/web/webservice-java/src/main/webapp/index.jsp

Modified: incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/controller/Service.java
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/controller/Service.java?rev=1489667&r1=1489666&r2=1489667&view=diff
==============================================================================
--- incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/controller/Service.java (original)
+++ incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/controller/Service.java Tue Jun  4 23:00:50 2013
@@ -1,3 +1,22 @@
+/*
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+ */
+
 package org.apache.devicemapjavaservice.controller;
  
 import org.apache.log4j.Logger;

Modified: incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/filter/IdentificationFilter.java
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/filter/IdentificationFilter.java?rev=1489667&r1=1489666&r2=1489667&view=diff
==============================================================================
--- incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/filter/IdentificationFilter.java (original)
+++ incubator/devicemap/trunk/web/webservice-java/src/main/java/org/apache/devicemapjavaservice/filter/IdentificationFilter.java Tue Jun  4 23:00:50 2013
@@ -1,3 +1,22 @@
+/*
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+ */
+
 package org.apache.devicemapjavaservice.filter;
 
 import java.io.IOException;

Modified: incubator/devicemap/trunk/web/webservice-java/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/web/webservice-java/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml?rev=1489667&r1=1489666&r2=1489667&view=diff
==============================================================================
--- incubator/devicemap/trunk/web/webservice-java/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml (original)
+++ incubator/devicemap/trunk/web/webservice-java/src/main/webapp/WEB-INF/mvc-dispatcher-servlet.xml Tue Jun  4 23:00:50 2013
@@ -1,14 +1,20 @@
 <beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:mvc="http://www.springframework.org/schema/mvc"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="
         http://www.springframework.org/schema/beans     
         http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+        http://www.springframework.org/schema/mvc
+        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
         http://www.springframework.org/schema/context 
         http://www.springframework.org/schema/context/spring-context-3.0.xsd">
  
-    <context:component-scan base-package="org.apache.devicemapjavaservice.controller" />
+    <mvc:annotation-driven />
+    <mvc:resources mapping="/js/**" location="/js/" />
  
+    <context:component-scan base-package="org.apache.devicemapjavaservice.controller" />
+
     <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
         <property name="prefix">
             <value>/WEB-INF/views/</value>
@@ -17,5 +23,5 @@
             <value>.jsp</value>
         </property>
     </bean>
- 
+
 </beans>

Modified: incubator/devicemap/trunk/web/webservice-java/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/web/webservice-java/src/main/webapp/index.jsp?rev=1489667&r1=1489666&r2=1489667&view=diff
==============================================================================
--- incubator/devicemap/trunk/web/webservice-java/src/main/webapp/index.jsp (original)
+++ incubator/devicemap/trunk/web/webservice-java/src/main/webapp/index.jsp Tue Jun  4 23:00:50 2013
@@ -3,6 +3,7 @@
 <head>
 <title>Device Map Java Client</title>
 <meta http-equiv="X-UA-Compatible" content="IE=edge">
+<script src="http://devicemap-vm.apache.org/dmapclient.js"></script>
 </head>
 <body onload="main();">
 <h1>Device Map Java Client</h1>
@@ -41,53 +42,6 @@ function submit()
   dmapClient.jsonp(document.getElementById("useragent").value,renderResults);
 }
 
-var dmapClient={
-
-  DMAP_ENDPOINT:"http://devicemap-vm.apache.org/javaservice.js",
-
-  jsonp:function(s,callback)
-  {
-    var stime=(new Date()).getTime();
-    var ua=encodeURIComponent(s);
-    var cb="dmapjc_cb"+Math.floor(Math.random()*1000*1000*1000);
-
-    window[cb]=function(json)
-      {
-        json.clientTime=(new Date()).getTime()-stime;
-        json.method="jsonp";
-        if(callback)
-          callback(json);
-      };
-
-    var st=document.createElement("script");
-    st.async=true;
-    st.src=this.DMAP_ENDPOINT+"?callback="+cb+"&ua="+ua;
-    document.getElementsByTagName("head")[0].appendChild(st);
-  },
-
-  xhr:function(s,callback)
-  {
-    var stime=(new Date()).getTime();
-    var ua=encodeURIComponent(s);
-    var dxhr=new XMLHttpRequest();
-
-    dxhr.open("GET",this.DMAP_ENDPOINT+"?ua="+ua,true);
-    dxhr.onreadystatechange=function()
-      {
-        if(dxhr!=null && dxhr.readyState==4 && dxhr.status==200)
-        {
-          var json=JSON.parse(dxhr.responseText);
-          json.clientTime=(new Date()).getTime()-stime;
-          json.method="xhr";
-          if(callback)
-            callback(json);
-        }
-      };
-
-    dxhr.send();
-  }
-};
-
 </script>
 </body>
 </html>

Added: incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/dmapclient.js
URL: http://svn.apache.org/viewvc/incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/dmapclient.js?rev=1489667&view=auto
==============================================================================
--- incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/dmapclient.js (added)
+++ incubator/devicemap/trunk/web/webservice-java/src/main/webapp/js/dmapclient.js Tue Jun  4 23:00:50 2013
@@ -0,0 +1,65 @@
+/*
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+ */
+
+var dmapClient={
+
+  DMAP_ENDPOINT:"http://devicemap-vm.apache.org/javaservice.js",
+
+  jsonp:function(s,callback)
+  {
+    var stime=(new Date()).getTime();
+    var ua=encodeURIComponent(s);
+    var cb="dmapjc_cb"+Math.floor(Math.random()*1000*1000*1000);
+
+    window[cb]=function(json)
+      {
+        json.clientTime=(new Date()).getTime()-stime;
+        json.method="jsonp";
+        if(callback)
+          callback(json);
+      };
+
+    var st=document.createElement("script");
+    st.async=true;
+    st.src=this.DMAP_ENDPOINT+"?callback="+cb+"&ua="+ua;
+    document.getElementsByTagName("head")[0].appendChild(st);
+  },
+
+  xhr:function(s,callback)
+  {
+    var stime=(new Date()).getTime();
+    var ua=encodeURIComponent(s);
+    var dxhr=new XMLHttpRequest();
+
+    dxhr.open("GET",this.DMAP_ENDPOINT+"?ua="+ua,true);
+    dxhr.onreadystatechange=function()
+      {
+        if(dxhr!=null && dxhr.readyState==4 && dxhr.status==200)
+        {
+          var json=JSON.parse(dxhr.responseText);
+          json.clientTime=(new Date()).getTime()-stime;
+          json.method="xhr";
+          if(callback)
+            callback(json);
+        }
+      };
+
+    dxhr.send();
+  }
+};