Updated custom style sheet

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/speciesdiscovery@141546 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2017-01-13 11:07:06 +00:00
parent 2b71b38a8b
commit da1885eba9
2 changed files with 119 additions and 139 deletions

View File

@ -50,7 +50,7 @@ import com.google.gwt.user.client.ui.Button;
/** /**
* *
* @author "Federico De Faveri defaveri@isti.cnr.it" - Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * @author "Federico De Faveri defaveri@isti.cnr.it" - Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* *
*/ */
@ -65,40 +65,38 @@ public class SpeciesSearchFormPanel extends ContentPanel {
private boolean isActiveAdvanced = false; private boolean isActiveAdvanced = false;
private HorizontalPanel hpAdvancedSearchLinks = new HorizontalPanel(); private HorizontalPanel hpAdvancedSearchLinks = new HorizontalPanel();
private final Html htmlLabelAdvs = new Html("Advanced Option"); private final Html htmlLabelAdvs = new Html("Advanced Option");
private HorizontalPanel horizontalQueryPanel = new HorizontalPanel(); private HorizontalPanel horizontalQueryPanel = new HorizontalPanel();
public static final int NORTHHEIGHT = 150; public static final int NORTHHEIGHT = 150;
private List<ToggleButton> tabItemList = new ArrayList<ToggleButton>(); private List<ToggleButton> tabItemList = new ArrayList<ToggleButton>();
private AdvancedSearchPanelManager advSearchPanelsManager = AdvancedSearchPanelManager.getInstance(); private AdvancedSearchPanelManager advSearchPanelsManager = AdvancedSearchPanelManager.getInstance();
private final int DEFAULTLINKPANELTHEIGHT = 22; private final int DEFAULTLINKPANELTHEIGHT = 22;
public static enum SEARCHTYPE {SIMPLE, FULLTEXT}; public static enum SEARCHTYPE {SIMPLE, FULLTEXT};
public TextArea textArea = new TextArea(); public TextArea textArea = new TextArea();
private SEARCHTYPE currentSearchType = SEARCHTYPE.SIMPLE; private SEARCHTYPE currentSearchType = SEARCHTYPE.SIMPLE;
private com.extjs.gxt.ui.client.widget.button.Button buttSearchBy = new com.extjs.gxt.ui.client.widget.button.Button(SEARCHBYQUERY); private com.extjs.gxt.ui.client.widget.button.Button buttSearchBy = new com.extjs.gxt.ui.client.widget.button.Button(SEARCHBYQUERY);
private final static String SEARCHBYQUERY = "Text query"; private final static String SEARCHBYQUERY = "Text query";
private final static String SEARCHBYSIMPLE = "Simple query"; private final static String SEARCHBYSIMPLE = "Simple query";
private HorizontalPanel simpleSearchPanel = new HorizontalPanel(); private HorizontalPanel simpleSearchPanel = new HorizontalPanel();
private HorizontalPanel querySeachPanel = new HorizontalPanel(); private HorizontalPanel querySeachPanel = new HorizontalPanel();
protected Button buttQuerySearch; protected Button buttQuerySearch;
protected Button buttQueryExample; protected Button buttQueryExample;
protected CheckBox checkValidateOccurrences = new CheckBox(); protected CheckBox checkValidateOccurrences = new CheckBox();
public SpeciesSearchFormPanel(EventBus eventBus) { public SpeciesSearchFormPanel(EventBus eventBus) {
this.eventBus = eventBus; this.eventBus = eventBus;
bind(); bind();
horizontalQueryPanel.setStyleAttribute("margin-left", "10px"); horizontalQueryPanel.setStyleAttribute("margin-left", "10px");
horizontalQueryPanel.setStyleAttribute("margin-top", "15px"); horizontalQueryPanel.setStyleAttribute("margin-top", "10px");
// horizontalQueryPanel.setScrollMode(Scroll.AUTO);
// simpleSearchPanel.setScrollMode(Scroll.AUTO);
htmlLabelAdvs.setStyleAttribute("font-size", "11px"); htmlLabelAdvs.setStyleAttribute("font-size", "11px");
htmlLabelAdvs.setStyleAttribute("margin-left", "10px"); htmlLabelAdvs.setStyleAttribute("margin-left", "10px");
buttSearchBy.setStyleName("button-hyperlink"); buttSearchBy.setStyleName("button-hyperlink");
buttSearchBy.setStyleAttribute("margin-left", "5px"); buttSearchBy.setStyleAttribute("margin-left", "5px");
@ -106,29 +104,29 @@ public class SpeciesSearchFormPanel extends ContentPanel {
setFrame(false); setFrame(false);
setHeaderVisible(false); setHeaderVisible(false);
setBorders(false); setBorders(false);
initComboSearchType(); initComboSearchType();
initComboSearchTypeResult(); initComboSearchTypeResult();
init(); init();
switchSearchType(SEARCHTYPE.SIMPLE); switchSearchType(SEARCHTYPE.SIMPLE);
add(advSearchPanelsManager.getPanel()); add(advSearchPanelsManager.getPanel());
} }
private void initComboSearchType(){ private void initComboSearchType(){
searchType = new SimpleComboBox<String>(); searchType = new SimpleComboBox<String>();
searchType.add(Arrays.asList(new String[]{ConstantsSpeciesDiscovery.SCIENTIFIC_NAME, ConstantsSpeciesDiscovery.COMMON_NAME})); searchType.add(Arrays.asList(new String[]{ConstantsSpeciesDiscovery.SCIENTIFIC_NAME, ConstantsSpeciesDiscovery.COMMON_NAME}));
searchType.setEditable(false); searchType.setEditable(false);
searchType.setTriggerAction(TriggerAction.ALL); searchType.setTriggerAction(TriggerAction.ALL);
searchType.setSimpleValue(ConstantsSpeciesDiscovery.SCIENTIFIC_NAME); searchType.setSimpleValue(ConstantsSpeciesDiscovery.SCIENTIFIC_NAME);
searchType.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<String>>() { searchType.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<String>>() {
@Override @Override
public void selectionChanged(SelectionChangedEvent<SimpleComboValue<String>> se) { public void selectionChanged(SelectionChangedEvent<SimpleComboValue<String>> se) {
@ -137,31 +135,31 @@ public class SpeciesSearchFormPanel extends ContentPanel {
}); });
} }
private void initComboSearchTypeResult(){ private void initComboSearchTypeResult(){
searchTypeResults = new SimpleComboBox<String>(); searchTypeResults = new SimpleComboBox<String>();
searchTypeResults.add(Arrays.asList(new String[]{SpeciesCapability.RESULTITEM.getName(), SpeciesCapability.TAXONOMYITEM.getName()})); searchTypeResults.add(Arrays.asList(new String[]{SpeciesCapability.RESULTITEM.getName(), SpeciesCapability.TAXONOMYITEM.getName()}));
searchTypeResults.setEditable(false); searchTypeResults.setEditable(false);
searchTypeResults.setTriggerAction(TriggerAction.ALL); searchTypeResults.setTriggerAction(TriggerAction.ALL);
searchTypeResults.setSimpleValue(SpeciesCapability.RESULTITEM.getName()); searchTypeResults.setSimpleValue(SpeciesCapability.RESULTITEM.getName());
searchTypeResults.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<String>>() { searchTypeResults.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<String>>() {
@Override @Override
public void selectionChanged(SelectionChangedEvent<SimpleComboValue<String>> se) { public void selectionChanged(SelectionChangedEvent<SimpleComboValue<String>> se) {
eventBus.fireEvent(new CapabilitySelectedEvent(getCapability(se.getSelectedItem().getValue()))); eventBus.fireEvent(new CapabilitySelectedEvent(getCapability(se.getSelectedItem().getValue())));
} }
}); });
} }
//RETURN RESULT ITEM OR TAXOMONY ITEM //RETURN RESULT ITEM OR TAXOMONY ITEM
public SpeciesCapability getSelectedCapability(){ public SpeciesCapability getSelectedCapability(){
return getCapability(searchTypeResults.getValue().getValue()); return getCapability(searchTypeResults.getValue().getValue());
} }
private SpeciesCapability getCapability(String value){ private SpeciesCapability getCapability(String value){
if(value.compareTo(SpeciesCapability.TAXONOMYITEM.getName())==0) if(value.compareTo(SpeciesCapability.TAXONOMYITEM.getName())==0)
return SpeciesCapability.TAXONOMYITEM; return SpeciesCapability.TAXONOMYITEM;
@ -173,24 +171,24 @@ public class SpeciesSearchFormPanel extends ContentPanel {
return SpeciesCapability.SYNONYMS; return SpeciesCapability.SYNONYMS;
else if(value.compareTo(SpeciesCapability.UNFOLD.getName())==0) else if(value.compareTo(SpeciesCapability.UNFOLD.getName())==0)
return SpeciesCapability.UNFOLD; return SpeciesCapability.UNFOLD;
return SpeciesCapability.UNKNOWN; return SpeciesCapability.UNKNOWN;
} }
private SearchType getSearchType(String value){ private SearchType getSearchType(String value){
if(value.compareTo(ConstantsSpeciesDiscovery.SCIENTIFIC_NAME)==0) if(value.compareTo(ConstantsSpeciesDiscovery.SCIENTIFIC_NAME)==0)
return SearchType.BY_SCIENTIFIC_NAME; return SearchType.BY_SCIENTIFIC_NAME;
else if(value.compareTo(ConstantsSpeciesDiscovery.COMMON_NAME)==0) else if(value.compareTo(ConstantsSpeciesDiscovery.COMMON_NAME)==0)
return SearchType.BY_COMMON_NAME; return SearchType.BY_COMMON_NAME;
return SearchType.BY_SCIENTIFIC_NAME; return SearchType.BY_SCIENTIFIC_NAME;
} }
public void switchSearchType(SEARCHTYPE searchType){ public void switchSearchType(SEARCHTYPE searchType){
currentSearchType = searchType; currentSearchType = searchType;
if(searchType.equals(SEARCHTYPE.SIMPLE)){ if(searchType.equals(SEARCHTYPE.SIMPLE)){
@ -205,22 +203,22 @@ public class SpeciesSearchFormPanel extends ContentPanel {
hpAdvancedSearchLinks.setEnabled(false); hpAdvancedSearchLinks.setEnabled(false);
activeAdvancedSearch(false); activeAdvancedSearch(false);
} }
} }
protected void init() protected void init()
{ {
horizontalQueryPanel.setBorders(false); horizontalQueryPanel.setBorders(false);
horizontalQueryPanel.setSize(1150, 33); horizontalQueryPanel.setSize(1150, 33);
searchTypeResults.setStyleAttribute("margin-right", "10px"); searchTypeResults.setStyleAttribute("margin-right", "10px");
initSimpleSearchPanel(); initSimpleSearchPanel();
initQuerySearchPanel(); initQuerySearchPanel();
createAdvancedSeachLinks(); createAdvancedSeachLinks();
horizontalQueryPanel.add(simpleSearchPanel); horizontalQueryPanel.add(simpleSearchPanel);
horizontalQueryPanel.add(querySeachPanel); horizontalQueryPanel.add(querySeachPanel);
@ -228,70 +226,70 @@ public class SpeciesSearchFormPanel extends ContentPanel {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
if(currentSearchType.equals(SEARCHTYPE.SIMPLE)) if(currentSearchType.equals(SEARCHTYPE.SIMPLE))
switchSearchType(SEARCHTYPE.FULLTEXT); switchSearchType(SEARCHTYPE.FULLTEXT);
else else
switchSearchType(SEARCHTYPE.SIMPLE); switchSearchType(SEARCHTYPE.SIMPLE);
} }
}); });
horizontalQueryPanel.add(buttSearchBy); horizontalQueryPanel.add(buttSearchBy);
add(horizontalQueryPanel); add(horizontalQueryPanel);
add(hpAdvancedSearchLinks); add(hpAdvancedSearchLinks);
} }
private void initQuerySearchPanel() { private void initQuerySearchPanel() {
querySeachPanel.setSpacing(5); querySeachPanel.setSpacing(5);
buttQuerySearch = new Button("Search"); buttQuerySearch = new Button("Search");
buttQuerySearch.setStyleName("wizardButton"); buttQuerySearch.setStyleName("wizardButton");
buttQuerySearch.addClickHandler(new ClickHandler() { buttQuerySearch.addClickHandler(new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
searchByQuery(textArea.getValue()); searchByQuery(textArea.getValue());
} }
}); });
buttQueryExample = new Button("Example", new ClickHandler() { buttQueryExample = new Button("Example", new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
textArea.setValue("SEARCH BY SN 'Carcharodon carcharias' in OBIS RETURN Occurrence"); textArea.setValue("SEARCH BY SN 'Carcharodon carcharias' in OBIS RETURN Occurrence");
} }
}); });
buttQueryExample.setStyleName("wizardButton"); buttQueryExample.setStyleName("wizardButton");
textArea.setSize(450, 37); textArea.setSize(450, 37);
textArea.setEmptyText("Write a query"); textArea.setEmptyText("Write a query");
textArea.setStyleAttribute("margin-right", "5px"); textArea.setStyleAttribute("margin-right", "5px");
querySeachPanel.add(textArea); querySeachPanel.add(textArea);
com.extjs.gxt.ui.client.widget.button.Button buttQueryInfo = new com.extjs.gxt.ui.client.widget.button.Button(); com.extjs.gxt.ui.client.widget.button.Button buttQueryInfo = new com.extjs.gxt.ui.client.widget.button.Button();
buttQueryInfo.setStyleAttribute("margin-right", "15px"); buttQueryInfo.setStyleAttribute("margin-right", "15px");
buttQueryInfo.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getHelpIcon())); buttQueryInfo.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getHelpIcon()));
buttQueryInfo.addSelectionListener(new SelectionListener<ButtonEvent>() { buttQueryInfo.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
new HelpQueryWindow(); new HelpQueryWindow();
} }
}); });
querySeachPanel.add(buttQueryInfo); querySeachPanel.add(buttQueryInfo);
querySeachPanel.add(buttQuerySearch); querySeachPanel.add(buttQuerySearch);
querySeachPanel.add(buttQueryExample); querySeachPanel.add(buttQueryExample);
@ -300,10 +298,10 @@ public class SpeciesSearchFormPanel extends ContentPanel {
private void initSimpleSearchPanel() { private void initSimpleSearchPanel() {
simpleSearchPanel.setSpacing(5); simpleSearchPanel.setSpacing(5);
simpleSearchPanel.setVerticalAlign(VerticalAlignment.MIDDLE); simpleSearchPanel.setVerticalAlign(VerticalAlignment.MIDDLE);
VerticalPanel vtPanel = new VerticalPanel(); VerticalPanel vtPanel = new VerticalPanel();
HorizontalPanel hpPanel = new HorizontalPanel(); HorizontalPanel hpPanel = new HorizontalPanel();
hpPanel.setVerticalAlign(VerticalAlignment.MIDDLE); hpPanel.setVerticalAlign(VerticalAlignment.MIDDLE);
@ -314,19 +312,19 @@ public class SpeciesSearchFormPanel extends ContentPanel {
hpPanel.add(textSearch); hpPanel.add(textSearch);
hpPanel.add(searchTypeResults); hpPanel.add(searchTypeResults);
Text textBy = new Text("By:"); Text textBy = new Text("By:");
textBy.setStyleAttribute("margin-left", "5px"); textBy.setStyleAttribute("margin-left", "5px");
textBy.setStyleAttribute("margin-right", "5px"); textBy.setStyleAttribute("margin-right", "5px");
hpPanel.add(textBy); hpPanel.add(textBy);
hpPanel.add(searchType); hpPanel.add(searchType);
Text textTerm = new Text("Term:"); Text textTerm = new Text("Term:");
textTerm.setStyleAttribute("margin-left", "10px"); textTerm.setStyleAttribute("margin-left", "10px");
textTerm.setStyleAttribute("margin-right", "5px"); textTerm.setStyleAttribute("margin-right", "5px");
hpPanel.add(textTerm); hpPanel.add(textTerm);
searchField = new TextField<String>(); searchField = new TextField<String>();
searchField.setStyleAttribute("margin-left", "0px"); searchField.setStyleAttribute("margin-left", "0px");
searchField.setStyleAttribute("margin-right", "10px"); searchField.setStyleAttribute("margin-right", "10px");
@ -338,76 +336,76 @@ public class SpeciesSearchFormPanel extends ContentPanel {
public void componentKeyPress(ComponentEvent event) { public void componentKeyPress(ComponentEvent event) {
if (event.getKeyCode()==KeyCodes.KEY_ENTER) search(); if (event.getKeyCode()==KeyCodes.KEY_ENTER) search();
} }
}); });
hpPanel.add(searchField); hpPanel.add(searchField);
checkValidateOccurrences.setBoxLabel("validate occurrences"); checkValidateOccurrences.setBoxLabel("validate occurrences");
checkValidateOccurrences.setValueAttribute("validate occurrences"); checkValidateOccurrences.setValueAttribute("validate occurrences");
checkValidateOccurrences.setStyleAttribute("margin-right", "10px"); checkValidateOccurrences.setStyleAttribute("margin-right", "10px");
buttSimpleSearch = new Button("Search"); buttSimpleSearch = new Button("Search");
buttSimpleSearch.addClickHandler(new ClickHandler() { buttSimpleSearch.addClickHandler(new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
search(); search();
} }
}); });
buttSimpleSearch.setStyleName("wizardButton"); buttSimpleSearch.setStyleName("wizardButton");
hpPanel.add(buttSimpleSearch); hpPanel.add(buttSimpleSearch);
buttSimpleExample = new Button("Example", new ClickHandler() { buttSimpleExample = new Button("Example", new ClickHandler() {
@Override @Override
public void onClick(ClickEvent event) { public void onClick(ClickEvent event) {
searchField.setValue("Carcharodon carcharias"); searchField.setValue("Carcharodon carcharias");
} }
}); });
buttSimpleExample.setStyleName("wizardButton"); buttSimpleExample.setStyleName("wizardButton");
hpPanel.add(buttSimpleExample); hpPanel.add(buttSimpleExample);
HorizontalPanel hpPanelExpand = new HorizontalPanel(); HorizontalPanel hpPanelExpand = new HorizontalPanel();
hpPanelExpand.setVerticalAlign(VerticalAlignment.MIDDLE); hpPanelExpand.setVerticalAlign(VerticalAlignment.MIDDLE);
hpPanelExpand.setStyleAttribute("margin-top", "10px"); hpPanelExpand.setStyleAttribute("margin-top", "10px");
Text textExpand = new Text("Expand with synonyms: "); Text textExpand = new Text("Expand with synonyms: ");
textExpand.setStyleAttribute("margin-left", "5px"); textExpand.setStyleAttribute("margin-left", "5px");
textExpand.setStyleAttribute("margin-right", "5px"); textExpand.setStyleAttribute("margin-right", "5px");
vtPanel.add(hpPanel); vtPanel.add(hpPanel);
simpleSearchPanel.add(vtPanel); simpleSearchPanel.add(vtPanel);
} }
public boolean getValueCheckValidateOcccurrences(){ public boolean getValueCheckValidateOcccurrences(){
return this.checkValidateOccurrences.getValue(); return this.checkValidateOccurrences.getValue();
} }
public void setValueCheckValidateOcccurrences(boolean bool){ public void setValueCheckValidateOcccurrences(boolean bool){
this.checkValidateOccurrences.setValue(bool); this.checkValidateOccurrences.setValue(bool);
} }
public void setVisibleCheckValidateOcccurrences(boolean bool){ public void setVisibleCheckValidateOcccurrences(boolean bool){
this.checkValidateOccurrences.setVisible(bool); this.checkValidateOccurrences.setVisible(bool);
} }
public void activeButtonSearch(boolean bool){ public void activeButtonSearch(boolean bool){
buttSimpleSearch.setEnabled(bool); buttSimpleSearch.setEnabled(bool);
} }
private void createAdvancedSeachLinks() { private void createAdvancedSeachLinks() {
hpAdvancedSearchLinks.setVerticalAlign(VerticalAlignment.MIDDLE); hpAdvancedSearchLinks.setVerticalAlign(VerticalAlignment.MIDDLE);
hpAdvancedSearchLinks.setStyleAttribute("marginLeft", "15px"); hpAdvancedSearchLinks.setStyleAttribute("marginLeft", "15px");
hpAdvancedSearchLinks.setStyleAttribute("marginRight", "15px"); hpAdvancedSearchLinks.setStyleAttribute("marginRight", "15px");
@ -415,12 +413,12 @@ public class SpeciesSearchFormPanel extends ContentPanel {
hpAdvancedSearchLinks.setStyleAttribute("border-bottom", "thin solid #99BBE8;"); hpAdvancedSearchLinks.setStyleAttribute("border-bottom", "thin solid #99BBE8;");
hpAdvancedSearchLinks.setStyleAttribute("background-color", "#EFF5FB"); hpAdvancedSearchLinks.setStyleAttribute("background-color", "#EFF5FB");
hpAdvancedSearchLinks.add(htmlLabelAdvs); hpAdvancedSearchLinks.add(htmlLabelAdvs);
hpAdvancedSearchLinks.setHeight(DEFAULTLINKPANELTHEIGHT); //hpAdvancedSearchLinks.setHeight(DEFAULTLINKPANELTHEIGHT);
// imageArrowRight.setStyleAttribute("margin-top", "5px"); // imageArrowRight.setStyleAttribute("margin-top", "5px");
// imageArrowDown.setStyleAttribute("margin-top", "5px"); // imageArrowDown.setStyleAttribute("margin-top", "5px");
for(final String advPanel : advSearchPanelsManager.getListAdvancedSearchPanels()){ for(final String advPanel : advSearchPanelsManager.getListAdvancedSearchPanels()){
ToggleButton butt = new ToggleButton(advPanel); ToggleButton butt = new ToggleButton(advPanel);
butt.setToggleGroup("tab"); butt.setToggleGroup("tab");
butt.setSize(100, -1); butt.setSize(100, -1);
@ -428,32 +426,32 @@ public class SpeciesSearchFormPanel extends ContentPanel {
butt.setId(advPanel); butt.setId(advPanel);
butt.setStyleName("button-hyperlink"); butt.setStyleName("button-hyperlink");
butt.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowRight())); butt.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowRight()));
tabItemList.add(butt); tabItemList.add(butt);
butt.addSelectionListener(new SelectionListener<ButtonEvent>() { butt.addSelectionListener(new SelectionListener<ButtonEvent>() {
@Override @Override
public void componentSelected(ButtonEvent ce) { public void componentSelected(ButtonEvent ce) {
// isActiveAdvanced = !isActiveAdvanced; // isActiveAdvanced = !isActiveAdvanced;
ToggleButton butt = (ToggleButton) ce.getButton(); ToggleButton butt = (ToggleButton) ce.getButton();
isActiveAdvanced = butt.isPressed(); isActiveAdvanced = butt.isPressed();
advSearchPanelsManager.setActivePanel(advPanel); advSearchPanelsManager.setActivePanel(advPanel);
activeAdvancedSearch(isActiveAdvanced); activeAdvancedSearch(isActiveAdvanced);
changeStateIcons(); changeStateIcons();
} }
private void changeStateIcons() { private void changeStateIcons() {
for(ToggleButton toggle : tabItemList){ for(ToggleButton toggle : tabItemList){
if(toggle.isPressed()){ if(toggle.isPressed()){
toggle.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowDown())); toggle.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowDown()));
toggle.getElement().getStyle().setBackgroundColor("#D0DEF0"); toggle.getElement().getStyle().setBackgroundColor("#D0DEF0");
}else{ }else{
toggle.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowRight())); toggle.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.getArrowRight()));
toggle.getElement().getStyle().clearBackgroundColor(); toggle.getElement().getStyle().clearBackgroundColor();
@ -461,19 +459,19 @@ public class SpeciesSearchFormPanel extends ContentPanel {
} }
} }
} }
}); });
hpAdvancedSearchLinks.add(butt); hpAdvancedSearchLinks.add(butt);
} }
} }
private void activeAdvancedSearch(boolean bool){ private void activeAdvancedSearch(boolean bool){
if(bool){ if(bool){
// htmlLabelAdvs.setHtml(messageAdvActive); // htmlLabelAdvs.setHtml(messageAdvActive);
SearchBorderLayoutPanel.getInstance().updateNorthSize(NORTHHEIGHT); SearchBorderLayoutPanel.getInstance().updateNorthSize(NORTHHEIGHT);
@ -489,17 +487,17 @@ public class SpeciesSearchFormPanel extends ContentPanel {
String searchTerm = searchField.getValue(); String searchTerm = searchField.getValue();
if (buttSimpleSearch.isEnabled() && searchTerm!=null && searchTerm.length()!=0) { if (buttSimpleSearch.isEnabled() && searchTerm!=null && searchTerm.length()!=0) {
// if(isActiveAdvanced){ // if(isActiveAdvanced){
search(searchTerm, search(searchTerm,
advSearchPanelsManager.getUpperBoundLatitudeField().getValue(), advSearchPanelsManager.getUpperBoundLatitudeField().getValue(),
advSearchPanelsManager.getUpperBoundLongitudeField().getValue(), advSearchPanelsManager.getUpperBoundLongitudeField().getValue(),
advSearchPanelsManager.getLowerBoundLatitudeField().getValue(), advSearchPanelsManager.getLowerBoundLatitudeField().getValue(),
advSearchPanelsManager.getLowerBoundLongitudeField().getValue(), advSearchPanelsManager.getLowerBoundLongitudeField().getValue(),
advSearchPanelsManager.getFromDate().getValue(), advSearchPanelsManager.getFromDate().getValue(),
advSearchPanelsManager.getToDate().getValue(), advSearchPanelsManager.getToDate().getValue(),
advSearchPanelsManager.getCheckedDataSources(), advSearchPanelsManager.getCheckedDataSources(),
ResultFilterPanelManager.getInstance().getGroupByRank(), ResultFilterPanelManager.getInstance().getGroupByRank(),
advSearchPanelsManager.getCurrentSelectedCapability(), advSearchPanelsManager.getCurrentSelectedCapability(),
advSearchPanelsManager.getCheckedDataSourceForSynonyms(), advSearchPanelsManager.getCheckedDataSourceForSynonyms(),
advSearchPanelsManager.getCheckedDataSourceForUnfold()); advSearchPanelsManager.getCheckedDataSourceForUnfold());
@ -522,8 +520,8 @@ public class SpeciesSearchFormPanel extends ContentPanel {
SearchEvent event = new SearchEvent(type, searchTerm, upperBoundLongitude, upperBoundLatitude, lowerBoundLongitude, lowerBoundLatitude, fromDate, toDate, listDataSources, groupRank, resultType, listDataSourceForSynonyms, listDataSourceForUnfold); SearchEvent event = new SearchEvent(type, searchTerm, upperBoundLongitude, upperBoundLatitude, lowerBoundLongitude, lowerBoundLatitude, fromDate, toDate, listDataSources, groupRank, resultType, listDataSourceForSynonyms, listDataSourceForUnfold);
eventBus.fireEvent(event); eventBus.fireEvent(event);
} }
protected void searchByQuery(String query) protected void searchByQuery(String query)
{ {
if (query!=null && query.length()!=0) { if (query!=null && query.length()!=0) {
@ -547,7 +545,7 @@ public class SpeciesSearchFormPanel extends ContentPanel {
@Override @Override
public void onSearchComplete(SearchCompleteEvent event) { public void onSearchComplete(SearchCompleteEvent event) {
enableSearch(); enableSearch();
} }
}); });
} }

View File

@ -96,11 +96,6 @@ public class SessionUtil {
session.setAttribute(TAXONOMY_OCCURRENCE, searchSession); session.setAttribute(TAXONOMY_OCCURRENCE, searchSession);
} }
// public static void setCurrentTaxonomyChildrenSession(ASLSession session, FetchingSession<TaxonomyRow> searchSession)
// {
// session.setAttribute(TAXONOMY_CHILD, searchSession);
// }
public static ASLSession getAslSession(HttpSession httpSession) public static ASLSession getAslSession(HttpSession httpSession)
{ {
String sessionID = httpSession.getId(); String sessionID = httpSession.getId();
@ -110,30 +105,19 @@ public class SessionUtil {
//for test only //for test only
user = "test.user"; user = "test.user";
// user = "lucio.lelii";
// user = "pasquale.pagano";
// user = "francesco.mangiacrapa";
String scope = "/gcube/devsec"; //Development String scope = "/gcube/devsec"; //Development
// String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityResearchEnvironment"; //Production // String scope = "/d4science.research-infrastructures.eu/gCubeApps/BiodiversityResearchEnvironment"; //Production
httpSession.setAttribute(USERNAME_ATTRIBUTE, user); httpSession.setAttribute(USERNAME_ATTRIBUTE, user);
ASLSession session = SessionManager.getInstance().getASLSession(sessionID, user); ASLSession session = SessionManager.getInstance().getASLSession(sessionID, user);
session.setScope(scope); session.setScope(scope);
logger.warn("TaxonomySearchServiceImpl STARTING IN TEST MODE - NO USER FOUND"); logger.warn("TaxonomySearchServiceImpl STARTING IN TEST MODE - NO USER FOUND");
logger.warn("Created fake Asl session for user "+user + " with scope "+scope); logger.warn("Created fake Asl session for user "+user + " with scope "+scope);
// session.setScope("/gcube/devsec");
return session; return session;
} }
return SessionManager.getInstance().getASLSession(sessionID, user); return SessionManager.getInstance().getASLSession(sessionID, user);
} }
//MODIFIED******************************************************************************************
public static void setCurrentEJBResultRow(ASLSession session, ResultRowPersistence resultRowPersistence) { public static void setCurrentEJBResultRow(ASLSession session, ResultRowPersistence resultRowPersistence) {
session.setAttribute(EJB_RESULT_ROW, resultRowPersistence); session.setAttribute(EJB_RESULT_ROW, resultRowPersistence);
} }
@ -197,7 +181,6 @@ public class SessionUtil {
} }
/** /**
* *
* @param aslSession * @param aslSession
@ -260,7 +243,6 @@ public class SessionUtil {
} }
/** /**
* @return * @return
* *