Starting migration to geoportal-data-list configuration for UCD
This commit is contained in:
parent
d62d7c9eec
commit
9e8aede170
|
@ -9,10 +9,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
#### Enhancements
|
#### Enhancements
|
||||||
|
|
||||||
- [#22684] Porting to Profiled Document
|
- [#22684] Migrated to geoportal-data-entry-app configuration for UCD
|
||||||
- [#23587] GUI model viewer passed to tree data structure
|
- [#23587] GUI model viewer passed to tree data structure
|
||||||
- Moved to maven-portal-bom v3.7.0[-SNAPSHOT]
|
- Moved to maven-portal-bom v3.7.0[-SNAPSHOT]
|
||||||
- [#22883] Integrated with (the new) geoportal-client (>= 1.1.0-SNAPSHOT)
|
- [#22883] Integrated with (the new) geoportal-client (>= 1.1.0-SNAPSHOT)
|
||||||
|
- [#22685] Migrated to geoportal-data-list configuration for UCD
|
||||||
|
|
||||||
## [v2.2.1] - 2022-06-29
|
## [v2.2.1] - 2022-06-29
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client;
|
package org.gcube.portlets.user.geoportaldataentry.client;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,4 +42,7 @@ public class ConstantsGeoPortalDataEntryApp {
|
||||||
public enum ACTION_PERFORMED_ON_ITEM {
|
public enum ACTION_PERFORMED_ON_ITEM {
|
||||||
UPDATED_PROJECT
|
UPDATED_PROJECT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static final List<String> HANDLERS_IDS = Arrays.asList(GEOPORTAL_DATA_HANDLER.geoportal_data_list.getId(),
|
||||||
|
GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getId());
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,10 @@ package org.gcube.portlets.user.geoportaldataentry.client;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
||||||
|
@ -14,13 +16,14 @@ import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
|
||||||
import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
|
import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
|
||||||
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
|
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
|
||||||
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
|
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.LifecycleInformationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.LifecycleInformationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
|
||||||
|
@ -108,7 +111,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
private GeonaDataEntryMainForm geoNaMainForm = null;
|
private GeonaDataEntryMainForm geoNaMainForm = null;
|
||||||
|
|
||||||
//private Collection<GeoNaFormCardModel> orderedCards = new ArrayList<GeoNaFormCardModel>();
|
// private Collection<GeoNaFormCardModel> orderedCards = new
|
||||||
|
// ArrayList<GeoNaFormCardModel>();
|
||||||
|
|
||||||
private GeonaMainTabPanel mainTabPanel;
|
private GeonaMainTabPanel mainTabPanel;
|
||||||
|
|
||||||
|
@ -122,14 +126,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
private LoaderIcon loader = new LoaderIcon("Loading Application... please wait");
|
private LoaderIcon loader = new LoaderIcon("Loading Application... please wait");
|
||||||
|
|
||||||
private List<ItemFieldDV> displayFields = new ArrayList<ItemFieldDV>();
|
|
||||||
private List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
|
||||||
private List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
|
||||||
|
|
||||||
private GeonaISConfig geonaISConfig;
|
private GeonaISConfig geonaISConfig;
|
||||||
|
|
||||||
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType = new TreeMap<String, List<GeoNaFormCardModel>>();
|
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType = new TreeMap<String, List<GeoNaFormCardModel>>();
|
||||||
|
|
||||||
|
private Map<String, List<ConfigurationDV<?>>> mapHandlersForProfileId = new HashMap<String, List<ConfigurationDV<?>>>();
|
||||||
|
|
||||||
private int numberOfCards = 0;
|
private int numberOfCards = 0;
|
||||||
|
|
||||||
private int expectedCards = 0;
|
private int expectedCards = 0;
|
||||||
|
@ -233,35 +235,42 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ItemFieldDV> itemFields = gNADataEntryConfig.getListItemFields();
|
// List<ItemFieldDV> itemFields = gNADataEntryConfig.getListItemFields();
|
||||||
|
//
|
||||||
|
// for (ItemFieldDV itemField : itemFields) {
|
||||||
|
// if (itemField.isDisplayAsResult()) {
|
||||||
|
// displayFields.add(itemField);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (itemField.isSearchable()) {
|
||||||
|
// searchByFields.add(itemField);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (itemField.isSortable()) {
|
||||||
|
// sortByFields.add(itemField);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// GWT.log("List display fields: " + itemFields);
|
||||||
|
// SearchingFilter initialSortFilter = new SearchingFilter();
|
||||||
|
// initialSortFilter.setOrder(ORDER.ASC);
|
||||||
|
// initialSortFilter.setOrderByFields(
|
||||||
|
// Arrays.asList(new ItemFieldDV("Name", Arrays.asList("name"), null, true, true, true)));
|
||||||
|
//
|
||||||
|
// displayFields = itemFields;
|
||||||
|
// mainTabPanel = new GeonaMainTabPanel(appManagerBus);
|
||||||
|
//
|
||||||
|
// mainTabPanel.setFilteringParameters(displayFields, sortByFields, searchByFields, initialSortFilter);
|
||||||
|
//
|
||||||
|
// // TWICE BECAUSE THE MAIN PANEL COULD BE NULL BEFORE
|
||||||
|
// setListUseCaseDescriptors(listUCDescriptors);
|
||||||
|
|
||||||
for (ItemFieldDV itemField : itemFields) {
|
|
||||||
if (itemField.isDisplayAsResult()) {
|
|
||||||
displayFields.add(itemField);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemField.isSearchable()) {
|
|
||||||
searchByFields.add(itemField);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemField.isSortable()) {
|
|
||||||
sortByFields.add(itemField);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
GWT.log("List display fields: " + itemFields);
|
|
||||||
SearchingFilter initialSortFilter = new SearchingFilter();
|
SearchingFilter initialSortFilter = new SearchingFilter();
|
||||||
|
List<ItemFieldDV> defaultItemField = Arrays
|
||||||
|
.asList(new ItemFieldDV("Name", Arrays.asList("name"), null, true, true, true));
|
||||||
initialSortFilter.setOrder(ORDER.ASC);
|
initialSortFilter.setOrder(ORDER.ASC);
|
||||||
initialSortFilter.setOrderByFields(
|
initialSortFilter.setOrderByFields(defaultItemField);
|
||||||
Arrays.asList(new ItemFieldDV("Name", Arrays.asList("name"), null, true, true, true)));
|
mainTabPanel = new GeonaMainTabPanel(appManagerBus, defaultItemField, initialSortFilter);
|
||||||
|
|
||||||
displayFields = itemFields;
|
|
||||||
mainTabPanel = new GeonaMainTabPanel(appManagerBus, displayFields, sortByFields, searchByFields,
|
|
||||||
initialSortFilter);
|
|
||||||
|
|
||||||
// TWICE BECAUSE THE MAIN PANEL COULD BE NULL BEFORE
|
|
||||||
setListUseCaseDescriptors(listUCDescriptors);
|
|
||||||
|
|
||||||
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
|
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
|
||||||
mainTabPanel.addFormPanel(geoNaMainForm);
|
mainTabPanel.addFormPanel(geoNaMainForm);
|
||||||
|
|
||||||
|
@ -315,10 +324,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
private void loadGeoportalConfigs(final String scope) {
|
private void loadGeoportalConfigs(final String scope) {
|
||||||
GWT.log("loading GeoportalConfigsAndBuildCards in the scope: " + scope);
|
GWT.log("loading GeoportalConfigsAndBuildCards in the scope: " + scope);
|
||||||
//orderedCards = new ArrayList<GeoNaFormCardModel>();
|
// orderedCards = new ArrayList<GeoNaFormCardModel>();
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getListUseCaseDescriptors(null,
|
GeoportalDataEntryServiceAsync.Util.getInstance().getListUseCaseDescriptors(
|
||||||
new AsyncCallback<List<UseCaseDescriptorDV>>() {
|
ConstantsGeoPortalDataEntryApp.HANDLERS_IDS, new AsyncCallback<List<UseCaseDescriptorDV>>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -339,6 +348,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
setListUseCaseDescriptors(listUCDescriptors);
|
setListUseCaseDescriptors(listUCDescriptors);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -352,6 +362,48 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
if (mainTabPanel.getListUCDescriptors() == null) {
|
if (mainTabPanel.getListUCDescriptors() == null) {
|
||||||
mainTabPanel.setListUseCaseDescriptors(listUCDescriptors);
|
mainTabPanel.setListUseCaseDescriptors(listUCDescriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (UseCaseDescriptorDV useCaseDescriptorDV : listUCDescriptors) {
|
||||||
|
|
||||||
|
List<ConfigurationDV<?>> listConfigurations = mapHandlersForProfileId
|
||||||
|
.get(useCaseDescriptorDV.getProfileID());
|
||||||
|
if (listConfigurations == null) {
|
||||||
|
listConfigurations = new ArrayList<ConfigurationDV<?>>();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (HandlerDeclarationDV handler : useCaseDescriptorDV.getHandlers()) {
|
||||||
|
ConfigurationDV<?> config = handler.getConfiguration();
|
||||||
|
listConfigurations.add(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
mapHandlersForProfileId.put(useCaseDescriptorDV.getProfileID(), listConfigurations);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for (ItemFieldDV itemField : itemFields) {
|
||||||
|
// if (itemField.isDisplayAsResult()) {
|
||||||
|
// displayFields.add(itemField);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (itemField.isSearchable()) {
|
||||||
|
// searchByFields.add(itemField);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (itemField.isSortable()) {
|
||||||
|
// sortByFields.add(itemField);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// GWT.log("List display fields: " + itemFields);
|
||||||
|
// SearchingFilter initialSortFilter = new SearchingFilter();
|
||||||
|
// initialSortFilter.setOrder(ORDER.ASC);
|
||||||
|
// initialSortFilter.setOrderByFields(
|
||||||
|
// Arrays.asList(new ItemFieldDV("Name", Arrays.asList("name"), null, true, true, true)));
|
||||||
|
//
|
||||||
|
// displayFields = itemFields;
|
||||||
|
// mainTabPanel = new GeonaMainTabPanel(appManagerBus);
|
||||||
|
//
|
||||||
|
// mainTabPanel.setFilteringParameters(displayFields, sortByFields, searchByFields, initialSortFilter);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -384,15 +436,15 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
List<GcubeProfileDV> listGPs) {
|
List<GcubeProfileDV> listGPs) {
|
||||||
dataEntryProjectCreated = true;
|
dataEntryProjectCreated = true;
|
||||||
mainTabPanel.setLoaderVisible("Loading...", true);
|
mainTabPanel.setLoaderVisible("Loading...", true);
|
||||||
//orderedCards.clear();
|
// orderedCards.clear();
|
||||||
resetUI();
|
resetUI();
|
||||||
|
|
||||||
List<GeoNaFormCardModel> cardsPerIT = mapGcubeProfilePerItemType.get(handlerDeclarationDV.getItemType());
|
List<GeoNaFormCardModel> cardsPerIT = mapGcubeProfilePerItemType.get(handlerDeclarationDV.getItemType());
|
||||||
mainTabPanel.setPageHeader(handlerDeclarationDV);
|
mainTabPanel.setPageHeader(handlerDeclarationDV);
|
||||||
|
|
||||||
if (cardsPerIT != null) {
|
if (cardsPerIT != null) {
|
||||||
GWT.log("Profiles/Cards per Item Type are: "+cardsPerIT);
|
GWT.log("Profiles/Cards per Item Type are: " + cardsPerIT);
|
||||||
//orderedCards.addAll(cardsPerIT);
|
// orderedCards.addAll(cardsPerIT);
|
||||||
buildNewCards(profileID, handlerDeclarationDV.getItemType(), new ArrayList<GeoNaFormCardModel>(cardsPerIT));
|
buildNewCards(profileID, handlerDeclarationDV.getItemType(), new ArrayList<GeoNaFormCardModel>(cardsPerIT));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -436,8 +488,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
GWT.log("TreeMap values: " + gnaCardsModels);
|
GWT.log("TreeMap values: " + gnaCardsModels);
|
||||||
mapGcubeProfilePerItemType.put(handlerDeclarationDV.getItemType(),
|
mapGcubeProfilePerItemType.put(handlerDeclarationDV.getItemType(),
|
||||||
new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
||||||
//orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
// orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
||||||
buildNewCards(profileID, handlerDeclarationDV.getItemType(), new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
buildNewCards(profileID, handlerDeclarationDV.getItemType(),
|
||||||
|
new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,7 +560,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
private void resetUI() {
|
private void resetUI() {
|
||||||
geoNaMainForm.resetUI();
|
geoNaMainForm.resetUI();
|
||||||
//geoNaMainForm.remeTree(treeItemPanel);
|
// geoNaMainForm.remeTree(treeItemPanel);
|
||||||
mapForms.clear();
|
mapForms.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -607,8 +660,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
modalContainerPanel.add(new HTML("Record id: " + (result.getProjectID())));
|
modalContainerPanel.add(new HTML("Record id: " + (result.getProjectID())));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
savedMap.put(result.getProjectID(),
|
savedMap.put(result.getProjectID(), saveGeonaDataFormsEvent.getTreeNode());
|
||||||
saveGeonaDataFormsEvent.getTreeNode());
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO: handle exception
|
// TODO: handle exception
|
||||||
}
|
}
|
||||||
|
@ -676,10 +728,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
selectedNode = (NodeItem) selectedItem.getWidget();
|
selectedNode = (NodeItem) selectedItem.getWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
GWT.log("TreeItemEvent selected node is: "+selectedNode);
|
GWT.log("TreeItemEvent selected node is: " + selectedNode);
|
||||||
|
|
||||||
if(selectedNode.isRoot()) {
|
if (selectedNode.isRoot()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,15 +781,16 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeItem newSubTree = cloneSubTreeItems(selectedItem);
|
TreeItem newSubTree = cloneSubTreeItems(selectedItem);
|
||||||
//TO DEBUG
|
// TO DEBUG
|
||||||
//TreeVisitUtil.postOrderVisit(newSubTree);
|
// TreeVisitUtil.postOrderVisit(newSubTree);
|
||||||
TreeItem parentItem = selectedItem.getParentItem();
|
TreeItem parentItem = selectedItem.getParentItem();
|
||||||
int nextSiblingIndex = -1;
|
int nextSiblingIndex = -1;
|
||||||
if (parentItem != null) {
|
if (parentItem != null) {
|
||||||
nextSiblingIndex = parentItem.getChildIndex(selectedItem);
|
nextSiblingIndex = parentItem.getChildIndex(selectedItem);
|
||||||
nextSiblingIndex++;
|
nextSiblingIndex++;
|
||||||
}
|
}
|
||||||
geoNaMainForm.getTreeItemPanel().addChild(selectedItem.getParentItem(), nextSiblingIndex, newSubTree);
|
geoNaMainForm.getTreeItemPanel().addChild(selectedItem.getParentItem(), nextSiblingIndex,
|
||||||
|
newSubTree);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -770,9 +823,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
confirm.hide();
|
confirm.hide();
|
||||||
|
|
||||||
//TODO QUA
|
// TODO QUA
|
||||||
|
|
||||||
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
||||||
newProjectEvent.getListGcubeProfiles());
|
newProjectEvent.getListGcubeProfiles());
|
||||||
// buildNewCards(orderedCards, OPERATION.NEW);
|
// buildNewCards(orderedCards, OPERATION.NEW);
|
||||||
|
@ -784,8 +837,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
} else if (projectSavedWithSuccess) {
|
} else if (projectSavedWithSuccess) {
|
||||||
// means the project has been saved
|
// means the project has been saved
|
||||||
|
|
||||||
//TODO HERE
|
// TODO HERE
|
||||||
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
||||||
newProjectEvent.getListGcubeProfiles());
|
newProjectEvent.getListGcubeProfiles());
|
||||||
// buildNewCards(orderedCards, OPERATION.NEW);
|
// buildNewCards(orderedCards, OPERATION.NEW);
|
||||||
|
@ -799,11 +852,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
confirm.hide();
|
confirm.hide();
|
||||||
|
|
||||||
//TODO HERE
|
|
||||||
//List<GeoNaFormCardModel> cardsPerIT = mapGcubeProfilePerItemType.get(newProjectEvent.getHandler().getItemType());
|
|
||||||
|
|
||||||
|
// TODO HERE
|
||||||
|
// List<GeoNaFormCardModel> cardsPerIT =
|
||||||
|
// mapGcubeProfilePerItemType.get(newProjectEvent.getHandler().getItemType());
|
||||||
|
|
||||||
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
createNewDataEntyFor(newProjectEvent.getProfileID(), newProjectEvent.getHandler(),
|
||||||
newProjectEvent.getListGcubeProfiles());
|
newProjectEvent.getListGcubeProfiles());
|
||||||
|
|
||||||
|
@ -821,8 +874,10 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
|
public void onGetList(GetListOfRecordsEvent getListOfRecordsEvent) {
|
||||||
|
|
||||||
SearchingFilter sortFilter = getListOfRecordsEvent.getSortFilter();
|
SearchingFilter sortFilter = getListOfRecordsEvent.getSortFilter();
|
||||||
|
List<ItemFieldDV> displayFields = mainTabPanel.getDisplayFields();
|
||||||
|
|
||||||
if (sortFilter == null) {
|
if (sortFilter == null) {
|
||||||
sortFilter = mainTabPanel.getCurrentSortFilter();
|
sortFilter = mainTabPanel.getCurrentSortFilter();
|
||||||
}
|
}
|
||||||
|
@ -832,16 +887,53 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (getListOfRecordsEvent.isReloadFilteringParameters()) {
|
||||||
|
|
||||||
|
displayFields = new ArrayList<ItemFieldDV>();
|
||||||
|
List<ItemFieldDV> searchByFields = new ArrayList<ItemFieldDV>();
|
||||||
|
List<ItemFieldDV> sortByFields = new ArrayList<ItemFieldDV>();
|
||||||
|
List<ConfigurationDV<?>> config = mapHandlersForProfileId.get(getListOfRecordsEvent.getProfileID());
|
||||||
|
|
||||||
|
for (ConfigurationDV<?> configurationDV : config) {
|
||||||
|
switch (configurationDV.getConfigurationType()) {
|
||||||
|
case item_fields:
|
||||||
|
List<ItemFieldDV> listItemFields = (List<ItemFieldDV>) configurationDV.getConfiguration();
|
||||||
|
|
||||||
|
for (ItemFieldDV itemField : listItemFields) {
|
||||||
|
if (itemField.isDisplayAsResult()) {
|
||||||
|
displayFields.add(itemField);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemField.isSearchable()) {
|
||||||
|
searchByFields.add(itemField);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemField.isSortable()) {
|
||||||
|
sortByFields.add(itemField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mainTabPanel.setFilteringParameters(displayFields, sortByFields, sortByFields, sortFilter);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, sortFilter);
|
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, sortFilter);
|
||||||
|
|
||||||
mainTabPanel.showListOfConcessioniView(grpw);
|
mainTabPanel.showListOfConcessioniView(grpw);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
appManagerBus.addHandler(ActionPerformedOnItemEvent.TYPE, new ActionPerformedOnItemEventHandler() {
|
appManagerBus.addHandler(ActionPerformedOnItemEvent.TYPE, new ActionPerformedOnItemEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends RecordDV> void onDoActionPerformedFired(
|
public <T extends DocumentDV> void onDoActionPerformedFired(
|
||||||
ActionPerformedOnItemEvent<T> actionPerformedOnItemEvent) {
|
ActionPerformedOnItemEvent<T> actionPerformedOnItemEvent) {
|
||||||
if (actionPerformedOnItemEvent != null) {
|
if (actionPerformedOnItemEvent != null) {
|
||||||
|
|
||||||
|
@ -864,14 +956,17 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item instanceof ConcessioneDV) {
|
if (item instanceof DocumentDV) {
|
||||||
final ConcessioneDV concessione = (ConcessioneDV) item;
|
final DocumentDV concessione = (DocumentDV) item;
|
||||||
GWT.log("onDoActionPerformedFired item: " + concessione);
|
GWT.log("onDoActionPerformedFired item: " + concessione);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case UPDATED_PROJECT:
|
case UPDATED_PROJECT:
|
||||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
// appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
actionPerformedOnItemEvent.getProfileID(), null,
|
// actionPerformedOnItemEvent.getProfileID(), null,
|
||||||
mainTabPanel.getCurrentSortFilter()));
|
// mainTabPanel.getCurrentSortFilter()));
|
||||||
|
|
||||||
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(null, grpw.getProfileID(),
|
||||||
|
mainTabPanel.getCurrentSortFilter(), false));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -883,7 +978,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
appManagerBus.addHandler(ActionOnItemEvent.TYPE, new ActionOnItemEventHandler() {
|
appManagerBus.addHandler(ActionOnItemEvent.TYPE, new ActionOnItemEventHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T extends RecordDV> void onDoActionFired(ActionOnItemEvent<T> showItemEvent) {
|
public <T extends DocumentDV> void onDoActionFired(ActionOnItemEvent<T> showItemEvent) {
|
||||||
|
|
||||||
GWT.log("Fired event: " + showItemEvent);
|
GWT.log("Fired event: " + showItemEvent);
|
||||||
|
|
||||||
|
@ -910,182 +1005,192 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
if (item == null)
|
if (item == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item instanceof ConcessioneDV) {
|
if (item instanceof DocumentDV) {
|
||||||
|
|
||||||
|
|
||||||
|
Window.alert("ACTION MUST BE REVISITED");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final ConcessioneDV concessione = (ConcessioneDV) item;
|
// final DocumentDV concessione = (DocumentDV) item;
|
||||||
GWT.log("onDoActionFired item: " + concessione);
|
// GWT.log("onDoActionFired item: " + concessione);
|
||||||
|
//
|
||||||
// Checking if the user is NOT authorized to perform this action in two ways:
|
// // Checking if the user is NOT authorized to perform this action in two ways:
|
||||||
// 1. the map of actions allowed for the user does not contain the action;
|
// // 1. the map of actions allowed for the user does not contain the action;
|
||||||
RoleRights roleRights = myRights.getRoleRights();
|
// RoleRights roleRights = myRights.getRoleRights();
|
||||||
OPERATION_TYPE operationType = roleRights.getListPermessions().get(action);
|
// OPERATION_TYPE operationType = roleRights.getListPermessions().get(action);
|
||||||
boolean allowedOperationForUser = operationType != null ? true : false;
|
// boolean allowedOperationForUser = operationType != null ? true : false;
|
||||||
if (!allowedOperationForUser) {
|
// if (!allowedOperationForUser) {
|
||||||
|
//
|
||||||
String msg = "You are not authorized to perform the action: " + action.getLabel();
|
// String msg = "You are not authorized to perform the action: " + action.getLabel();
|
||||||
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
// ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
||||||
"Forbidden: " + action, msg, AlertType.WARNING);
|
// "Forbidden: " + action, msg, AlertType.WARNING);
|
||||||
modalW.show();
|
// modalW.show();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
// 2. the user cannot access to action (e.g. the user cannot write an item of
|
// // 2. the user cannot access to action (e.g. the user cannot write an item of
|
||||||
// another user)
|
// // another user)
|
||||||
// if so an error is shown
|
// // if so an error is shown
|
||||||
GcubeUserRole userRole = myRights.getRoleRights().getUserRole();
|
// GcubeUserRole userRole = myRights.getRoleRights().getUserRole();
|
||||||
boolean allowedWriteActionOnItem = checkAccessToOperationType(userRole, operationType,
|
// boolean allowedWriteActionOnItem = checkAccessToOperationType(userRole, operationType,
|
||||||
concessione);
|
// concessione);
|
||||||
if (!allowedWriteActionOnItem) {
|
// if (!allowedWriteActionOnItem) {
|
||||||
String title = "Forbidden: missing write access";
|
// String title = "Forbidden: missing write access";
|
||||||
String msg = "You do not have write access to item: " + concessione.getNome();
|
// String msg = "You do not have write access to item: " + concessione.getNome();
|
||||||
if (!userRole.isWriteOwn()) {
|
// if (!userRole.isWriteOwn()) {
|
||||||
msg = "You do not have write access to item: " + concessione.getNome();
|
// msg = "You do not have write access to item: " + concessione.getNome();
|
||||||
} else if (!userRole.isWriteAny()) {
|
// } else if (!userRole.isWriteAny()) {
|
||||||
title = "Forbidden: missing ownership";
|
// title = "Forbidden: missing ownership";
|
||||||
msg = "You are not the creator of: " + concessione.getNome()
|
// msg = "You are not the creator of: " + concessione.getNome()
|
||||||
+ ". You cannot access to it";
|
// + ". You cannot access to it";
|
||||||
}
|
// }
|
||||||
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()), title, msg,
|
// ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()), title, msg,
|
||||||
AlertType.WARNING);
|
// AlertType.WARNING);
|
||||||
modalW.show();
|
// modalW.show();
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
switch (action) {
|
// switch (action) {
|
||||||
case VIEW_ON_MAP:
|
// case VIEW_ON_MAP:
|
||||||
final Modal modal = new Modal(true, true);
|
// final Modal modal = new Modal(true, true);
|
||||||
modal.setCloseVisible(true);
|
// modal.setCloseVisible(true);
|
||||||
final HorizontalPanel hpGetLink = new HorizontalPanel();
|
// final HorizontalPanel hpGetLink = new HorizontalPanel();
|
||||||
final LoaderIcon lc = new LoaderIcon("Just moment getting link...");
|
// final LoaderIcon lc = new LoaderIcon("Just moment getting link...");
|
||||||
hpGetLink.add(lc);
|
// hpGetLink.add(lc);
|
||||||
modal.add(hpGetLink);
|
// modal.add(hpGetLink);
|
||||||
|
//
|
||||||
final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", "");
|
// final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", "");
|
||||||
|
//
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(concessione.getItemId(),
|
// GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(concessione.getItemId(),
|
||||||
showItemEvent.getProfileID(), new AsyncCallback<GeoNaItemRef>() {
|
// showItemEvent.getProfileID(), new AsyncCallback<GeoNaItemRef>() {
|
||||||
@Override
|
// @Override
|
||||||
public void onFailure(Throwable caught) {
|
// public void onFailure(Throwable caught) {
|
||||||
hpGetLink.clear();
|
// hpGetLink.clear();
|
||||||
Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
|
// Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
|
||||||
alert.setClose(false);
|
// alert.setClose(false);
|
||||||
hpGetLink.add(alert);
|
// hpGetLink.add(alert);
|
||||||
newBrowserWindow.close();
|
// newBrowserWindow.close();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void onSuccess(GeoNaItemRef result) {
|
// public void onSuccess(GeoNaItemRef result) {
|
||||||
String theURL = result.getRestrictedLink().getShortURL() != null
|
// String theURL = result.getRestrictedLink().getShortURL() != null
|
||||||
? result.getRestrictedLink().getShortURL()
|
// ? result.getRestrictedLink().getShortURL()
|
||||||
: result.getRestrictedLink().getCompleteURL();
|
// : result.getRestrictedLink().getCompleteURL();
|
||||||
newBrowserWindow.setUrl(theURL);
|
// newBrowserWindow.setUrl(theURL);
|
||||||
modal.hide();
|
// modal.hide();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
modal.show();
|
// modal.show();
|
||||||
|
//
|
||||||
break;
|
|
||||||
|
|
||||||
case VIEW_REPORT:
|
|
||||||
|
|
||||||
final Modal modal2 = new Modal(true, true);
|
|
||||||
modal2.setTitle(
|
|
||||||
"<span style='font-size:20px;'>Report: <span style='color:#555; font-size:20px;'>"
|
|
||||||
+ concessione.getNome() + "</span></span>");
|
|
||||||
modal2.setWidth(800);
|
|
||||||
modal2.setCloseVisible(true);
|
|
||||||
if (concessione.getValidationReport() == null) {
|
|
||||||
modal2.add(new HTML("No report available for: " + concessione.getNome()));
|
|
||||||
} else {
|
|
||||||
BuildValidationReport buildValidationReport = new BuildValidationReport(
|
|
||||||
concessione.getValidationReport());
|
|
||||||
modal2.add(buildValidationReport);
|
|
||||||
}
|
|
||||||
modal2.show();
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case EDIT_PROJECT:
|
|
||||||
final Modal modal3 = new Modal(true, true);
|
|
||||||
modal3.setTitle(
|
|
||||||
"<span style='font-size:20px;'>Edit: <span style='color:#555; font-size:20px;'>"
|
|
||||||
+ concessione.getNome() + "</span></span>");
|
|
||||||
modal3.setWidth(950);
|
|
||||||
modal3.setHeight("700px");
|
|
||||||
modal3.setCloseVisible(true);
|
|
||||||
((Element) modal3.getElement().getChildNodes().getItem(1))
|
|
||||||
.addClassName("modal-body-custom");
|
|
||||||
EditModeRecord emr = new EditModeRecord(appManagerBus, concessione,
|
|
||||||
RECORD_TYPE.CONCESSIONE);
|
|
||||||
modal3.add(emr);
|
|
||||||
modal3.show();
|
|
||||||
break;
|
|
||||||
|
|
||||||
// case UPDATED_PROJECT:
|
|
||||||
// appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
|
||||||
// mainTabPanel.getCurrentSortFilter()));
|
|
||||||
// break;
|
// break;
|
||||||
case DELETE_PROJECT:
|
//
|
||||||
|
// case VIEW_REPORT:
|
||||||
String htmlMsg = "Going to delete the project with:";
|
//
|
||||||
htmlMsg += "<ul>";
|
// final Modal modal2 = new Modal(true, true);
|
||||||
htmlMsg += "<li>id: " + concessione.getItemId() + "</li>";
|
// modal2.setTitle(
|
||||||
htmlMsg += "<li>name: " + concessione.getNome() + "</li>";
|
// "<span style='font-size:20px;'>Report: <span style='color:#555; font-size:20px;'>"
|
||||||
htmlMsg += "</ul>";
|
// + concessione.getNome() + "</span></span>");
|
||||||
htmlMsg += "<br>";
|
// modal2.setWidth(800);
|
||||||
htmlMsg += "This operation cannot be undone. Would you like to proceed?";
|
// modal2.setCloseVisible(true);
|
||||||
|
// if (concessione.getValidationReport() == null) {
|
||||||
final DialogConfirm dialog = new DialogConfirm(null, "Delete Confirm?", htmlMsg);
|
// modal2.add(new HTML("No report available for: " + concessione.getNome()));
|
||||||
dialog.center();
|
// } else {
|
||||||
|
// BuildValidationReport buildValidationReport = new BuildValidationReport(
|
||||||
dialog.getYesButton().addClickHandler(new ClickHandler() {
|
// concessione.getValidationReport());
|
||||||
|
// modal2.add(buildValidationReport);
|
||||||
@Override
|
// }
|
||||||
public void onClick(ClickEvent event) {
|
// modal2.show();
|
||||||
dialog.hide();
|
//
|
||||||
final Modal modal = new Modal(true, true);
|
// break;
|
||||||
modal.setCloseVisible(true);
|
//
|
||||||
final HorizontalPanel hp = new HorizontalPanel();
|
// case EDIT_PROJECT:
|
||||||
final LoaderIcon lc = new LoaderIcon("Deleting Project...");
|
// final Modal modal3 = new Modal(true, true);
|
||||||
hp.add(lc);
|
// modal3.setTitle(
|
||||||
modal.add(hp);
|
// "<span style='font-size:20px;'>Edit: <span style='color:#555; font-size:20px;'>"
|
||||||
|
// + concessione.getNome() + "</span></span>");
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().deleteRecord(
|
// modal3.setWidth(950);
|
||||||
concessione.getItemId(), RECORD_TYPE.CONCESSIONE,
|
// modal3.setHeight("700px");
|
||||||
new AsyncCallback<Boolean>() {
|
// modal3.setCloseVisible(true);
|
||||||
|
// ((Element) modal3.getElement().getChildNodes().getItem(1))
|
||||||
@Override
|
// .addClassName("modal-body-custom");
|
||||||
public void onFailure(Throwable caught) {
|
// EditModeRecord emr = new EditModeRecord(appManagerBus, concessione,
|
||||||
hp.clear();
|
// RECORD_TYPE.CONCESSIONE);
|
||||||
Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
|
// modal3.add(emr);
|
||||||
alert.setClose(false);
|
// modal3.show();
|
||||||
hp.add(alert);
|
// break;
|
||||||
|
//
|
||||||
}
|
//// case UPDATED_PROJECT:
|
||||||
|
//// appManagerBus.fireEvent(new GetListOfRecordsEvent(RECORD_TYPE.CONCESSIONE,
|
||||||
@Override
|
//// mainTabPanel.getCurrentSortFilter()));
|
||||||
public void onSuccess(Boolean result) {
|
//// break;
|
||||||
if (result) {
|
// case DELETE_PROJECT:
|
||||||
hp.clear();
|
//
|
||||||
Alert alert = new Alert("Project '" + concessione.getNome()
|
// String htmlMsg = "Going to delete the project with:";
|
||||||
+ "' deleted correclty", AlertType.INFO);
|
// htmlMsg += "<ul>";
|
||||||
alert.setClose(false);
|
// htmlMsg += "<li>id: " + concessione.getItemId() + "</li>";
|
||||||
hp.add(alert);
|
// htmlMsg += "<li>name: " + concessione.getNome() + "</li>";
|
||||||
|
// htmlMsg += "</ul>";
|
||||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(
|
// htmlMsg += "<br>";
|
||||||
RECORD_TYPE.CONCESSIONE, grpw.getProfileID(), null,
|
// htmlMsg += "This operation cannot be undone. Would you like to proceed?";
|
||||||
mainTabPanel.getCurrentSortFilter()));
|
//
|
||||||
}
|
// final DialogConfirm dialog = new DialogConfirm(null, "Delete Confirm?", htmlMsg);
|
||||||
|
// dialog.center();
|
||||||
}
|
//
|
||||||
});
|
// dialog.getYesButton().addClickHandler(new ClickHandler() {
|
||||||
modal.show();
|
//
|
||||||
}
|
// @Override
|
||||||
});
|
// public void onClick(ClickEvent event) {
|
||||||
|
// dialog.hide();
|
||||||
default:
|
// final Modal modal = new Modal(true, true);
|
||||||
break;
|
// modal.setCloseVisible(true);
|
||||||
}
|
// final HorizontalPanel hp = new HorizontalPanel();
|
||||||
|
// final LoaderIcon lc = new LoaderIcon("Deleting Project...");
|
||||||
|
// hp.add(lc);
|
||||||
|
// modal.add(hp);
|
||||||
|
//
|
||||||
|
// GeoportalDataEntryServiceAsync.Util.getInstance().deleteRecord(
|
||||||
|
// concessione.getItemId(), RECORD_TYPE.CONCESSIONE,
|
||||||
|
// new AsyncCallback<Boolean>() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(Throwable caught) {
|
||||||
|
// hp.clear();
|
||||||
|
// Alert alert = new Alert(caught.getMessage(), AlertType.ERROR);
|
||||||
|
// alert.setClose(false);
|
||||||
|
// hp.add(alert);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Boolean result) {
|
||||||
|
// if (result) {
|
||||||
|
// hp.clear();
|
||||||
|
// Alert alert = new Alert("Project '" + concessione.getNome()
|
||||||
|
// + "' deleted correclty", AlertType.INFO);
|
||||||
|
// alert.setClose(false);
|
||||||
|
// hp.add(alert);
|
||||||
|
//
|
||||||
|
// appManagerBus.fireEvent(
|
||||||
|
// new GetListOfRecordsEvent(null, grpw.getProfileID(),
|
||||||
|
// mainTabPanel.getCurrentSortFilter(), false));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// modal.show();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
|
import org.gcube.application.geoportalcommon.shared.config.ACTION_ON_ITEM;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
@ -15,7 +16,7 @@ import com.google.gwt.event.shared.GwtEvent;
|
||||||
* Sep 15, 2021
|
* Sep 15, 2021
|
||||||
* @param <T> the generic type
|
* @param <T> the generic type
|
||||||
*/
|
*/
|
||||||
public class ActionOnItemEvent<T extends RecordDV> extends GwtEvent<ActionOnItemEventHandler> {
|
public class ActionOnItemEvent<T extends DocumentDV> extends GwtEvent<ActionOnItemEventHandler> {
|
||||||
public static Type<ActionOnItemEventHandler> TYPE = new Type<ActionOnItemEventHandler>();
|
public static Type<ActionOnItemEventHandler> TYPE = new Type<ActionOnItemEventHandler>();
|
||||||
private List<T> selectItems;
|
private List<T> selectItems;
|
||||||
private ACTION_ON_ITEM action;
|
private ACTION_ON_ITEM action;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
@ -19,5 +19,5 @@ public interface ActionOnItemEventHandler extends EventHandler {
|
||||||
* @param <T> the generic type
|
* @param <T> the generic type
|
||||||
* @param showItemEvent the show item event
|
* @param showItemEvent the show item event
|
||||||
*/
|
*/
|
||||||
<T extends RecordDV> void onDoActionFired(ActionOnItemEvent<T> showItemEvent);
|
<T extends DocumentDV> void onDoActionFired(ActionOnItemEvent<T> showItemEvent);
|
||||||
}
|
}
|
|
@ -2,7 +2,7 @@ package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
@ -15,7 +15,7 @@ import com.google.gwt.event.shared.GwtEvent;
|
||||||
* Sep 15, 2021
|
* Sep 15, 2021
|
||||||
* @param <T> the generic type
|
* @param <T> the generic type
|
||||||
*/
|
*/
|
||||||
public class ActionPerformedOnItemEvent<T extends RecordDV> extends GwtEvent<ActionPerformedOnItemEventHandler> {
|
public class ActionPerformedOnItemEvent<T extends DocumentDV> extends GwtEvent<ActionPerformedOnItemEventHandler> {
|
||||||
public static Type<ActionPerformedOnItemEventHandler> TYPE = new Type<ActionPerformedOnItemEventHandler>();
|
public static Type<ActionPerformedOnItemEventHandler> TYPE = new Type<ActionPerformedOnItemEventHandler>();
|
||||||
private List<T> selectItems;
|
private List<T> selectItems;
|
||||||
private ACTION_PERFORMED_ON_ITEM action;
|
private ACTION_PERFORMED_ON_ITEM action;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.EventHandler;
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
@ -20,5 +20,5 @@ public interface ActionPerformedOnItemEventHandler extends EventHandler {
|
||||||
*
|
*
|
||||||
* @param actionPerformedOnItemEvent the action performed on item event
|
* @param actionPerformedOnItemEvent the action performed on item event
|
||||||
*/
|
*/
|
||||||
<T extends RecordDV> void onDoActionPerformedFired(ActionPerformedOnItemEvent<T> actionPerformedOnItemEvent);
|
<T extends DocumentDV> void onDoActionPerformedFired(ActionPerformedOnItemEvent<T> actionPerformedOnItemEvent);
|
||||||
}
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
|
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
@ -17,24 +15,25 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
|
|
||||||
/** The type. */
|
/** The type. */
|
||||||
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
|
public static Type<GetListOfRecordsEventHandler> TYPE = new Type<GetListOfRecordsEventHandler>();
|
||||||
private RECORD_TYPE recordType;
|
|
||||||
private SearchingFilter sortFilter;
|
private SearchingFilter sortFilter;
|
||||||
private String profileID;
|
private String profileID;
|
||||||
private String profileName;
|
private String projectName;
|
||||||
|
private Boolean reloadFilteringParameters = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new cancel upload event.
|
* Instantiates a new cancel upload event.
|
||||||
*
|
*
|
||||||
* @param recordType the record type
|
* @param projectName the project name
|
||||||
* @param theUseCaseDesc the the use case desc
|
* @param profileID the profile ID
|
||||||
* @param sortFilter the sort filter
|
* @param sortFilter the sort filter
|
||||||
|
* @param reloadFilteringParameters the reload filtering parameters
|
||||||
*/
|
*/
|
||||||
public GetListOfRecordsEvent(ConstantsGeoPortalDataEntryApp.RECORD_TYPE recordType, String profileID,
|
public GetListOfRecordsEvent(String projectName, String profileID, SearchingFilter sortFilter,
|
||||||
String profileName, SearchingFilter sortFilter) {
|
Boolean reloadFilteringParameters) {
|
||||||
this.recordType = recordType;
|
|
||||||
this.sortFilter = sortFilter;
|
this.sortFilter = sortFilter;
|
||||||
this.profileID = profileID;
|
this.profileID = profileID;
|
||||||
this.profileName = profileName;
|
this.projectName = projectName;
|
||||||
|
this.reloadFilteringParameters = reloadFilteringParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,15 +68,6 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
handler.onGetList(this);
|
handler.onGetList(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the record type.
|
|
||||||
*
|
|
||||||
* @return the record type
|
|
||||||
*/
|
|
||||||
public RECORD_TYPE getRecordType() {
|
|
||||||
return recordType;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the sort filter.
|
* Gets the sort filter.
|
||||||
*
|
*
|
||||||
|
@ -87,12 +77,31 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
||||||
return sortFilter;
|
return sortFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the profile ID.
|
||||||
|
*
|
||||||
|
* @return the profile ID
|
||||||
|
*/
|
||||||
public String getProfileID() {
|
public String getProfileID() {
|
||||||
return profileID;
|
return profileID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getProfileName() {
|
/**
|
||||||
return profileName;
|
* Gets the project name.
|
||||||
|
*
|
||||||
|
* @return the project name
|
||||||
|
*/
|
||||||
|
public String getProjectName() {
|
||||||
|
return projectName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the reload filtering parameters.
|
||||||
|
*
|
||||||
|
* @return the reload filtering parameters
|
||||||
|
*/
|
||||||
|
public boolean isReloadFilteringParameters() {
|
||||||
|
return reloadFilteringParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.gcube.application.geoportalcommon.shared.SearchingFilter.LOGICAL_OP;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
|
||||||
import org.gcube.application.geoportalcommon.shared.WhereClause;
|
import org.gcube.application.geoportalcommon.shared.WhereClause;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
|
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
||||||
|
@ -17,9 +18,11 @@ import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfil
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.UCD_Util;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
import com.github.gwtbootstrap.client.ui.Alert;
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
|
@ -144,6 +147,9 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Dropdown ddCreateNewProject;
|
Dropdown ddCreateNewProject;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
Dropdown ddProjectType;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
PageHeader pageHeaderDataEntry;
|
PageHeader pageHeaderDataEntry;
|
||||||
|
|
||||||
|
@ -168,35 +174,50 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
* Instantiates a new geona main tab panel.
|
* Instantiates a new geona main tab panel.
|
||||||
*
|
*
|
||||||
* @param appManagerBus the first name
|
* @param appManagerBus the first name
|
||||||
* @param sortByFields the sort by fields
|
|
||||||
* @param initialSortFilter
|
* @param initialSortFilter
|
||||||
|
* @param defaultItemField
|
||||||
*/
|
*/
|
||||||
public GeonaMainTabPanel(HandlerManager appManagerBus, List<ItemFieldDV> displayFields,
|
public GeonaMainTabPanel(HandlerManager appManagerBus, List<ItemFieldDV> defaultItemField,
|
||||||
List<ItemFieldDV> sortByFields, List<ItemFieldDV> searchForFields, SearchingFilter initialSortFilter) {
|
SearchingFilter initialSortFilter) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.appManagerBus = appManagerBus;
|
this.appManagerBus = appManagerBus;
|
||||||
this.sortByFields = sortByFields;
|
setFilteringParameters(defaultItemField, defaultItemField, defaultItemField, initialSortFilter);
|
||||||
this.displayFields = displayFields;
|
|
||||||
this.currentSortFilter = initialSortFilter;
|
|
||||||
this.searchForFields = searchForFields;
|
|
||||||
|
|
||||||
alertSortBy.setType(AlertType.INFO);
|
alertSortBy.setType(AlertType.INFO);
|
||||||
alertSortBy.setClose(false);
|
alertSortBy.setClose(false);
|
||||||
|
|
||||||
alertSearchFor.setType(AlertType.INFO);
|
alertSearchFor.setType(AlertType.INFO);
|
||||||
alertSearchFor.setClose(false);
|
alertSearchFor.setClose(false);
|
||||||
|
|
||||||
alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
|
||||||
alertSortBy.setText(toLabelFilter((initialSortFilter.getOrderByFields().get(0)), initialSortFilter.getOrder()));
|
|
||||||
|
|
||||||
//pageHeaderDataEntry.setHeight("25px");
|
|
||||||
bindEvents();
|
bindEvents();
|
||||||
resetSearch.setIconSize(IconSize.TWO_TIMES);
|
resetSearch.setIconSize(IconSize.TWO_TIMES);
|
||||||
resetSearch.setType(ButtonType.LINK);
|
resetSearch.setType(ButtonType.LINK);
|
||||||
|
|
||||||
setLoaderVisible("", false);
|
setLoaderVisible("", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the filtering parameters.
|
||||||
|
*
|
||||||
|
* @param displayFields the display fields
|
||||||
|
* @param sortByFields the sort by fields
|
||||||
|
* @param searchForFields the search for fields
|
||||||
|
* @param initialSortFilter the initial sort filter
|
||||||
|
*/
|
||||||
|
public void setFilteringParameters(List<ItemFieldDV> displayFields, List<ItemFieldDV> sortByFields,
|
||||||
|
List<ItemFieldDV> searchForFields, SearchingFilter initialSortFilter) {
|
||||||
|
this.displayFields = displayFields;
|
||||||
|
this.sortByFields = sortByFields;
|
||||||
|
this.currentSortFilter = initialSortFilter;
|
||||||
|
this.searchForFields = searchForFields;
|
||||||
|
|
||||||
|
alertSearchFor.setText(searchForFields.get(0).getDisplayName());
|
||||||
|
alertSortBy.setText(toLabelFilter((initialSortFilter.getOrderByFields().get(0)), initialSortFilter.getOrder()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the internal height.
|
||||||
|
*
|
||||||
|
* @param height the new internal height
|
||||||
|
*/
|
||||||
public void setInternalHeight(int height) {
|
public void setInternalHeight(int height) {
|
||||||
contTabNewProject.asWidget().setHeight(height + "px");
|
contTabNewProject.asWidget().setHeight(height + "px");
|
||||||
contTabGetListOfProjects.asWidget().setHeight(height + "px");
|
contTabGetListOfProjects.asWidget().setHeight(height + "px");
|
||||||
|
@ -303,7 +324,7 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
List<ConcessioneDV> listConcessioni = null;
|
List<DocumentDV> listConcessioni = null;
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
if (grpw != null && grpw.getSelectItems() != null) {
|
||||||
listConcessioni = grpw.getSelectItems();
|
listConcessioni = grpw.getSelectItems();
|
||||||
}
|
}
|
||||||
|
@ -322,7 +343,7 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
List<ConcessioneDV> listConcessioni = null;
|
List<DocumentDV> listConcessioni = null;
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
if (grpw != null && grpw.getSelectItems() != null) {
|
||||||
listConcessioni = grpw.getSelectItems();
|
listConcessioni = grpw.getSelectItems();
|
||||||
}
|
}
|
||||||
|
@ -341,7 +362,7 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
List<ConcessioneDV> listConcessioni = null;
|
List<DocumentDV> listConcessioni = null;
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
if (grpw != null && grpw.getSelectItems() != null) {
|
||||||
listConcessioni = grpw.getSelectItems();
|
listConcessioni = grpw.getSelectItems();
|
||||||
}
|
}
|
||||||
|
@ -360,7 +381,7 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
List<ConcessioneDV> listConcessioni = null;
|
List<DocumentDV> listConcessioni = null;
|
||||||
if (grpw != null && grpw.getSelectItems() != null) {
|
if (grpw != null && grpw.getSelectItems() != null) {
|
||||||
listConcessioni = grpw.getSelectItems();
|
listConcessioni = grpw.getSelectItems();
|
||||||
}
|
}
|
||||||
|
@ -402,10 +423,18 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the role label.
|
||||||
|
*
|
||||||
|
* @param msg the new role label
|
||||||
|
*/
|
||||||
public void setRoleLabel(String msg) {
|
public void setRoleLabel(String msg) {
|
||||||
roleLabel.setText(msg);
|
roleLabel.setText(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do search event.
|
||||||
|
*/
|
||||||
private void doSearchEvent() {
|
private void doSearchEvent() {
|
||||||
String searchText = searchField.getText();
|
String searchText = searchField.getText();
|
||||||
if (searchText.length() < MIN_LENGHT_SERCHING_STRING) {
|
if (searchText.length() < MIN_LENGHT_SERCHING_STRING) {
|
||||||
|
@ -422,6 +451,13 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To label filter.
|
||||||
|
*
|
||||||
|
* @param itemField the item field
|
||||||
|
* @param direction the direction
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
private String toLabelFilter(ItemFieldDV itemField, ORDER direction) {
|
private String toLabelFilter(ItemFieldDV itemField, ORDER direction) {
|
||||||
String labelFilter = itemField.getDisplayName() + LABEL_FILTER_SEPARATOR + direction.name();
|
String labelFilter = itemField.getDisplayName() + LABEL_FILTER_SEPARATOR + direction.name();
|
||||||
return labelFilter;
|
return labelFilter;
|
||||||
|
@ -461,6 +497,12 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
loader.setVisible(visible);
|
loader.setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To sort filter.
|
||||||
|
*
|
||||||
|
* @param labelFilter the label filter
|
||||||
|
* @return the searching filter
|
||||||
|
*/
|
||||||
public SearchingFilter toSortFilter(String labelFilter) {
|
public SearchingFilter toSortFilter(String labelFilter) {
|
||||||
GWT.log("toSortFilter for label " + labelFilter);
|
GWT.log("toSortFilter for label " + labelFilter);
|
||||||
String[] array = labelFilter.split(LABEL_FILTER_SEPARATOR);
|
String[] array = labelFilter.split(LABEL_FILTER_SEPARATOR);
|
||||||
|
@ -484,6 +526,11 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Built searching filter.
|
||||||
|
*
|
||||||
|
* @return the searching filter
|
||||||
|
*/
|
||||||
private SearchingFilter builtSearchingFilter() {
|
private SearchingFilter builtSearchingFilter() {
|
||||||
SearchingFilter searchingFilter = toSortFilter(alertSortBy.getText());
|
SearchingFilter searchingFilter = toSortFilter(alertSortBy.getText());
|
||||||
String searchText = searchField.getText();
|
String searchText = searchField.getText();
|
||||||
|
@ -507,16 +554,31 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
return searchingFilter;
|
return searchingFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current sort filter.
|
||||||
|
*
|
||||||
|
* @return the current sort filter
|
||||||
|
*/
|
||||||
public SearchingFilter getCurrentSortFilter() {
|
public SearchingFilter getCurrentSortFilter() {
|
||||||
currentSortFilter = builtSearchingFilter();
|
currentSortFilter = builtSearchingFilter();
|
||||||
GWT.log("currentSortFilter: " + currentSortFilter);
|
GWT.log("currentSortFilter: " + currentSortFilter);
|
||||||
return currentSortFilter;
|
return currentSortFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the tab.
|
||||||
|
*
|
||||||
|
* @param index the index
|
||||||
|
*/
|
||||||
public void removeTab(int index) {
|
public void removeTab(int index) {
|
||||||
tabPanel.remove(index);
|
tabPanel.remove(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the tab active.
|
||||||
|
*
|
||||||
|
* @param index the new tab active
|
||||||
|
*/
|
||||||
public void setTabActive(int index) {
|
public void setTabActive(int index) {
|
||||||
tabPanel.selectTab(index);
|
tabPanel.selectTab(index);
|
||||||
}
|
}
|
||||||
|
@ -534,6 +596,11 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the list use case descriptors.
|
||||||
|
*
|
||||||
|
* @param listUCDescriptors the new list use case descriptors
|
||||||
|
*/
|
||||||
public void setListUseCaseDescriptors(List<UseCaseDescriptorDV> listUCDescriptors) {
|
public void setListUseCaseDescriptors(List<UseCaseDescriptorDV> listUCDescriptors) {
|
||||||
GWT.log("Setting listUCDescriptors: " + listUCDescriptors);
|
GWT.log("Setting listUCDescriptors: " + listUCDescriptors);
|
||||||
this.listUCDescriptors = listUCDescriptors;
|
this.listUCDescriptors = listUCDescriptors;
|
||||||
|
@ -541,7 +608,8 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
for (final UseCaseDescriptorDV ucd : listUCDescriptors) {
|
for (final UseCaseDescriptorDV ucd : listUCDescriptors) {
|
||||||
|
|
||||||
HandlerDeclarationDV dataEntryHandler = getDataEntryHandler(ucd);
|
HandlerDeclarationDV dataEntryHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
||||||
|
GEOPORTAL_DATA_HANDLER.geoportal_data_entry);
|
||||||
|
|
||||||
if (dataEntryHandler != null) {
|
if (dataEntryHandler != null) {
|
||||||
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
||||||
|
@ -568,6 +636,26 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
});
|
});
|
||||||
|
|
||||||
ddCreateNewProject.add(link);
|
ddCreateNewProject.add(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Setting Project type having HANDLER DATA LIST
|
||||||
|
HandlerDeclarationDV dataListHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
||||||
|
GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
||||||
|
|
||||||
|
if (dataListHandler != null) {
|
||||||
|
|
||||||
|
NavLink link = new NavLink(ucd.getName());
|
||||||
|
link.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
|
appManagerBus.fireEvent(new GetListOfRecordsEvent(ucd.getName(), ucd.getProfileID(),
|
||||||
|
getCurrentSortFilter(), true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ddProjectType.add(link);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -581,7 +669,8 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
public void execute() {
|
public void execute() {
|
||||||
GWT.log("One Config loaded. Firing CreateNewProjectEvent");
|
GWT.log("One Config loaded. Firing CreateNewProjectEvent");
|
||||||
UseCaseDescriptorDV useCaseDescriptor = listUCDescriptors.get(0);
|
UseCaseDescriptorDV useCaseDescriptor = listUCDescriptors.get(0);
|
||||||
HandlerDeclarationDV dataEntryHandler = getDataEntryHandler(useCaseDescriptor);
|
HandlerDeclarationDV dataEntryHandler = UCD_Util.getHandlerDeclarationFor(useCaseDescriptor,
|
||||||
|
GEOPORTAL_DATA_HANDLER.geoportal_data_entry);
|
||||||
if (dataEntryHandler != null) {
|
if (dataEntryHandler != null) {
|
||||||
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
ConfigurationDV<?> config = dataEntryHandler.getConfiguration();
|
||||||
List<GcubeProfileDV> listGcubeProfiles = toListGcubeProfiles(config);
|
List<GcubeProfileDV> listGcubeProfiles = toListGcubeProfiles(config);
|
||||||
|
@ -596,21 +685,12 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private HandlerDeclarationDV getDataEntryHandler(UseCaseDescriptorDV useCaseDescriptor) {
|
/**
|
||||||
|
* To list gcube profiles.
|
||||||
for (HandlerDeclarationDV handler : useCaseDescriptor.getHandlers()) {
|
*
|
||||||
GEOPORTAL_DATA_HANDLER dataHandlerType = handler.getDataHandlerType();
|
* @param config the config
|
||||||
|
* @return the list
|
||||||
// Checking if the handler if of geoportal_data_entry type
|
*/
|
||||||
if (dataHandlerType != null
|
|
||||||
&& dataHandlerType.getType().equals(GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getType())) {
|
|
||||||
return handler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<GcubeProfileDV> toListGcubeProfiles(ConfigurationDV<?> config) {
|
private List<GcubeProfileDV> toListGcubeProfiles(ConfigurationDV<?> config) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -623,6 +703,29 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To list item fields.
|
||||||
|
*
|
||||||
|
* @param config the config
|
||||||
|
* @return the list
|
||||||
|
*/
|
||||||
|
private List<ItemFieldDV> toListItemFields(ConfigurationDV<?> config) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
return (List<ItemFieldDV>) config.getConfiguration();
|
||||||
|
} catch (Exception e) {
|
||||||
|
GWT.log("Error on casting " + ConfigurationDV.class.getName() + " to List of "
|
||||||
|
+ ItemFieldDV.class.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the page header.
|
||||||
|
*
|
||||||
|
* @param hDV the new page header
|
||||||
|
*/
|
||||||
public void setPageHeader(HandlerDeclarationDV hDV) {
|
public void setPageHeader(HandlerDeclarationDV hDV) {
|
||||||
introGNAHero.setVisible(false);
|
introGNAHero.setVisible(false);
|
||||||
this.pageHeaderDataEntry.setVisible(true);
|
this.pageHeaderDataEntry.setVisible(true);
|
||||||
|
@ -630,8 +733,17 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
this.pageHeaderDataEntry.setSubtext("New: " + hDV.getItemType());
|
this.pageHeaderDataEntry.setSubtext("New: " + hDV.getItemType());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the list UC descriptors.
|
||||||
|
*
|
||||||
|
* @return the list UC descriptors
|
||||||
|
*/
|
||||||
public List<UseCaseDescriptorDV> getListUCDescriptors() {
|
public List<UseCaseDescriptorDV> getListUCDescriptors() {
|
||||||
return listUCDescriptors;
|
return listUCDescriptors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ItemFieldDV> getDisplayFields() {
|
||||||
|
return displayFields;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,11 @@
|
||||||
<g:HTMLPanel ui:field="contTabGetListOfProjects">
|
<g:HTMLPanel ui:field="contTabGetListOfProjects">
|
||||||
<b:Navbar addStyleNames="nav-toolbar-style">
|
<b:Navbar addStyleNames="nav-toolbar-style">
|
||||||
<b:Brand>List of Projects</b:Brand>
|
<b:Brand>List of Projects</b:Brand>
|
||||||
|
<b:Nav>
|
||||||
|
<b:Dropdown text="Project Type"
|
||||||
|
ui:field="ddProjectType" icon="BUILDING">
|
||||||
|
</b:Dropdown>
|
||||||
|
</b:Nav>
|
||||||
<b:Nav>
|
<b:Nav>
|
||||||
<b:Dropdown text="Sort by" ui:field="dropdownSortBy">
|
<b:Dropdown text="Sort by" ui:field="dropdownSortBy">
|
||||||
</b:Dropdown>
|
</b:Dropdown>
|
||||||
|
|
|
@ -4,8 +4,8 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.SortedCellTable;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.SortedCellTable;
|
||||||
|
@ -42,8 +42,8 @@ public class GeonaRecordsPaginatedView {
|
||||||
private VerticalPanel vPanel = new VerticalPanel();
|
private VerticalPanel vPanel = new VerticalPanel();
|
||||||
private FlowPanel pagerPanel = new FlowPanel();
|
private FlowPanel pagerPanel = new FlowPanel();
|
||||||
private Boolean initClassFirstRangeChanged = false;
|
private Boolean initClassFirstRangeChanged = false;
|
||||||
private ItemsTable<ConcessioneDV> itemsTable;
|
private ItemsTable<DocumentDV> itemsTable;
|
||||||
private MyCustomDataProvider<ConcessioneDV> dataProvider = new MyCustomDataProvider<ConcessioneDV>();
|
private MyCustomDataProvider<DocumentDV> dataProvider = new MyCustomDataProvider<DocumentDV>();
|
||||||
protected Widget orginalLoadingIndicator = null;
|
protected Widget orginalLoadingIndicator = null;
|
||||||
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
|
private LoaderIcon loadingPanel = new LoaderIcon("Loading data...");
|
||||||
// private int serverStartIndex;
|
// private int serverStartIndex;
|
||||||
|
@ -65,7 +65,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
this.currentSortFilter = currentSortFilter;
|
this.currentSortFilter = currentSortFilter;
|
||||||
this.initClassFirstRangeChanged = true;
|
this.initClassFirstRangeChanged = true;
|
||||||
this.eventBus = eventbus;
|
this.eventBus = eventbus;
|
||||||
itemsTable = new ItemsTable<ConcessioneDV>(eventbus, displayFields);
|
itemsTable = new ItemsTable<DocumentDV>(eventbus, displayFields);
|
||||||
itemsTable.initTable(null, null, dataProvider);
|
itemsTable.initTable(null, null, dataProvider);
|
||||||
|
|
||||||
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
|
orginalLoadingIndicator = itemsTable.getCellTable().getLoadingIndicator();
|
||||||
|
@ -79,8 +79,8 @@ public class GeonaRecordsPaginatedView {
|
||||||
*
|
*
|
||||||
* @return the table data provider
|
* @return the table data provider
|
||||||
*/
|
*/
|
||||||
public AsyncDataProvider<ConcessioneDV> getTableDataProvider() {
|
public AsyncDataProvider<DocumentDV> getTableDataProvider() {
|
||||||
return (AsyncDataProvider<ConcessioneDV>) getCellTable().getDataProvider();
|
return (AsyncDataProvider<DocumentDV>) getCellTable().getDataProvider();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -88,7 +88,7 @@ public class GeonaRecordsPaginatedView {
|
||||||
*
|
*
|
||||||
* @return the cell tale
|
* @return the cell tale
|
||||||
*/
|
*/
|
||||||
private SortedCellTable<ConcessioneDV> getCellTable() {
|
private SortedCellTable<DocumentDV> getCellTable() {
|
||||||
return itemsTable.getCellTable();
|
return itemsTable.getCellTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,13 +158,13 @@ public class GeonaRecordsPaginatedView {
|
||||||
private void setNewPageResult(ResultSetPaginatedData result) {
|
private void setNewPageResult(ResultSetPaginatedData result) {
|
||||||
GWT.log("setNewPageResult: " + result);
|
GWT.log("setNewPageResult: " + result);
|
||||||
// serverStartIndex = result.getServerEndIndex();
|
// serverStartIndex = result.getServerEndIndex();
|
||||||
SelectionModel<? super ConcessioneDV> sm = getCellTable().getSelectionModel();
|
SelectionModel<? super DocumentDV> sm = getCellTable().getSelectionModel();
|
||||||
|
|
||||||
if (sm instanceof SingleSelectionModel) {
|
if (sm instanceof SingleSelectionModel) {
|
||||||
SingleSelectionModel<ConcessioneDV> ssm = (SingleSelectionModel<ConcessioneDV>) sm;
|
SingleSelectionModel<DocumentDV> ssm = (SingleSelectionModel<DocumentDV>) sm;
|
||||||
ssm.clear();
|
ssm.clear();
|
||||||
} else if (sm instanceof MultiSelectionModel) {
|
} else if (sm instanceof MultiSelectionModel) {
|
||||||
MultiSelectionModel<ConcessioneDV> msm = (MultiSelectionModel<ConcessioneDV>) sm;
|
MultiSelectionModel<DocumentDV> msm = (MultiSelectionModel<DocumentDV>) sm;
|
||||||
msm.clear();
|
msm.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,21 +235,22 @@ public class GeonaRecordsPaginatedView {
|
||||||
* @param limitToPage the limit to page
|
* @param limitToPage the limit to page
|
||||||
*/
|
*/
|
||||||
public void selectItems(boolean select, boolean limitToPage) {
|
public void selectItems(boolean select, boolean limitToPage) {
|
||||||
SortedCellTable<ConcessioneDV> table = getCellTable();
|
SortedCellTable<DocumentDV> table = getCellTable();
|
||||||
int rowSize = table.getVisibleItemCount();
|
int rowSize = table.getVisibleItemCount();
|
||||||
|
|
||||||
for (int i = 0; i < rowSize; i++) {
|
for (int i = 0; i < rowSize; i++) {
|
||||||
ConcessioneDV item = table.getVisibleItem(i);
|
DocumentDV item = table.getVisibleItem(i);
|
||||||
itemsTable.getSelectionModel().setSelected(item, select);
|
itemsTable.getSelectionModel().setSelected(item, select);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the select items.
|
* Gets the select items.
|
||||||
|
* @return
|
||||||
*
|
*
|
||||||
* @return the select items
|
* @return the select items
|
||||||
*/
|
*/
|
||||||
public List<ConcessioneDV> getSelectItems() {
|
public List<DocumentDV> getSelectItems() {
|
||||||
return itemsTable.getSelectedItems();
|
return itemsTable.getSelectedItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,12 @@ package org.gcube.portlets.user.geoportaldataentry.client.ui.table;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV;
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV.ValidationStatus;
|
import org.gcube.application.geoportalcommon.shared.products.model.ValidationReportDV.ValidationStatus;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.ButtonCell;
|
import com.github.gwtbootstrap.client.ui.ButtonCell;
|
||||||
|
@ -45,7 +43,7 @@ import com.google.gwt.view.client.SingleSelectionModel;
|
||||||
* Jun 15, 2021
|
* Jun 15, 2021
|
||||||
* @param <T> the generic type
|
* @param <T> the generic type
|
||||||
*/
|
*/
|
||||||
public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<T> {
|
public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T> {
|
||||||
|
|
||||||
private static final int ITEMS_PER_PAGE = 10;
|
private static final int ITEMS_PER_PAGE = 10;
|
||||||
private static final String NO_DATA = "No data";
|
private static final String NO_DATA = "No data";
|
||||||
|
@ -103,7 +101,16 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
||||||
|
|
||||||
if (object == null)
|
if (object == null)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
|
DocumentDV documentDV = (DocumentDV) object;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return documentDV.getDocumentAsMap().get(itemField.getJsonFields().get(0)).toString();
|
||||||
|
}catch (Exception e) {
|
||||||
|
GWT.log("Error e: "+e);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if (displayName.equalsIgnoreCase("Name")) {
|
if (displayName.equalsIgnoreCase("Name")) {
|
||||||
return ((ConcessioneDV) object).getNome();
|
return ((ConcessioneDV) object).getNome();
|
||||||
} else if (displayName.equalsIgnoreCase("Introduction")) {
|
} else if (displayName.equalsIgnoreCase("Introduction")) {
|
||||||
|
@ -153,7 +160,7 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
||||||
ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport();
|
ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport();
|
||||||
if (vr != null && vr.getObjectName() != null)
|
if (vr != null && vr.getObjectName() != null)
|
||||||
return vr.getObjectName();
|
return vr.getObjectName();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -199,184 +206,6 @@ public class ItemsTable<T extends ConcessioneDV> extends AbstractItemsCellTable<
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.NAME)) {
|
|
||||||
*
|
|
||||||
* // NAME name = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
* return ((ConcessioneDV) object).getNome(); }
|
|
||||||
*
|
|
||||||
* // ADDING TOOLTIP
|
|
||||||
*
|
|
||||||
* @Override public void render(com.google.gwt.cell.client.Cell.Context context,
|
|
||||||
* T object, SafeHtmlBuilder sb) { if (object == null) return;
|
|
||||||
* sb.appendHtmlConstant("<div introduction=\"" + ((ConcessioneDV)
|
|
||||||
* object).getNome() + "\">"); super.render(context, object, sb);
|
|
||||||
* sb.appendHtmlConstant("</div>"); }; };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(name, RECORD_FIELD.NAME.getDisplayName(), true);
|
|
||||||
*
|
|
||||||
* if (!isAsyncronusTable) { Comparator<T> c = new Comparator<T>() {
|
|
||||||
*
|
|
||||||
* @Override public int compare(T o1, T o2) { return ((ConcessioneDV)
|
|
||||||
* o1).getNome().compareTo(((ConcessioneDV) o2).getNome()); } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.setComparator(name, c); }
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.INTRODUCTION)) {
|
|
||||||
*
|
|
||||||
* introduction = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
* return ((ConcessioneDV) object).getIntroduzione() != null ? ((ConcessioneDV)
|
|
||||||
* object).getIntroduzione() : ""; } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(introduction,
|
|
||||||
* RECORD_FIELD.INTRODUCTION.getDisplayName(), true);
|
|
||||||
*
|
|
||||||
* if (!isAsyncronusTable) { Comparator<T> c = new Comparator<T>() {
|
|
||||||
*
|
|
||||||
* @Override public int compare(T o1, T o2) { return ((ConcessioneDV)
|
|
||||||
* o1).getIntroduzione().compareTo(((ConcessioneDV) o2).getIntroduzione()); } };
|
|
||||||
* sortedCellTable.setComparator(introduction, c); }
|
|
||||||
*
|
|
||||||
* // sortedCellTable.setColumnWidth(introduction, 100, Unit.PCT);
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.AUTHOR)) {
|
|
||||||
*
|
|
||||||
* author = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
*
|
|
||||||
* String toDisplay = toDisplayAuthors(((ConcessioneDV) object).getAuthors());
|
|
||||||
* return toDisplay; } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(author, RECORD_FIELD.AUTHOR.getDisplayName(),
|
|
||||||
* true);
|
|
||||||
*
|
|
||||||
* if (!isAsyncronusTable) { Comparator<T> c = new Comparator<T>() {
|
|
||||||
*
|
|
||||||
* @Override public int compare(T o1, T o2) { String toDisplay1 =
|
|
||||||
* toDisplayAuthors(((ConcessioneDV) o1).getAuthors()); String toDisplay2 =
|
|
||||||
* toDisplayAuthors(((ConcessioneDV) o2).getAuthors()); return
|
|
||||||
* toDisplay1.compareTo(toDisplay2); } }; sortedCellTable.setComparator(author,
|
|
||||||
* c); }
|
|
||||||
*
|
|
||||||
* sortedCellTable.setColumnWidth(author, 220, Unit.PX);
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.PROJECT_START_END_DATE)) {
|
|
||||||
*
|
|
||||||
* startEndProjectColumn = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
*
|
|
||||||
* Date dS = null; Date dE = null; if(object.getDataInizioProgetto()!=null) { dS
|
|
||||||
* = (((ConcessioneDV) object).getDataInizioProgetto()); }
|
|
||||||
*
|
|
||||||
* if(object.getDataFineProgetto()!=null) { dE = (((ConcessioneDV)
|
|
||||||
* object).getDataFineProgetto()); }
|
|
||||||
*
|
|
||||||
* String dateFormat = ""; if(dS!=null) { dateFormat+=dtformat.format(dS); }
|
|
||||||
*
|
|
||||||
* dateFormat+=" / ";
|
|
||||||
*
|
|
||||||
* if(dE!=null) { dateFormat+=dtformat.format(dE); }
|
|
||||||
*
|
|
||||||
* return dateFormat; } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(startEndProjectColumn,
|
|
||||||
* RECORD_FIELD.PROJECT_START_END_DATE.getDisplayName(), false);
|
|
||||||
* sortedCellTable.setColumnWidth(startEndProjectColumn, 180, Unit.PX);
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.CREATED)) {
|
|
||||||
*
|
|
||||||
* DateCell date = new
|
|
||||||
* DateCell(DateTimeFormat.getFormat(ConvertToDataViewModel.DATE_FORMAT+" "
|
|
||||||
* +ConvertToDataViewModel.TIME_FORMAT)); createdColumn = new Column<T,
|
|
||||||
* Date>(date) {
|
|
||||||
*
|
|
||||||
* @Override public Date getValue(T object) { if (object == null) return null;
|
|
||||||
*
|
|
||||||
* return (((ConcessioneDV) object).getCreationTime()); } };
|
|
||||||
* sortedCellTable.addColumn(createdColumn,
|
|
||||||
* RECORD_FIELD.CREATED.getDisplayName(), true);
|
|
||||||
*
|
|
||||||
* if (!isAsyncronusTable) { Comparator<T> c = new Comparator<T>() {
|
|
||||||
*
|
|
||||||
* @Override public int compare(T o1, T o2) { if (o1 == null) return -1;
|
|
||||||
*
|
|
||||||
* if (o2 == null) return 1;
|
|
||||||
*
|
|
||||||
* Date d1 = (((ConcessioneDV) o1).getCreationTime()); Date d2 =
|
|
||||||
* (((ConcessioneDV) o2).getCreationTime());
|
|
||||||
*
|
|
||||||
* // GWT.log(d1.toString() + "is after "+d2.toString() +" ? "+d2.after(d1));
|
|
||||||
*
|
|
||||||
* if (d1.after(d2)) return 1; else return -1; } };
|
|
||||||
* GWT.log("date colum sortable"); sortedCellTable.setComparator(createdColumn,
|
|
||||||
* c); }
|
|
||||||
*
|
|
||||||
* sortedCellTable.setColumnWidth(createdColumn, 150, Unit.PX);
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.CREATED_BY)) {
|
|
||||||
*
|
|
||||||
* // NAME insertedBy = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
* return ((ConcessioneDV) object).getCreationUser(); } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(insertedBy,
|
|
||||||
* RECORD_FIELD.CREATED_BY.getDisplayName(), true);
|
|
||||||
*
|
|
||||||
* if (!isAsyncronusTable) { Comparator<T> c = new Comparator<T>() {
|
|
||||||
*
|
|
||||||
* @Override public int compare(T o1, T o2) { return ((ConcessioneDV)
|
|
||||||
* o1).getCreationUser().compareTo(((ConcessioneDV) o2).getCreationUser()); } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.setComparator(insertedBy, c); }
|
|
||||||
* sortedCellTable.setColumnWidth(insertedBy, 220, Unit.PX); }
|
|
||||||
*
|
|
||||||
* if (this.displayFields.contains(RECORD_FIELD.RECORD_STATUS)) {
|
|
||||||
*
|
|
||||||
* statusColumn = new TextColumn<T>() {
|
|
||||||
*
|
|
||||||
* @Override public String getValue(T object) { if (object == null) return "";
|
|
||||||
*
|
|
||||||
* ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport(); if
|
|
||||||
* (vr != null && vr.getStatus() != null) return vr.getStatus().getLabel();
|
|
||||||
* return ""; }
|
|
||||||
*
|
|
||||||
* @Override public void render(Context context, T object, SafeHtmlBuilder sb) {
|
|
||||||
* // TODO Auto-generated method stub
|
|
||||||
*
|
|
||||||
* String value = getValue(object); String color = "#000"; if
|
|
||||||
* (value.compareTo(ValidationStatus.PASSED.getLabel()) == 0) { color =
|
|
||||||
* "#32CD32"; } else if (value.compareTo(ValidationStatus.WARNING.getLabel()) ==
|
|
||||||
* 0) { color = "#FF8000"; } else if
|
|
||||||
* (value.compareTo(ValidationStatus.ERROR.getLabel()) == 0) { color = "red"; }
|
|
||||||
* sb.appendHtmlConstant("<span style=\"color:" + color + "\";>");
|
|
||||||
* super.render(context, object, sb); sb.appendHtmlConstant("</span>");
|
|
||||||
*
|
|
||||||
* } };
|
|
||||||
*
|
|
||||||
* sortedCellTable.addColumn(statusColumn,
|
|
||||||
* RECORD_FIELD.RECORD_STATUS.getDisplayName(), false);
|
|
||||||
* sortedCellTable.setColumnWidth(statusColumn, 120, Unit.PX);
|
|
||||||
*
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enableWriteOperations() {
|
public void enableWriteOperations() {
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package org.gcube.portlets.user.geoportaldataentry.client.ui.utils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
|
||||||
|
|
||||||
|
public class UCD_Util {
|
||||||
|
|
||||||
|
public static HandlerDeclarationDV getHandlerDeclarationFor(List<UseCaseDescriptorDV> listUCDescriptors,
|
||||||
|
String profileID, GEOPORTAL_DATA_HANDLER dataHandler) {
|
||||||
|
|
||||||
|
for (UseCaseDescriptorDV useCaseDescriptor : listUCDescriptors) {
|
||||||
|
|
||||||
|
if (useCaseDescriptor.getProfileID().compareTo(profileID) == 0) {
|
||||||
|
|
||||||
|
for (HandlerDeclarationDV handler : useCaseDescriptor.getHandlers()) {
|
||||||
|
GEOPORTAL_DATA_HANDLER dataHandlerType = handler.getDataHandlerType();
|
||||||
|
|
||||||
|
if (dataHandlerType != null && dataHandlerType.equals(dataHandler)) {
|
||||||
|
return handler;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerDeclarationDV getHandlerDeclarationFor(UseCaseDescriptorDV useCaseDescriptor,
|
||||||
|
GEOPORTAL_DATA_HANDLER dataHandler) {
|
||||||
|
|
||||||
|
if (useCaseDescriptor == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
for (HandlerDeclarationDV handler : useCaseDescriptor.getHandlers()) {
|
||||||
|
GEOPORTAL_DATA_HANDLER dataHandlerType = handler.getDataHandlerType();
|
||||||
|
|
||||||
|
if (dataHandlerType != null && dataHandlerType.equals(dataHandler)) {
|
||||||
|
return handler;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -702,7 +702,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
LOG.info("Fileset is empty, skipping registerFileSet");
|
LOG.info("Fileset is empty, skipping registerFileSet");
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Publishings itemId: " + itemId);
|
LOG.info("Publishing itemId: " + itemId);
|
||||||
concessione = clientMongo.publish(itemId);
|
concessione = clientMongo.publish(itemId);
|
||||||
|
|
||||||
LOG.debug("returning concessione: " + concessione);
|
LOG.debug("returning concessione: " + concessione);
|
||||||
|
@ -890,6 +890,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
handlersIds = Arrays.asList(GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getId());
|
handlersIds = Arrays.asList(GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getId());
|
||||||
LOG.info("handlersIds is null, so using default: " + handlersIds);
|
LOG.info("handlersIds is null, so using default: " + handlersIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO MUST BE USED THE FOLLOWING ONE
|
||||||
// listUseCaseDescriptor = client.getListForHandlerIds(handlersIds);
|
// listUseCaseDescriptor = client.getListForHandlerIds(handlersIds);
|
||||||
|
|
||||||
listUseCaseDescriptor = client.getList();
|
listUseCaseDescriptor = client.getList();
|
||||||
|
|
Loading…
Reference in New Issue