This article is a complete step-by-step procedure to be able to create a new and complete web-mapping project using GeoPrisma as your main application. With these instructions, you’ll be able to start from nothing at all and end with all the knowledge, tips and tricks needed to be able to start your project.
If your intention is to create and add a new sample to the GeoPrisma samples, read this topic instead : How to make a new sample .
First, be sure to have read and understood the Architecture and Concepts of GeoPrima.
It is strongly recommended to have some basic knowledge in the following topics before moving on :
This portion of the article is about the configuration and use of any Service needed in your GeoPrisma installation. Before moving on, you should have your Services all set and ready. When they are, prepare your Resources.
Here’s two ways to help you think about how to prepare your Resources :
You have plenty of data and don’t know what to do with it (no Service yet) :
Make a list of the Resources you want to use in your application.
For each Resource, define what widget will be available
For each Resource, define all the ServiceType used by the widgets it will use
Each ServiceType will consist of a DataStore and a Service you need to prepare for the data.
Example with [widget](ServiceType) :
You have a city shapefile you want to use in GeoPrisma. You want users to be able to view the cities in a [map](WMS), use some query tool [query](WMS) and some will have the rights to edit them [edition](featureserver). So, the data need to be served by a WMS server, such as MapServer and by FeatureServer. You’ll need both services installed, serving the data accordingly to your need. Also, since you’ll want the users to upload changes to the data, you should plan to import your data in a editable format, such as in a PostGIS database.
You have working and ready web mapping services you want to use in GeoPrisma :
IMPORTANT
GeoPrisma becomes responsible of the access to these Resources, so you must make all the Services they use unavailable outside the GeoPrisma Proxy (else, what’s the point, right ?)
Check that your have every Prerequistes filled. If you use apache, you might want to automatically load the required modules as extension in your config.ini file (example, for linux) :
extension=php_curl.so
extension=php_gettext.so
extension=php_xsl.so
extension=php_pgsql.so
Here’s a proposed directory structure to use inside your project directory. It will be used in this how to :
Make your htdocs directory visible from the web.
The easiest way to start your project is to look among the existing samples and choose one that fits your needs. If it’s your first time playing around with GeoPrisma, think small and easy !
Simply copy the files from a single example and place them in your project directory. If you used the above structure, copy the files to the locations :
Finally, also copy this file (from the root samples directory).
To know more about these files, see Architecture and Concepts .
In the core configuration file of GeoPrisma, you’ll have to specify which driver to use for each of the following elements :
You can either choose from existing drivers included in GeoPrisma or create and your own. If you decide to do so, please fill a ticket with a patch in trac : http://trac.osgeo.org/geoprisma/
If it’s your first time playing around with GeoPrisma, you should start by using the NoACL as your ACL driver. It’ll be easier to play around with less stuff to worry about. We’ll cover that later.
The choice of the config driver is up to you, but in this how to we’ll pick the XMLConfig since it’s easy, quick to use and all the samples currently use this driver.
All the .php files are used to configure the core of GeoPrisma. Edit them to fit to your chosen driver settings.
You might need to change some path variables, like :
$g_strGeoprisma = "$g_strCurrentDir/..";
to :
$g_strGeoprisma = "/path/to/YourGeoPrismaRootDir";
Set your ACL and CONFIG driver. Set your default LOCALE language.
Edit your XMLConfig file (config.xml).
Remove the junk you don’t need. Add your Services, DataStores, Resources and Widgets defined in your list. See the Widget API documentation and samples to know more about the widgets and their possible options.
Edit your Template file
xmlns:map="http://geoprisma.org/map"
xmlns:geoexttoolbar="http://geoprisma.org/geoexttoolbar"
xmlns:shortcut="http://geoprisma.org/shortcut"
extension-element-prefixes="dyn map geoexttoolbar shortcut"
<xsl:include href="../../../src/client/templates/inc/Globals.xslt" />
<xsl:include href="../../../src/client/widgets/map/Map.xslt"/>
<xsl:include href="../../../src/client/widgets/geoexttoolbar/GeoExtToolbar.xslt" />
<xsl:include href="../../../src/client/widgets/shortcut/Shortcut.xslt" />
<xsl:include href="/path/to/your/geoprisma/trunk/src/client/templates/inc/Globals.xslt" />
<xsl:include href="/path/to/your/geoprisma/trunk/src/client/widgets/map/Map.xslt"/>
<xsl:include href="/path/to/your/geoprisma/trunk/src/client/widgets/geoexttoolbar/GeoExtToolbar.xslt" />
<xsl:include href="/path/to/your/geoprisma/trunk/src/client/widgets/shortcut/Shortcut.xslt" />
All your html pages should start with :
<?xml version="1.0" encoding="utf-8"?>
To be able to use the existing internationalization support in current widgets and adding them to your project, read about i18n (internationalization)
Visit project htdocs directory form in a browser. GeoPrisma should automatically generates the interface from the Resources and Widgets you defined.
See also
Ask the Mailing Lists for help, questions and comments when needed.
See at http://www.geoprisma.org to join the lists.
Now that you’ve played around the files and config a lot, you’re ready to play with the coolest thing in GeoPrisma : the ACL.
There’s an existing example available showing all kind of different drivers to use for the ACL. Simply play with it and look at the config files to learn more :
GeoPrisma has a basic tool to manage the ACL. See at :
The example uses the BorealisACL driver, which is available to use.