task_24166 #11
|
@ -50,6 +50,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -123,6 +126,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -196,6 +202,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -269,6 +278,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -309,6 +321,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -316,9 +331,9 @@
|
|||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
<dependent-module archiveName="geoportal-data-common-2.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -443,6 +458,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -516,6 +534,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -589,6 +610,9 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
## [v3.1.0-SNAPSHOT] - 2022-11-30
|
||||
|
||||
- [#24166] Implemented the Update facility
|
||||
- [#24244] Integrated with the geoportal-data-mapper library
|
||||
|
||||
## [v3.0.0] - 2022-11-09
|
||||
|
||||
|
|
24
pom.xml
24
pom.xml
|
@ -68,22 +68,6 @@
|
|||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- needed to compile with gwt > 2.7 -->
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>xml-apis</groupId> -->
|
||||
<!-- <artifactId>xml-apis</artifactId> -->
|
||||
<!-- <version>1.4.01</version> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<!-- ASM required for GWT 2.9 -->
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>org.ow2.asm</groupId> -->
|
||||
<!-- <artifactId>asm</artifactId> -->
|
||||
<!-- <scope>provided</scope> -->
|
||||
<!-- <version>7.1</version> -->
|
||||
<!-- </dependency> -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-servlet</artifactId>
|
||||
|
@ -107,6 +91,14 @@
|
|||
<artifactId>gwt-bootstrap</artifactId>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.application</groupId>
|
||||
<artifactId>geoportal-data-mapper</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>metadata-profile-form-builder-widget</artifactId>
|
||||
|
|
|
@ -13,9 +13,13 @@
|
|||
<inherits name="com.google.gwt.json.JSON" />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||
name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||
|
||||
<inherits name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||
<inherits
|
||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||
|
||||
|
||||
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||
|
|
|
@ -50,7 +50,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel;
|
|||
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.ModalWindow;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.EditModeRecord;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.UpdateRecord;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.LifecycleInformationPanel;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
|
||||
|
@ -1481,8 +1481,12 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
modal3.setCloseVisible(true);
|
||||
((Element) modal3.getElement().getChildNodes().getItem(1))
|
||||
.addClassName("modal-body-custom");
|
||||
EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV);
|
||||
modal3.add(emr);
|
||||
//EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV);
|
||||
|
||||
|
||||
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(), resultDocumentDV.getId());
|
||||
|
||||
modal3.add(ur);
|
||||
modal3.show();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||
|
@ -31,6 +32,15 @@ import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
|||
@RemoteServiceRelativePath("geoportaldataentryservice")
|
||||
public interface GeoportalDataEntryService extends RemoteService {
|
||||
|
||||
/**
|
||||
* Save geona data forms.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @param tree_Node the tree node
|
||||
* @param stepsOnPostCreation the steps on post creation
|
||||
* @return the commit report
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
CommitReport saveGeonaDataForms(String profileID, Tree_Node<GeoNaFormDataObject> tree_Node,
|
||||
List<String> stepsOnPostCreation) throws Exception;
|
||||
|
||||
|
@ -184,7 +194,7 @@ public interface GeoportalDataEntryService extends RemoteService {
|
|||
* @param id the id
|
||||
* @param toProfileID the to profile ID
|
||||
* @param toProjectID the to project ID
|
||||
* @return
|
||||
* @return the result document DV
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
ResultDocumentDV deleteRelationship(String fromProfileID, String fromProjectID, String id, String toProfileID,
|
||||
|
@ -199,4 +209,14 @@ public interface GeoportalDataEntryService extends RemoteService {
|
|||
*/
|
||||
TemporalReferenceDV temporalReferenceForProject(String profileID, String projectID);
|
||||
|
||||
/**
|
||||
* Gets the project edit.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @param projectID the project ID
|
||||
* @return the project edit
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
ProjectEdit getProjectEdit(String profileID, String projectID) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalReferenceDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||
|
@ -88,4 +89,6 @@ public interface GeoportalDataEntryServiceAsync {
|
|||
|
||||
void temporalReferenceForProject(String profileID, String projectID, AsyncCallback<TemporalReferenceDV> callback);
|
||||
|
||||
void getProjectEdit(String profileID, String projectID, AsyncCallback<ProjectEdit> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Alert;
|
||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||
import com.github.gwtbootstrap.client.ui.ListBox;
|
||||
import com.github.gwtbootstrap.client.ui.constants.AlertType;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ChangeEvent;
|
||||
import com.google.gwt.event.dom.client.ChangeHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
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.Widget;
|
||||
|
||||
public class UpdateRecord extends Composite {
|
||||
|
||||
private static UpdateRecordUiBinder uiBinder = GWT.create(UpdateRecordUiBinder.class);
|
||||
|
||||
interface UpdateRecordUiBinder extends UiBinder<Widget, UpdateRecord> {
|
||||
}
|
||||
|
||||
@UiField
|
||||
ListBox listBoxSections;
|
||||
|
||||
@UiField
|
||||
HTMLPanel htmlSectionContent;
|
||||
|
||||
@UiField
|
||||
HTMLPanel alertHTMLPanel;
|
||||
|
||||
@UiField
|
||||
ControlGroup controlsControlGroup;
|
||||
|
||||
private LoaderIcon loaderProjectSections = new LoaderIcon("Loading Project sections..., please wait");
|
||||
|
||||
public UpdateRecord(HandlerManager editorManagerBus, String profileID, String projectID) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
|
||||
alertHTMLPanel.add(loaderProjectSections);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
||||
new AsyncCallback<ProjectEdit>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(ProjectEdit result) {
|
||||
|
||||
try {
|
||||
alertHTMLPanel.remove(loaderProjectSections);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
||||
for (final MetaDataProfileBeanExt profileBean : result.getTheProfileBeans()) {
|
||||
|
||||
listBoxSections.addItem(profileBean.getType(), profileBean.getType());
|
||||
|
||||
listBoxSections.addChangeHandler(new ChangeHandler() {
|
||||
|
||||
@Override
|
||||
public void onChange(ChangeEvent event) {
|
||||
controlsControlGroup.setVisible(true);
|
||||
htmlSectionContent.clear();
|
||||
List<MetadataFieldWrapper> listMeta = profileBean.getMetadataFields();
|
||||
if (listMeta != null && listMeta.size() > 0) {
|
||||
MetadataFieldWrapper firstMeta = listMeta.get(0);
|
||||
FlowPanel fp = new FlowPanel();
|
||||
fp.add(new HTML(firstMeta.getFieldName()));
|
||||
fp.add(new HTML(firstMeta.getCurrentValue()));
|
||||
htmlSectionContent.add(fp);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
alertHTMLPanel.remove(loaderProjectSections);
|
||||
|
||||
String errorMsg = caught.getMessage();
|
||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||
alert.setClose(false);
|
||||
try {
|
||||
alertHTMLPanel.remove(loaderProjectSections);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
alertHTMLPanel.add(alert);
|
||||
Window.alert(errorMsg);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
|
||||
xmlns:g="urn:import:com.google.gwt.user.client.ui"
|
||||
xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
|
||||
<ui:style>
|
||||
.important {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.button-save-style {
|
||||
margin-top: 10px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.max-height-500 {
|
||||
max-height: 450px;
|
||||
}
|
||||
</ui:style>
|
||||
<g:HTMLPanel>
|
||||
<g:HTMLPanel ui:field="alertHTMLPanel">
|
||||
</g:HTMLPanel>
|
||||
<g:ScrollPanel>
|
||||
<b:Form type="INLINE">
|
||||
<b:Fieldset addStyleNames="form-fieldset-edit">
|
||||
<b:ControlGroup>
|
||||
<b:ControlLabel>Select the section of the document you want to update...</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<b:ListBox ui:field="listBoxSections"></b:ListBox>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup ui:field="controlsControlGroup"
|
||||
visible="false">
|
||||
<b:ControlLabel>Manage the content of</b:ControlLabel>
|
||||
<b:Controls>
|
||||
<g:HTMLPanel ui:field="htmlSectionContent"></g:HTMLPanel>
|
||||
</b:Controls>
|
||||
</b:ControlGroup>
|
||||
<b:ControlGroup>
|
||||
<g:ScrollPanel>
|
||||
<g:HTMLPanel ui:field="uploadFileContainer"
|
||||
addStyleNames="upload-file-container"></g:HTMLPanel>
|
||||
</g:ScrollPanel>
|
||||
</b:ControlGroup>
|
||||
</b:Fieldset>
|
||||
</b:Form>
|
||||
</g:ScrollPanel>
|
||||
<b:Button icon="SAVE" type="INFO"
|
||||
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate"
|
||||
visible="false">UPDATE</b:Button>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder>
|
|
@ -53,6 +53,8 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.TemporalRe
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
|
||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.contentmanagement.blobstorage.transport.backend.RemoteBackendException;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService;
|
||||
|
@ -553,8 +555,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
// SETTING ORIGINAL PROJECTION FROM CLIENT
|
||||
filter.setProjection(originalProjection);
|
||||
// LIMIT IS FROM CLIENT
|
||||
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalItems, start, limit,
|
||||
filter);
|
||||
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalItems, start, limit, filter);
|
||||
|
||||
searchedData.setClientStartIndex(start);
|
||||
searchedData.setLimit(limit);
|
||||
|
@ -563,7 +564,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
List<ResultDocumentDV> toReturnList = ConvertToDataValueObjectModel.toListResultDocument(projects);
|
||||
searchedData.setData(toReturnList);
|
||||
|
||||
LOG.info("Total Docs page size returned:" + toReturnList.size() + ", start: " + start + ", limit: " + limit);
|
||||
LOG.info(
|
||||
"Total Docs page size returned:" + toReturnList.size() + ", start: " + start + ", limit: " + limit);
|
||||
|
||||
if (totalProjectForProfile == limit || totalProjectForProfile == 0) {
|
||||
LOG.debug("Page completed returning " + totalProjectForProfile + " projects");
|
||||
|
@ -1129,6 +1131,36 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectEdit getProjectEdit(String profileID, String projectID) throws Exception {
|
||||
LOG.info("getProjectEdit called for profileID: {}, and projectID: {}", profileID, projectID);
|
||||
try {
|
||||
PortalContext pContext = PortalContext.getConfiguration();
|
||||
GCubeUser user = pContext.getCurrentUser(this.getThreadLocalRequest());
|
||||
String scope = SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||
|
||||
ProjectsCaller clientProjects = GeoportalClientCaller.projects();
|
||||
Project theProject = clientProjects.getProjectByID(profileID, projectID);
|
||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||
projectBuilder.relationships(true);
|
||||
ProjectDV theProjectDV = ConvertToDataValueObjectModel.toProjectDV(theProject, projectBuilder);
|
||||
|
||||
ProjectEdit projectEdit = Geoportal_JSON_Mapper.loadProjectEdit(theProjectDV, scope, user.getUsername());
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
Geoportal_JSON_Mapper.prettyPrintProjectEdit(projectEdit);
|
||||
}
|
||||
|
||||
LOG.info("getProjectEdit returing not null: " + (projectEdit != null));
|
||||
return projectEdit;
|
||||
} catch (Exception e) {
|
||||
String erroMsg = "Error occurred on reading ProjectEdit DTO for id: " + projectID;
|
||||
LOG.warn(erroMsg, e);
|
||||
throw new Exception(
|
||||
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Pretty print client data entry map.
|
||||
*
|
||||
|
|
|
@ -12,17 +12,15 @@
|
|||
|
||||
<inherits name="com.google.gwt.json.JSON" />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
||||
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||
|
||||
<inherits name='org.gcube.application.geoportalcommon.GeoportalDataCommon' />
|
||||
|
||||
<!-- Inherit the default GWT style sheet. You can change -->
|
||||
<!-- the theme of your GWT application by uncommenting -->
|
||||
<!-- any one of the following lines. -->
|
||||
<!--<inherits name='com.google.gwt.user.theme.standard.Standard' /> -->
|
||||
|
||||
<inherits name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||
|
||||
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
|
||||
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
|
||||
|
@ -30,7 +28,8 @@
|
|||
<!-- Other module inherits -->
|
||||
|
||||
<!-- Specify the app entry point class. -->
|
||||
<entry-point class='org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp' />
|
||||
<entry-point
|
||||
class='org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
|
|
Loading…
Reference in New Issue