Apache DeviceMap 2.0 Reference Client [Internal TODO] -combine loadPattern and loadFile into 1 load with state -fix attribute json to be an object WHAT IS THIS? ============= This is the reference client for Apache DeviceMap 2.0. Apache DeviceMap is primarily a device classification project. This is also known as device detection. Basically, give DeviceMap a string (like a User-Agent request header) and it will tell you what it is. DeviceMap 2.0 has extended the idea of classification into generic domains. The domain tells the DeviceMap client how to classify the input into a result. This will allow this project and 3rd parties to create their own domains and use them with standard DeviceMap 2.0 clients. This reference client is the starting point for: * Creating, testing, and validating a DeviceMap 2.0 domain. * Creating a DeviceMap 2.0 client for a specific platform or language. 2.0 SPECIFICATION ================= http://wiki.apache.org/devicemap/DataSpec2 SOURCE ====== https://svn.apache.org/repos/asf/devicemap/trunk/clients/2.0/reference/ The source is broken up into several components: * src/Main.java This is the driver for the reference client. It contains logic to parse the command line and the test file. * src/DeviceMapClient.java This is the actual DeviceMap client. It is initialized with a pattern file and an attribute file (or multiple). Once initialized, it can then classify text and return back attribute maps. * src/JsonFile.java This parses a JSON file into something the DeviceMapClient can handle. * src/Pattern.java This is a pattern object. * src/Attributes.java This is the pattern attributes object. * src/Transformer*.java These are transformers. COMPILE ======= Note: this step requires "javac" (JDK) ./compile.sh To clean: ./compile.sh clean RUN === Note: this step requires "java" (JRE) ./run.sh -p [pattern file] -a [attribute file] -t [test file] For help: ./run.sh -h To run the reference_a domain: ./run.sh \ -p ../../../data/2.0/reference/a/patterns.json \ -a ../../../data/2.0/reference/a/attributes.json \ -t ../../../data/2.0/reference/a/test.json You can also use the test harness: ./test.sh ../../../data/2.0/reference/a