Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Links sanitycheck csv branch #39

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
2 changes: 1 addition & 1 deletion 1 Introduction/00030-GitProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Read Atlassian's awesome [Git Flow documentation](https://www.atlassian.com/git/
- Development for a new feature
- These should be used in forks, not the official repositories
- Once the feature is completed the branch will be merged into develop
- See [how to contribute](LINK_Development/how-to-contribute) for Git instructions
- See [how to contribute](../7 Operating instructions/00310-HowToContributeToOskariProject.md) for Git instructions

**release/x.y.z**
- A release branch is opened as a code freeze some time before the next release based on the current develop-branch.
Expand Down
4 changes: 2 additions & 2 deletions 10 Enabling modules/00110-HowToEnableThematicMaps.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Oskari can display statistical data and link it to map layers creating thematic maps. Currently choropleth maps are supported for areal data. The statistical data are combined with the map layer data with an ID field that must match between the data. Supported data sources for statistical data are PX-Web, SDMX REST and Sotkanet REST, more support can be added via adapters written in Java. When the requested statistical data is multi-dimensional the user has to slice each dimension to reach a tabular form of data.

See [requirements](./00111-ThematicMapsRequirements.md) for using the thematic maps functionality in Oskari application.
See [requirements](00111-ThematicMapsRequirements.md) for using the thematic maps functionality in Oskari application.

See instructions for [configuring](./00112-ThematicMapsConfig.mdg) the thematic maps functionality.
See instructions for [configuring](00112-ThematicMapsConfig.md) the thematic maps functionality.
2 changes: 1 addition & 1 deletion 10 Enabling modules/00112-ThematicMapsConfig.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Configuring thematic maps functionality

See [requirements](requirements) for enabling the code that powers the thematic maps functionality.
See [requirements](00111-ThematicMapsRequirements.md) for enabling the code that powers the thematic maps functionality.

#### Adding regionsets as maplayers

Expand Down
2 changes: 1 addition & 1 deletion 3 Setup instructions/00020-SetupDatabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ See [Setup Jetty](00030-SetupJetty.md) documentation for details where changes a
The empty database will be populated when the oskari-server is started for the first time. The database population is split into modules. The core module creates and migrates the main database tables used by Oskari. The default configuration has a module named "example" enabled that will populate an example app and maplayer to get a nice unboxing experience. You should replace "example" module with your own app configuration and content for anything other than basic development and playing around.

To learn how to customize Oskari including populating the database with your own content instead of example content see:
* [Create a custom Oskari-server extension](../7 Developing instructions/00160-HowToCreateACustomOskariServerExtension.md)
* [Create a custom Oskari-server extension](../8 Developing instructions/00160-HowToCreateACustomOskariServerExtension.md)
2 changes: 1 addition & 1 deletion 4 Application core functionality/00030-Bundles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A bundle is a component in an Oskari application. A bundle is a selection of Oskari classes which form a component that offers additional functionality for an application. A bundle can offer multiple implementations for a functionality which can then be divided into smaller packages for different application setups. Packages can be used to offer a multiple views for the same functionality for example search functionality as a small on-map textfield or a window-like UI (see Tile/Flyout) for the same functionality.

