Upgraded to GWT 2.6.1

Integrated with Workspace Explorer

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/speciesdiscovery@117124 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-07-09 13:46:05 +00:00
parent a5303d355b
commit b19ac37fcb
18 changed files with 413 additions and 122 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/species-discovery-3.7.2-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="lib" path="/home/francesco-mangiacrapa/libraries/asm-5.0.3/lib/asm-5.0.3.jar"/>
<classpathentry kind="src" output="target/species-discovery-3.7.3-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -30,6 +31,5 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER/gwt-2.5.1"/>
<classpathentry kind="output" path="target/species-discovery-3.7.2-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/species-discovery-3.7.3-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -3,7 +3,7 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="gis-viewer-3.6.2-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gis-viewer-TRUNK/gis-viewer-TRUNK">
<dependent-module archiveName="workspace-light-tree-2.14.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-light-tree-TRUNK/workspace-light-tree-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>

1
.tern-project Normal file
View File

@ -0,0 +1 @@
{"ide":{"scriptPaths":[]},"plugins":{"aui":{},"liferay":{},"yui":{}},"libs":["ecma5","browser"]}

View File

@ -17,7 +17,7 @@ Authors
Version and Release Date
------------------------
v. 3.7.2 April 2015
v. 3.8.0 July 2015
Description
-----------

View File

@ -1,36 +1,37 @@
<ReleaseNotes>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-7-2"
<Changeset component="org.gcube.portlets-user.species-discovery.3-8-0"
date="15-05-2015">
<Change>Upgraded to gwt 2.6.1
</Change>
<Change>Integrated with Workspace Explorer
</Change>
</Changeset>
<Changeset component="org.gcube.portlets-user.species-discovery.3-7-2"
date="15-05-2015">
<Change>Changed dateformat at dd-MM-yyyy
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-7-1"
<Changeset component="org.gcube.portlets-user.species-discovery.3-7-1"
date="09-12-2014">
<Change>Removed openlayers dependency from pom
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-7-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-7-0"
date="04-06-2014">
<Change>Updated pom to support new portal configuration (gcube release
3.2)
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-6-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-6-0"
date="23-04-2014">
<Change>Portlet updated to support service updating</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-5-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-5-0"
date="24-10-2013">
<Change>Portlet updated to support GWT 2.5.1</Change>
<Change>Ticket 2224: was implemented</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-4-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-4-0"
date="06-09-2013">
<Change>Enhancements on GUI of SPD portlet was realized (view last
query, new expand button are available)
@ -40,45 +41,38 @@
with synonyms", "Unfold the taxa group by".
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-3-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-3-0"
date="09-07-2013">
<Change>Bug Fixed: on species classification
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-2-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-2-0"
date="29-05-2013">
<Change>Bug Fixed: #612 (SPD: Error when saving csv file in workspace)
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-1-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-1-0"
date="14-04-2013">
<Change>Synch with SPD service changes</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.3-0-0"
<Changeset component="org.gcube.portlets-user.species-discovery.3-0-0"
date="05-03-2013">
<Change>Ticket #1260: This component has been mavenized</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.2-3-0"
<Changeset component="org.gcube.portlets-user.species-discovery.2-3-0"
date="17-01-2013">
<Change>Ticket #986: Species Occurrence jobs / Re-submit job and
"info"
</Change>
<Change>Ticket #1002: SPD portlet persistence refactoring</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.2-2-0"
<Changeset component="org.gcube.portlets-user.species-discovery.2-2-0"
date="30-11-2012">
<Change>Ticket #508: Implementation of requirements resulting from
ticket #508
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.2-0-0"
<Changeset component="org.gcube.portlets-user.species-discovery.2-0-0"
date="13-09-2012">
<Change>Ticket #81: Implementation of requirements resulting from user
feedback
@ -88,14 +82,12 @@
the GIS Viewer
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.1-0-1"
<Changeset component="org.gcube.portlets-user.species-discovery.1-0-1"
date="23-07-2012">
<Change>Fixed 447: Map generation fails in Species Discovery Portlet
</Change>
</Changeset>
<Changeset
component="org.gcube.portlets-user.species-discovery.1-0-0"
<Changeset component="org.gcube.portlets-user.species-discovery.1-0-0"
date="04-05-2012">
<Change>First release</Change>
</Changeset>

