devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wk...@apache.org
Subject svn commit: r1648145 - in /devicemap/trunk/examples/ddr-filter/src/main: java/org/apache/devicemap/example/webfilter/IdentificationFilter.java webapp/WEB-INF/oddr.properties
Date Sun, 28 Dec 2014 02:45:12 GMT
Author: wkeil
Date: Sun Dec 28 02:45:12 2014
New Revision: 1648145

URL: http://svn.apache.org/r1648145
Log:
DMAP-111: Improve Web Examples 

Task-Url: https://issues.apache.org/jira/browse/DMAP-111

Modified:
    devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
    devicemap/trunk/examples/ddr-filter/src/main/webapp/WEB-INF/oddr.properties

Modified: devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java?rev=1648145&r1=1648144&r2=1648145&view=diff
==============================================================================
--- devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
(original)
+++ devicemap/trunk/examples/ddr-filter/src/main/java/org/apache/devicemap/example/webfilter/IdentificationFilter.java
Sun Dec 28 02:45:12 2014
@@ -63,7 +63,6 @@ public class IdentificationFilter implem
 	        try {
 	            initializationProperties.load(context.getResourceAsStream("/WEB-INF/oddr.properties"));
 	            identificationService = ServiceFactory.newService("org.apache.devicemap.simpleddr.ODDRService",
initializationProperties.getProperty(ODDRService.ODDR_VOCABULARY_IRI), initializationProperties);
-	            
 	        } catch (Exception ex) {
 	            throw new RuntimeException(ex);
 	        }
@@ -99,7 +98,11 @@ public class IdentificationFilter implem
 
         PropertyRef[] propertyRefs = new PropertyRef[] {vendorRef, modelRef, displayWidthRef,
displayHeightRef};
         Evidence e = new ODDRHTTPEvidence();
-        e.put("User-Agent", ((HttpServletRequest)request).getHeader("User-Agent"));
+//        String userAgent = ((HttpServletRequest)request).getHeader("User-Agent");
+//        String userAgent = "Mozilla/5.0 (Linux; Android 4.4.2; nl-nl; SAMSUNG SM-T530 Build/KOT49H)
AppleWebKit/537.36 (KHTML, like Gecko) Version/1.5 Chrome/28.0.1500.94 Safari/537.36";
+        String userAgent = "Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; SAMSUNG-SGH-I997
Build/FROYO) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1";
+//        System.out.println("User-Agent: " + userAgent);
+        e.put("User-Agent", userAgent);
 
         try {
             PropertyValues propertyValues = identificationService.getPropertyValues(e, propertyRefs);

Modified: devicemap/trunk/examples/ddr-filter/src/main/webapp/WEB-INF/oddr.properties
URL: http://svn.apache.org/viewvc/devicemap/trunk/examples/ddr-filter/src/main/webapp/WEB-INF/oddr.properties?rev=1648145&r1=1648144&r2=1648145&view=diff
==============================================================================
--- devicemap/trunk/examples/ddr-filter/src/main/webapp/WEB-INF/oddr.properties (original)
+++ devicemap/trunk/examples/ddr-filter/src/main/webapp/WEB-INF/oddr.properties Sun Dec 28
02:45:12 2014
@@ -8,4 +8,4 @@ ddr.vocabulary.core.path=/temp/devicemap
 oddr.vocabulary.path=/temp/devicemap-data/devicedata/oddrVocabulary.xml
 oddr.limited.vocabulary.path=/temp/devicemap-data/devicedata/oddrLimitedVocabulary.xml
 oddr.vocabulary.device=http://www.openddr.org/oddr-vocabulary
-oddr.threshold=70
+oddr.threshold=99



Mime
View raw message