A simple web application built on top of the Hippo Repository Java Adapter. It contains a GUI for uploading, viewing and deleting queries (dasl files) and transformers (xsl files). These queries and transformers can then be executed by calling the appropriate url, the results are sent back to the client application (browser, flash movie, etc.)
The CacheManager caches all calls to the repository making this webapp quite fast.
Download, install and start the latest release of the Hippo Repository
Dowload, install and start Apache Tomcat version 5.5 and up.
Download the application war from the project downloads directory
Go to the Tomcat Manager at http://localhost:8080/manager/html and deploy the application war.
Tomcat will have unzipped the WAR file into the $TOMCAT_HOME/webapps/hippo-repository-adapter-webapp directory. In that directory there is a file called 'adapter.properties' which is used for configuring the application. The default settings are correct if you have a default binary distribution of the Hippo Repository running on localhost. If this is not the case you can edit this file to suit your needs and restart Tomcat (not just redeploy the application, see known bugs below)
Logging can be configured by adjusting the 'log4j.properties' file in the $TOMCAT_HOME/webapps/hippo-repository-adapter-webapp/WEB-INF/classes directory.
Go to http://localhost:8080/hippo-repository-adapter-webapp, there you can browse the contents Hippo Repository. Nothing very special, it's the same you get if you navigate to the web frontend of the repository itself at http://localhost:60000)
Things become more interesting if you go to http://localhost:8080/hippo-repository-adapter-webapp/admin, This admin page enables you to upload DASL queries and XSLT transformations.
CopyPaste the sample DASL query file and save it to a file called 'sample.xml' on your local machine. Then upload it to the repository using the upload form at bottom of the admin page
Go back to the admin page, the uploaded file appears in the 'queries' section. (You might need to refresh your browser)
Go to http://localhost:8080/hippo-repository-adapter-webapp/query/sample/documents/2. What you see is the search result of the query 'sample' with target path /documents (relative to files/default.preview/content) and '2' substituted for the '${_1}' parameter in the <d:nresults> element. Try http://localhost:8080/hippo-repository-adapter-webapp/query/sample/documents/1 and notice that the number of results is now 1 instead of 2.
CopyPaste the sample XSL transformation file and save it to a file called 'sample.xsl' on your local machine. Then upload it to the repository using the upload form at bottom of the admin page
Go back to the admin page, the uploaded file appears in the 'transformers' section. (You might need to refresh your browser)
Return to to http://localhost:8080/hippo-repository-adapter-webapp/query/sample/documents/2 and see how the xsl file has transformed the searchresult.
Note that the name and extention of the uploaded files are important: <queryname>.xml for the query (dasl) file and <queryname>.xsl for the transformation (xsl) file. The query file is mandatory, the transformation file is optional.
The application is a simple Servlet accepting a url and returning a bytestream, no application framework is used, everything is done by hand.
Adding new functionality should be as easy as writing a (Java) regular expression. The application is organized around a number of 'Matchers', each exposing a regular expression and an execute() method returning a bytestream that can be sent to the client. These Matchers are stored in an ordered list, an incoming url is matched against each Matcher in the list and the first match is executed. Parameters are supplied by using regexp capturing groups, not url parameters, making the thing 'Google friendly'.
At the moment the functionality is a bit limited, the only interesting matchers are the ContentMatcher for browsing, the AdminMatcher for uploading etc. and the QueryMatcher for running the queries and transformations. The QueryMatcher itself is also very limited in the parameters it accepts: (1) the name of the query, (2) a target path one level below the 'files/default.preview/content' folder and (3) one parameter that will be substituted for a ${_1} placeholder in the dasl query.
Next steps: