Added NetCDF support and WorkspaceExplorerPaginated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/data-miner-manager@158339 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a96e288843
commit
0da8ce43f8
|
@ -1,6 +1,6 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-6-0"
|
||||
date="2016-08-01">
|
||||
date="2016-11-09">
|
||||
<Change>Updated to support pagination in Workspace Explorer [ticket #9114]</Change>
|
||||
</Changeset>
|
||||
<Changeset component="org.gcube.portlets-user.data-miner-manager.1-5-0"
|
||||
|
|
2
pom.xml
2
pom.xml
|
@ -275,7 +275,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>workspace-explorer</artifactId>
|
||||
<version>[1.4.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<version>[1.6.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<!-- <version>1.6.0-SNAPSHOT</version> -->
|
||||
</dependency>
|
||||
|
||||
|
|
|
@ -2,8 +2,13 @@ package org.gcube.portlets.user.dataminermanager.client.computations;
|
|||
|
||||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.computations.ComputationValueFile;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.event.SelectVariableEvent;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.event.SelectVariableEvent.SelectVariableEventHandler;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.widgets.NetCDFPreviewDialog;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sencha.gxt.core.client.dom.XDOM;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
|
@ -58,9 +63,47 @@ public class ComputationValueFilePanel extends SimpleContainer {
|
|||
|
||||
}
|
||||
});
|
||||
|
||||
TextButton netcdfButton = new TextButton("");
|
||||
netcdfButton.setIcon(DataMinerManager.resources.netcdf());
|
||||
netcdfButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
showNetCDFFile();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
lc.add(downloadBtn, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
if (computationValueFile.isNetcdf()) {
|
||||
lc.add(netcdfButton, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
}
|
||||
add(lc);
|
||||
}
|
||||
|
||||
|
||||
private void showNetCDFFile() {
|
||||
if (computationValueFile != null && computationValueFile.getValue() != null && !computationValueFile.getValue().isEmpty()
|
||||
&& computationValueFile.isNetcdf()) {
|
||||
GWT.log("NetcdfBasicWidgetsManager");
|
||||
|
||||
// Example
|
||||
SelectVariableEventHandler handler = new SelectVariableEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onResponse(SelectVariableEvent event) {
|
||||
GWT.log("SelectVariable Response: " + event);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
NetCDFPreviewDialog netcdfDialog = new NetCDFPreviewDialog(computationValueFile.getValue());
|
||||
netcdfDialog.addSelectVariableEventHandler(handler);
|
||||
netcdfDialog.setZIndex(XDOM.getTopZIndex());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -59,8 +59,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
|
||||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
// private WorkspaceResourcesExplorerPanel ;
|
||||
private WorkspaceResourcesExplorerPanelPaginated wsResourcesExplorerPanel;
|
||||
// private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||
private TextButton btnShow;
|
||||
private TextButton btnDownload;
|
||||
private TextButton btnDelete;
|
||||
|
@ -432,7 +432,8 @@ public class ComputationsExecutedPanel extends FramedPanel {
|
|||
private void refreshWSResourceExplorerPanel() {
|
||||
if (wsResourcesExplorerPanel != null) {
|
||||
try {
|
||||
wsResourcesExplorerPanel.hardRefresh();
|
||||
// wsResourcesExplorerPanel.hardRefresh();
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
} catch (Exception e) {
|
||||
Log.error("Error retrieving data: " + e.getLocalizedMessage());
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
private WorkspaceResourcesExplorerPanelPaginated wsResourcesExplorerPanel;
|
||||
//private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||
private TextButton btnDownload;
|
||||
private TextButton btnDelete;
|
||||
private TextButton btnRefresh;
|
||||
|
@ -364,9 +365,9 @@ public class InputDataSetsPanel extends FramedPanel {
|
|||
|
||||
private void refreshWSResourceExplorerPanel() {
|
||||
if (wsResourcesExplorerPanel != null) {
|
||||
// wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
try {
|
||||
wsResourcesExplorerPanel.hardRefresh();
|
||||
//wsResourcesExplorerPanel.hardRefresh();
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
} catch (Exception e) {
|
||||
Log.error("Error retrieving data: " + e.getLocalizedMessage());
|
||||
|
||||
|
|
|
@ -56,7 +56,9 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
private Item selectedItem;
|
||||
private MultipleDNDUpload dnd;
|
||||
|
||||
private WorkspaceResourcesExplorerPanelPaginated wsResourcesExplorerPanel;
|
||||
// private WorkspaceResourcesExplorerPanel wsResourcesExplorerPanel;
|
||||
private TextButton btnDownload;
|
||||
private TextButton btnDelete;
|
||||
private TextButton btnRefresh;
|
||||
|
@ -361,9 +363,10 @@ public class OutputDataSetsPanel extends FramedPanel {
|
|||
|
||||
private void refreshWSResourceExplorerPanel() {
|
||||
if (wsResourcesExplorerPanel != null) {
|
||||
// wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
try {
|
||||
wsResourcesExplorerPanel.hardRefresh();
|
||||
wsResourcesExplorerPanel.refreshRootFolderView();
|
||||
|
||||
// wsResourcesExplorerPanel.hardRefresh();
|
||||
} catch (Exception e) {
|
||||
Log.error("Error retrieving data: " + e.getLocalizedMessage());
|
||||
|
||||
|
|
|
@ -70,10 +70,10 @@ public class OperatorsPanel extends FramedPanel {
|
|||
private View view = null;
|
||||
private String currentClassificationName = Constants.UserClassificationName;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param handler operators panel handler
|
||||
* @param handler
|
||||
* operators panel handler
|
||||
*/
|
||||
public OperatorsPanel(OperatorsPanelHandler handler) {
|
||||
super();
|
||||
|
@ -92,85 +92,78 @@ public class OperatorsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
private void bind() {
|
||||
EventBusProvider.INSTANCE
|
||||
.addHandler(
|
||||
OperatorsClassificationEvent.TYPE,
|
||||
new OperatorsClassificationEvent.OperatorsClassificationEventHandler() {
|
||||
EventBusProvider.INSTANCE.addHandler(OperatorsClassificationEvent.TYPE,
|
||||
new OperatorsClassificationEvent.OperatorsClassificationEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onOperatorsClassification(
|
||||
OperatorsClassificationEvent event) {
|
||||
Log.debug("OperatorsPanel catch OperatorsClassificationEvent: "
|
||||
+ event);
|
||||
manageOperatorsClassificationEvent(event);
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onOperatorsClassification(OperatorsClassificationEvent event) {
|
||||
Log.debug("OperatorsPanel catch OperatorsClassificationEvent: " + event);
|
||||
manageOperatorsClassificationEvent(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void manageOperatorsClassificationEvent(
|
||||
OperatorsClassificationEvent event) {
|
||||
if (event.getOperatorsClassificationRequestType().compareTo(
|
||||
OperatorsClassificationRequestType.ByName) == 0) {
|
||||
if (currentClassificationName.compareTo(event
|
||||
.getClassificationName()) == 0) {
|
||||
waitMessage(false);
|
||||
if (event.getOperatorsClassification() != null) {
|
||||
operatorsClassification = event
|
||||
.getOperatorsClassification();
|
||||
operators.clear();
|
||||
operators.addAll(event.getOperatorsClassification()
|
||||
.getOperators());
|
||||
String operatorId = event.getOperatorId();
|
||||
private void manageOperatorsClassificationEvent(OperatorsClassificationEvent event) {
|
||||
try {
|
||||
|
||||
Log.debug("ShowCategoriesList");
|
||||
List<OperatorCategoryPanel> categoryPanels = mapCategoriesPanels
|
||||
.get(currentClassificationName);
|
||||
if (categoryPanels == null) {
|
||||
categoryPanels = new ArrayList<OperatorCategoryPanel>();
|
||||
if (operatorsClassification != null) {
|
||||
for (OperatorCategory cat : operatorsClassification
|
||||
.getOperatorCategories()) {
|
||||
categoryPanels.add(new OperatorCategoryPanel(
|
||||
handler, cat));
|
||||
}
|
||||
}
|
||||
mapCategoriesPanels.put(currentClassificationName,
|
||||
categoryPanels);
|
||||
}
|
||||
if (event.getOperatorsClassificationRequestType()
|
||||
.compareTo(OperatorsClassificationRequestType.ByName) == 0) {
|
||||
if (currentClassificationName.compareTo(event.getClassificationName()) == 0) {
|
||||
waitMessage(false);
|
||||
if (event.getOperatorsClassification() != null) {
|
||||
operatorsClassification = event.getOperatorsClassification();
|
||||
operators.clear();
|
||||
operators.addAll(event.getOperatorsClassification().getOperators());
|
||||
String operatorId = event.getOperatorId();
|
||||
|
||||
v.clear();
|
||||
for (OperatorCategoryPanel panel : categoryPanels){
|
||||
v.add(panel);
|
||||
|
||||
}
|
||||
view = View.CATEGORIES;
|
||||
if(operatorId!=null&&!operatorId.isEmpty()){
|
||||
OperatorCategory operatorCategoryDefault=null;
|
||||
Operator operatorDefault=null;
|
||||
for(Operator op:operators){
|
||||
if(op.getId().compareTo(operatorId)==0){
|
||||
operatorDefault=op;
|
||||
operatorCategoryDefault=op.getCategory();
|
||||
break;
|
||||
Log.debug("ShowCategoriesList");
|
||||
List<OperatorCategoryPanel> categoryPanels = mapCategoriesPanels.get(currentClassificationName);
|
||||
if (categoryPanels == null) {
|
||||
categoryPanels = new ArrayList<OperatorCategoryPanel>();
|
||||
if (operatorsClassification != null) {
|
||||
for (OperatorCategory cat : operatorsClassification.getOperatorCategories()) {
|
||||
categoryPanels.add(new OperatorCategoryPanel(handler, cat));
|
||||
}
|
||||
}
|
||||
mapCategoriesPanels.put(currentClassificationName, categoryPanels);
|
||||
}
|
||||
if(operatorCategoryDefault!=null){
|
||||
for (OperatorCategoryPanel opCategoryPanel : categoryPanels){
|
||||
if(opCategoryPanel.getCategory().compareTo(operatorCategoryDefault)==0){
|
||||
opCategoryPanel.setOperatorDefault(operatorDefault);
|
||||
|
||||
v.clear();
|
||||
for (OperatorCategoryPanel panel : categoryPanels) {
|
||||
v.add(panel);
|
||||
|
||||
}
|
||||
view = View.CATEGORIES;
|
||||
if (operatorId != null && !operatorId.isEmpty()) {
|
||||
OperatorCategory operatorCategoryDefault = null;
|
||||
Operator operatorDefault = null;
|
||||
for (Operator op : operators) {
|
||||
if (op.getId().compareTo(operatorId) == 0) {
|
||||
operatorDefault = op;
|
||||
operatorCategoryDefault = op.getCategory();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
if (operatorCategoryDefault != null) {
|
||||
for (OperatorCategoryPanel opCategoryPanel : categoryPanels) {
|
||||
if (opCategoryPanel.getCategory().compareTo(operatorCategoryDefault) == 0) {
|
||||
opCategoryPanel.setOperatorDefault(operatorDefault);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
forceLayout();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
Log.error("Error in OperatorsPanel: " + e.getLocalizedMessage(), e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -189,8 +182,7 @@ public class OperatorsPanel extends FramedPanel {
|
|||
OperatorsClassificationRequestEvent operatorsClassificationRequestEvent = new OperatorsClassificationRequestEvent(
|
||||
currentClassificationName, true);
|
||||
Log.debug("OperatorsPanel fire: " + operatorsClassificationRequestEvent);
|
||||
EventBusProvider.INSTANCE
|
||||
.fireEvent(operatorsClassificationRequestEvent);
|
||||
EventBusProvider.INSTANCE.fireEvent(operatorsClassificationRequestEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -202,8 +194,7 @@ public class OperatorsPanel extends FramedPanel {
|
|||
final StoreFilterField<String> filterField = new StoreFilterField<String>() {
|
||||
|
||||
@Override
|
||||
protected boolean doSelect(Store<String> store, String parent,
|
||||
String item, String filter) {
|
||||
protected boolean doSelect(Store<String> store, String parent, String item, String filter) {
|
||||
Log.debug("StoreFilterField: " + item + " " + filter);
|
||||
return false;
|
||||
}
|
||||
|
@ -228,18 +219,16 @@ public class OperatorsPanel extends FramedPanel {
|
|||
filterField.setWidth(100);
|
||||
|
||||
TextButton showAllOperatorsButton = new TextButton();
|
||||
showAllOperatorsButton.setIcon(DataMinerManager.resources
|
||||
.sortAscending());
|
||||
showAllOperatorsButton
|
||||
.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
showAllOperatorsButton.setIcon(DataMinerManager.resources.sortAscending());
|
||||
showAllOperatorsButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
filterField.clear();
|
||||
showAllOperatorsList();
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
filterField.clear();
|
||||
showAllOperatorsList();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
showAllOperatorsButton.setToolTip(SHOW_ALL_OPERATORS_TOOLTIP);
|
||||
|
||||
TextButton showCategoriesButton = new TextButton();
|
||||
|
@ -256,18 +245,15 @@ public class OperatorsPanel extends FramedPanel {
|
|||
|
||||
showCategoriesButton.setToolTip(SHOW_CATEGORIES_TOOLTIP);
|
||||
|
||||
final TextButton btnMenuPerspective = new TextButton(
|
||||
currentClassificationName);
|
||||
btnMenuPerspective
|
||||
.setIcon(DataMinerManager.resources.userPerspective());
|
||||
final TextButton btnMenuPerspective = new TextButton(currentClassificationName);
|
||||
btnMenuPerspective.setIcon(DataMinerManager.resources.userPerspective());
|
||||
|
||||
Menu menuPerspective = new Menu();
|
||||
|
||||
for (final String perspectiveName : Constants.ClassificationNames) {
|
||||
final ImageResource img = perspectiveName
|
||||
.equals(Constants.UserClassificationName) ? DataMinerManager.resources
|
||||
.userPerspective() : DataMinerManager.resources
|
||||
.computationPerspective();
|
||||
final ImageResource img = perspectiveName.equals(Constants.UserClassificationName)
|
||||
? DataMinerManager.resources.userPerspective()
|
||||
: DataMinerManager.resources.computationPerspective();
|
||||
MenuItem perspectiveItem = new MenuItem(perspectiveName);
|
||||
perspectiveItem.addSelectionHandler(new SelectionHandler<Item>() {
|
||||
|
||||
|
@ -307,16 +293,14 @@ public class OperatorsPanel extends FramedPanel {
|
|||
List<String> ids = new ArrayList<String>();
|
||||
for (Operator op : operators)
|
||||
// check for filtering and prevent duplicates
|
||||
if (op.getName().toLowerCase().contains(searchText.toLowerCase())
|
||||
&& !ids.contains(op.getId())) {
|
||||
if (op.getName().toLowerCase().contains(searchText.toLowerCase()) && !ids.contains(op.getId())) {
|
||||
filteredOperators.add(op);
|
||||
ids.add(op.getId());
|
||||
}
|
||||
|
||||
v.clear();
|
||||
|
||||
HTML html = new HTML("Filtered results <span class='counter'>("
|
||||
+ filteredOperators.size() + " item"
|
||||
HTML html = new HTML("Filtered results <span class='counter'>(" + filteredOperators.size() + " item"
|
||||
+ (filteredOperators.size() == 1 ? "" : "s") + " found)</span>");
|
||||
html.addStyleName("filterResultText");
|
||||
v.add(html);
|
||||
|
@ -333,19 +317,15 @@ public class OperatorsPanel extends FramedPanel {
|
|||
try {
|
||||
if (force || view != View.CATEGORIES) {
|
||||
Log.debug("ShowCategoriesList");
|
||||
List<OperatorCategoryPanel> categoryPanels = mapCategoriesPanels
|
||||
.get(currentClassificationName);
|
||||
List<OperatorCategoryPanel> categoryPanels = mapCategoriesPanels.get(currentClassificationName);
|
||||
if (categoryPanels == null) {
|
||||
categoryPanels = new ArrayList<OperatorCategoryPanel>();
|
||||
if (operatorsClassification != null) {
|
||||
for (OperatorCategory cat : operatorsClassification
|
||||
.getOperatorCategories()) {
|
||||
categoryPanels.add(new OperatorCategoryPanel(
|
||||
handler, cat));
|
||||
for (OperatorCategory cat : operatorsClassification.getOperatorCategories()) {
|
||||
categoryPanels.add(new OperatorCategoryPanel(handler, cat));
|
||||
}
|
||||
}
|
||||
mapCategoriesPanels.put(currentClassificationName,
|
||||
categoryPanels);
|
||||
mapCategoriesPanels.put(currentClassificationName, categoryPanels);
|
||||
}
|
||||
|
||||
v.clear();
|
||||
|
@ -364,8 +344,7 @@ public class OperatorsPanel extends FramedPanel {
|
|||
if (view != View.ALL) {
|
||||
v.clear();
|
||||
|
||||
HTML html = new HTML("All Operators <span class='counter'>("
|
||||
+ operators.size() + " item"
|
||||
HTML html = new HTML("All Operators <span class='counter'>(" + operators.size() + " item"
|
||||
+ (operators.size() == 1 ? "" : "s") + " found)</span>");
|
||||
html.addStyleName("filterResultText");
|
||||
v.add(html);
|
||||
|
|
|
@ -3,8 +3,13 @@ package org.gcube.portlets.user.dataminermanager.client.widgets;
|
|||
import org.gcube.portlets.user.dataminermanager.client.DataMinerManager;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.computations.ComputationId;
|
||||
import org.gcube.portlets.user.dataminermanager.shared.data.output.FileResource;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.event.SelectVariableEvent;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.event.SelectVariableEvent.SelectVariableEventHandler;
|
||||
import org.gcube.portlets.widgets.netcdfbasicwidgets.client.widgets.NetCDFPreviewDialog;
|
||||
|
||||
import com.google.gwt.core.shared.GWT;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
import com.sencha.gxt.core.client.dom.XDOM;
|
||||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.HtmlLayoutContainer;
|
||||
|
@ -59,8 +64,43 @@ public class FileViewer extends SimpleContainer {
|
|||
}
|
||||
});
|
||||
|
||||
TextButton netcdfButton = new TextButton("");
|
||||
netcdfButton.setIcon(DataMinerManager.resources.netcdf());
|
||||
netcdfButton.addSelectHandler(new SelectEvent.SelectHandler() {
|
||||
|
||||
@Override
|
||||
public void onSelect(SelectEvent event) {
|
||||
showNetCDFFile();
|
||||
}
|
||||
});
|
||||
|
||||
lc.add(downloadBtn, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
if (fileResource.isNetcdf()) {
|
||||
lc.add(netcdfButton, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
}
|
||||
add(lc);
|
||||
}
|
||||
|
||||
private void showNetCDFFile() {
|
||||
if (fileResource != null && fileResource.getUrl() != null && !fileResource.getUrl().isEmpty()
|
||||
&& fileResource.isNetcdf()) {
|
||||
GWT.log("NetcdfBasicWidgetsManager");
|
||||
|
||||
// Example
|
||||
SelectVariableEventHandler handler = new SelectVariableEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onResponse(SelectVariableEvent event) {
|
||||
GWT.log("SelectVariable Response: " + event);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
NetCDFPreviewDialog netcdfDialog = new NetCDFPreviewDialog(fileResource.getUrl());
|
||||
netcdfDialog.addSelectVariableEventHandler(handler);
|
||||
netcdfDialog.setZIndex(XDOM.getTopZIndex());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
<!-- <inherits name='com.google.gwt.user.theme.clean.Clean' /> -->
|
||||
<inherits name='com.sencha.gxt.ui.GXT' />
|
||||
<!-- <inherits name="com.extjs.gxt.ui.GXT" /> -->
|
||||
|
||||
<!-- <inherits name="com.google.gwt.logging.Logging" /> -->
|
||||
|
||||
<!--
|
||||
<inherits name="com.google.gwt.logging.Logging" /> -->
|
||||
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
|
||||
|
||||
<!-- Debug CSS style
|
||||
|
@ -36,18 +37,19 @@
|
|||
|
||||
<entry-point
|
||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||
/> -->
|
||||
/> -->
|
||||
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
|
||||
|
||||
|
||||
|
||||
<source path='client' />
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -34,6 +34,12 @@ import org.gcube.portlets.user.dataminermanager.shared.parameters.WKTParameter;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Giancarlo Panichi
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class WPS2DM {
|
||||
private final static String SEPARATOR = "|";
|
||||
|
||||
|
@ -81,7 +87,7 @@ public class WPS2DM {
|
|||
* @param maxOcc
|
||||
* max occurences
|
||||
* @param rangeOccs
|
||||
* range occurences
|
||||
* range occurrences
|
||||
* @param defaultValue
|
||||
* default value
|
||||
* @param id
|
||||
|
@ -292,6 +298,7 @@ public class WPS2DM {
|
|||
} else {
|
||||
if (title.contains("[a http link to a file")) {
|
||||
if (title.contains("[NETCDF]")) {
|
||||
title.replaceFirst("[NETCDF]", "");
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
|
||||
} else {
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
|
||||
|
@ -316,6 +323,7 @@ public class WPS2DM {
|
|||
supportedMimeTypes);
|
||||
} else {
|
||||
if (title.contains("[NETCDF]")) {
|
||||
title.replaceFirst("[NETCDF]", "");
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
|
||||
} else {
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
|
||||
|
@ -323,18 +331,19 @@ public class WPS2DM {
|
|||
}
|
||||
} else {
|
||||
if (title.contains("[NETCDF]")) {
|
||||
title.replaceFirst("[NETCDF]", "");
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, true);
|
||||
} else {
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes,false);
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes,false);
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
|
||||
}
|
||||
} else {
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes,false);
|
||||
converted = new FileParameter(id, title, mimeType, supportedMimeTypes, false);
|
||||
}
|
||||
return converted;
|
||||
}
|
||||
|
|
|
@ -22,14 +22,12 @@ import org.slf4j.LoggerFactory;
|
|||
*
|
||||
*/
|
||||
public class ComputationValueBuilder {
|
||||
private static Logger logger = LoggerFactory
|
||||
.getLogger(ComputationValueBuilder.class);
|
||||
private static Logger logger = LoggerFactory.getLogger(ComputationValueBuilder.class);
|
||||
|
||||
private ArrayList<ComputationItemPropertiesValue> valueParameters;
|
||||
private LinkedHashMap<String, ComputationValue> computationsValueParameters;
|
||||
|
||||
public ComputationValueBuilder(
|
||||
ArrayList<ComputationItemPropertiesValue> valueParameters) {
|
||||
public ComputationValueBuilder(ArrayList<ComputationItemPropertiesValue> valueParameters) {
|
||||
this.valueParameters = valueParameters;
|
||||
}
|
||||
|
||||
|
@ -42,21 +40,17 @@ public class ComputationValueBuilder {
|
|||
if (valueParameters != null && !valueParameters.isEmpty()) {
|
||||
for (ComputationItemPropertiesValue valueParameter : valueParameters) {
|
||||
String value = valueParameter.getValue();
|
||||
if (value != null && !value.isEmpty()
|
||||
&& value.startsWith("http")) {
|
||||
if (value != null && !value.isEmpty() && value.startsWith("http")) {
|
||||
if (value.contains("|")) {
|
||||
ComputationValue valueFileList = createComputationValueFileList(value);
|
||||
computationsValueParameters.put(
|
||||
valueParameter.getKey(), valueFileList);
|
||||
computationsValueParameters.put(valueParameter.getKey(), valueFileList);
|
||||
} else {
|
||||
ComputationValue computationValue = retrieveFileName(value);
|
||||
computationsValueParameters.put(
|
||||
valueParameter.getKey(), computationValue);
|
||||
computationsValueParameters.put(valueParameter.getKey(), computationValue);
|
||||
}
|
||||
} else {
|
||||
ComputationValue valueString = new ComputationValue(value);
|
||||
computationsValueParameters.put(valueParameter.getKey(),
|
||||
valueString);
|
||||
computationsValueParameters.put(valueParameter.getKey(), valueString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,8 +72,7 @@ public class ComputationValueBuilder {
|
|||
}
|
||||
computationValue = retrieveFileName(value);
|
||||
fileList.add(computationValue);
|
||||
ComputationValueFileList computationValueFileList = new ComputationValueFileList(
|
||||
fileList, "|");
|
||||
ComputationValueFileList computationValueFileList = new ComputationValueFileList(fileList, "|");
|
||||
return computationValueFileList;
|
||||
|
||||
}
|
||||
|
@ -96,7 +89,7 @@ public class ComputationValueBuilder {
|
|||
} catch (Throwable e) {
|
||||
logger.error("Retrieve File Name: " + e.getLocalizedMessage());
|
||||
e.printStackTrace();
|
||||
return new ComputationValueFile(value, null, null);
|
||||
return new ComputationValueFile(value, null, null, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,11 +137,14 @@ public class ComputationValueBuilder {
|
|||
mimeType = conn.getContentType();
|
||||
if ((mimeType != null && mimeType.compareToIgnoreCase("image/png") == 0)
|
||||
|| fileName != null && fileName.endsWith(".png")) {
|
||||
computationValue = new ComputationValueImage(value, fileName,
|
||||
mimeType);
|
||||
computationValue = new ComputationValueImage(value, fileName, mimeType);
|
||||
} else {
|
||||
computationValue = new ComputationValueFile(value, fileName,
|
||||
mimeType);
|
||||
if ((mimeType != null && mimeType.compareToIgnoreCase("application/x-netcdf") == 0)
|
||||
|| fileName != null && fileName.endsWith(".nc")) {
|
||||
computationValue = new ComputationValueFile(value, fileName, mimeType, true);
|
||||
} else {
|
||||
computationValue = new ComputationValueFile(value, fileName, mimeType, false);
|
||||
}
|
||||
}
|
||||
|
||||
return computationValue;
|
||||
|
|
|
@ -11,15 +11,17 @@ public class ComputationValueFile extends ComputationValue {
|
|||
|
||||
private String fileName;
|
||||
private String mimeType;
|
||||
private boolean netcdf;
|
||||
|
||||
public ComputationValueFile() {
|
||||
super(ComputationValueType.File);
|
||||
}
|
||||
|
||||
public ComputationValueFile(String url, String fileName, String mimeType) {
|
||||
public ComputationValueFile(String url, String fileName, String mimeType, boolean netcdf) {
|
||||
super(ComputationValueType.File, url);
|
||||
this.fileName = fileName;
|
||||
this.mimeType = mimeType;
|
||||
this.netcdf = netcdf;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
|
@ -38,12 +40,17 @@ public class ComputationValueFile extends ComputationValue {
|
|||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationValueFile [fileName=" + fileName + ", mimeType="
|
||||
+ mimeType + ", type=" + type + ", value=" + value + "]";
|
||||
public boolean isNetcdf() {
|
||||
return netcdf;
|
||||
}
|
||||
|
||||
|
||||
public void setNetcdf(boolean netcdf) {
|
||||
this.netcdf = netcdf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ComputationValueFile [fileName=" + fileName + ", mimeType=" + mimeType + ", netcdf=" + netcdf + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ public class FileResource extends Resource {
|
|||
|
||||
private String url;
|
||||
private String mimeType;
|
||||
private boolean netcdf;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -39,11 +40,15 @@ public class FileResource extends Resource {
|
|||
* url
|
||||
* @param mimeType
|
||||
* mime type
|
||||
* @param netcdf
|
||||
* netcdf
|
||||
*/
|
||||
public FileResource(String resourceId, String name, String description, String url, String mimeType) {
|
||||
public FileResource(String resourceId, String name, String description, String url, String mimeType,
|
||||
boolean netcdf) {
|
||||
super(resourceId, name, description, ResourceType.FILE);
|
||||
this.url = url;
|
||||
this.mimeType = mimeType;
|
||||
this.netcdf = netcdf;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,11 +81,31 @@ public class FileResource extends Resource {
|
|||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return true if is NetCDF file
|
||||
*/
|
||||
public boolean isNetcdf() {
|
||||
return netcdf;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param netcdf
|
||||
* true if is NetCDF file
|
||||
*/
|
||||
public void setNetcdf(boolean netcdf) {
|
||||
this.netcdf = netcdf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "FileResource [url=" + url + ", mimeType=" + mimeType + ", getResourceId()=" + getResourceId()
|
||||
+ ", getName()=" + getName() + ", getDescription()=" + getDescription() + ", getResourceType()="
|
||||
+ getResourceType() + "]";
|
||||
return "FileResource [url=" + url + ", mimeType=" + mimeType + ", netcdf=" + netcdf + ", getResourceId()="
|
||||
+ getResourceId() + ", getName()=" + getName() + ", getDescription()=" + getDescription()
|
||||
+ ", getResourceType()=" + getResourceType() + ", isTabular()=" + isTabular() + ", isObject()="
|
||||
+ isObject() + ", isFile()=" + isFile() + ", isMap()=" + isMap() + ", isImages()=" + isImages()
|
||||
+ ", isError()=" + isError() + ", toString()=" + super.toString() + ", getClass()=" + getClass()
|
||||
+ ", hashCode()=" + hashCode() + "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public class FileParameter extends Parameter {
|
|||
public FileParameter() {
|
||||
super();
|
||||
this.typology = ParameterType.FILE;
|
||||
netcdf=false;
|
||||
netcdf = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,13 +37,15 @@ public class FileParameter extends Parameter {
|
|||
* default mime type
|
||||
* @param supportedMimeTypes
|
||||
* supported mime types
|
||||
* @param netcdf
|
||||
* is netcdf file
|
||||
*/
|
||||
public FileParameter(String name, String description, String defaultMimeType,
|
||||
ArrayList<String> supportedMimeTypes, boolean netcdf) {
|
||||
public FileParameter(String name, String description, String defaultMimeType, ArrayList<String> supportedMimeTypes,
|
||||
boolean netcdf) {
|
||||
super(name, ParameterType.FILE, description);
|
||||
this.defaultMimeType = defaultMimeType;
|
||||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
this.netcdf=netcdf;
|
||||
this.netcdf = netcdf;
|
||||
}
|
||||
|
||||
public String getDefaultMimeType() {
|
||||
|
@ -62,7 +64,6 @@ public class FileParameter extends Parameter {
|
|||
this.supportedMimeTypes = supportedMimeTypes;
|
||||
}
|
||||
|
||||
|
||||
public boolean isNetcdf() {
|
||||
return netcdf;
|
||||
}
|
||||
|
@ -78,5 +79,4 @@ public class FileParameter extends Parameter {
|
|||
+ ", value=" + value + "]";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,9 @@
|
|||
<inherits name='com.sencha.gxt.ui.GXT' />
|
||||
<!-- <inherits name="com.extjs.gxt.ui.GXT" /> -->
|
||||
|
||||
<!-- <inherits name="com.google.gwt.logging.Logging" /> -->
|
||||
<!--
|
||||
<inherits name="com.google.gwt.logging.Logging" /> -->
|
||||
|
||||
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
|
||||
|
||||
<!-- Debug CSS style
|
||||
|
@ -37,19 +39,18 @@
|
|||
<entry-point
|
||||
class='org.gcube.portlets.user.dataminermanager.client.DataMinerManager' />
|
||||
|
||||
<!--
|
||||
<!--
|
||||
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
|
||||
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
|
||||
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
|
||||
/> -->
|
||||
/> -->
|
||||
|
||||
|
||||
|
||||
<set-property name="log_ConsoleLogger" value="DISABLED" />
|
||||
<set-property name="log_DivLogger" value="DISABLED" />
|
||||
<set-property name="log_GWTLogger" value="DISABLED" />
|
||||
<set-property name="log_SystemLogger" value="DISABLED" />
|
||||
|
||||
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
||||
|
|
Loading…
Reference in New Issue