In progress on Update facility
This commit is contained in:
parent
843a9b19b6
commit
04eb740ea5
|
@ -54,6 +54,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,6 +132,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -208,6 +210,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -285,6 +288,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -327,6 +331,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -336,9 +341,7 @@
|
||||||
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -471,6 +474,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -548,6 +552,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -625,6 +630,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,10 +37,10 @@ public class UpdateRecord extends Composite {
|
||||||
ListBox listBoxSections;
|
ListBox listBoxSections;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel htmlSectionContent;
|
ScrollPanel scrollSectionContent;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
ScrollPanel scrollPanelContainer;
|
HTMLPanel htmlPanelContainer;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
HTMLPanel alertHTMLPanel;
|
HTMLPanel alertHTMLPanel;
|
||||||
|
@ -48,21 +48,25 @@ public class UpdateRecord extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
ControlGroup controlsControlGroup;
|
ControlGroup controlsControlGroup;
|
||||||
|
|
||||||
|
public static final String PLACEHOLDER_LIST_BOX = "Select section...";
|
||||||
|
|
||||||
private LoaderIcon loaderProjectSections = new LoaderIcon("Loading Project sections..., please wait");
|
private LoaderIcon loaderProjectSections = new LoaderIcon("Loading Project sections..., please wait");
|
||||||
|
|
||||||
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);
|
htmlPanelContainer.setVisible(false);
|
||||||
|
|
||||||
alertHTMLPanel.add(loaderProjectSections);
|
alertHTMLPanel.add(loaderProjectSections);
|
||||||
|
|
||||||
|
scrollSectionContent.getElement().getStyle().setProperty("maxHeight", "500px");
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
||||||
new AsyncCallback<ProjectEdit>() {
|
new AsyncCallback<ProjectEdit>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(ProjectEdit result) {
|
public void onSuccess(ProjectEdit result) {
|
||||||
scrollPanelContainer.setVisible(true);
|
htmlPanelContainer.setVisible(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
alertHTMLPanel.remove(loaderProjectSections);
|
||||||
|
@ -70,7 +74,7 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
listBoxSections.addItem("Select section...", "Select section...");
|
listBoxSections.addItem(PLACEHOLDER_LIST_BOX, PLACEHOLDER_LIST_BOX);
|
||||||
|
|
||||||
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
||||||
listBoxSections.addItem(profileBean.getType(), profileBean.getType());
|
listBoxSections.addItem(profileBean.getType(), profileBean.getType());
|
||||||
|
@ -81,15 +85,18 @@ public class UpdateRecord extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
MetaDataProfileBeanExt selectedBean = result.getTheProfileBeans()
|
MetaDataProfileBeanExt selectedBean = result.getTheProfileBeans()
|
||||||
.get(listBoxSections.getSelectedIndex());
|
.get(listBoxSections.getSelectedIndex() - 1); // -1 because the first element is
|
||||||
|
// the PLACEHOLDER "Select
|
||||||
|
// section..."
|
||||||
GWT.log("Change handler fired " + selectedBean);
|
GWT.log("Change handler fired " + selectedBean);
|
||||||
controlsControlGroup.setVisible(true);
|
controlsControlGroup.setVisible(true);
|
||||||
htmlSectionContent.clear();
|
scrollSectionContent.clear();
|
||||||
|
|
||||||
GcubeProfileDV gcubeProfile = selectedBean.getGcubeProfileDV();
|
GcubeProfileDV gcubeProfile = selectedBean.getGcubeProfileDV();
|
||||||
|
|
||||||
GeoNaFormCardModel formcard = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile(gcubeProfile, 1, selectedBean, OPERATION.UPDATE, editorManagerBus);
|
GeoNaFormCardModel formcard = GeoPortalDataEntryApp.buildNewFormCardModelFromProfile(
|
||||||
htmlSectionContent.add(formcard.getMetadataForm());
|
gcubeProfile, 1, selectedBean, OPERATION.UPDATE, editorManagerBus);
|
||||||
|
scrollSectionContent.add(formcard.getMetadataForm());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -98,7 +105,7 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
scrollPanelContainer.setVisible(true);
|
htmlPanelContainer.setVisible(true);
|
||||||
alertHTMLPanel.remove(loaderProjectSections);
|
alertHTMLPanel.remove(loaderProjectSections);
|
||||||
|
|
||||||
String errorMsg = caught.getMessage();
|
String errorMsg = caught.getMessage();
|
||||||
|
|
|
@ -14,24 +14,30 @@
|
||||||
.max-height-500 {
|
.max-height-500 {
|
||||||
max-height: 450px;
|
max-height: 450px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.margin-top-10 {
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<g:HTMLPanel ui:field="alertHTMLPanel">
|
<g:HTMLPanel ui:field="alertHTMLPanel">
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
<g:ScrollPanel ui:field="scrollPanelContainer">
|
<g:HTMLPanel ui:field="htmlPanelContainer">
|
||||||
<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:Label type="INFO">Select the section of the document you want to update...</b:Label>
|
<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"
|
||||||
|
addStyleNames="{style.margin-top-10}"></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:Label type="INFO">Manage the content of</b:Label>
|
<b:Label type="INFO">Manage the content of</b:Label>
|
||||||
<b:Controls>
|
<b:Controls>
|
||||||
<g:HTMLPanel ui:field="htmlSectionContent"></g:HTMLPanel>
|
<g:ScrollPanel ui:field="scrollSectionContent"></g:ScrollPanel>
|
||||||
</b:Controls>
|
</b:Controls>
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
<b:ControlGroup>
|
<b:ControlGroup>
|
||||||
|
@ -42,7 +48,7 @@
|
||||||
</b:ControlGroup>
|
</b:ControlGroup>
|
||||||
</b:Fieldset>
|
</b:Fieldset>
|
||||||
</b:Form>
|
</b:Form>
|
||||||
</g:ScrollPanel>
|
</g:HTMLPanel>
|
||||||
<b:Button icon="SAVE" type="INFO"
|
<b:Button icon="SAVE" type="INFO"
|
||||||
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate"
|
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate"
|
||||||
visible="false">UPDATE</b:Button>
|
visible="false">UPDATE</b:Button>
|
||||||
|
|
Loading…
Reference in New Issue