task_24166 #11
|
@ -1,5 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,7 +102,9 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-module deploy-name="geoportal-data-entry-app-3.2.0-SNAPSHOT">
|
<wb-module deploy-name="geoportal-data-entry-app-3.2.0-SNAPSHOT">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -201,7 +205,9 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -302,7 +308,9 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -403,7 +411,9 @@
|
||||||
|
|
||||||
|
|
||||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -459,7 +469,12 @@
|
||||||
<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">
|
<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>
|
<dependency-type>uses</dependency-type>
|
||||||
</dependent-module>
|
</dependent-module>
|
||||||
|
<dependent-module archiveName="metadata-profile-form-builder-widget-2.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -560,7 +575,9 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="context-root" value="geoportal-data-entry-app"/>
|
<property name="context-root" value="geoportal-data-entry-app"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -661,7 +678,9 @@
|
||||||
|
|
||||||
|
|
||||||
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -762,7 +781,9 @@
|
||||||
|
|
||||||
|
|
||||||
</wb-module>
|
</wb-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
- [#24166] Implemented the Update facility
|
- [#24166] Implemented the Update facility
|
||||||
- [#24244] Integrated with the geoportal-data-mapper library
|
- [#24244] Integrated with the geoportal-data-mapper library
|
||||||
|
- [#25015] Integrated the Geoportal Data-Viewer Widget
|
||||||
|
|
||||||
## [v3.1.0] - 2023-03-06
|
## [v3.1.0] - 2023-03-06
|
||||||
|
|
||||||
|
|
7
pom.xml
7
pom.xml
|
@ -92,6 +92,13 @@
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.widgets.gdvw</groupId>
|
||||||
|
<artifactId>geoportal-data-viewer-widget</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.application</groupId>
|
<groupId>org.gcube.application</groupId>
|
||||||
<artifactId>geoportal-data-mapper</artifactId>
|
<artifactId>geoportal-data-mapper</artifactId>
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
||||||
|
|
||||||
|
<inherits
|
||||||
|
name='org.gcube.portlets.widgets.gdvw.geoportal_data_viewer_widget' />
|
||||||
|
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||||
|
|
|
@ -26,6 +26,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||||
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
import org.gcube.application.geoportaldatamapper.shared.MetaDataProfileBeanExt;
|
||||||
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.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig;
|
||||||
|
@ -43,6 +44,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerform
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEventHandler;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEventHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandler;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent;
|
||||||
|
import org.gcube.portlets.user.geoportaldataentry.client.events.RelationActionHandlerEvent.RELACTION_ACTION_TYPE;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsEvent;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsHandler;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsHandler;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.events.TreeItemEvent;
|
import org.gcube.portlets.user.geoportaldataentry.client.events.TreeItemEvent;
|
||||||
|
@ -71,6 +73,8 @@ import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeoportalISConfig;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node;
|
import org.gcube.portlets.user.geoportaldataentry.shared.Tree_Node;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.UserRights;
|
import org.gcube.portlets.user.geoportaldataentry.shared.UserRights;
|
||||||
|
import org.gcube.portlets.widgets.gdvw.client.GeoportalDataViewerWidget;
|
||||||
|
import org.gcube.portlets.widgets.gdvw.client.project.ProjectViewer;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilderServiceAsync;
|
import org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilderServiceAsync;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm;
|
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
|
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm.OPERATION;
|
||||||
|
@ -875,7 +879,21 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
switch (createRelationHE.getRelactionActionType()) {
|
switch (createRelationHE.getRelactionActionType()) {
|
||||||
case DELETE: {
|
case DELETE: {
|
||||||
|
|
||||||
|
GcubeUserRole myRole = myRights.getRoleRights().getUserRole();
|
||||||
|
|
||||||
|
// TODO REMOVE THIS IF AFTER ADDING ALL THE OPERATIONS IN THE IS
|
||||||
|
// OPERATIONS/RIGHTS CONFIGURATION
|
||||||
|
if (!myRole.equals(GcubeUserRole.DATA_MANAGER) && !myRole.equals(GcubeUserRole.DATA_EDITOR)) {
|
||||||
|
String action = RELACTION_ACTION_TYPE.DELETE +" Relation";
|
||||||
|
|
||||||
|
String msg = "You are not authorized to perform the action: " + action;
|
||||||
|
ModalWindow modalW = new ModalWindow(new Image(Images.ICONS.accessDenied()),
|
||||||
|
"Forbidden: " + action, msg, AlertType.WARNING);
|
||||||
|
modalW.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (createRelationHE.getFromProject() == null || createRelationHE.getToProject() == null) {
|
if (createRelationHE.getFromProject() == null || createRelationHE.getToProject() == null) {
|
||||||
DialogInform di = new DialogInform(null, "No selection", "You must select a Project");
|
DialogInform di = new DialogInform(null, "No selection", "You must select a Project");
|
||||||
di.center();
|
di.center();
|
||||||
|
@ -1532,8 +1550,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
// modal3.setWidth(950);
|
// modal3.setWidth(950);
|
||||||
// modal3.setHeight("700px");
|
// modal3.setHeight("700px");
|
||||||
modal3.setCloseVisible(true);
|
modal3.setCloseVisible(true);
|
||||||
((Element) modal3.getElement().getChildNodes().getItem(1))
|
((Element) modal3.getElement().getChildNodes().getItem(1)).addClassName("modal-body-edit");
|
||||||
.addClassName("modal-body-edit");
|
|
||||||
int height = Window.getClientHeight() * 70 / 100;
|
int height = Window.getClientHeight() * 70 / 100;
|
||||||
|
|
||||||
int width = Window.getClientWidth() * 70 / 100;
|
int width = Window.getClientWidth() * 70 / 100;
|
||||||
|
@ -1614,6 +1631,56 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case SHOW_METADATA: {
|
||||||
|
GWT.log("VIEW SHOW_METADATA fired");
|
||||||
|
final Modal modal = new Modal(true, true);
|
||||||
|
modal.setCloseVisible(true);
|
||||||
|
final int height = Window.getClientHeight() * 70 / 100;
|
||||||
|
int width = Window.getClientWidth() * 70 / 100;
|
||||||
|
modal.setMaxHeigth("none");
|
||||||
|
modal.setWidth(width);
|
||||||
|
modal.setHeight(height + "px");
|
||||||
|
modal.setTitle(
|
||||||
|
"<span style='font-size:20px;'>View Document for Project ID: <span style='color:#555; font-size:20px;'>"
|
||||||
|
+ resultDocumentDV.getId() + "</span></span>");
|
||||||
|
final HorizontalPanel hp = new HorizontalPanel();
|
||||||
|
final LoaderIcon lc = new LoaderIcon("Loading Project... please wait");
|
||||||
|
hp.add(lc);
|
||||||
|
modal.add(hp);
|
||||||
|
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectView(
|
||||||
|
resultDocumentDV.getProfileID(), resultDocumentDV.getProjectID(),
|
||||||
|
new AsyncCallback<ProjectView>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Throwable caught) {
|
||||||
|
hp.clear();
|
||||||
|
modal.setTitle("Error :-(");
|
||||||
|
Alert alert = new Alert(
|
||||||
|
"Sorry, I cannot show the Project with id '"
|
||||||
|
+ resultDocumentDV.getId()
|
||||||
|
+ "' Refresh an try again. Error: " + caught.getMessage(),
|
||||||
|
AlertType.ERROR);
|
||||||
|
alert.setClose(false);
|
||||||
|
hp.add(alert);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(ProjectView result) {
|
||||||
|
hp.clear();
|
||||||
|
GeoportalDataViewerWidget wid = new GeoportalDataViewerWidget();
|
||||||
|
ProjectViewer viewer = wid.getProjectViewer(result);
|
||||||
|
viewer.setTocContentVisible(true);
|
||||||
|
viewer.setHeight((height - 80) + "px");
|
||||||
|
modal.add(viewer);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
modal.show();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case DELETE_PROJECT: {
|
case DELETE_PROJECT: {
|
||||||
|
|
||||||
String htmlMsg = "Going to delete the project with:";
|
String htmlMsg = "Going to delete the project with:";
|
||||||
|
@ -1650,7 +1717,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
hp.clear();
|
hp.clear();
|
||||||
modal.setTitle("Error");
|
modal.setTitle("Error :-(");
|
||||||
Alert alert = new Alert(
|
Alert alert = new Alert(
|
||||||
"Sorry, I cannot delete the Project with id '"
|
"Sorry, I cannot delete the Project with id '"
|
||||||
+ resultDocumentDV.getId()
|
+ resultDocumentDV.getId()
|
||||||
|
@ -1849,13 +1916,13 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
|
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
|
||||||
|
|
||||||
|
// In case of UPDATE operation, the fields of kind File will be not mandatory.
|
||||||
//In case of UPDATE operation, the fields of kind File will be not mandatory.
|
if (operation != null && operation.equals(OPERATION.UPDATE)) {
|
||||||
if(operation!=null && operation.equals(OPERATION.UPDATE)) {
|
|
||||||
List<MetadataFieldWrapper> fields = geoNaFormCardModel.getMetadataProfileBean().getMetadataFields();
|
List<MetadataFieldWrapper> fields = geoNaFormCardModel.getMetadataProfileBean().getMetadataFields();
|
||||||
for (MetadataFieldWrapper metadataFieldWrapper : fields) {
|
for (MetadataFieldWrapper metadataFieldWrapper : fields) {
|
||||||
if(metadataFieldWrapper.getMandatory() && metadataFieldWrapper.getType().equals(DataTypeWrapper.File)) {
|
if (metadataFieldWrapper.getMandatory()
|
||||||
|
&& metadataFieldWrapper.getType().equals(DataTypeWrapper.File)) {
|
||||||
metadataFieldWrapper.setMandatory(false);
|
metadataFieldWrapper.setMandatory(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1869,7 +1936,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
} else {
|
} else {
|
||||||
GWT.log("Instancing CreateMetadataForm with files");
|
GWT.log("Instancing CreateMetadataForm with files");
|
||||||
List<? extends FileUploaded> files = toListFileUploadedRemote(fileset);
|
List<? extends FileUploaded> files = toListFileUploadedRemote(fileset);
|
||||||
GWT.log("files are: "+files);
|
GWT.log("files are: " + files);
|
||||||
baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()), appManagerBus,
|
baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()), appManagerBus,
|
||||||
operation, files);
|
operation, files);
|
||||||
}
|
}
|
||||||
|
@ -1885,16 +1952,17 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
List<FileUploadedRemote> fileUploaded = new ArrayList<FileUploadedRemote>();
|
List<FileUploadedRemote> fileUploaded = new ArrayList<FileUploadedRemote>();
|
||||||
|
|
||||||
for (FilesetDV filesetDV : fileset) {
|
for (FilesetDV filesetDV : fileset) {
|
||||||
GWT.log("filesetDV fieldName: "+filesetDV.getFilesetFieldName() + " profile: "+filesetDV.getGcubeProfileFieldName());
|
GWT.log("filesetDV fieldName: " + filesetDV.getFilesetFieldName() + " profile: "
|
||||||
|
+ filesetDV.getGcubeProfileFieldName());
|
||||||
|
|
||||||
for (PayloadDV payload : filesetDV.getListPayload()) {
|
for (PayloadDV payload : filesetDV.getListPayload()) {
|
||||||
FileUploadedRemote fu = new FileUploadedRemote();
|
FileUploadedRemote fu = new FileUploadedRemote();
|
||||||
fu.setFileName(payload.getName());
|
fu.setFileName(payload.getName());
|
||||||
fu.setUrl(payload.getLink());
|
fu.setUrl(payload.getLink());
|
||||||
fu.setMimeType(payload.getMimetype());
|
fu.setMimeType(payload.getMimetype());
|
||||||
//adding FilePath according to spefic file registred in the UCD
|
// adding FilePath according to spefic file registred in the UCD
|
||||||
FilePath filePath = new FilePath(filesetDV.getGcubeProfileFieldName(), filesetDV.getFilesetFieldName());
|
FilePath filePath = new FilePath(filesetDV.getGcubeProfileFieldName(), filesetDV.getFilesetFieldName());
|
||||||
fu.setFilePath(filePath);
|
fu.setFilePath(filePath);
|
||||||
fileUploaded.add(fu);
|
fileUploaded.add(fu);
|
||||||
|
|
|
@ -13,6 +13,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.project.TemporalReferenceDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||||
|
@ -234,4 +235,6 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
|
CommitReport updateGeportalDataForm(String profileID, String projectID, GeoNaFormDataObject section,
|
||||||
String sectionPath, List<FilePathDV> listFilePaths) throws Exception;
|
String sectionPath, List<FilePathDV> listFilePaths) throws Exception;
|
||||||
|
|
||||||
|
ProjectView getProjectView(String profileID, String projectID) throws Exception;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,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.project.TemporalReferenceDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtendedConfigProfile;
|
||||||
|
@ -95,4 +96,6 @@ public interface GeoportalDataEntryServiceAsync {
|
||||||
|
|
||||||
void getProjectEdit(String profileID, String projectID, AsyncCallback<ProjectEdit> callback);
|
void getProjectEdit(String profileID, String projectID, AsyncCallback<ProjectEdit> callback);
|
||||||
|
|
||||||
|
void getProjectView(String profileID, String projectID, AsyncCallback<ProjectView> callback);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,9 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
Tab tabGetListOfProjects;
|
Tab tabGetListOfProjects;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
NavLink navView;
|
||||||
|
|
||||||
@UiField
|
@UiField
|
||||||
NavLink navShowOnMap;
|
NavLink navShowOnMap;
|
||||||
|
@ -243,6 +246,21 @@ public class GeonaMainTabPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
navView.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
List<DocumentDV> listDocuments = null;
|
||||||
|
if (grpw != null && grpw.getSelectItems() != null) {
|
||||||
|
listDocuments = grpw.getSelectItems();
|
||||||
|
}
|
||||||
|
|
||||||
|
appManagerBus
|
||||||
|
.fireEvent(new OperationOnItemEvent<DocumentDV>(listDocuments, OPERATION_ON_ITEM.SHOW_METADATA));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
navShowReport.addClickHandler(new ClickHandler() {
|
navShowReport.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,8 @@
|
||||||
<g:FlowPanel>
|
<g:FlowPanel>
|
||||||
<g:FlowPanel addStyleNames="move-sticky">
|
<g:FlowPanel addStyleNames="move-sticky">
|
||||||
<b:NavPills>
|
<b:NavPills>
|
||||||
|
<b:NavLink ui:field="navView" title="View Document"
|
||||||
|
icon="FILE">View Document</b:NavLink>
|
||||||
<b:NavLink ui:field="navShowOnMap" title="Show on Map"
|
<b:NavLink ui:field="navShowOnMap" title="Show on Map"
|
||||||
icon="MAP_MARKER">Show on Map</b:NavLink>
|
icon="MAP_MARKER">Show on Map</b:NavLink>
|
||||||
<b:NavLink ui:field="navShowReport"
|
<b:NavLink ui:field="navShowReport"
|
||||||
|
|
|
@ -100,7 +100,7 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
alertHTMLPanel.add(loaderProjectSections);
|
alertHTMLPanel.add(loaderProjectSections);
|
||||||
|
|
||||||
scrollSectionContent.setHeight((modalHeight-340)+"px");
|
scrollSectionContent.setHeight((modalHeight-350)+"px");
|
||||||
|
|
||||||
listBoxSections.setWidth((modalWidth-50)+"px");
|
listBoxSections.setWidth((modalWidth-50)+"px");
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,11 @@
|
||||||
.margin-top-10 {
|
.margin-top-10 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-operation {
|
||||||
|
font-size: 12px;
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
<g:HTMLPanel ui:field="alertHTMLPanel">
|
<g:HTMLPanel ui:field="alertHTMLPanel">
|
||||||
|
@ -49,7 +54,18 @@
|
||||||
</b:Fieldset>
|
</b:Fieldset>
|
||||||
</b:Form>
|
</b:Form>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
<b:Button icon="SAVE" type="INFO"
|
<g:HTMLPanel>
|
||||||
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate">UPDATE</b:Button>
|
<g:HTMLPanel addStyleNames="{style.info-operation}">
|
||||||
|
To update the document:
|
||||||
|
"Select the Section you wish to update, update the metadata and/or
|
||||||
|
the
|
||||||
|
file/s and then confirm by clicking on "Create".
|
||||||
|
Finally select
|
||||||
|
"Update".
|
||||||
|
</g:HTMLPanel>
|
||||||
|
<b:Button icon="SAVE" type="INFO"
|
||||||
|
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate">UPDATE</b:Button>
|
||||||
|
</g:HTMLPanel>
|
||||||
|
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
</ui:UiBinder>
|
</ui:UiBinder>
|
|
@ -173,7 +173,7 @@ public class ViewRelationshipPanel extends Composite {
|
||||||
|
|
||||||
FlowPanel panelContainer = new FlowPanel();
|
FlowPanel panelContainer = new FlowPanel();
|
||||||
Button deleteRelation = new Button("", IconType.TRASH);
|
Button deleteRelation = new Button("", IconType.TRASH);
|
||||||
deleteRelation.setTitle("Delete this releation");
|
deleteRelation.setTitle("Delete this relation");
|
||||||
deleteRelation.setType(ButtonType.LINK);
|
deleteRelation.setType(ButtonType.LINK);
|
||||||
deleteRelation.addClickHandler(new ClickHandler() {
|
deleteRelation.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ 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.GEOPORTAL_DATA_HANDLER;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.RelationshipDefinitionDV;
|
||||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||||
|
import org.gcube.application.geoportalcommon.shared.geoportal.view.ProjectView;
|
||||||
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
|
import org.gcube.application.geoportaldatamapper.Geoportal_JSON_Mapper;
|
||||||
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
import org.gcube.application.geoportaldatamapper.shared.ProjectEdit;
|
||||||
import org.gcube.common.portal.PortalContext;
|
import org.gcube.common.portal.PortalContext;
|
||||||
|
@ -1414,10 +1415,40 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
Geoportal_JSON_Mapper.prettyPrintProjectEdit(projectEdit);
|
Geoportal_JSON_Mapper.prettyPrintProjectEdit(projectEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("getProjectEdit returing not null: " + (projectEdit != null));
|
LOG.info(ProjectEdit.class.getSimpleName()+" returing not null: " + (projectEdit != null));
|
||||||
return projectEdit;
|
return projectEdit;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String erroMsg = "Error occurred on reading ProjectEdit DTO for id: " + projectID;
|
String erroMsg = "Error occurred on reading "+ProjectEdit.class.getSimpleName()+" DTO for id: " + projectID;
|
||||||
|
LOG.warn(erroMsg, e);
|
||||||
|
throw new Exception(
|
||||||
|
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProjectView getProjectView(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);
|
||||||
|
|
||||||
|
ProjectView projectView = Geoportal_JSON_Mapper.loadProjectView(theProjectDV, scope, user.getUsername());
|
||||||
|
|
||||||
|
if (LOG.isDebugEnabled()) {
|
||||||
|
Geoportal_JSON_Mapper.prettyPrintProjectView(projectView);
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.info(ProjectView.class.getSimpleName()+" returing not null: " + (projectView != null));
|
||||||
|
return projectView;
|
||||||
|
} catch (Exception e) {
|
||||||
|
String erroMsg = "Error occurred on reading "+ProjectView.class.getSimpleName()+" DTO for id: " + projectID;
|
||||||
LOG.warn(erroMsg, e);
|
LOG.warn(erroMsg, e);
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
erroMsg + ". Error: " + e.getMessage() + ". Refresh and try again or contact the support");
|
||||||
|
|
|
@ -17,6 +17,10 @@
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
name='org.gcube.application.geoportaldatamapper.GeoportalDataMapper' />
|
||||||
|
|
||||||
|
<inherits
|
||||||
|
name='org.gcube.portlets.widgets.gdvw.geoportal_data_viewer_widget' />
|
||||||
|
|
||||||
|
|
||||||
<inherits
|
<inherits
|
||||||
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
name='org.gcube.portlets.widgets.mpformbuilder.MetadataProfileFormBuilder' />
|
||||||
|
|
Loading…
Reference in New Issue