32
pom.xml
View File

@ -19,7 +19,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>species-discovery</artifactId>
<packaging>war</packaging>
<version>3.7.2-SNAPSHOT</version>
<version>3.8.0-SNAPSHOT</version>
<name>gCube Species Discovery</name>
<description>
gCube Species Discovery Portlet lets the users discovery species information from the Species Service.
@ -31,11 +31,11 @@
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.5.1</gwtVersion>
<gwtVersion>2.6.1</gwtVersion>
<distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 -->
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -55,13 +55,14 @@
</dependencyManagement>
<dependencies>
<dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
@ -71,8 +72,8 @@
<dependency>
<groupId>com.sencha.gxt</groupId>
<artifactId>gxt</artifactId>
<version>2.2.5</version>
<artifactId>gxt2.2.5-gwt2.X</artifactId>
<version>2.7.0</version>
<scope>compile</scope>
</dependency>
@ -141,6 +142,19 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-explorer</artifactId>
<version>[0.0.1-SNAPSHOT, 1.0.0-SNAPSHOT)</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>gwt-user</artifactId>
<groupId>com.google.gwt</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- GisViewer dependecies -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
@ -208,7 +222,7 @@
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>provided</scope>
<scope>compile</scope>
</dependency>
<!-- END FWS -->

View File

