Step 12: Your own application
<- Step 11: Your own data Step 13: User config ->
It is now time to make a new application that uses the new feature type. In order to be able to do this, a number of things need to be done. First of all, a new application configuration needs to be created. To this end, go to the geGIS directory (standard under “C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\"), more specifically under "/data/ggis/applications/". This is where we unzipped the demo application in step 10. This time we use the "new-app.zip" file. Unzip it in the current directory next to "hello" and "demo". A new directory "new-app" will now appear, as shown on the figure below.
It is time to choose a name for the new application. In this manual the name "test" has been chosen. Now rename the “new-app” directory “test”. Then go to the configuration tool and select “Applications” in the menu.
To start with, go to “Change configuration”. To this end, select the new application (test) and click on the button. A text field will now appear with the configuration for the new application.
This configuration is a one-layer application. Before this can be activated, a number of things need to be changed:
- url: The URL element has two attributes: "ref" and "value". These are currently on “application name”. Change it to the name you selected for the application. In our example this is "test".
- name: The element “name” must be given the same values.
- user: There is currently one authorised user for this application: “guest”. You may add other users to this.
These were the necessary attributes with regard to the general configuration of an application. Now we have the layer definitions. There is only one layer in our example in which we will use the feature type which we created in the previous step.
- layerName: Fill in a name here for the layer.
- layerType: The layer type is a number which indicates the geometrical type for this layer. It is currently at ‘4’, which means we wish to display polygons. If this is incorrect, adjust it. (1=raster/wms, 2=points, 3=lines, 4=polygons).
- featureType: Now fill in the feature type you wish to use here. In other words, fill in the feature type here which you used in the previous step. Remember that the complete name has to be filled in (including namespace) and that this name is case sensitive.
- snappingRules: Here you can define several rules for snapping points. Currently, only one rule is defined. The layer name refers to the layer to which the points in this layer should be able to snap. Just fill in the name of this layer here. (case sensitive!)
- attributes: Now you have the "identifying" and "viewable" attributes. A name and a label are required for each attribute you wish to define here. The name is the exact name of an attribute as it is defined in a feature type (you can view this through the feature types list). The label is the name as it should be displayed to the user. Currently, one identifying and one viewable attribute have been configured. You can always determine these numbers yourself.
- labelConfig: Fill in the name of the attribute that is to be displayed in the labels. (Name, no label! Again case sensitive)
- styleDef: Currently one style is defined for this layer. This style is described in css, in the element 'svgStyle'. Let us just stick to this one style. Just change the name of this style in what seems to be appropriate. (for instance "test style")
These are the most important things. Check once again whether everything has been properly filled in. Most fields are case sensitive. A small typing error can thus make the difference between an application that functions and one that does not. If everything is ok, click on “Store!”.
Before we proceed to the next step, it may be advisable to test whether nothing has gone wrong during the configuration. To this end, click in the application page on “Check configuration”. This button will check the form of the configuration, not the content. In other words, if an element is missing, you will be notified. However, if you filled in an attribute which does not exist, it will not be detected. In case any errors are detected, read the error message very carefully! If you really cannot find what has gone wrong, it may be better to redo this step.