task_24166 #11
|
@ -60,6 +60,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -143,6 +147,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -226,6 +234,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -309,6 +321,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -348,6 +364,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -366,6 +386,19 @@
|
|||
|
||||
|
||||
<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>
|
||||
<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>
|
||||
<dependent-module archiveName="geoportal-data-common-2.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -510,6 +543,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -593,6 +630,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -676,6 +717,10 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
- [#24166] Implemented the Update facility
|
||||
- [#24244] Integrated with the geoportal-data-mapper library
|
||||
|
||||
## [v3.1.0-SNAPSHOT] - 2023-02-09
|
||||
## [v3.1.0] - 2023-03-06
|
||||
|
||||
#### Enhancements
|
||||
|
||||
|
|
|
@ -18,12 +18,15 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.WORKFLOW_PHASE;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.FilesetDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.materialization.innerobject.PayloadDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||
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.UseCaseDescriptorDV;
|
||||
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.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ClickItemEvent;
|
||||
|
@ -72,6 +75,8 @@ import org.gcube.portlets.widgets.mpformbuilder.client.MetadataProfileFormBuilde
|
|||
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.shared.metadata.MetaDataProfileBean;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploadedRemote;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Alert;
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
|
@ -382,8 +387,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
}
|
||||
|
||||
private void createNewDataEntyFor(String profileID, HandlerDeclarationDV handlerDeclarationDV,
|
||||
List<GcubeProfileDV> listGPs) {
|
||||
private <T extends MetaDataProfileBean> void createNewDataEntyFor(String profileID,
|
||||
HandlerDeclarationDV handlerDeclarationDV, List<GcubeProfileDV> listGPs) {
|
||||
dataEntryProjectCreated = true;
|
||||
mainTabPanel.setLoaderVisible("Loading...", true);
|
||||
// orderedCards.clear();
|
||||
|
@ -412,10 +417,18 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
final int order = i;
|
||||
GWT.log("calling getProfilesInTheScope for secondaryType: " + gcubeProfile.getGcubeSecondaryType()
|
||||
+ ", name: " + gcubeProfile.getGcubeName());
|
||||
|
||||
MetadataProfileFormBuilderServiceAsync.Util.getInstance().getProfilesInTheScopeForName(
|
||||
geoportalISConfigs.getScope(), gcubeProfile.getGcubeSecondaryType(), gcubeProfile.getGcubeName(),
|
||||
new AsyncCallback<List<MetaDataProfileBean>>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
mainTabPanel.setLoaderVisible("Loading...", false);
|
||||
Window.alert(caught.getMessage());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(List<MetaDataProfileBean> result) {
|
||||
|
||||
|
@ -446,12 +459,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
// orderedCards.addAll(new ArrayList<GeoNaFormCardModel>(gnaCardsModels));
|
||||
buildNewCards(profileID, handlerDeclarationDV.getItemType(), listGNAFormCardModel);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
mainTabPanel.setLoaderVisible("Loading...", false);
|
||||
Window.alert(caught.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1529,13 +1537,13 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
modal3.setWidth(width);
|
||||
modal3.setHeight(height + "px");
|
||||
|
||||
|
||||
// #24569
|
||||
boolean isNotInDRAFT = false;
|
||||
|
||||
if (resultDocumentDV.getLifecycleInfo() != null) {
|
||||
String phase = resultDocumentDV.getLifecycleInfo().getPhase();
|
||||
// IF the project is not in DRAFT phase, showing an alert and no Update Mode will
|
||||
// IF the project is not in DRAFT phase, showing an alert and no Update Mode
|
||||
// will
|
||||
// be activated
|
||||
if (phase != null && phase.compareToIgnoreCase(WORKFLOW_PHASE.DRAFT.getLabel()) != 0) {
|
||||
|
||||
|
@ -1564,7 +1572,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
ur.noUpdateMode();
|
||||
}
|
||||
|
||||
|
||||
modal3.add(ur);
|
||||
modal3.show();
|
||||
break;
|
||||
|
@ -1818,8 +1825,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
* @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) {
|
||||
public static <T extends MetaDataProfileBean> GeoNaFormCardModel buildNewFormCardModelFromProfile(
|
||||
GcubeProfileDV gcubeProfile, int order, T metaDataProfileBean, OPERATION operation,
|
||||
HandlerManager appManagerBus) {
|
||||
|
||||
// Managing Forms Repeatability
|
||||
int minOccurs = gcubeProfile.getMinOccurs();
|
||||
|
@ -1831,13 +1839,50 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
ProjectFormCard cct = new ProjectFormCard(gcubeProfile.getSectionName(), gcubeProfile.getSectionTitle(), order,
|
||||
maxOccurs > 1, minOccurs, maxOccurs);
|
||||
|
||||
List<FilesetDV> fileset = null;
|
||||
if (metaDataProfileBean instanceof MetaDataProfileBeanExt) {
|
||||
MetaDataProfileBeanExt metaDataProfileBeanExt = (MetaDataProfileBeanExt) metaDataProfileBean;
|
||||
fileset = metaDataProfileBeanExt.getListFileset();
|
||||
}
|
||||
|
||||
GeoNaFormCardModel geoNaFormCardModel = new GeoNaFormCardModel(metaDataProfileBean, null, cct, gcubeProfile);
|
||||
|
||||
CreateMetadataForm baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()),
|
||||
appManagerBus, operation);
|
||||
CreateMetadataForm baseForm = null;
|
||||
if (fileset == null) {
|
||||
GWT.log("Instancing CreateMetadataForm without files");
|
||||
baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()), appManagerBus,
|
||||
operation);
|
||||
} else {
|
||||
GWT.log("Instancing CreateMetadataForm with files");
|
||||
List<? extends FileUploaded> files = toListFileUploadedRemote(fileset);
|
||||
baseForm = new CreateMetadataForm(Arrays.asList(geoNaFormCardModel.getMetadataProfileBean()), appManagerBus,
|
||||
operation, files);
|
||||
}
|
||||
|
||||
geoNaFormCardModel.setMetadataForm(baseForm);
|
||||
|
||||
return geoNaFormCardModel;
|
||||
}
|
||||
|
||||
public static List<? extends FileUploaded> toListFileUploadedRemote(List<FilesetDV> fileset) {
|
||||
|
||||
if (fileset == null || fileset.size() == 0)
|
||||
return null;
|
||||
|
||||
List<FileUploadedRemote> fileUploaded = new ArrayList<FileUploadedRemote>();
|
||||
|
||||
FilesetDV listFiles = fileset.get(0);
|
||||
|
||||
for (PayloadDV payload : listFiles.getListPayload()) {
|
||||
FileUploadedRemote fu = new FileUploadedRemote();
|
||||
fu.setFileName(payload.getName());
|
||||
fu.setUrl(payload.getLink());
|
||||
fu.setMimeType(payload.getMimetype());
|
||||
fileUploaded.add(fu);
|
||||
}
|
||||
|
||||
return fileUploaded;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.gcube.portlets.user.geoportaldataentry.client.ProjectFormCard;
|
|||
import org.gcube.portlets.widgets.mpformbuilder.client.form.generic.CreateMetadataForm;
|
||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
|
||||
|
||||
public class GeoNaFormCardModel {
|
||||
public class GeoNaFormCardModel<T extends MetaDataProfileBean> {
|
||||
|
||||
private MetaDataProfileBean metadataProfileBean;
|
||||
private T metadataProfileBean;
|
||||
private CreateMetadataForm metadataForm;
|
||||
private ProjectFormCard formCard; // matching with metadata profile
|
||||
private GcubeProfileDV gcubeProfile;
|
||||
|
@ -16,8 +16,8 @@ public class GeoNaFormCardModel {
|
|||
|
||||
}
|
||||
|
||||
public GeoNaFormCardModel(MetaDataProfileBean metadataProfileBean, CreateMetadataForm metadataForm,
|
||||
ProjectFormCard formCard, GcubeProfileDV gcubeProfile) {
|
||||
public GeoNaFormCardModel(T metadataProfileBean, CreateMetadataForm metadataForm, ProjectFormCard formCard,
|
||||
GcubeProfileDV gcubeProfile) {
|
||||
super();
|
||||
this.metadataProfileBean = metadataProfileBean;
|
||||
this.metadataForm = metadataForm;
|
||||
|
@ -25,11 +25,11 @@ public class GeoNaFormCardModel {
|
|||
this.gcubeProfile = gcubeProfile;
|
||||
}
|
||||
|
||||
public MetaDataProfileBean getMetadataProfileBean() {
|
||||
public T getMetadataProfileBean() {
|
||||
return metadataProfileBean;
|
||||
}
|
||||
|
||||
public void setMetadataProfileBean(MetaDataProfileBean metadataProfileBean) {
|
||||
public void setMetadataProfileBean(T metadataProfileBean) {
|
||||
this.metadataProfileBean = metadataProfileBean;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
<!-- <!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
|
||||
<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">
|
||||
|
@ -47,4 +47,4 @@
|
|||
addStyleNames="{style.button-save-style}" ui:field="buttonUpdate"
|
||||
visible="false">UPDATE</b:Button>
|
||||
</g:HTMLPanel>
|
||||
</ui:UiBinder> -->
|
||||
</ui:UiBinder>
|
|
@ -22,7 +22,6 @@ import org.bson.Document;
|
|||
import org.gcube.application.geoportal.client.utils.Serialization;
|
||||
import org.gcube.application.geoportal.common.model.document.Project;
|
||||
import org.gcube.application.geoportal.common.model.document.access.Access;
|
||||
import org.gcube.application.geoportal.common.model.document.access.AccessPolicy;
|
||||
import org.gcube.application.geoportal.common.model.document.lifecycle.LifecycleInformation;
|
||||
import org.gcube.application.geoportal.common.model.rest.TempFile;
|
||||
import org.gcube.application.geoportal.common.model.useCaseDescriptor.RelationshipDefinition;
|
||||
|
@ -81,8 +80,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
|
||||
import com.jayway.jsonpath.JsonPath;
|
||||
import com.jayway.jsonpath.spi.json.JsonOrgJsonProvider;
|
||||
|
||||
/**
|
||||
* The server side implementation of the RPC service.
|
||||
|
@ -1197,9 +1194,9 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
for (String keyEntry : map.keySet()) {
|
||||
LOG.debug("\t " + keyEntry + ": " + map.get(keyEntry));
|
||||
}
|
||||
for (FileUploaded fup : gbd.getFilesUploaded()) {
|
||||
LOG.debug("\t " + fup);
|
||||
}
|
||||
// for (FileUploaded fup : gbd.getFilesUploaded()) {
|
||||
// LOG.debug("\t " + fup);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue