Chapter 4. Configuring MAJAS Users

You can configure users for you MAJAS applications in the data/ggis/users subdirectory of the MAJAS web application directory. In this directory you can put an XML file for each user that contains user-specific configuration settings. The files must be named after the user: [username].xml. It contains at least one application element for each application to which that user has access.

?xml version="1.0" encoding="UTF-8"?>
<mc:user xmlns:mc="http://www.majas.org/schema/2006/configuration/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:ns2="http://www.w3.org/1999/xhtml" 
    xmlns:ns="http://www.majas.org/schema/2006/configuration/" 
    xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty" 
    xsi:schemaLocation="http://www.majas.org/schema/2006/configuration/ file://xsd/majas-user.xsd">

 <id>5</id>

 <application ref="test-application" label="Some Test"> 
  <layerFilters>
    <layerFilter layer="1" filter="(prov == 3)" />
    <layerFilter layer="2" filter="(FEATURE WITHIN GEOMETRY.1(prov == 3))" />
    <layerFilter layer="3" filter="(FEATURE WITHIN GEOMETRY.1(prov == 3))" />
  </layerFilters>
  <initialMapExtent maxX="200000" maxY="230000" minX="50000" minY="170000"/>  
  <maxMapExtent maxX="260000" maxY="245000" minX="20000" minY="150000"/>  
  <bookmarks> 
    <bookmark maxX="200000" maxY="225000" minX="5000" minY="165000" name="initial"/>  
  </bookmarks> 
 </application>
  
</mc:user>

The structure of this configuration file is defined in the majas-user.xsd (see majas-user.xsd).

First of all let's start with the link between an application in MAJAS, and an application tag here in the user configuration. For each application that has allowed a user to access it, there is need of a specific configuration of that user for the application. But more then that, a user might have defined more then one configuration for a specific application, hence the label attribute in the application tag. In other words, there is a ref-attribute that denotes the application this configuration refers to, and there is the extra label attribute that is displayed to the user in case of multiple configurations for the same user on the same applicartion. The user must always choose one configuration. Usually different configurations for the same application, go hand in hand with different layerfilters.

The layerfilters are the first part of a userconfiguration. They state what should be accessible to a user, and what shouldn't. Let's take a look at the first layerFilter. It's a filter to be applied on layer 1, and filter says (prov == 3). This means that for layer "1", only objects with the property "prov" equal to "3" will be shown. All other objects in that layer will not be accessible for this user. Now a more interesting example of a layerflter, the filter for layer "2". It says "(FEATURE WITHIN GEOMETRY.1(prov == 3))". What does this mean? Well it means that this layer will only display features that are geographically within the feature determined by "(prov ==3)" in layer 1. This way it is possible to use geographic filters on features in other layers.

Next is the initialMapExtent. This a the mapextent visible to the user at the moment he/she logs in. It should always be geographically within the maxMapExtent. The maxMapExtent is maximum boundary for this user. He will not be allowed to move outside of this boundary.

Then there are the bookmarks. These can always be left empty, because each user can save bookmarks from within the MAJAS applications.