Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions HowToDeploy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,44 @@ cp -r /home/cvop/calbfg-patch/* webapps/calbfg
rm -rf webapps/calbfg/staging/
mv temp/staging webapps/calbfg/

===========================================================================
GeoServer - Calvalus production
-------------------------------
Calvalus supports the automated publishing of both regular GeoTIFF (geotiff imageType) and Cloud
Optimized GeoTIFF (cog imageType) images to GeoServer using the existing quicklooks production feature.

The GeoServer data store name used by the upload service is automatically generated using the product
name. Any existing data store with this product name within the workspace is replaced. Likewise,
the GeoServer layer name used by the upload service is also generated using the same product name. Any
existing layer with this name within the workspace is also replaced. The upload service uses the
default GeoServer raster style. Once data is published to GeoServer, the data product is automatically
accessible from GeoServer via Web Mapping Service (WMS).

The Calvalus administrator needs to configure these GeoServer quicklooks settings in calvalus.properties
to enable GeoServer - Calvalus production support:

# Quicklooks upload handler. Note: only geoserver supported. Mandatory.
calvalus.ql.upload.handler = geoserver

# Quicklooks upload URL. Mandatory. Example:
calvalus.ql.upload.URL = http://localhost:8080/geoserver/rest/

# Username and password for the GeoServer upload URL service. Optional. Example:
calvalus.ql.upload.username = admin
calvalus.ql.upload.password = geoserver

# GeoServer workspace to use. Mandatory. Example:
calvalus.ql.upload.workspace = calmar

===========================================================================
GeoServer - Calvalus portal support
-----------------------------------
Once GeoServer is enabled in the Calvalus production system, it is also possible to configure a
quicklooks WMS checkbox in the portal user interface. To enable this WMS checkbox please set the
following configuration option, this is an example:

# Quicklooks WMS checkbox - access control and visual configuration
calvalus.portal.ql.wms = calvalus bc bg coastcolour calwps



Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.bc.calvalus.portal.shared.ContextRetrievalServiceAsync;
import com.bc.calvalus.portal.shared.DtoAggregatorDescriptor;
import com.bc.calvalus.portal.shared.DtoCalvalusConfig;
import com.bc.calvalus.portal.shared.DtoColorPalette;
import com.bc.calvalus.portal.shared.DtoProcessorDescriptor;
import com.bc.calvalus.portal.shared.DtoProductSet;
import com.bc.calvalus.portal.shared.DtoProduction;
Expand Down Expand Up @@ -60,6 +61,7 @@ public class CalvalusPortal implements EntryPoint, PortalContext {
"vicariousCalibrationView",
"matchupComparisonView",
"l2ToL3ComparisonView",
"qlView",
"regionsView",
"requestsView",
"bundlesView",
Expand All @@ -74,6 +76,7 @@ public class CalvalusPortal implements EntryPoint, PortalContext {
// Data provided by various external services
private ListDataProvider<Region> regions;
private DtoProductSet[] productSets;
private DtoColorPalette[] colorPalettes;
private DtoProcessorDescriptor[] systemProcessors;
private DtoProcessorDescriptor[] userProcessors;
private DtoProcessorDescriptor[] allUserProcessors;
Expand Down Expand Up @@ -128,6 +131,7 @@ public void onModuleLoad() {
Runnable runnable = new Runnable() {
public void run() {
backendService.loadRegions(NO_FILTER, new InitRegionsCallback());
backendService.loadColorPalettes(NO_FILTER, new InitColorPaletteSetsCallback());
backendService.getProductSets(NO_FILTER, new InitProductSetsCallback());

final BundleFilter systemFilter = new BundleFilter();
Expand Down Expand Up @@ -182,6 +186,11 @@ public DtoProductSet[] getProductSets() {
return productSets;
}

@Override
public DtoColorPalette[] getColorPalettes() {
return colorPalettes;
}

@Override
public DtoProcessorDescriptor[] getProcessors(String filter) {
if (filter.equals(BundleFilter.PROVIDER_SYSTEM)) {
Expand Down Expand Up @@ -285,6 +294,8 @@ private PortalView createViewOf(String name) {
return new OrderMACProductionView(this);
case "l2ToL3ComparisonView":
return new OrderL2toL3ProductionView(this);
case "qlView":
return new OrderQLProductionView(this);
case "regionsView":
return new ManageRegionsView(this);
case "bundlesView":
Expand Down Expand Up @@ -482,6 +493,22 @@ public void onFailure(Throwable caught) {
}
}

private class InitColorPaletteSetsCallback implements AsyncCallback<DtoColorPalette[]> {

@Override
public void onSuccess(DtoColorPalette[] dtoColorPalettes) {
CalvalusPortal.this.colorPalettes = dtoColorPalettes;
maybeInitFrontend();
}

@Override
public void onFailure(Throwable caught) {
caught.printStackTrace(System.err);
Dialog.error("Server-side Error", caught.getMessage());
CalvalusPortal.this.colorPalettes = new DtoColorPalette[0];
}
}

private class InitProcessorsCallback implements AsyncCallback<DtoProcessorDescriptor[]> {

private final String filter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import com.bc.calvalus.portal.shared.DtoInputSelection;
import com.bc.calvalus.portal.shared.DtoProcessorDescriptor;
import com.bc.calvalus.portal.shared.DtoProcessorVariable;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
Expand All @@ -44,6 +45,7 @@ public class OrderL2ProductionView extends OrderProductionView {
private ProductsFromCatalogueForm productsFromCatalogueForm;
private L2ConfigForm l2ConfigForm;
private OutputParametersForm outputParametersForm;
private QuicklookParametersForm quicklookParametersForm;
private Widget widget;

public OrderL2ProductionView(PortalContext portalContext) {
Expand Down Expand Up @@ -77,6 +79,7 @@ public void onClearSelectionClick() {
}

outputParametersForm = new OutputParametersForm(portalContext);
quicklookParametersForm = new QuicklookParametersForm(portalContext);
l2ConfigForm.setProductSet(productSetSelectionForm.getSelectedProductSet());
handleProcessorChanged();

Expand All @@ -89,6 +92,7 @@ public void onClearSelectionClick() {
}
panel.add(l2ConfigForm);
panel.add(outputParametersForm);
panel.add(quicklookParametersForm);
Anchor l2Help = new Anchor("Show Help");
l2Help.getElement().getStyle().setProperty("textDecoration", "none");
l2Help.addStyleName("anchor");
Expand Down Expand Up @@ -168,6 +172,7 @@ protected HashMap<String, String> getProductionParameters() {
}
parameters.putAll(l2ConfigForm.getValueMap());
parameters.putAll(outputParametersForm.getValueMap());
parameters.putAll(quicklookParametersForm.getValueMap());
return parameters;
}

Expand All @@ -185,6 +190,7 @@ public void setProductionParameters(Map<String, String> parameters) {
}
l2ConfigForm.setValues(parameters);
outputParametersForm.setValues(parameters);
quicklookParametersForm.setValues(parameters);
}

private class InputSelectionCallback implements AsyncCallback<DtoInputSelection> {
Expand Down Expand Up @@ -216,6 +222,13 @@ private void handleProcessorChanged() {
add("BigGeoTiff", outputFormats);
}
outputParametersForm.setAvailableOutputFormats(outputFormats.toArray(new String[0]));

List<String> processorVariables = new ArrayList<>();
DtoProcessorVariable[] dtoProcessorVariables = processorDescriptor.getProcessorVariables();
for (DtoProcessorVariable dtoProcessorVariable : dtoProcessorVariables) {
processorVariables.add(dtoProcessorVariable.getName());
}
quicklookParametersForm.setBandNames(processorVariables.toArray(new String[0]));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
/*
* Copyright (C) 2013 Brockmann Consult GmbH (info@brockmann-consult.de)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see http://www.gnu.org/licenses/
*/

