For developers

Background

Openaid.se is built with and runs on open source software. Sida’s purpose of developing web interfaces and their underlying software with open source code is so that when it is shared and used by others it will contribute and encourage more users to adopt the IATI-standard.

License

All code that is accessible with the openaidstage.cybercomhosting.com project complies with the license GPLv3 (see other licenses for other components). This means that those who use the Openaid software (code) have the freedom to improve and adapt it to their own needs. They can then distribute improvements to others who are able to take advantage of any modifications.

Install your own version of Openaid.se

Currently the software is adapted to the settings for the website Openaid.se, therefore before you begin you need to complete an initial installation. By doing this you will get a good understanding of how Openaid is built before you begin making your own adjustments. You should be familiar with Linux-environments in order to follow the guide.

  1. Make sure your environment fulfills all system requirements.
  2. Download the latest version of WordPress
  3. Download and install the WordPress theme “Openaid”
  4. Download the latest version of “iati-importer”
  5. Download the latest version of “pdf-importer”
  6. Run the script to change the URL in the database
  7. Import the iati-data (iati-importer)
  8. Import the documents (pdf-importer)
  9. Install a plug-ins with the equivalent functionality of Openaid
  10. create the aid-page

1. Make sure that your environment fulfills all system requirements

In order for openaidstage.cybercomhosting.com to work in a satisfactory manner you should install it on the platform recommended below. Openaid.se is installed on a virtual server with the components listed below. It is ok to use equivalent software but this guide does not go through all variations.

Recommended environment (version and license)

  • Operating System: Linux/UNIX Ubuntu 14.04.2 LTS (GPL)
  • Database: MySQL Ver 14.14 Distrib 5.5.41, for debian-linux-gnu (x86_64) using readline 6.3 (GPL)
  • Web server: NGINX/1.4.6 (Ubuntu) (2-class, a version of BSD license)
  • Process manager: HipHop VM 3.5.1 (PHP, Zend and BSD license)
  • Programming language PHP 5.5.14 (and cli) (built: Sep 9 2014 19:09:25) (The PHP License, version 3.0)
  • CMS: WordPress 4.4+ (recommended latest) (GPLv2)
  • Visualisation (graph, map): D3 (Data-Driven Documents) (BSD licence)

To follow this guide, you should be familiar with Linux-environments. If you do not have a Linux-environment installed there are many guides available on the Internet that show you how to do this.

2. Download and install the latest version of WordPress

WordPress is a modern and free publishing tool used to build blogs and websites.

It is useful to create a new database the same as the one we use in Openaid.se.

# CREATE SCHEMA `openaid` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Then install WordPress using their famous 5-minute installation instructions.

3. Download and install the WordPress-theme Openaid

Download the theme and unzip it in the catalogue “/wp-content/themes/” or install it directly from WordPress by downloading and saving the theme and then upload it to your WordPress-environment.

4. Download the latest version of iati-importer

iati-importer contains a database schema with examples of data and code to import from the IATI-datastore.

5. Download the latest version of pdf-importer

pdf-importer contains a database schema with examples of data and code to import from the IATI-datastore.

6. Run the script to change the URL in the database

In the schema you will find the URL “http://openaid.se”. You should change this to the same URL as where your host. You can use the following code to change the URL to your own. An alternative is to install WP-CLI (http://wp-cli.org) and run “search-replace”.

set @old = "http://openaid.se"; /* adress att byta från */
set @new = "http://www.domän.se"; /* adress att byta till */
update wp_posts set post_content = replace(post_content, @old, @new), guid = replace(guid, @old, @new);
update wp_postmeta set meta_value = replace(meta_value, @old, @new);
update wp_options set option_value = replace(option_value, @old, @new);

7. Import the iati-data (iati-importer)

Change the name of config-sample.php to config.php and write in the correct database details at the top. Run index.php from the terminal with PHP-CLI.

# php index.php

When you run the index.php, it does the following:

  1. Downloads the data from the IATI-datastore. Then imports it to the “transaction” table in the openaid-database.
  2. Generates WordPress pages from the data in the “transaction” table (the pages are created in agency/recipient and organisation post type)

8. Import the documents (pdf-importer)

Change the name of config-sample.php to config.php and write in the correct database details at the top. Run index.php from the terminal with PHP-CLI.

# php index.php

When you run the index.php, it imports the documents to the “documents” database table

9. Install extensions

Install the following extensions if you want to have the same functionality as Openaid.se.

Akismet
Used by millions, Akismet is quite possibly the best way in the world to protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep.

Google XML Sitemaps
This plugin will generate a special XML sitemap which will help search engines like Google, Yahoo, Bing and Ask.com to better index your blog.

Magic Fields
Create custom fields for your post types

Manual Purge Cache
Plugin for purging selected cached pages on disk generated with cache plugin or proxy server. Download Manual Purge Cache from GITHub (https://github.com/matiasvangsnes/manual-purge-cache)

qTranslate-X
The plugin offers a way to maintain dynamic multilingual content on a WordPress site. While static localization is already excellently implemented and offered by WordPress framework through po/mo file framwork, it is still impossible to maintain dynamic multilingual content without an additional specialized plugin, a kind of which qTranslate-X belongs to.

W3 Total Cache
The highest rated and most complete WordPress performance plugin. Dramatically improve the speed and user experience of your site. Add browser, page, object and database caching as well as minify and content delivery network (CDN) to WordPress.

10. Create the aid page

Create a page called “Aid”. Make sure the slug is just “aid”. Select “toolbox” to be the template of this page. This is the template that shows the graphics on the startpage.