Create a custom Oskari-server extension

This document describes how to use maven artifacts provided in Oskari Maven repository to build customized Oskari-server.

Requirements

1. Template maven project

Generate a copy for an Oskari based server webapp from our template

2. Start modifying the content

  • Edit the pom.xmls to change the groupId/artifactId and oskari.version.
  • Edit the pom.xmls to add/change the included dependencies
  • The app-resources contain configurations what functionalities, users, map layers and other content to initialize for the Oskari-based server.
  • Edit the geoportal.jsp under webapp-map to modify the base HTML.
  • Create your own action routes like MyAction under server-extension.

The Oskari dependencies are downloaded from oskari.org Maven repository:

 <repositories>
    <repository>
        <id>oskari_org</id>
        <name>Oskari.org release repository</name>
        <url>https://oskari.org/nexus/content/repositories/releases/</url>
    </repository>
    <repository>
        <id>oskari_org_snapshot</id>
        <name>Oskari.org snapshot repository</name>
        <url>https://oskari.org/nexus/content/repositories/snapshots/</url>
    </repository>
 </repositories>

3. Build

This will build your webapp and include your code on top of the Oskari-server.

cd sample-server-extension
mvn clean install

4.Deploy to servers

Copy the oskari-map.war file from under sample-server-extension/webapp-map/target/ to your servers deploy folder {JETTY_HOME}/webapps replacing the old one.

Note! You will need to adjust oskari-ext.properties accordingly. For example if you only add one view, the id of that view should be the default view in oskari-ext.properties OR you can remove the default view configuration so it will use the view type "DEFAULT" on database to detect the default view.

Examples

Last modified: Mon Oct 12 2020 09:54:12 GMT+0300 (Eastern European Summer Time)