package com.bc.calvalus.portal.client;

import com.bc.calvalus.portal.shared.DtoInputSelection;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

import java.util.HashMap;
import java.util.Map;

/**
* Demo view that lets users submit a new L2 production.
*
* @author Norman
*/
public class OrderQLProductionView extends OrderProductionView {

public static final String ID = OrderQLProductionView.class.getName();

private ProductSetSelectionForm productSetSelectionForm;
private ProductSetFilterForm productSetFilterForm;
private ProductsFromCatalogueForm productsFromCatalogueForm;
private OutputParametersForm outputParametersForm;
private QuicklookParametersForm quicklookParametersForm;
private Widget widget;

public OrderQLProductionView(PortalContext portalContext) {
super(portalContext);

productSetSelectionForm = new ProductSetSelectionForm(getPortal());
productSetFilterForm = new ProductSetFilterForm(portalContext);
productSetFilterForm.setProductSet(productSetSelectionForm.getSelectedProductSet());

if (getPortal().withPortalFeature(INPUT_FILES_PANEL)) {
productsFromCatalogueForm = new ProductsFromCatalogueForm(getPortal());
productsFromCatalogueForm.addInputSelectionHandler(new ProductsFromCatalogueForm.InputSelectionHandler() {
@Override
public AsyncCallback<DtoInputSelection> getInputSelectionChangedCallback() {
return new InputSelectionCallback();
}

@Override
public void onClearSelectionClick() {
productsFromCatalogueForm.removeSelections();
}
});
}

outputParametersForm = new OutputParametersForm(portalContext);
outputParametersForm.showFormatSelectionPanel(false);
outputParametersForm.setAvailableOutputFormats("Image");

quicklookParametersForm = new QuicklookParametersForm(portalContext);
quicklookParametersForm.setBandNames();

VerticalPanel panel = new VerticalPanel();
panel.setWidth("100%");
panel.add(productSetSelectionForm);
panel.add(productSetFilterForm);
if (getPortal().withPortalFeature(INPUT_FILES_PANEL)){
panel.add(productsFromCatalogueForm);
}
panel.add(outputParametersForm);
panel.add(quicklookParametersForm);
Anchor l2Help = new Anchor("Show Help");
l2Help.getElement().getStyle().setProperty("textDecoration", "none");
l2Help.addStyleName("anchor");
panel.add(l2Help);
HelpSystem.addClickHandler(l2Help, "l2Processing");
//panel.add(new HTML("<br/>"));
panel.add(createOrderPanel());

this.widget = panel;
}

@Override
public Widget asWidget() {
return widget;
}

@Override
public String getViewId() {
return ID;
}

@Override
public String getTitle() {
return "Quicklook generation";
}

@Override
protected String getProductionType() {
return "QL";
}

@Override
public void onShowing() {
// make sure #triggerResize is called after the new view is shown
Scheduler.get().scheduleFinally(() -> {
// See http://code.google.com/p/gwt-google-apis/issues/detail?id=127
productSetFilterForm.getRegionMap().getMapWidget().triggerResize();
});
}

@Override
protected boolean validateForm() {
try {
productSetSelectionForm.validateForm();
productSetFilterForm.validateForm();
if (productsFromCatalogueForm != null) {
productsFromCatalogueForm.validateForm(productSetSelectionForm.getSelectedProductSet().getName());
}
outputParametersForm.validateForm();


if (!getPortal().withPortalFeature("unlimitedJobSize")) {
try {
final int numDaysValue = Integer.parseInt(productSetFilterForm.numDays.getValue());
if (numDaysValue > 365 + 366) {
throw new ValidationException(productSetFilterForm.numDays, "time range larger than allowed");
}
} catch (NumberFormatException e) {
// ignore
}
}
return true;
} catch (ValidationException e) {
e.handle();
return false;
}
}

@Override
protected HashMap<String, String> getProductionParameters() {
HashMap<String, String> parameters = new HashMap<>();
parameters.putAll(productSetSelectionForm.getValueMap());
parameters.putAll(productSetFilterForm.getValueMap());
if (productsFromCatalogueForm != null) {
parameters.putAll(productsFromCatalogueForm.getValueMap());
}
parameters.putAll(outputParametersForm.getValueMap());
parameters.putAll(quicklookParametersForm.getValueMap());
return parameters;
}

@Override
public boolean isRestoringRequestPossible() {
return true;
}

@Override
public void setProductionParameters(Map<String, String> parameters) {
productSetSelectionForm.setValues(parameters);
productSetFilterForm.setValues(parameters);
if (productsFromCatalogueForm != null) {
productsFromCatalogueForm.setValues(parameters);
}
outputParametersForm.setValues(parameters);
quicklookParametersForm.setValues(parameters);
}

private class InputSelectionCallback implements AsyncCallback<DtoInputSelection> {

@Override
public void onSuccess(DtoInputSelection inputSelection) {
Map<String, String> inputSelectionMap = UIUtils.parseParametersFromContext(inputSelection);
productsFromCatalogueForm.setValues(inputSelectionMap);
productSetSelectionForm.setValues(inputSelectionMap);
productSetFilterForm.setValues(inputSelectionMap);
}

@Override
public void onFailure(Throwable caught) {
Dialog.error("Error in retrieving input selection", caught.getMessage());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.bc.calvalus.portal.shared.BackendServiceAsync;
import com.bc.calvalus.portal.shared.ContextRetrievalServiceAsync;
import com.bc.calvalus.portal.shared.DtoAggregatorDescriptor;
import com.bc.calvalus.portal.shared.DtoColorPalette;
import com.bc.calvalus.portal.shared.DtoProcessorDescriptor;
import com.bc.calvalus.portal.shared.DtoProductSet;
import com.bc.calvalus.portal.shared.DtoProduction;
Expand All @@ -27,6 +28,8 @@ public interface PortalContext {
// make this return ListDataProvider<GsProductSet>
DtoProductSet[] getProductSets();

DtoColorPalette[] getColorPalettes();

// make this return ListDataProvider<GsProcessorDescriptor>
DtoProcessorDescriptor[] getProcessors(String filter);
DtoAggregatorDescriptor[] getAggregators(String filter);
Expand Down
Loading