task_24166 #11
|
@ -53,6 +53,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,6 +130,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -205,6 +207,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -281,6 +284,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -323,6 +327,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -331,6 +336,10 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||||
|
<dependent-module archiveName="geoportal-data-mapper-1.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-mapper/geoportal-data-mapper">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -461,6 +470,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -537,6 +547,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -613,6 +624,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -388,9 +388,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
resetUI();
|
resetUI();
|
||||||
mainTabPanel.setPageHeader(handlerDeclarationDV);
|
mainTabPanel.setPageHeader(handlerDeclarationDV);
|
||||||
|
|
||||||
//TODO AVOIDING THE CACHE
|
// 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
|
// 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());
|
// List<GeoNaFormCardModel> cardsPerIT = geoportalCaches.getGcubeProfilePerItemType(handlerDeclarationDV.getItemType());
|
||||||
// if (cardsPerIT != null) {
|
// if (cardsPerIT != null) {
|
||||||
|
@ -427,7 +427,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
GWT.log("Building form card for type: " + theMetaType);
|
GWT.log("Building form card for type: " + theMetaType);
|
||||||
|
|
||||||
GeoNaFormCardModel geonaForm = buildNewFormCardModelFromProfile(gcubeProfile, order,
|
GeoNaFormCardModel geonaForm = buildNewFormCardModelFromProfile(gcubeProfile, order,
|
||||||
metaDataProfileBean, OPERATION.UPDATE);
|
metaDataProfileBean, OPERATION.UPDATE, appManagerBus);
|
||||||
|
|
||||||
treemapOrderedGNAProfiles.put(order, geonaForm);
|
treemapOrderedGNAProfiles.put(order, geonaForm);
|
||||||
}
|
}
|
||||||
|
@ -437,12 +437,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
// ordered values
|
// ordered values
|
||||||
Collection<GeoNaFormCardModel> gnaCardsModels = treemapOrderedGNAProfiles.values();
|
Collection<GeoNaFormCardModel> gnaCardsModels = treemapOrderedGNAProfiles.values();
|
||||||
GWT.log("TreeMap values: " + gnaCardsModels);
|
GWT.log("TreeMap values: " + gnaCardsModels);
|
||||||
List<GeoNaFormCardModel> listGNAFormCardModel = new ArrayList<GeoNaFormCardModel>(gnaCardsModels);
|
List<GeoNaFormCardModel> listGNAFormCardModel = new ArrayList<GeoNaFormCardModel>(
|
||||||
|
gnaCardsModels);
|
||||||
geoportalCaches.putGcubeProfilePerItemType(handlerDeclarationDV.getItemType(),
|
geoportalCaches.putGcubeProfilePerItemType(handlerDeclarationDV.getItemType(),
|
||||||
listGNAFormCardModel);
|
listGNAFormCardModel);
|
||||||
// orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
// orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
||||||
buildNewCards(profileID, handlerDeclarationDV.getItemType(),
|
buildNewCards(profileID, handlerDeclarationDV.getItemType(), listGNAFormCardModel);
|
||||||
listGNAFormCardModel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,44 +456,13 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Builds the new form card model from profile.
|
|
||||||
*
|
|
||||||
* @param gcubeProfile the gcube profile
|
|
||||||
* @param order the order
|
|
||||||
* @param metaDataProfileBean the meta data profile bean
|
|
||||||
* @param operation the operation
|
|
||||||
* @return the geo na form card model
|
|
||||||
*/
|
|
||||||
private GeoNaFormCardModel buildNewFormCardModelFromProfile(GcubeProfileDV gcubeProfile, int order,
|
|
||||||
MetaDataProfileBean metaDataProfileBean, OPERATION operation) {
|
|
||||||
|
|
||||||
// Managing Forms repeatability
|
|
||||||
int minOccurs = gcubeProfile.getMinOccurs();
|
|
||||||
minOccurs = minOccurs <= 0 ? 0 : minOccurs;
|
|
||||||
int maxOccurs = gcubeProfile.getMaxOccurs();
|
|
||||||
maxOccurs = maxOccurs <= 0 ? Integer.MAX_VALUE : maxOccurs;
|
|
||||||
|
|
||||||
// TODO MUST BE MANAGED MIN_OCCURS
|
|
||||||
ProjectFormCard cct = new ProjectFormCard(gcubeProfile.getSectionName(), gcubeProfile.getSectionTitle(), order,
|
|
||||||
maxOccurs > 1, minOccurs, maxOccurs);
|
|
||||||
|
|
||||||
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
|
|
||||||
|
|
||||||
CreateMetadataForm baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()),
|
|
||||||
appManagerBus, operation);
|
|
||||||
geoNaFormCardModel.setMetadataForm(baseForm);
|
|
||||||
|
|
||||||
return geoNaFormCardModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void buildNewCards(String profileID, String itemTypeTitle, Collection<GeoNaFormCardModel> orderedCards) {
|
private void buildNewCards(String profileID, String itemTypeTitle, Collection<GeoNaFormCardModel> orderedCards) {
|
||||||
|
|
||||||
projectSavedWithSuccess = false; // resetting state of saving
|
projectSavedWithSuccess = false; // resetting state of saving
|
||||||
mainTabPanel.setLoaderVisible("Loading...", true);
|
mainTabPanel.setLoaderVisible("Loading...", true);
|
||||||
geoNaMainForm.setVisibleFormActions(true);
|
geoNaMainForm.setVisibleFormActions(true);
|
||||||
resetUI();
|
resetUI();
|
||||||
//geoNaMainForm.removeTree(treeItemPanel);
|
// geoNaMainForm.removeTree(treeItemPanel);
|
||||||
|
|
||||||
geoNaMainForm.enableButtonSave(true);
|
geoNaMainForm.enableButtonSave(true);
|
||||||
mainTabPanel.setLoaderVisible("", false);
|
mainTabPanel.setLoaderVisible("", false);
|
||||||
|
@ -775,9 +744,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
GWT.log("Fired: " + getListOfRecordsEvent);
|
GWT.log("Fired: " + getListOfRecordsEvent);
|
||||||
SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter();
|
SearchingFilter searchingFilter = getListOfRecordsEvent.getSearchingFilter();
|
||||||
|
|
||||||
|
CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches
|
||||||
CacheSearchingFilterParametersFromConfig seachingFilterParameters =
|
.getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID(),
|
||||||
geoportalCaches.getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID(), GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
GEOPORTAL_DATA_HANDLER.geoportal_data_list);
|
||||||
|
|
||||||
// CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches
|
// CacheSearchingFilterParametersFromConfig seachingFilterParameters = geoportalCaches
|
||||||
// .getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID());
|
// .getFilterParametersForProfileId(getListOfRecordsEvent.getProfileID());
|
||||||
|
@ -1196,21 +1165,24 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String stepString = wActionOnItem.getAction().getCallSteps().length==1?"Step":"Steps";
|
String stepString = wActionOnItem.getAction().getCallSteps().length == 1
|
||||||
|
? "Step"
|
||||||
|
: "Steps";
|
||||||
|
|
||||||
String stepsToString = "";
|
String stepsToString = "";
|
||||||
for (String step : wActionOnItem.getAction().getCallSteps()) {
|
for (String step : wActionOnItem.getAction().getCallSteps()) {
|
||||||
stepsToString+=step+", ";
|
stepsToString += step + ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
Alert alert = new Alert(
|
Alert alert = new Alert(
|
||||||
stepString +" "+ stepsToString
|
stepString + " " + stepsToString + "performed correclty!");
|
||||||
+ "performed correclty!");
|
|
||||||
alert.setType(AlertType.INFO);
|
alert.setType(AlertType.INFO);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
modal.add(alert);
|
modal.add(alert);
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getResultDocumentFoProjectByID(result.getProfileID(), result.getId(), new AsyncCallback<ResultDocumentDV>() {
|
GeoportalDataEntryServiceAsync.Util.getInstance()
|
||||||
|
.getResultDocumentFoProjectByID(result.getProfileID(),
|
||||||
|
result.getId(), new AsyncCallback<ResultDocumentDV>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
@ -1219,26 +1191,37 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ResultDocumentDV theResultDocument) {
|
public void onSuccess(
|
||||||
|
ResultDocumentDV theResultDocument) {
|
||||||
VerticalPanel vp = new VerticalPanel();
|
VerticalPanel vp = new VerticalPanel();
|
||||||
vp.getElement().getStyle().setMarginTop(20, Unit.PX);
|
vp.getElement().getStyle().setMarginTop(20,
|
||||||
vp.add(new Label("Check outcome in the Publication Report"));
|
Unit.PX);
|
||||||
|
vp.add(new Label(
|
||||||
|
"Check outcome in the Publication Report"));
|
||||||
Button buttonShowPublicationReport = new Button(
|
Button buttonShowPublicationReport = new Button(
|
||||||
"Show Publication Report");
|
"Show Publication Report");
|
||||||
buttonShowPublicationReport.setType(ButtonType.INFO);
|
buttonShowPublicationReport
|
||||||
buttonShowPublicationReport.addClickHandler(new ClickHandler() {
|
.setType(ButtonType.INFO);
|
||||||
|
buttonShowPublicationReport
|
||||||
|
.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(
|
||||||
|
ClickEvent event) {
|
||||||
modal.hide();
|
modal.hide();
|
||||||
appManagerBus.fireEvent(new OperationOnItemEvent<DocumentDV>(
|
appManagerBus.fireEvent(
|
||||||
Arrays.asList(theResultDocument),
|
new OperationOnItemEvent<DocumentDV>(
|
||||||
|
Arrays.asList(
|
||||||
|
theResultDocument),
|
||||||
OPERATION_ON_ITEM.VIEW_REPORT));
|
OPERATION_ON_ITEM.VIEW_REPORT));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
buttonShowPublicationReport.getElement().getStyle().setMarginTop(10, Unit.PX);
|
buttonShowPublicationReport.getElement()
|
||||||
buttonShowPublicationReport.getElement().getStyle().setMarginBottom(20, Unit.PX);
|
.getStyle().setMarginTop(10, Unit.PX);
|
||||||
|
buttonShowPublicationReport.getElement()
|
||||||
|
.getStyle()
|
||||||
|
.setMarginBottom(20, Unit.PX);
|
||||||
vp.add(buttonShowPublicationReport);
|
vp.add(buttonShowPublicationReport);
|
||||||
|
|
||||||
modal.add(vp);
|
modal.add(vp);
|
||||||
|
@ -1481,10 +1464,14 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
modal3.setCloseVisible(true);
|
modal3.setCloseVisible(true);
|
||||||
((Element) modal3.getElement().getChildNodes().getItem(1))
|
((Element) modal3.getElement().getChildNodes().getItem(1))
|
||||||
.addClassName("modal-body-custom");
|
.addClassName("modal-body-custom");
|
||||||
//EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV);
|
int height = Window.getClientHeight() * 70 / 100;
|
||||||
|
|
||||||
|
int width = Window.getClientWidth() * 70 / 100;
|
||||||
|
modal3.setWidth(width);
|
||||||
|
modal3.setHeight(height + "px");
|
||||||
|
|
||||||
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(), resultDocumentDV.getId());
|
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(),
|
||||||
|
resultDocumentDV.getId());
|
||||||
|
|
||||||
modal3.add(ur);
|
modal3.add(ur);
|
||||||
modal3.show();
|
modal3.show();
|
||||||
|
@ -1614,7 +1601,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
NodeItem theRootNode = (NodeItem) root.getWidget();
|
NodeItem theRootNode = (NodeItem) root.getWidget();
|
||||||
GeoNaFormCardModel nodeCard = theRootNode.getGeoNaFormCardModel();
|
GeoNaFormCardModel nodeCard = theRootNode.getGeoNaFormCardModel();
|
||||||
GeoNaFormCardModel newNodeFormCard = buildNewFormCardModelFromProfile(nodeCard.getGcubeProfile(), -1,
|
GeoNaFormCardModel newNodeFormCard = buildNewFormCardModelFromProfile(nodeCard.getGcubeProfile(), -1,
|
||||||
nodeCard.getMetadataProfileBean(), OPERATION.UPDATE);
|
nodeCard.getMetadataProfileBean(), OPERATION.UPDATE, appManagerBus);
|
||||||
|
|
||||||
// create a new node with the same data as the root node
|
// create a new node with the same data as the root node
|
||||||
boolean canBeDuplicated = newNodeFormCard.getFormCard().isInternalRepeatibleForm();
|
boolean canBeDuplicated = newNodeFormCard.getFormCard().isInternalRepeatibleForm();
|
||||||
|
@ -1708,4 +1695,36 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the new form card model from profile.
|
||||||
|
*
|
||||||
|
* @param gcubeProfile the gcube profile
|
||||||
|
* @param order the order
|
||||||
|
* @param metaDataProfileBean the meta data profile bean
|
||||||
|
* @param operation the operation
|
||||||
|
* @param appManagerBus the app manager bus
|
||||||
|
* @return the geo na form card model
|
||||||
|
*/
|
||||||
|
public static GeoNaFormCardModel buildNewFormCardModelFromProfile(GcubeProfileDV gcubeProfile, int order,
|
||||||
|
MetaDataProfileBean metaDataProfileBean, OPERATION operation, HandlerManager appManagerBus) {
|
||||||
|
|
||||||
|
// Managing Forms Repeatability
|
||||||
|
int minOccurs = gcubeProfile.getMinOccurs();
|
||||||
|
minOccurs = minOccurs <= 0 ? 0 : minOccurs;
|
||||||
|
int maxOccurs = gcubeProfile.getMaxOccurs();
|
||||||
|
maxOccurs = maxOccurs <= 0 ? Integer.MAX_VALUE : maxOccurs;
|
||||||
|
|
||||||
|
// TODO MUST BE MANAGED MIN_OCCURS
|
||||||
|
ProjectFormCard cct = new ProjectFormCard(gcubeProfile.getSectionName(), gcubeProfile.getSectionTitle(), order,
|
||||||
|
maxOccurs > 1, minOccurs, maxOccurs);
|
||||||
|
|
||||||
|
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
|
||||||
|
|
||||||
|
CreateMetadataForm baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()),
|
||||||
|
appManagerBus, operation);
|
||||||
|
geoNaFormCardModel.setMetadataForm(baseForm);
|
||||||
|
|
||||||
|
return geoNaFormCardModel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
||||||
|
|
||||||
import java.util.List;
|
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||||
|
|
||||||
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Alert;
|
import com.github.gwtbootstrap.client.ui.Alert;
|
||||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||||
|
@ -22,9 +22,8 @@ import com.google.gwt.uibinder.client.UiField;
|
||||||
import com.google.gwt.user.client.Window;
|
import com.google.gwt.user.client.Window;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.gwt.user.client.ui.Composite;
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.FlowPanel;
|
|
||||||
import com.google.gwt.user.client.ui.HTML;
|
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
|
import com.google.gwt.user.client.ui.ScrollPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
public class UpdateRecord extends Composite {
|
public class UpdateRecord extends Composite {
|
||||||
|
@ -40,6 +39,9 @@ public class UpdateRecord extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel htmlSectionContent;
|
HTMLPanel htmlSectionContent;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
ScrollPanel scrollPanelContainer;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel alertHTMLPanel;
|
HTMLPanel alertHTMLPanel;
|
||||||
|
|
||||||
|
@ -51,6 +53,8 @@ public class UpdateRecord extends Composite {
|
||||||
public UpdateRecord(HandlerManager editorManagerBus, String profileID, String projectID) {
|
public UpdateRecord(HandlerManager editorManagerBus, String profileID, String projectID) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
|
|
||||||
|
scrollPanelContainer.setVisible(false);
|
||||||
|
|
||||||
alertHTMLPanel.add(loaderProjectSections);
|
alertHTMLPanel.add(loaderProjectSections);
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
||||||
|
@ -58,6 +62,7 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ProjectEdit result) {
|
public void onSuccess(ProjectEdit result) {
|
||||||
|
scrollPanelContainer.setVisible(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
alertHTMLPanel.remove(loaderProjectSections);
|
||||||
|
@ -65,33 +70,35 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
listBoxSections.addItem("Select section...", "Select section...");
|
||||||
|
|
||||||
|
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
||||||
listBoxSections.addItem(profileBean.getType(), profileBean.getType());
|
listBoxSections.addItem(profileBean.getType(), profileBean.getType());
|
||||||
|
}
|
||||||
|
|
||||||
listBoxSections.addChangeHandler(new ChangeHandler() {
|
listBoxSections.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
|
MetaDataProfileBeanExt selectedBean = result.getTheProfileBeans()
|
||||||
|
.get(listBoxSections.getSelectedIndex());
|
||||||
|
GWT.log("Change handler fired " + selectedBean);
|
||||||
controlsControlGroup.setVisible(true);
|
controlsControlGroup.setVisible(true);
|
||||||
htmlSectionContent.clear();
|
htmlSectionContent.clear();
|
||||||
List<MetadataFieldWrapper> listMeta = profileBean.getMetadataFields();
|
|
||||||
if (listMeta != null && listMeta.size() > 0) {
|
GcubeProfileDV gcubeProfile = selectedBean.getGcubeProfileDV();
|
||||||
MetadataFieldWrapper firstMeta = listMeta.get(0);
|
|
||||||
FlowPanel fp = new FlowPanel();
|
GeoNaFormCardModel formcard = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile(gcubeProfile, 1, selectedBean, OPERATION.UPDATE, editorManagerBus);
|
||||||
fp.add(new HTML(firstMeta.getFieldName()));
|
htmlSectionContent.add(formcard.getMetadataForm());
|
||||||
fp.add(new HTML(firstMeta.getCurrentValue()));
|
|
||||||
htmlSectionContent.add(fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
|
scrollPanelContainer.setVisible(true);
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
alertHTMLPanel.remove(loaderProjectSections);
|
||||||
|
|
||||||
String errorMsg = caught.getMessage();
|
String errorMsg = caught.getMessage();
|
||||||
|
|
|
@ -18,18 +18,18 @@
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<g:HTMLPanel ui:field="alertHTMLPanel">
|
<g:HTMLPanel ui:field="alertHTMLPanel">
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
<g:ScrollPanel>
|
<g:ScrollPanel ui:field="scrollPanelContainer">
|
||||||
<b:Form type="INLINE">
|
<b:Form type="INLINE">
|
||||||
<b:Fieldset addStyleNames="form-fieldset-edit">
|
<b:Fieldset addStyleNames="form-fieldset-edit">
|
||||||
<b:ControlGroup>
|
<b:ControlGroup>
|
||||||
<b:ControlLabel>Select the section of the document you want to update...</b:ControlLabel>
|
<b:Label type="INFO">Select the section of the document you want to update...</b:Label>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<b:ListBox ui:field="listBoxSections"></b:ListBox>
|
<b:ListBox ui:field="listBoxSections"></b:ListBox>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
<b:ControlGroup ui:field="controlsControlGroup"
|
<b:ControlGroup ui:field="controlsControlGroup"
|
||||||
visible="false">
|
visible="false">
|
||||||
<b:ControlLabel>Manage the content of</b:ControlLabel>
|
<b:Label type="INFO">Manage the content of</b:Label>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<g:HTMLPanel ui:field="htmlSectionContent"></g:HTMLPanel>
|
<g:HTMLPanel ui:field="htmlSectionContent"></g:HTMLPanel>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
|
|
|
@ -57,28 +57,6 @@ public class TreeItemPanel {
|
||||||
|
|
||||||
treeItemParents.put(JSON_ROOT_PATH, Arrays.asList(root));
|
treeItemParents.put(JSON_ROOT_PATH, Arrays.asList(root));
|
||||||
|
|
||||||
/*
|
|
||||||
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
|
||||||
|
|
||||||
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
|
||||||
String parentName = profile.getParentName();
|
|
||||||
|
|
||||||
if (profile.getSectionName().compareTo("relazioneScavo") == 0) {
|
|
||||||
profile.setParentName(JSON_ROOT_PATH + "abstractRelazione");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (profile.getSectionName().compareTo("posizionamentoScavo") == 0) {
|
|
||||||
profile.setParentName(JSON_ROOT_PATH + "immaginiRappresentative");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (profile.getSectionName().compareTo("pianteFineScavo") == 0) {
|
|
||||||
profile.setParentName(JSON_ROOT_PATH + "immaginiRappresentative.posizionamentoScavo");
|
|
||||||
}
|
|
||||||
|
|
||||||
GWT.log(" print tree parentName: " + parentName + " name: " + profile.getSectionName() + " title: "
|
|
||||||
+ profile.getSectionTitle());
|
|
||||||
}*/
|
|
||||||
|
|
||||||
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
for (GeoNaFormCardModel geoNaFormCardModel : gnaCardsModels) {
|
||||||
|
|
||||||
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
GcubeProfileDV profile = geoNaFormCardModel.getGcubeProfile();
|
||||||
|
|
Loading…
Reference in New Issue