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

Feature/update-capabilities-automatically #86

Merged
merged 59 commits into from
Nov 14, 2017

Conversation

jampukka
Copy link
Member

This branch adds a new service-capabilities-update module.
The module consists of UpdateCapabilitiesJob which adds support for scheduled updating of information that is based on the GetCapabilties responses.
Refactor (rewrite) CapabilitiesCacheService and CapabilitiesCacheServiceMybatisImpl
Refactor (rewrite) WMTSCapabilitiesParser and the domain classes.
Add basic validation to the parsed WMTS Capabilities logic (some of the stuff that should throw an exception just logs a warning in this branch)
Remove few unused, mostly commented-out classes within `service-map/src/main/java/fi/nls/oskari/wfs package

Add find(List<String>) without crs parameter to OskariLayerService, like findAll() has
…o codebase

Handle converting url and layertype to lowercase outside of SQL Query
…util.Date to java.sql.Timestamp

Change the order of columsn in Select queries in CapabilitiesMapper to match the order of parameters in OskariLayerCapabilities constructor
…d OskariLayerCapabilities, make necessary adjustments
…on causing autocommit. As a result changed mapper functionality
…dler to service-map/OskariLayerCapabilitiesTools
…apabilities response

Remove recursion from loadCapabilitiesFromService

Let XMLStreamReader determine the charset in XML prolog

Remove encoding logic from GetGtWMSCapabilities by removing the prolog after decoding it succesfully
@@ -78,11 +69,12 @@ public void migrate(Connection connection) throws SQLException {
}

private void insertCaps(Connection conn, OskariLayerCapabilities caps) throws SQLException {
final String sql = "INSERT INTO oskari_capabilities_cache (layertype, url, data) VALUES(?,?,?)";
final String sql = "INSERT INTO oskari_capabilities_cache (layertype, url, data, version) VALUES(?,?,?,?)";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version column is added after this migration: https://github.com/oskariorg/oskari-server/blob/master/content-resources/src/main/resources/flyway/oskari/V1_36_4__add_version_column_to_oskari_capabilities_cache.sql so it isn't part of the table at this point. There's all kinds of trouble to be found when updating old migrations :)

HttpServletRequest request = params.getRequest();
final String xslt = request.getParameter("xslt");
private boolean handleWMSSpecific(final ActionParameters params, OskariLayer ml) {
final String xslt = params.getHttpParam("xslt");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference here is whether we want to run the value through jsoup or not. Have you tried that xslt is not modified by jsoup?

*/
getCapabilitiesXML = getXMLFromService(layer);
}
if (getCapabilitiesXML == null || getCapabilitiesXML.isEmpty()) {
Copy link
Member

@ZakarFin ZakarFin Sep 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have some info/warning logging as well? The getter logs exceptions so maybe it's enough.

if (minTileRow < 0) {
LOG.warn(tm.getId(), "Negative MinTileRow");
}
if (maxTileRow >= tm.getMatrixWidth()) {
Copy link
Member

@ZakarFin ZakarFin Sep 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First thought was that rows should be compared to height, but looking at the schema this looks correct. Maybe add a comment about this since it's a bit confusing:

<element name="MaxTileCol" type="positiveInteger">
      <annotation>
            <documentation>
                     Maximim tile column index valid for this layer. From minTileCol to tileHeight-1 of the tileMatrix section of this tileMatrixSet.


  <element name="MaxTileRow" type="positiveInteger">
            <annotation>
                   <documentation>
                           Maximim tile row index valid for this layer. From minTileRow to matrixWidth-1 of the tileMatrix section of this tileMatrixSet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants