Fixing. AVOIDING CACHING OF GeoNaFormCardModel. Reloading profiles from

server
This commit is contained in:
Francesco Mangiacrapa 2022-11-10 16:38:44 +01:00
parent 96955abaea
commit 38660a489a
3 changed files with 52 additions and 37 deletions

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -58,7 +60,9 @@
<wb-module deploy-name="geoportal-data-entry-app-3.0.0-SNAPSHOT">
@ -117,7 +121,9 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -176,7 +182,9 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -235,7 +243,9 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
@ -246,7 +256,12 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="geoportal-data-common-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -305,7 +320,9 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -364,7 +381,9 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -423,7 +442,9 @@
</wb-module>

View File

@ -352,25 +352,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
mainTabPanel.initMainAccordingToListUseCaseDescriptors(listUCDescriptors);
for (final UseCaseDescriptorDV ucdDV : listUCDescriptors) {
// List<ConfigurationDV<?>> listConfigurations = geoportalCaches
// .getHandlerConfigurationsForProfileId(ucdDV.getProfileID());
//
// if (listConfigurations == null) {
// listConfigurations = new ArrayList<ConfigurationDV<?>>();
// }
//
// for (HandlerDeclarationDV handler : ucdDV.getHandlers()) {
// ConfigurationDV<?> config = handler.getConfiguration();
// listConfigurations.add(config);
// }
//
// geoportalCaches.putHandlerConfigurationsForProfileId(ucdDV.getProfileID(), listConfigurations);
geoportalCaches.putUCDForProfileId(ucdDV.getProfileID(), ucdDV);
}
//geoportalCaches.printCacheHandlerConfigurations();
}
/**
@ -402,17 +386,19 @@ public class GeoPortalDataEntryApp implements EntryPoint {
mainTabPanel.setLoaderVisible("Loading...", true);
// orderedCards.clear();
resetUI();
List<GeoNaFormCardModel> cardsPerIT = geoportalCaches
.getGcubeProfilePerItemType(handlerDeclarationDV.getItemType());
mainTabPanel.setPageHeader(handlerDeclarationDV);
if (cardsPerIT != null) {
GWT.log("Profiles/Cards per Item Type are: " + cardsPerIT);
// orderedCards.addAll(cardsPerIT);
buildNewCards(profileID, handlerDeclarationDV.getItemType(), new ArrayList<GeoNaFormCardModel>(cardsPerIT));
return;
}
//TODO AVOIDING THE CACHE
//TODO I NEED TO CHECK WHY THE BY USING THE CACHE THE WEB-FORM IS FULL (EQUAL TO PREVIOUS ONE) AND NOT RESET PERFORMED
// List<GeoNaFormCardModel> cardsPerIT = geoportalCaches.getGcubeProfilePerItemType(handlerDeclarationDV.getItemType());
// if (cardsPerIT != null) {
// GWT.log("Profiles/Cards per Item Type are: " + cardsPerIT);
// // orderedCards.addAll(cardsPerIT);
// buildNewCards(profileID, handlerDeclarationDV.getItemType(), new ArrayList<GeoNaFormCardModel>(cardsPerIT));
// return;
// }
numberOfCards = 0;
expectedCards = listGPs.size();
@ -451,11 +437,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
// ordered values
Collection<GeoNaFormCardModel> gnaCardsModels = treemapOrderedGNAProfiles.values();
GWT.log("TreeMap values: " + gnaCardsModels);
List<GeoNaFormCardModel> listGNAFormCardModel = new ArrayList<GeoNaFormCardModel>(gnaCardsModels);
geoportalCaches.putGcubeProfilePerItemType(handlerDeclarationDV.getItemType(),
new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
listGNAFormCardModel);
// orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
buildNewCards(profileID, handlerDeclarationDV.getItemType(),
new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
listGNAFormCardModel);
}
}
@ -506,6 +493,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
mainTabPanel.setLoaderVisible("Loading...", true);
geoNaMainForm.setVisibleFormActions(true);
resetUI();
//geoNaMainForm.removeTree(treeItemPanel);
geoNaMainForm.enableButtonSave(true);
mainTabPanel.setLoaderVisible("", false);

View File

@ -135,7 +135,7 @@ public class GeonaDataEntryMainForm extends Composite {
try {
treePanel.remove(treeItemPanel.getTree());
} catch (Exception e) {
// TODO: handle exception
GWT.log("error: "+e.getMessage());
}
}
@ -168,7 +168,12 @@ public class GeonaDataEntryMainForm extends Composite {
mapForms.clear();
// mainHTMLPanel.clear();
inputPanel.clear();
//inputPanel = new ScrollPanel();
//removeTree(treeItemPanel);
treePanel.clear();
alertFormAction.clear();
alertFormAction.setVisible(false);
//treePanel = new ScrollPanel();
// treePanel = new ScrollPanel();
// listTabs.clear();
}