diff --git a/CHANGELOG b/CHANGELOG index e2e2e8e6..5741d818 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,13 @@ +2.5.0 +===== +Updated to EDAL 1.5.0 +Minor bugfixes +Changes to make JDK11 compatible + +2.4.2 +===== +Updated to EDAL 1.4.2 + 2.4.1 ===== Updated to EDAL 1.4.1 diff --git a/Dockerfile b/Dockerfile index 2a5c0ddd..4d22c4f8 100755 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ RUN mkdir /edal && \ COPY . /ncWMS RUN cd /ncWMS && \ JAVA_HOME=/usr/lib/jvm/java-8-oracle mvn clean install && \ - unzip target/ncWMS2.war -d $CATALINA_HOME/webapps/ncWMS/ && \ + unzip target/ncWMS2.war -d $CATALINA_HOME/webapps/ncWMS2/ && \ rm -rf /edal && \ rm -rf /ncWMS/target diff --git a/docs/04-usage.md b/docs/04-usage.md index 61709ed7..7bba7922 100755 --- a/docs/04-usage.md +++ b/docs/04-usage.md @@ -66,6 +66,9 @@ The `TIME` parameter should specify a range of times in the form `starttime/endt * image/jpg * image/jpeg * text/csv +* text/json +* application/prs.coverage+json +* application/prs.coverage json ### GetVerticalProfile @@ -75,6 +78,9 @@ This produces either a vertical profile graph or, if downloading is enabled, a C * image/jpg * image/jpeg * text/csv +* text/json +* application/prs.coverage+json +* application/prs.coverage json ### GetTransect diff --git a/docs/images/palettes.png b/docs/images/palettes.png index a07d17c8..1888217b 100644 Binary files a/docs/images/palettes.png and b/docs/images/palettes.png differ diff --git a/pom.xml b/pom.xml index 49bcecc3..984094d8 100755 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,17 @@ - + 4.0.0 uk.ac.rdg.resc ncWMS - 2.4.2 + 2.5.0 UTF-8 - 2.7.0 + 2.8.2 0.9.10 - 1.4.2 + 1.5.0 http://www.met.reading.ac.uk/resc/home/ @@ -32,7 +34,8 @@ full details). - + Guy Griffiths @@ -63,6 +66,18 @@ edal-godiva ${edal.version} + + com.google.gwt + gwt-dev + ${gwt.version} + provided + + + xml-apis + xml-apis + + + com.google.gwt gwt-user @@ -104,6 +119,12 @@ com.google.gwt gwt-codeserver ${gwt.version} + + + com.google.gwt + gwt-dev + + provided @@ -123,21 +144,6 @@ ncWMS2 - - org.codehaus.mojo - gwt-maven-plugin - ${gwt.version} - - - - compile - - - - - true - - maven-war-plugin 2.2 @@ -162,7 +168,8 @@ - + realmClassName uk.ac.rdg.resc.edal.ncwms.StandaloneAuthentication @@ -170,13 +177,14 @@ - + maven-compiler-plugin - 1.8 - 1.8 + 11 + 11 + true - 2.5.1 + 3.8.1 org.sonatype.plugins @@ -202,14 +210,17 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.3 + 3.2.0 - + ${project.basedir} - + org.codehaus.mojo exec-maven-plugin 1.5.0 @@ -237,6 +248,16 @@ + + net.ltgt.gwt.maven + gwt-maven-plugin + 1.0.0 + true + + uk.ac.rdg.resc.edal.ncwms.Godiva3 + src/main/webapp + + @@ -291,7 +312,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.10.1 + 3.2.0 attach-javadocs @@ -365,7 +386,10 @@ 2.10.3 javadoc:aggregate - + http://java.sun.com/j2se/1.6.0/docs/api/ http://joda-time.sourceforge.net/api-2.0/ diff --git a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsAdminServlet.java b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsAdminServlet.java index e89c0529..4619c5a0 100755 --- a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsAdminServlet.java +++ b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsAdminServlet.java @@ -532,6 +532,10 @@ private void updateConfig(HttpServletRequest request, HttpServletResponse respon boolean queryable = request .getParameter("dynamicService." + ds.getAlias() + ".queryable") != null; ds.setQueryable(queryable); + + boolean downloadable = request + .getParameter("dynamicService." + ds.getAlias() + ".downloadable") != null; + ds.setDownloadable(downloadable); String newDataReaderClass = request .getParameter("dynamicService." + ds.getAlias() + ".reader"); @@ -724,10 +728,6 @@ private void addDataset(HttpServletRequest request, HttpServletResponse response datasetOK = false; message = "Dataset with ID " + id + " already exists"; } - if (CdmUtils.expandGlobExpression(location).size() < 1) { - datasetOK = false; - message = "Location: " + location + " doesn't refer to any existing files"; - } try { if (!dataReader.isEmpty()) { Class.forName(dataReader); diff --git a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsCatalogue.java b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsCatalogue.java index 886d0747..c48ac15e 100755 --- a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsCatalogue.java +++ b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsCatalogue.java @@ -29,6 +29,7 @@ package uk.ac.rdg.resc.edal.ncwms; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import net.sf.ehcache.Cache; import net.sf.ehcache.Element; @@ -91,15 +92,12 @@ public NcwmsCatalogue(NcwmsConfig config) throws IOException { /* * Configure cache */ - CacheConfiguration cacheConfig = new CacheConfiguration(CACHE_NAME, - cacheInfo.getNumberOfDatasets()) - .memoryStoreEvictionPolicy(EVICTION_POLICY) - .persistence(new PersistenceConfiguration() - .strategy(PERSISTENCE_STRATEGY)) - .transactionalMode(TRANSACTIONAL_MODE); + CacheConfiguration cacheConfig = new CacheConfiguration(CACHE_NAME, cacheInfo.getNumberOfDatasets()) + .memoryStoreEvictionPolicy(EVICTION_POLICY) + .persistence(new PersistenceConfiguration().strategy(PERSISTENCE_STRATEGY)) + .transactionalMode(TRANSACTIONAL_MODE); if (cacheInfo.getElementLifetimeMinutes() > 0) { - cacheConfig.setTimeToLiveSeconds( - (long) (cacheInfo.getElementLifetimeMinutes() * 60)); + cacheConfig.setTimeToLiveSeconds((long) (cacheInfo.getElementLifetimeMinutes() * 60)); } else { cacheConfig.eternal(true); } @@ -112,8 +110,8 @@ public NcwmsCatalogue(NcwmsConfig config) throws IOException { } /** - * @return The NcwmsConfig object used by this catalogue. Package-private - * since this should not be accessed by external users + * @return The NcwmsConfig object used by this catalogue. Package-private since + * this should not be accessed by external users */ public NcwmsConfig getConfig() { return (NcwmsConfig) super.getConfig(); @@ -126,15 +124,12 @@ public void updateDynamicDatasetCache(NcwmsDynamicCacheInfo cacheInfo) { /* * Create cache */ - CacheConfiguration cacheConfig = new CacheConfiguration(CACHE_NAME, - cacheInfo.getNumberOfDatasets()) - .memoryStoreEvictionPolicy(EVICTION_POLICY) - .persistence( - new PersistenceConfiguration().strategy(PERSISTENCE_STRATEGY)) - .transactionalMode(TRANSACTIONAL_MODE); + CacheConfiguration cacheConfig = new CacheConfiguration(CACHE_NAME, cacheInfo.getNumberOfDatasets()) + .memoryStoreEvictionPolicy(EVICTION_POLICY) + .persistence(new PersistenceConfiguration().strategy(PERSISTENCE_STRATEGY)) + .transactionalMode(TRANSACTIONAL_MODE); if (cacheInfo.getElementLifetimeMinutes() > 0) { - cacheConfig - .setTimeToLiveSeconds((long) (cacheInfo.getElementLifetimeMinutes() * 60)); + cacheConfig.setTimeToLiveSeconds((long) (cacheInfo.getElementLifetimeMinutes() * 60)); } else { cacheConfig.eternal(true); } @@ -150,8 +145,7 @@ public void updateDynamicDatasetCache(NcwmsDynamicCacheInfo cacheInfo) { } else { dynamicDatasetCache.getCacheConfiguration().eternal(true); } - dynamicDatasetCache.getCacheConfiguration() - .setMaxEntriesInCache(cacheInfo.getNumberOfDatasets()); + dynamicDatasetCache.getCacheConfiguration().setMaxEntriesInCache(cacheInfo.getNumberOfDatasets()); } } @@ -180,17 +174,18 @@ public Dataset getDatasetFromId(String datasetId) { return dataset; } else { /* - * We may have a dynamic dataset. First check the dynamic dataset - * cache. + * We may have a dynamic dataset. First check the dynamic dataset cache. */ - Element element = dynamicDatasetCache.get(datasetId); - if (element != null && element.getObjectValue() != null) { - return (Dataset) element.getObjectValue(); + if(dynamicDatasetCache != null) { + Element element = dynamicDatasetCache.get(datasetId); + if (element != null && element.getObjectValue() != null) { + return (Dataset) element.getObjectValue(); + } } /* - * Check to see if we have a dynamic service defined which this - * dataset ID can map to + * Check to see if we have a dynamic service defined which this dataset ID can + * map to */ NcwmsDynamicService dynamicService = getDynamicServiceFromLayerName(datasetId); if (dynamicService == null || dynamicService.isDisabled()) { @@ -209,8 +204,8 @@ public Dataset getDatasetFromId(String datasetId) { String datasetPath = datasetId.substring(dynamicService.getAlias().length() + 1); /* - * Check if we allow this path or if it is disallowed by the dynamic - * dataset regex + * Check if we allow this path or if it is disallowed by the dynamic dataset + * regex */ if (!dynamicService.getIdMatchPattern().matcher(datasetPath).matches()) { return null; @@ -223,8 +218,7 @@ public Dataset getDatasetFromId(String datasetId) { title = title.substring(1); try { - DatasetFactory datasetFactory = DatasetFactory - .forName(dynamicService.getDataReaderClass()); + DatasetFactory datasetFactory = DatasetFactory.forName(dynamicService.getDataReaderClass()); Dataset dynamicDataset = datasetFactory.createDataset(datasetId, datasetUrl); /* * Store in the cache @@ -233,8 +227,9 @@ public Dataset getDatasetFromId(String datasetId) { dynamicDatasetCache.put(new Element(datasetId, dynamicDataset)); } return dynamicDataset; - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException - | IOException | EdalException e) { + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | IOException + | EdalException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException + | SecurityException e) { /* * TODO log error */ @@ -250,11 +245,11 @@ public EnhancedVariableMetadata getLayerMetadata(final VariableMetadata variable return super.getLayerMetadata(variableMetadata); } catch (EdalLayerNotFoundException e) { /* - * The layer is not defined in the XmlDataCatalogue. However, we may - * still have a dynamic dataset + * The layer is not defined in the XmlDataCatalogue. However, we may still have + * a dynamic dataset */ - final String layerName = getLayerNameMapper() - .getLayerName(variableMetadata.getDataset().getId(), variableMetadata.getId()); + final String layerName = getLayerNameMapper().getLayerName(variableMetadata.getDataset().getId(), + variableMetadata.getId()); final NcwmsDynamicService dynamicService = getDynamicServiceFromLayerName(layerName); if (dynamicService == null) { @@ -276,8 +271,8 @@ public String getTitle() { @Override public PlottingStyleParameters getDefaultPlottingParameters() { - return new PlottingStyleParameters(null, ColourPalette.DEFAULT_PALETTE_NAME, - null, null, null, false, ColourPalette.MAX_NUM_COLOURS, 1f); + return new PlottingStyleParameters(null, ColourPalette.DEFAULT_PALETTE_NAME, null, null, null, + false, ColourPalette.MAX_NUM_COLOURS, 1f); } @Override @@ -321,8 +316,7 @@ private NcwmsDynamicService getDynamicServiceFromLayerName(String layerName) { dynamicService = testDynamicService; } } - if (dynamicService == null - || !dynamicService.getIdMatchPattern().matcher(layerName).matches()) { + if (dynamicService == null || !dynamicService.getIdMatchPattern().matcher(layerName).matches()) { return null; } return dynamicService; @@ -346,8 +340,7 @@ public String getDatasetTitle(String datasetId) { } else if (getDynamicServiceFromLayerName(datasetId) != null) { return "Dynamic service from " + datasetId; } else { - throw new EdalLayerNotFoundException( - datasetId + " does not refer to an existing dataset"); + throw new EdalLayerNotFoundException(datasetId + " does not refer to an existing dataset"); } } @@ -404,11 +397,9 @@ public boolean isDisabled(String layerName) { } private VariableConfig getXmlVariable(String layerName) { - DatasetConfig datasetInfo = config - .getDatasetInfo(getLayerNameMapper().getDatasetIdFromLayerName(layerName)); + DatasetConfig datasetInfo = config.getDatasetInfo(getLayerNameMapper().getDatasetIdFromLayerName(layerName)); if (datasetInfo != null) { - return datasetInfo - .getVariableById(getLayerNameMapper().getVariableIdFromLayerName(layerName)); + return datasetInfo.getVariableById(getLayerNameMapper().getVariableIdFromLayerName(layerName)); } else { return null; } diff --git a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsServlet.java b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsServlet.java index 2f1bfa84..40ecafc4 100755 --- a/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsServlet.java +++ b/src/main/java/uk/ac/rdg/resc/edal/ncwms/NcwmsServlet.java @@ -42,7 +42,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import uk.ac.rdg.resc.edal.ncwms.config.NcwmsConfig; +import uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig; import uk.ac.rdg.resc.edal.util.GISUtils; import uk.ac.rdg.resc.edal.wms.RequestParams; import uk.ac.rdg.resc.edal.wms.WmsCatalogue; @@ -70,7 +70,7 @@ public NcwmsServlet() { @Override public void destroy() { super.destroy(); - NcwmsConfig.shutdown(); + CatalogueConfig.shutdown(); GISUtils.releaseEpsgDatabase(); } diff --git a/src/main/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsDynamicService.java b/src/main/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsDynamicService.java index 6d8ed403..dd7b94e0 100755 --- a/src/main/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsDynamicService.java +++ b/src/main/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsDynamicService.java @@ -134,6 +134,10 @@ public void setDisabled(boolean disabled) { public boolean isDownloadable() { return downloadable; } + + public void setDownloadable(boolean downloadable) { + this.downloadable = downloadable; + } public boolean isQueryable() { return queryable; diff --git a/src/main/resources/uk/ac/rdg/resc/edal/ncwms/Godiva3.gwt.xml b/src/main/resources/uk/ac/rdg/resc/edal/ncwms/Godiva3.gwt.xml index 052f224f..75be49ea 100755 --- a/src/main/resources/uk/ac/rdg/resc/edal/ncwms/Godiva3.gwt.xml +++ b/src/main/resources/uk/ac/rdg/resc/edal/ncwms/Godiva3.gwt.xml @@ -1,9 +1,7 @@ - - diff --git a/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsConfigTest.java b/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsConfigTest.java index b7fa3af5..e93e702d 100755 --- a/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsConfigTest.java +++ b/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/NcwmsConfigTest.java @@ -40,7 +40,6 @@ import org.junit.Before; import org.junit.Test; -import org.xml.sax.SAXException; import uk.ac.rdg.resc.edal.catalogue.jaxb.CacheInfo; import uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig; @@ -122,7 +121,7 @@ public void testSerialise() throws JAXBException { } // @Test - public void testDeserialise() throws JAXBException, SAXException, FileNotFoundException { + public void testDeserialise() throws JAXBException, FileNotFoundException { NcwmsConfig deserialise = NcwmsConfig.deserialise(new StringReader(XML)); // NcwmsConfig deserialise = NcwmsConfig.deserialise(new FileReader(new File( // "/home/guy/.ncWMS2/config.xml"))); diff --git a/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/SLDParserTester.java b/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/SLDParserTester.java index 98e57c96..fc1da170 100755 --- a/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/SLDParserTester.java +++ b/src/test/java/uk/ac/rdg/resc/edal/ncwms/config/SLDParserTester.java @@ -5,6 +5,7 @@ import javax.imageio.ImageIO; +import uk.ac.rdg.resc.edal.catalogue.jaxb.CatalogueConfig; import uk.ac.rdg.resc.edal.dataset.DatasetFactory; import uk.ac.rdg.resc.edal.dataset.cdm.CdmGridDatasetFactory; import uk.ac.rdg.resc.edal.geometry.BoundingBox; @@ -61,7 +62,7 @@ public static void main(String[] args) { e.printStackTrace(); } - NcwmsConfig.shutdown(); + CatalogueConfig.shutdown(); } }