A comprehensive versioned documentation of all available bundles can be found [here](https://www.oskari.org/api/bundles)
A comprehensive versioned documentation of all available bundles can be found [here](/documentation/api/bundles/latest/)

### Bundle architecture

Expand Down
2 changes: 1 addition & 1 deletion 4 Application core functionality/00040-BundleRequests.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Bundle requests

A comprehensive versioned documentation of all available bundle requests can be found [here](https://www.oskari.org/api/requests)
A comprehensive versioned documentation of all available bundle requests can be found [here](/documentation/api/requests/latest/)


2 changes: 1 addition & 1 deletion 4 Application core functionality/00050-BundleEvents.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## Bundle events

A comprehensive versioned documentation of all available bundle events can be found [here](https://www.oskari.org/api/events)
A comprehensive versioned documentation of all available bundle events can be found [here](/documentation/api/events/latest/)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Remote procedure call (RPC)

A demo app with a bunch of examples on how to use Oskari over RPC api is [here](https://oskari.org/examples/rpc-api/#/)
A demo app with a bunch of examples on how to use Oskari over RPC api is [here](/examples/rpc-api/)

2 changes: 1 addition & 1 deletion 7 Operating instructions/00030-HowToUseDevelopmentTools.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,6 @@ over.
#### Building the backend

The development build for the backend is compiled and run using Maven, as described [in the
development documentation](/documentation/backend/setup-development).
development documentation](../3 Setup instructions/00040-SetupDevelopmentEnvironment.md).

* * *
2 changes: 1 addition & 1 deletion 7 Operating instructions/00050-HowToUseOskariFilter.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@ To have WFS layer that contains only features which regionCode '091' and service

#### Oskari style
Using filter with optional styles see:
[Oskari style](/documentation/examples/oskari-style#optional-styles)
[Oskari style](../7 Operating instructions/00060-HowToUseOskariStyle.md)
4 changes: 2 additions & 2 deletions 7 Operating instructions/00060-HowToUseOskariStyle.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ Hover options describes how to visualize layer's features on hover and what kind

#### Optional styles

The styling definitions for optional style is same as above. Features that uses optional style are filtered with [Oskari filter](/documentation/examples/oskari-filter) definition by features' property keys and values. To filter features by different property keys you can use AND or OR operators.
The styling definitions for optional style is same as above. Features that uses optional style are filtered with [Oskari filter](00050-HowToUseOskariFilter.md) definition by features' property keys and values. To filter features by different property keys you can use AND or OR operators.

You can pass the optional styles array with the key `optionalStyles` when you pass the base style with key `featureStyle` in for example [AddFeaturesToMapRequest](/api/requests/#/latest/mapping/mapmodule/request/addfeaturestomaprequest.md).
You can pass the optional styles array with the key `optionalStyles` when you pass the base style with key `featureStyle` in for example [AddFeaturesToMapRequest](/documentation/api/requests/latest/AddFeaturesToMapRequest).

#### Optional style examples

Expand Down
4 changes: 2 additions & 2 deletions 7 Operating instructions/00080-HowToUseABundle.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
### How to use a bundle

A bundle is a component in an Oskari application. A bundle is a selection of [Oskari classes](/documentation/core-concepts/oskari-class) which form a component that offers additional functionality for an application. A bundle can offer multiple implementations for a functionality which can then be divided into smaller packages for different application setups. Packages can be used to offer a multiple views for the same functionality for example search functionality as a small on-map textfield or a window-like UI (see Tile/Flyout) for the same functionality. For a short introduction see [create your own bundle](/guides/quick-start/create-your-own-bundle).
A bundle is a component in an Oskari application. A bundle is a selection of [Oskari classes](../7 Operating instructions/00100-HowToUseClasses.md) which form a component that offers additional functionality for an application. A bundle can offer multiple implementations for a functionality which can then be divided into smaller packages for different application setups. Packages can be used to offer a multiple views for the same functionality for example search functionality as a small on-map textfield or a window-like UI (see Tile/Flyout) for the same functionality. For a short introduction see [create your own bundle](/guides/quick-start/create-your-own-bundle).

#### Directory structure

See [here](/documentation/directory-structure) for info about structure and conventions.
See [here](../2 Application environment/00020-Frontend.md) for info about structure and conventions.

#### Implementation

Expand Down
2 changes: 1 addition & 1 deletion 7 Operating instructions/00100-HowToUseClasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The create method returns an instance of the class which you specify as paramete

#### Protocol

Classes can declare implementing a protocol (none to many) or classes can also be used to define a protocol. A protocol can be thought of as an interface declaration and contract for a set of functions that a class must provide/implement. For example for a class to register to [Oskari sandbox](/documentation/core-concepts/oskari-core) it needs to implement the `Oskari.mapframework.module.Module` protocol which defines that the class must have for example a `getName()` and `onEvent()` methods. This way we can depend that any registered component can handle operations that will be expected from registered components.
Classes can declare implementing a protocol (none to many) or classes can also be used to define a protocol. A protocol can be thought of as an interface declaration and contract for a set of functions that a class must provide/implement. For example for a class to register to [Oskari sandbox](../4 Application core functionality/00020-CoreAndSandbox.md) it needs to implement the `Oskari.mapframework.module.Module` protocol which defines that the class must have for example a `getName()` and `onEvent()` methods. This way we can depend that any registered component can handle operations that will be expected from registered components.

```javascript
Oskari.clazz.define('Oskari.mynamespace.MyProtocol', function() {}, {
Expand Down
4 changes: 2 additions & 2 deletions 9 Configuration instructions/00120-HowToModifyAppSetups.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ After the frontend receives the response for `GetAppSetup` it will try to start

### Database

On the database these application setups are saved on the <a href="https://oskari.org/db/tables/oskari_appsetup.html" target="_blank">`oskari_appsetup` table</a>. The setups can be `name`d and they have a `type` to separate between the default geoportal application, an embedded map application (users can create these with the publisher functionality bundle), applications that the users have saved as their own personalized starting "views" etc. The setups reference the frontend application code with the `application` column and the HTML-template (JSP-page) with the `page` column.
On the database these application setups are saved on the `oskari_appsetup` table. The setups can be `name`d and they have a `type` to separate between the default geoportal application, an embedded map application (users can create these with the publisher functionality bundle), applications that the users have saved as their own personalized starting "views" etc. The setups reference the frontend application code with the `application` column and the HTML-template (JSP-page) with the `page` column.

The selection of functionalities for applications are stored on the database <a href="https://oskari.org/db/tables/oskari_appsetup_bundles.html" target="_blank">table `oskari_appsetup_bundles`</a>. A row on the table is a bundle in the application with possible configuration and state information. For example most applications have the map as functionality. You can see that the `mapfull` bundle is repeated on the table multiple times with the `appsetup_id` column pointing to the application where the map is used, `state` has information like what are the coordinates and zoom level the map is initially set and what map layers are on the map when the application is shown. The `config` column holds configuration like what feature toggles are activated for the user on that bundle. For the `mapfull` bundle the config are toggles from supporting wms-layers (usually always enabled) to supporting adding markers on the map and enabling adding vector features to the map programmatically. The difference between state and config is that state usually changes during runtime on the client (user moves the map and coordinates are changed) and config doesn't (the user either has the ability use a feature or not). Both config and state options are described for bundles on the <a href="https://oskari.org/api/bundles" target="_blank">API documentation</a>. The `seqno` column is used to set the order in which the functionalities are started. Map is usually near the start of the sequence with a low value in `seqno`. The `bundle_id` column references the <a href="https://oskari.org/db/tables/oskari_bundle.html" target="_blank">`oskari_bundle` database table</a> where `name` is the "bundle id" that is recognized by the frontend.
The selection of functionalities for applications are stored on the database table `oskari_appsetup_bundles`. A row on the table is a bundle in the application with possible configuration and state information. For example most applications have the map as functionality. You can see that the `mapfull` bundle is repeated on the table multiple times with the `appsetup_id` column pointing to the application where the map is used, `state` has information like what are the coordinates and zoom level the map is initially set and what map layers are on the map when the application is shown. The `config` column holds configuration like what feature toggles are activated for the user on that bundle. For the `mapfull` bundle the config are toggles from supporting wms-layers (usually always enabled) to supporting adding markers on the map and enabling adding vector features to the map programmatically. The difference between state and config is that state usually changes during runtime on the client (user moves the map and coordinates are changed) and config doesn't (the user either has the ability use a feature or not). Both config and state options are described for bundles on the <a href="https://oskari.org/api/bundles" target="_blank">API documentation</a>. The `seqno` column is used to set the order in which the functionalities are started. Map is usually near the start of the sequence with a low value in `seqno`. The `bundle_id` column references the `oskari_bundle` database table where `name` is the "bundle id" that is recognized by the frontend.

### Role based functionalities

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Oskari frontend contains additional bundles for controlling camera and displayed
import 'oskari-loader!oskari-frontend/packages/mapping/time-control-3d/bundle.js';
import 'oskari-loader!oskari-frontend/packages/mapping/camera-controls-3d/bundle.js';
```
Cesium adjusts the sun's position and visualizes the shadows according to the time set for the map. You can also adjust displayed time with [SetTimeRequest](https://oskari.org/api/requests#unreleased/mapping/mapmodule/request/SetTimeRequest.md).
Cesium adjusts the sun's position and visualizes the shadows according to the time set for the map. You can also adjust displayed time with [SetTimeRequest](/documentation/api/requests/latest/SetTimeRequest).

#### Using 2D and 3D maps side by side

Expand Down
8 changes: 4 additions & 4 deletions 9 Configuration instructions/00160-HowToConfigureTheSearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

The search functionality in Oskari can be extended, customized and configured in a number of ways. Different datasources can be exposed as search channels in Oskari. Search channels can provide textual search, reverse geocoding or both and can have other parameters that are passed to the datasource. Search channel access can be restricted by permissions and the queried channels (datasources) can be specified when making a search. By default all the available search channels are used for making searches, but this can be configured and customized.

- [Guide for creating custom search channel](search/customchannel)
- [Guide for creating ChannelProviders](search/channelprovider)
- [Guide for setting up WFS-based search channels](search/wfssearch)
- [Guide for creating custom search channel](00161-SearchCustomchannel.md)
- [Guide for creating ChannelProviders](00162-SearchChannelprovider.md)
- [Guide for setting up WFS-based search channels](00163-SearchWfsSearch.md)

### Configuring default search channels

Expand All @@ -25,7 +25,7 @@ If you want to whitelist search channels and use only relevant ones for your app

search.channels=OPENSTREETMAP_CHANNEL,MyChannel

Channels generated by ChannelProvider components are not restricted by this setting. Provider channels are always added. Read more about [ChannelProviders](search/channelprovider).
Channels generated by ChannelProvider components are not restricted by this setting. Provider channels are always added. Read more about [ChannelProviders](00162-SearchChannelprovider.md).

### Things to improve (TODO)

Expand Down
82 changes: 82 additions & 0 deletions 9 Configuration instructions/00161-SearchCustomchannel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
## Creating a custom location search channel

All search channels need to implement the `SearchableChannel` interface from the
file `service-search/src/main/java/fi/nls/oskari/search/channel/SearchableChannel.java`. The easiest way to add a
custom search channel is to extend the class `service-search/src/main/java/fi/nls/oskari/search/channel/SearchChannel.java`
and annotate the class with `@Oskari("channelID")`. This example offers a basic textual search implementation:

package fi.nls.oskari.search;

import fi.mml.portti.service.search.ChannelSearchResult;
import fi.mml.portti.service.search.SearchCriteria;
import fi.mml.portti.service.search.SearchResultItem;
import fi.nls.oskari.annotation.Oskari;
import fi.nls.oskari.search.channel.SearchChannel;
import fi.nls.oskari.util.IOHelper;

import java.io.IOException;

@Oskari("MyChannel")
public class CustomChannel extends SearchChannel {

public ChannelSearchResult doSearch(SearchCriteria criteria) {
ChannelSearchResult result = new ChannelSearchResult();
try {
// TODO: do the actual search
final String responseData = IOHelper.getURL("https://www.google.fi/?q="
+ criteria.getSearchString());
// parse responseData and populate result with SearchResultItems
SearchResultItem item = new SearchResultItem();
item.setTitle("MySearchResult");
result.addItem(item);
}
catch (IOException ex) {
throw new RuntimeException("Error searching", ex);
}
return result;
}
}

Once the class is in the servers classpath the search channel is available in searches as channel with id `MyChannel`.
*Note!* The results location (coordinates) should be in the same projection as specified in the criteria!

### SearchChannel methods to override

#### void init();

Any initialization should be performed here. Properties setup for example.

#### boolean hasPermission(User user)

Default implementation returns true for all users. Override if the datasource should only be available for some users.

#### Default search channels

Default channels are used for searching when no channel has been specified for the search. Search channels can specify if they should be included to be used in such queries. This can be done by returning a boolean value from the `SearchChannel.isDefaultChannel()` method. The default is true and can be configured with channel specific properties:

public boolean isDefaultChannel() {
return PropertyUtil.getOptional("search.channel." + getName() + ".isDefault", true);
}

#### SearchableChannel.Capabilities getCapabilities();

Capabilities is an enum with values COORD, TEXT and BOTH. Defaults to TEXT on SearchChannel baseclass.
- TEXT means the channel can be used to search with text.
- COORD means the channel can be used to search with coordinates/reverse geocode.
- BOTH means the channel implements both text and coordinate based searches.

#### boolean isValidSearchTerm(SearchCriteria criteria);

This method can be overridden to check whether the criteria makes sense in the context of the channel.
Like is the searchtext in correct syntax for a cadastral parcel id etc.

#### ChannelSearchResult reverseGeocode(SearchCriteria criteria) throws IllegalSearchCriteriaException;

Implement this method if you want to use reverse geocoding for the channel.
You will also need to override getCapabilities to return COORD or BOTH.

### More examples

There is an example search channel for OpenStreetMap available in the
file `service-search-opendata/src/main/java/fi/nls/oskari/search/OpenStreetMapSearchService.java` and several more in service-search-nls.

Loading