-
Notifications
You must be signed in to change notification settings - Fork 11
Installation
Installation info:
You need to build the hakken server before you can run it. This is done using maven. BEfore building, you'll need to create a deployContext.properties file in the src/main/webapp/WEB-INF/classes directory - copy the deployContext.properties.default file to give you a starting point.
Items that will need configuring are:
- Database connection info (unless you
- Ldap connection info (unless you aren't using ldap authentication)
- location of your task definition files.
See the appropriate following sections for more details.
You will also need to create a deploy-context.xml file in the src/main/webapp/WEB-INF/spring directory. Again, there is a .default file to use as a starting point. In this file, you need to define the authentication mechanism being used and any DataConnectors you wish to use.
Hakken currently uses a postgres database for storing mapping information, submissions etc. By default, it expects to find a local database named taskhelper
accessible by a username/password combo of taskhelper/taskhelper. IF you wish to use a location/name then modify your deployContext.properties file accordingly.
Hakken hasn't been tested on any other databases but it uses Hibernate for all database access so it should be easy enough to port to another type of database.
Currently, Hakken supports two authenticators:
- LDAP
- A Dummy "Always Allow" authentication.
Comment/Uncomment the appropriate section in your deploy-context.xml file accordingly. Only use the dummy authenticator when testing.
In order to be useful, Hakken needs one or more data connectors configured. This is done in the deploy-context.xml file and is specific for each type of data connector.
For the JDBC Connector, add an entry as follows:
<bean name="exampleJdbcConnector"
class="uk.co.vurt.hakken.server.connector.JDBCConnector" >
<property name="connectionString"
value="jdbc:oracle:thin:@dbserver.anyco.com:1521:dbname" />
<property name="driverName" value="oracle.jdbc.OracleDriver" />
<property name="dbUser" value="dbUser" />
<property name="dbPassword" value="dbPassword" />
<property name="schema" value="SCHEMA" />
<property name="name" value="AnyIdentifier" />
</bean>
As it's plain old JDBC, you can use any database that you have a JDBC driver for. The name property defines the label that will be visible in the Hakken admin interface so make it something useful.
To build the project, it's simply a matter of running mvn package
in the project root directoy. Everything will be built for you and you'll find the server war file in the hakken-server/target directory.
Simply deploy the war file to your Java server of choice (Tomcat 7 is what I've used so far).
Once the server is up and running, you can access the admin interface at http://servername:port/hakken/admin/ (trailing slash is important due to crappy url mapping on my part)
Here you will be able to see:
- any Task Definitions that the server has been able to load
- any Data Connectors that have been defined in the server config
- any Data Connector Task Definitions (terminology needs improving)
- any Mappings between Task Definitions and Data Connector Task Definitions (yes, I know, terribly terminology - it was a long night and I was all out of inspiration).
There are also some tools for reloading task definitions and viewing/resubmitting submissions from devices. This last tool is useful when debugging issues with the data synchronisation.
You'll first want to create a DataConnectorTaskDefinition by clicking on the appropriate DataConnector then selecting a task definition from the list it presents you with.
Once that has been done, you need to create a mapping between a hakken TaskDefinition and the DataConnectorTaskDefinition. This is done by clicking on the TaskDefinition then clicking on the create mapping button, selecting the appropriate DataConnectorTaskDefinition first. If dataitems have the same names in both task definitions, then they will be auto-matched in the next screen, otherwise you will need to manually define the mappings.
Once the mapping has been created, Hakken is ready to go, you just need a mobile client to connect to it.
Hakken's client isn't yet in the Google Play store (although I'm working on it), so for the time being you need to sideload it onto your device. One way to do this is to point your device's web browser at your server (http://servername:port/hakken) then clicking on the download link.
Once you've downlaoded and installed the apk, you can launch it.
On first launch, you'll be presented with the preferences view in order to configure the application so it knows which server to communicate with. Enter the url for your server.
Next you'll need to log in with valid credentials. This will create a Hakken account on your device. Currently only one account per device is supported. After this first launch, these screens won't be presented again, instead you'll go straight to the job list view of the app.
When the app launches, you'll be presented with a list of any jobs for you once it has synched from the server. In addition, you can create an adhoc job using one of the available task definitions that have been synched to the device, available on the other tab.