Usage

pangratz666 edited this page Apr 14, 2011 · 15 revisions
Clone this wiki locally

#Usage#

Want to know how this module is used so you can create your own amazing CouchApp with views, lists, etc. and do some pushing, then you're in the right place.

##Create a new CouchApp##

To create a new CouchApp project inside NetBeans choose File -> New Project and select the CouchApp as shown in the figure.

NewCouchAppDialog1

On the next dialog page you can enter the name of the project and it's location. Additionally you can specify whether you want to create a new CouchApp or if you want to push an existing one. To do so you have to select the corresponding item and specify the URL. Clicking on finish will create either a new CouchApp or push the existing one. Either way, you successfully created a CouchApp project which can be modified as described in the next section.

NewCouchAppDialog2

The project structure of a newly created CouchApp is shown in the next screenshot.

ProjectStructure

##Create a new View/List/Filter/Show/Update##

A right click on the root of a CouchApp project opens a Pop Up which lets you create new Views, Filters, and so on.

GenerateViewPopUp

To create - for instance - a new view, you just have to click the corresponding item in the PopUp and afterwards a dialog appears where you have to enter a name for the stuff you want to create.

GenerateViewDialog

In this example a new view named my_view has been created and the result of this operation can be seen in the next screenshot:

ProjectStructureAfterViewGenerated

##Ready, Set, Push!##

If you want to share your CouchApp you can do so by pushing it to any CouchDB instance. You can either click the CouchDB icon in the menu bar or select Push CouchApp... from the PopUp menu on the root node of the CouchApp project.

A dialog is opened in which the location of the CouchDB is entered where the CouchApp shall be pushed to. You can either choose one entry of the .couchapprc file or manually enter any valid URL to an CouchDB instance.

PushCouchAppDialog

As stated before the available options for the predefined CouchDB locations are defined in the .couchapprc file, which is structured as follow:

CouchapprcFile

Since version 0.5 of the plugin, there is an editor available, which is accessible via the project properties of a CouchApp project. This editor lets you define the specific properties in one place, as seen in the next image:

Editor

After the CouchApp has been pushed it is "opened" in the default browser so you can immediatly test your app.

CouchApp