@ -94,12 +94,9 @@ import org.gcube.portlets.user.speciesdiscovery.shared.SearchType;
import org.gcube.portlets.user.speciesdiscovery.shared.SpeciesCapability;
import org.gcube.portlets.user.speciesdiscovery.shared.filter.ResultFilter;
import org.gcube.portlets.user.speciesdiscovery.shared.util.SearchTermValidator;
import org.gcube.portlets.widgets.lighttree.client.ItemType;
import org.gcube.portlets.widgets.lighttree.client.event.DataLoadEvent;
import org.gcube.portlets.widgets.lighttree.client.event.DataLoadHandler;
import org.gcube.portlets.widgets.lighttree.client.event.PopupEvent;
import org.gcube.portlets.widgets.lighttree.client.event.PopupHandler;
import org.gcube.portlets.widgets.lighttree.client.save.WorkspaceLightTreeSavePopup;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSaveNotification.WorskpaceExplorerSaveNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.save.WorkspaceExplorerSaveDialog;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.data.BaseModelData;
@ -279,6 +276,7 @@ public class SearchController {
@Override
public void onSearch(SearchEvent event) {
//Info.display("Event", event.toString());
GWT.log(event.toString());
Log.trace(event.toString());
lastSearchEvent = event;
@ -852,6 +850,7 @@ public class SearchController {
@Override
public void onFailure(Throwable caught) {
new MessageBoxAlert("Error", caught.getMessage() + ". Please, try your request again later.", null);
GWT.log("loadDataSourceFromService error: "+caught.getMessage());
// Info.display("Error on loading", "An error occurred on loading Data Source, retry.");
// Log.error("Error on loading", "An error occurred on loading Data Source, retry. " +caught.getMessage());
// Log.error("Error on loading", "An error occurred on loading Data Source, retry. " +caught);
@ -862,6 +861,7 @@ public class SearchController {
@Override
public void onSuccess(List<DataSourceModel> result) {
GWT.log("LOADED "+result.size()+" plugin's");
if(result!=null && result.size()>0)
AdvancedSearchPanelManager.getInstance().loadDataSource(result);
@ -929,7 +929,48 @@ public class SearchController {
case CSV: fileName += ".csv"; break;
case DARWIN_CORE: fileName += ".xml"; break;
}
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the Occurrence points", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveSelectedOccurrencePoints(parent.getId(), fileName, fileFormat, typeCSV, new AsyncCallback<Void>() {
@Override
public void onSuccess(Void result) {
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the Occurrence points", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -970,7 +1011,7 @@ public class SearchController {
});
popup.getElement().getStyle().setZIndex(10001);
popup.show();
*/
}
@ -1003,6 +1044,52 @@ public class SearchController {
private void saveTaxonomyJobErrorFile() {
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the file with Job error", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveTaxonomyJobError(jobTaxonomyModel.getIdentifier(), parent.getId(), fileName, scientificName, dataSourceName, new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
if(result){
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
changeStatusJob(SearchResultType.TAXONOMY_ITEM, jobTaxonomyModel.getIdentifier(), DownloadState.SAVED);
}
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the file with Job error", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -1047,7 +1134,7 @@ public class SearchController {
}
});
popup.show();
*/
}
});
}
@ -1057,10 +1144,54 @@ public class SearchController {
// IN THIS CASE THERE IS ONE DATASOURCE
final String dataSourceName = listDataSources.get(0)!=null?listDataSources.get(0).getName():"no datasource";
String fileName = jobTaxonomyModel.getName() +" from "+dataSourceName+" - DWCA.zip";
// String fileName = "DWCA " +rank + " -"+scientificName +"- from "+dataSourceName+".zip";
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the Job", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveTaxonomyJob(jobTaxonomyModel.getIdentifier(), parent.getId(), fileName, scientificName, dataSourceName, new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
if(result){
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
changeStatusJob(SearchResultType.TAXONOMY_ITEM, jobTaxonomyModel.getIdentifier(), DownloadState.SAVED);
}
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the Job", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -1105,7 +1236,7 @@ public class SearchController {
}
});
popup.show();
*/
}
@ -1146,6 +1277,50 @@ public class SearchController {
private void saveOccurrenceJobError() {
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the error file", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveOccurrenceJobError(jobOccurrencesModel, parent.getId(), fileName, scientificName, dataSources, new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
if(result){
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
changeStatusJob(SearchResultType.OCCURRENCE_POINT, jobOccurrencesModel.getJobIdentifier(), DownloadState.SAVED);
}
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the error file", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -1191,7 +1366,7 @@ public class SearchController {
});
popup.show();
*/
}
});
@ -1226,7 +1401,50 @@ public class SearchController {
// String fileName = "Occurrences results of "+scientificName +"- from "+dataSourceName+" - "+suffix+"."+extension;
String fileName = jobOccurrencesModel.getJobName() +" from "+dataSourceName+" - "+suffix+"."+extension;
final String dataSources = dataSourceName;
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the Occurrences", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveOccurrenceJob(jobOccurrencesModel, parent.getId(), fileName, scientificName, dataSources, new AsyncCallback<Boolean>() {
@Override
public void onSuccess(Boolean result) {
if(result){
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
changeStatusJob(SearchResultType.OCCURRENCE_POINT, jobOccurrencesModel.getJobIdentifier(), DownloadState.SAVED);
}
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the Occurrence points", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -1273,7 +1491,7 @@ public class SearchController {
}
});
popup.show();
*/
}
@ -1323,6 +1541,45 @@ public class SearchController {
case DARWIN_CORE_ARCHIVE: fileName += ".zip"; break;
}
final WorkspaceExplorerSaveDialog navigator = new WorkspaceExplorerSaveDialog("Select where to save the Taxonomy", fileName, true);
WorskpaceExplorerSaveNotificationListener listener = new WorskpaceExplorerSaveNotificationListener(){
@Override
public void onSaving(Item parent, final String fileName) {
GWT.log("onSaving parent: "+parent +", fileName" +fileName);
navigator.hide();
Info.display("Saving in progress", "...");
SpeciesDiscovery.taxonomySearchService.saveSelectedTaxonomyPoints(parent.getId(), fileName, fileFormat, new AsyncCallback<Void>() {
@Override
public void onSuccess(Void result) {
Info.display("File saved", "The "+fileName+" file has been saved in the workspace.");
}
@Override
public void onFailure(Throwable caught) {
Info.display("Error saving the file", "An error occurred saving the file, retry.");
Log.error("Error saving the file", "An error occurred saving the file, retry." +caught.getMessage());
}
});
}
@Override
public void onAborted() {
GWT.log("onAborted");
}
@Override
public void onFailed(Throwable throwable) {
GWT.log("onFailed");
}
};
navigator.addWorkspaceExplorerSaveNotificationListener(listener);
navigator.show();
/*
WorkspaceLightTreeSavePopup popup = new WorkspaceLightTreeSavePopup("Select where to save the Taxonomy", true, fileName);
popup.setModal(false);
popup.setSelectableTypes(ItemType.FOLDER, ItemType.ROOT);
@ -1363,7 +1620,7 @@ public class SearchController {
}
});
popup.show();
*/
}
public void showOccurrencesMap()
@ -1592,7 +1849,7 @@ public class SearchController {
protected void search(SearchType type, String searchTerm, Number upperBoundLongitude, Number upperBoundLatitude, Number lowerBoundLongitude, Number lowerBoundLatitude, Date fromDate, Date toDate, List<DataSourceModel> listDataSources, String groupRank, SpeciesCapability resultType, List<DataSourceModel> listDataSourcesForSynonyms, List<DataSourceModel> listDataSourcesForUnfold)
{
GWT.log("IN SEARCH..............");
Log.trace("IN SEARCH..............");
AsyncCallback<Void> callback = initSearchCallback();
@ -1611,9 +1868,11 @@ public class SearchController {
switch (type) {
case BY_SCIENTIFIC_NAME:
GWT.log("search BY_SCIENTIFIC_NAME");
SpeciesDiscovery.taxonomySearchService.searchByScientificName(searchTerm, filters, callback);
break;
case BY_COMMON_NAME:
GWT.log("search BY_COMMON_NAME");
SpeciesDiscovery.taxonomySearchService.searchByCommonName(searchTerm, filters, callback);
break;
}

View File

@ -5,10 +5,12 @@ import org.gcube.portlets.user.speciesdiscovery.client.rpc.TaxonomySearchService
import com.allen_sauer.gwt.log.client.Log;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.github.gwtbootstrap.client.ui.resources.Resources;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.core.client.ScriptInjector;
import com.google.gwt.event.logical.shared.ResizeEvent;
import com.google.gwt.event.logical.shared.ResizeHandler;
import com.google.gwt.user.client.Window;
@ -32,6 +34,16 @@ public class SpeciesDiscovery implements EntryPoint {
public void onModuleLoad() {
Log.setUncaughtExceptionHandler();
boolean jQueryLoaded = isjQueryLoaded();
GWT.log("jQueryLoaded: "+jQueryLoaded);
// GWT.log("Injected : "+Resources.RESOURCES.jquery().getText());
if (!isjQueryLoaded()) {
ScriptInjector.fromString(Resources.RESOURCES.jquery().getText())
.setWindow(ScriptInjector.TOP_WINDOW)
.inject();
}
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@ -51,6 +63,15 @@ public class SpeciesDiscovery implements EntryPoint {
}
});
}
/**
* Checks if is j query loaded.
*
* @return true, if is j query loaded
*/
private native boolean isjQueryLoaded() /*-{
return (typeof $wnd['jQuery'] !== 'undefined');
}-*/;
public void onModuleLoad2() {

View File

@ -41,6 +41,7 @@ import com.extjs.gxt.ui.client.widget.form.SimpleComboValue;
import com.extjs.gxt.ui.client.widget.form.TextArea;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.KeyCodes;
@ -490,6 +491,7 @@ public class SpeciesSearchFormPanel extends ContentPanel {
String searchTerm = searchField.getValue();
if (buttSimpleSearch.isEnabled() && searchTerm!=null && searchTerm.length()!=0) {
GWT.log("search...");
// if(isActiveAdvanced){
search(searchTerm,
advSearchPanelsManager.getUpperBoundLatitudeField().getValue(),
@ -512,9 +514,26 @@ public class SpeciesSearchFormPanel extends ContentPanel {
protected void search(String searchTerm, Number upperBoundLongitude, Number upperBoundLatitude, Number lowerBoundLongitude, Number lowerBoundLatitude, Date fromDate, Date toDate, List<DataSourceModel> listDataSources, String groupRank, SpeciesCapability resultType, List<DataSourceModel> listDataSourceForSynonyms, List<DataSourceModel> listDataSourceForUnfold)
{
GWT.log("Searching...");
mask("Searching...");
//searchButton.setEnabled(false);
/*
GWT.log(searchTerm);
GWT.log(upperBoundLongitude!=null?upperBoundLongitude.toString():"upperBoundLongitude");
GWT.log(upperBoundLatitude!=null? upperBoundLatitude.toString():"upperBoundLatitude");
GWT.log(lowerBoundLongitude!=null? lowerBoundLongitude.toString():"lowerBoundLongitude");
GWT.log(lowerBoundLatitude!=null? lowerBoundLatitude.toString():"lowerBoundLatitude");
GWT.log(fromDate!=null? fromDate.toString():"fromDate");
GWT.log(toDate!=null? toDate.toString():"toDate");
for (DataSourceModel dataSourceModel : listDataSources) {
GWT.log(dataSourceModel.toString());
}
GWT.log(groupRank);
GWT.log(resultType.toString());
GWT.log(listDataSourceForSynonyms!=null?listDataSourceForSynonyms.toString():"");
GWT.log(listDataSourceForUnfold!=null?listDataSourceForUnfold.toString():"");
*/
SearchType type = null;
if (ConstantsSpeciesDiscovery.SCIENTIFIC_NAME.equals(searchType.getSimpleValue())) type = SearchType.BY_SCIENTIFIC_NAME;
if (ConstantsSpeciesDiscovery.COMMON_NAME.equals(searchType.getSimpleValue())) type = SearchType.BY_COMMON_NAME;

View File

@ -1184,8 +1184,6 @@ public class TaxonomySearchServiceImpl extends RemoteServiceServlet implements T
logger.trace("loadDataSourceList... ");
// System.out.println("loadDataSourceList loadDataSourceList loadDataSourceList loadDataSourceList loadDataSourceList ");
List<DataSourceModel> listDS = null;
try {
DaoSession.initSessionDaoObjects(getASLSession()); //FIXME temporary?

View File

@ -16,8 +16,11 @@ import javax.persistence.Id;
@Entity
public class DataSource implements Serializable{
private static final long serialVersionUID = 1L;
/**
*
*/
private static final long serialVersionUID = 3373136869904925484L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected int internalId;
@ -26,6 +29,8 @@ public class DataSource implements Serializable{
private String name;
private String description;
public DataSource() {}
/**
*
* @param id
@ -44,7 +49,7 @@ public class DataSource implements Serializable{
setName(name);
}
public DataSource() {}
public String getId() {
return id;

View File

@ -10,15 +10,14 @@ import java.util.ArrayList;
*/
public class DataSourceCapability implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -9083819206898794333L;
private ArrayList<SpeciesCapability> listFilters;
private SpeciesCapability capability;
public DataSourceCapability() {}
public DataSourceCapability(SpeciesCapability capability, ArrayList<SpeciesCapability> listFilters) {
super();
this.capability = capability;
@ -26,8 +25,6 @@ public class DataSourceCapability implements Serializable{
}
public DataSourceCapability() {}
public ArrayList<SpeciesCapability> getListFilters() {
return listFilters;
}

View File

@ -1,5 +1,6 @@
package org.gcube.portlets.user.speciesdiscovery.shared;
import java.io.Serializable;
import java.util.ArrayList;
/**
@ -8,12 +9,15 @@ import java.util.ArrayList;
*
*/
public class DataSourceModel extends DataSource{
public class DataSourceModel extends DataSource implements Serializable{
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 7399231525793036218L;
private ArrayList<DataSourceCapability> listCapabilities;
private DataSourceRepositoryInfo dataSourceRepositoryInfo;
public DataSourceModel() {}
/**
*
* @param id
@ -38,7 +42,7 @@ public class DataSourceModel extends DataSource{
super(id,name);
}
public DataSourceModel() {}
public ArrayList<DataSourceCapability> getListCapabilities() {
return listCapabilities;
@ -51,23 +55,4 @@ public class DataSourceModel extends DataSource{
public DataSourceRepositoryInfo getDataSourceRepositoryInfo() {
return dataSourceRepositoryInfo;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("DataSourceModel [listCapabilities=");
builder.append(listCapabilities);
builder.append(", dataSourceRepositoryInfo=");
builder.append(dataSourceRepositoryInfo);
builder.append(", getId()=");
builder.append(getId());
builder.append(", getName()=");
builder.append(getName());
builder.append(", getDescription()=");
builder.append(getDescription());
builder.append("]");
return builder.toString();
}
}

View File

@ -15,22 +15,23 @@ public class DataSourceRepositoryInfo implements Serializable{
/**
*
*/
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -4557351371954637191L;
private String logoUrl;
private String pageUrl;
private Map<String, String> properties;
private String name;
private String description;
public DataSourceRepositoryInfo() {}
public DataSourceRepositoryInfo(String logoUrl, String pageUrl, Map<String,String> properties, String description) {
this.logoUrl = logoUrl;
this.pageUrl = pageUrl;
this.properties = properties;
this.description = description;
}
public DataSourceRepositoryInfo() {}
public String getLogoUrl() {
return logoUrl;
}

View File

@ -24,7 +24,7 @@ public enum SpeciesCapability {
private String id;
private String name;
SpeciesCapability(){
private SpeciesCapability(){
}
@ -42,7 +42,4 @@ public enum SpeciesCapability {
public String getName() {
return name;
}
}

View File

@ -2,7 +2,8 @@
<module rename-to='speciesdiscovery'>
<inherits name='com.google.gwt.user.User' />
<inherits name='org.gcube.portlets.widgets.wsexplorer.WorkspaceExplorer' />
<!-- Other module inherits -->
<inherits name="com.extjs.gxt.ui.GXT" />
<inherits name="org.gcube.portlets.user.gcubegisviewer.GCubeGisViewer" />
@ -10,8 +11,7 @@
<inherits name="com.allen_sauer.gwt.log.gwt-log-TRACE" />
<set-property name="log_DivLogger" value="DISABLED" />
<inherits name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />
<!-- <inherits name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' /> -->
<!-- <inherits name='com.google.gwt.query.Query'/> -->
<!-- Specify the app entry point class. -->

View File

@ -7,24 +7,16 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="speciesdiscovery/js/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="speciesdiscovery/js/bootstrap.min.js"></script>
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="SpeciesDiscovery.css">
<link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>Species Discovery</title>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="speciesdiscovery/speciesdiscovery.nocache.js"></script>
<script type="text/javascript" language="javascript" src="speciesdiscovery/speciesdiscovery.nocache.js"></script>
</head>
<!-- -->

View File

@ -58,14 +58,24 @@
</servlet-mapping>
<!-- Workspace Light Tree servlet -->
<!-- <servlet> -->
<!-- <servlet-name>WorkspaceLightService</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.widgets.lighttree.server.WorkspaceServiceImpl</servlet-class> -->
<!-- </servlet> -->
<!-- <servlet-mapping> -->
<!-- <servlet-name>WorkspaceLightService</servlet-name> -->
<!-- <url-pattern>/speciesdiscovery/WorkspaceLightService</url-pattern> -->
<!-- </servlet-mapping> -->
<servlet>
<servlet-name>WorkspaceLightService</servlet-name>
<servlet-class>org.gcube.portlets.widgets.lighttree.server.WorkspaceServiceImpl</servlet-class>
<servlet-name>workspaceExplorer</servlet-name>
<servlet-class>org.gcube.portlets.widgets.wsexplorer.server.WorkspaceExplorerServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>WorkspaceLightService</servlet-name>
<url-pattern>/speciesdiscovery/WorkspaceLightService</url-pattern>
<servlet-name>workspaceExplorer</servlet-name>
<url-pattern>/speciesdiscovery/WorkspaceExplorerService</url-pattern>
</servlet-mapping>
<servlet>