Skip to content

README.md

couchapp for Java language views

Requirements

cloudant hosted account (sign up at https://cloudant.com/#!/solutions/cloud), couchapp (installation instructions at http://couchapp.org/page/installing).

Usage

This is a simple example couchapp that uploads a java language view. The is part of the couchjava project.

To specify that the language of the view is java, there is a file "language" containing the term "java" in the top level directory.

As with all couchapps, the view is defined in the view folder. In this case, there is a view call "title" with a map and reduces classes defined:

views/title/map.java
views/title/reduce.java

There is also an example of a SearhView for use with Cloudant's search application: views/index/map.java views/index/reduce.java

Any jar files that you want to upload should be place in the _attachments directory (note -- you can place multiple jar files there). If you want to work with the deafult javaviews.jar file created by the couchjava project, create a symoblic link to couchjava/dist/javaviews.jar

mkdir _attachments
ln -s ../../dist/javaviews.jar _attachments/javaviews.jar

If you wish to specify a default database for this view, modify the .couchapprc file:

cat > .couchapprc {"env":{"default":{"db":"http://<user>:<pass>@<user>.cloudant.com:5984/<your_db>"}}} ^C that last line means hit *CTRL-C***

the you can install the view with:

couchapp push

Otherwise, you can specify the database in the couchapp call:

couchapp push http://<user>:<pass>@<user>.cloudant.com:5984/<your_db>

Contact

Cloudant folks are usually hanging out in IRC. Freenode, channel #cloudant. We may also be reached:


Something went wrong with that request. Please try again.