Potlatch 1/Development overview/Installing and compiling
Potlatch is designed to be installed on an OSM server, but you can also run it "standalone" to communicate with the main.dev.openstreetmap.org server. If you have OSM running on your own machine, you may like to install Potlatch, although of course this will only write to your local database!
To fetch the development version:
svn co http://svn.openstreetmap.org/applications/editors/potlatch
- Ming (ideally version 0.4.0 or later) - this library compiles the Flash SWF applet
- If you are using Ming 0.3.0, you will need to patch the Ming source slightly. (0.4.0 does not need patching.)
- When you have ungzipped Ming, edit src/ming.c, and simply change version > 7 in line 103 to version > 8.
- Ming requires flex. (On Debian bases systems you can install it with sudo apt-get install flex)
- Then build as normal (./configure, make, make install).
- Ming Perl language wrapper
- Obtain perl_ext from sourceforge (if it's not already in your Ming archive).
- Ungzip it into your Ming install directory.
- cd perl_ext, perl Makefile.PL, make, make test, make install
- Flash Player 8 or later to run Potlatch!
As part of a full OSM install
You'll need a fully working Rails port, and a populated OSM database (e.g. by planetosm-to-db.pl or Osmosis).
Let's make a change to the code and see it live on your local install.
Navigate to applications/editors/potlatch, and edit potlatch.as. Find the line that says var signature="Potlatch ... (probably around line 100) and change the version number.
Now you need to compile the SWF. Still in applications/editors/potlatch, run this command:
perl potlatch.pl ~/osm/sites/rails_port/public/potlatch/potlatch.swf
(changing ~/osm to be the location of your OSM install!). The SWF is now compiled. Fire up your browser, go to 'Edit' and test it!
You can also play with the Potlatch source without the hassle of a full OSM install. In this case, Potlatch will access the test server at main.dev.openstreetmap.org.
To do this, you need to have test.html and your compiled potlatch.swf running on your local webserver.
- Download the source: http://svn.openstreetmap.org/applications/editors/potlatch/
- Create a directory on your local webserver, and copy test.html into it.
- Compile the SWF:
perl potlatch.pl --dev --trace ~/the/same/directory/on/your/local/webserver/potlatch.swf
- Navigate to the relevant place! (e.g. http://127.0.0.1/~richard/potlatch/test.html)
The '--dev' option means 'talk to the test server'. The '--trace' option means 'show some debug windows'. These windows are called _root.chat and _root.coordmonitor, so you can write to them like this:
_root.chat.text="Here's a debug message";
Writing to the dev server
If you want to save any changes on the dev server, you'll need a valid token. To do this, log into an account at http://main.dev.openstreetmap.org/ - you can use the user ID 'Potlatch' and the password 'potlatch' for this. Then open the edit tab there (not your local install). View the source, and search for 'token'. Copy the token string from there into test.html on your local webserver.