in progress on Edit Mode
This commit is contained in:
parent
378f9419a6
commit
765ca9f621
|
@ -69,6 +69,9 @@
|
||||||
|
|
||||||
|
|
||||||
<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-common-1.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
|
||||||
|
<dependency-type>uses</dependency-type>
|
||||||
|
</dependent-module>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.ResultSetPaginatedData;
|
import org.gcube.portlets.user.geoportaldataentry.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.SortFilter;
|
import org.gcube.portlets.user.geoportaldataentry.shared.SortFilter;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteService;
|
import com.google.gwt.user.client.rpc.RemoteService;
|
||||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
|
@ -112,4 +113,16 @@ public interface GeoportalDataEntryService extends RemoteService {
|
||||||
* @throws Exception the exception
|
* @throws Exception the exception
|
||||||
*/
|
*/
|
||||||
ConcessioneDV getRecord(String itemId, RECORD_TYPE recordType) throws Exception;
|
ConcessioneDV getRecord(String itemId, RECORD_TYPE recordType) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update record.
|
||||||
|
*
|
||||||
|
* @param itemId the item id
|
||||||
|
* @param jsonUpdate the json update
|
||||||
|
* @param recordType the record type
|
||||||
|
* @return the updated JSON string representing the itemId
|
||||||
|
* @throws Exception the exception
|
||||||
|
*/
|
||||||
|
ConcessioneDV updateSectionForRecord(String itemId, String recordType, String section, int pathIndex,
|
||||||
|
GenericDatasetBean gDBean) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig;
|
import org.gcube.portlets.user.geoportaldataentry.shared.GeonaISConfig;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.ResultSetPaginatedData;
|
import org.gcube.portlets.user.geoportaldataentry.shared.ResultSetPaginatedData;
|
||||||
import org.gcube.portlets.user.geoportaldataentry.shared.SortFilter;
|
import org.gcube.portlets.user.geoportaldataentry.shared.SortFilter;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
@ -67,4 +68,8 @@ public interface GeoportalDataEntryServiceAsync
|
||||||
|
|
||||||
|
|
||||||
void getRecord(String itemId, RECORD_TYPE recordType, AsyncCallback<ConcessioneDV> callback);
|
void getRecord(String itemId, RECORD_TYPE recordType, AsyncCallback<ConcessioneDV> callback);
|
||||||
|
|
||||||
|
|
||||||
|
void updateSectionForRecord(String itemId, String recordType, String section, int pathIndex,
|
||||||
|
GenericDatasetBean gDBean, AsyncCallback<ConcessioneDV> callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,6 @@ public class EditModeRecord extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(FileSetPathsDV fileSetPaths) {
|
public void onSuccess(FileSetPathsDV fileSetPaths) {
|
||||||
UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, fileSetPaths.getFileSetPaths());
|
UpdateFileset updateFileset = new UpdateFileset(selectedConcessione, recordType, fileSetPaths.getFileSetPaths());
|
||||||
//updateFileset.setHeight("300px !important");
|
|
||||||
filesUpdatePanel.add(updateFileset);
|
filesUpdatePanel.add(updateFileset);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
|
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
|
||||||
|
@ -13,8 +14,11 @@ import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataE
|
||||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.form.MetaDataField;
|
import org.gcube.portlets.widgets.mpformbuilder.client.form.MetaDataField;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.metadata.MetaDataFieldSkeleton;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.DialogUpload;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.DataTypeWrapper;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.DataTypeWrapper;
|
||||||
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetadataFieldWrapper;
|
||||||
|
import org.gcube.portlets.widgets.mpformbuilder.shared.upload.FileUploaded;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Button;
|
import com.github.gwtbootstrap.client.ui.Button;
|
||||||
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
import com.github.gwtbootstrap.client.ui.ControlGroup;
|
||||||
|
@ -50,8 +54,6 @@ public class UpdateFileset extends Composite {
|
||||||
|
|
||||||
private static final String _FORM_FIELDS_SIZE = "740px";
|
private static final String _FORM_FIELDS_SIZE = "740px";
|
||||||
|
|
||||||
private static final String UPLOAD_MISSING_FILE = "You must upload a file";
|
|
||||||
|
|
||||||
private static UpdateFilesetUiBinder uiBinder = GWT.create(UpdateFilesetUiBinder.class);
|
private static UpdateFilesetUiBinder uiBinder = GWT.create(UpdateFilesetUiBinder.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,9 +83,7 @@ public class UpdateFileset extends Composite {
|
||||||
|
|
||||||
private List<String> listFileSetPaths;
|
private List<String> listFileSetPaths;
|
||||||
|
|
||||||
private boolean listBoxPathsPlaceholder = true;
|
private boolean placeholderListBoxPaths = true;
|
||||||
|
|
||||||
private String recordId;
|
|
||||||
|
|
||||||
private BaseConcessioneDV selectedConcessione;
|
private BaseConcessioneDV selectedConcessione;
|
||||||
|
|
||||||
|
@ -91,14 +91,14 @@ public class UpdateFileset extends Composite {
|
||||||
|
|
||||||
private RECORD_TYPE recordType;
|
private RECORD_TYPE recordType;
|
||||||
|
|
||||||
// private MultipleDilaogUpload mDU;
|
private boolean placeholderListBoxIndex = true;
|
||||||
|
|
||||||
private boolean listBoxIndexPlaceholder = true;
|
|
||||||
|
|
||||||
private HandlerManager uiBus = new HandlerManager(null);
|
private HandlerManager uiBus = new HandlerManager(null);
|
||||||
|
|
||||||
private MetaDataField fieldUploadWidget;
|
private MetaDataField fieldUploadWidget;
|
||||||
|
|
||||||
|
private Integer pathIndex = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new update fileset.
|
* Instantiates a new update fileset.
|
||||||
*
|
*
|
||||||
|
@ -123,9 +123,9 @@ public class UpdateFileset extends Composite {
|
||||||
GWT.log("Profile type selection changed...");
|
GWT.log("Profile type selection changed...");
|
||||||
cgSelectFile.setVisible(false);
|
cgSelectFile.setVisible(false);
|
||||||
|
|
||||||
if (listBoxPathsPlaceholder) {
|
if (placeholderListBoxPaths) {
|
||||||
listBoxPaths.removeItem(0); // this is the placeholder, removing it once
|
listBoxPaths.removeItem(0); // this is the placeholder, removing it once
|
||||||
listBoxPathsPlaceholder = false;
|
placeholderListBoxPaths = false;
|
||||||
}
|
}
|
||||||
showUploadFileGUI();
|
showUploadFileGUI();
|
||||||
}
|
}
|
||||||
|
@ -151,10 +151,27 @@ public class UpdateFileset extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
if (checkValidUpload() == null) {
|
String errorMsg = checkValidUpload();
|
||||||
Window.alert("I can save...");
|
if (errorMsg == null) {
|
||||||
|
List<FileUploaded> listFilesUploaded = new ArrayList<FileUploaded>();
|
||||||
|
List<MetaDataFieldSkeleton> listMetaDataFieldSkeleton = fieldUploadWidget.getListOfMetadataFields();
|
||||||
|
for (MetaDataFieldSkeleton field : listMetaDataFieldSkeleton) {
|
||||||
|
DialogUpload dUpload = (DialogUpload) field.getHolder();
|
||||||
|
// adding it only if exists
|
||||||
|
if (dUpload.getFileUploadingState() != null)
|
||||||
|
listFilesUploaded.add(dUpload.getFileUploadingState().getFile());
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericDatasetBean gdb = new GenericDatasetBean();
|
||||||
|
gdb.setFilesUploaded(listFilesUploaded);
|
||||||
|
// adding it only if exists
|
||||||
|
|
||||||
|
GWT.log("Section selected: " + listBoxPaths.getSelectedItemText());
|
||||||
|
GWT.log("Content index selected: " + pathIndex);
|
||||||
|
GWT.log("FileUploaded selected: " + gdb.getFilesUploaded());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Window.alert("New file not found. " + UPLOAD_MISSING_FILE);
|
Window.alert(errorMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -170,15 +187,16 @@ public class UpdateFileset extends Composite {
|
||||||
buttonUpdate.setVisible(false);
|
buttonUpdate.setVisible(false);
|
||||||
uploadFileContainer.clear();
|
uploadFileContainer.clear();
|
||||||
controlsContent.clear();
|
controlsContent.clear();
|
||||||
listBoxIndexPlaceholder = true;
|
placeholderListBoxIndex = true;
|
||||||
fieldUploadWidget = null;
|
fieldUploadWidget = null;
|
||||||
|
pathIndex = null;
|
||||||
|
|
||||||
// listBoxIndex.clear();
|
// listBoxIndex.clear();
|
||||||
cgSelectFile.setVisible(true);
|
cgSelectFile.setVisible(true);
|
||||||
|
|
||||||
ListBox listBoxIndex = new ListBox();
|
ListBox listBoxContentIndex = new ListBox();
|
||||||
listBoxIndex.setWidth(_FORM_FIELDS_SIZE);
|
listBoxContentIndex.setWidth(_FORM_FIELDS_SIZE);
|
||||||
listBoxIndex.addItem("Select a content...");
|
listBoxContentIndex.addItem("Select a content...");
|
||||||
|
|
||||||
if (listBoxPaths.getSelectedItemText().contains("abstract_relazione")) {
|
if (listBoxPaths.getSelectedItemText().contains("abstract_relazione")) {
|
||||||
AbstractRelazioneScavoDV ar = fullConcessione.getAbstractRelazioneScavo();
|
AbstractRelazioneScavoDV ar = fullConcessione.getAbstractRelazioneScavo();
|
||||||
|
@ -188,7 +206,7 @@ public class UpdateFileset extends Composite {
|
||||||
}
|
}
|
||||||
|
|
||||||
int posizIndex = 0;
|
int posizIndex = 0;
|
||||||
fillListBoxToBeReplaced(listBoxIndex, "abstract_relazione", posizIndex, ar.getTitolo(),
|
fillListBoxToBeReplaced(listBoxContentIndex, "abstract_relazione", posizIndex, ar.getTitolo(),
|
||||||
ar.getListWsContent());
|
ar.getListWsContent());
|
||||||
|
|
||||||
} else if (listBoxPaths.getSelectedItemText().contains("immagini")) {
|
} else if (listBoxPaths.getSelectedItemText().contains("immagini")) {
|
||||||
|
@ -199,7 +217,7 @@ public class UpdateFileset extends Composite {
|
||||||
}
|
}
|
||||||
int posizIndex = 0;
|
int posizIndex = 0;
|
||||||
for (UploadedImageDV uploadedImageDV : listImmagini) {
|
for (UploadedImageDV uploadedImageDV : listImmagini) {
|
||||||
fillListBoxToBeReplaced(listBoxIndex, "immagini", posizIndex, uploadedImageDV.getTitolo(),
|
fillListBoxToBeReplaced(listBoxContentIndex, "immagini", posizIndex, uploadedImageDV.getTitolo(),
|
||||||
uploadedImageDV.getListWsContent());
|
uploadedImageDV.getListWsContent());
|
||||||
posizIndex++;
|
posizIndex++;
|
||||||
}
|
}
|
||||||
|
@ -211,7 +229,7 @@ public class UpdateFileset extends Composite {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int posizIndex = 0;
|
int posizIndex = 0;
|
||||||
fillListBoxToBeReplaced(listBoxIndex, "relazione", posizIndex, realzione.getTitolo(),
|
fillListBoxToBeReplaced(listBoxContentIndex, "relazione", posizIndex, realzione.getTitolo(),
|
||||||
realzione.getListWsContent());
|
realzione.getListWsContent());
|
||||||
|
|
||||||
} else if (listBoxPaths.getSelectedItemText().contains("posizionamentoScavo")) {
|
} else if (listBoxPaths.getSelectedItemText().contains("posizionamentoScavo")) {
|
||||||
|
@ -221,7 +239,7 @@ public class UpdateFileset extends Composite {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int posizIndex = 0;
|
int posizIndex = 0;
|
||||||
fillListBoxToBeReplaced(listBoxIndex, "posizionamentoScavo", posizIndex, posiz.getTitolo(),
|
fillListBoxToBeReplaced(listBoxContentIndex, "posizionamentoScavo", posizIndex, posiz.getTitolo(),
|
||||||
posiz.getListWsContent());
|
posiz.getListWsContent());
|
||||||
|
|
||||||
} else if (listBoxPaths.getSelectedItemText().contains("piante")) {
|
} else if (listBoxPaths.getSelectedItemText().contains("piante")) {
|
||||||
|
@ -232,17 +250,17 @@ public class UpdateFileset extends Composite {
|
||||||
}
|
}
|
||||||
int posizIndex = 0;
|
int posizIndex = 0;
|
||||||
for (LayerConcessioneDV lcDV : piante) {
|
for (LayerConcessioneDV lcDV : piante) {
|
||||||
fillListBoxToBeReplaced(listBoxIndex, "piante", posizIndex, lcDV.getTitolo(), lcDV.getListWsContent());
|
fillListBoxToBeReplaced(listBoxContentIndex, "piante", posizIndex, lcDV.getTitolo(), lcDV.getListWsContent());
|
||||||
posizIndex++;
|
posizIndex++;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
controlsContent.add(listBoxIndex);
|
controlsContent.add(listBoxContentIndex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void fillListBoxToBeReplaced(ListBox listBoxIndex, String section, int posizIndex, String title,
|
private void fillListBoxToBeReplaced(ListBox listBoxContentIndex, String section, int posizIndex, String title,
|
||||||
List<WorkspaceContentDV> listWSC) {
|
List<WorkspaceContentDV> listWSC) {
|
||||||
|
|
||||||
if (listWSC == null || listWSC.isEmpty()) {
|
if (listWSC == null || listWSC.isEmpty()) {
|
||||||
|
@ -250,22 +268,22 @@ public class UpdateFileset extends Composite {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
listBoxIndex.addItem(title, posizIndex + "");
|
listBoxContentIndex.addItem(title, posizIndex + "");
|
||||||
|
|
||||||
// adding handler once
|
// adding handler once
|
||||||
if (posizIndex == 0) {
|
if (posizIndex == 0) {
|
||||||
|
|
||||||
listBoxIndex.addChangeHandler(new ChangeHandler() {
|
listBoxContentIndex.addChangeHandler(new ChangeHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChange(ChangeEvent event) {
|
public void onChange(ChangeEvent event) {
|
||||||
|
|
||||||
if (listBoxIndexPlaceholder) {
|
if (placeholderListBoxIndex) {
|
||||||
listBoxIndex.removeItem(0); // this is the placeholder, removing it once
|
listBoxContentIndex.removeItem(0); // this is the placeholder, removing it once
|
||||||
listBoxIndexPlaceholder = false;
|
placeholderListBoxIndex = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
showFileBrowseInteraction(listWSC);
|
showFileBrowseInteraction(listBoxContentIndex.getSelectedIndex(), listWSC);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -273,8 +291,9 @@ public class UpdateFileset extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showFileBrowseInteraction(List<WorkspaceContentDV> listWSC) {
|
private void showFileBrowseInteraction(int pathContentIndex, List<WorkspaceContentDV> listWSC) {
|
||||||
uploadFileContainer.clear();
|
uploadFileContainer.clear();
|
||||||
|
pathIndex = pathContentIndex;
|
||||||
|
|
||||||
if (listWSC.size() > 0) {
|
if (listWSC.size() > 0) {
|
||||||
FlexTable table = new FlexTable();
|
FlexTable table = new FlexTable();
|
||||||
|
@ -327,6 +346,9 @@ public class UpdateFileset extends Composite {
|
||||||
*/
|
*/
|
||||||
private String checkValidUpload() {
|
private String checkValidUpload() {
|
||||||
|
|
||||||
|
if (fieldUploadWidget == null)
|
||||||
|
return "No file uploaded";
|
||||||
|
|
||||||
for (MetaDataFieldSkeleton field : fieldUploadWidget.getListOfMetadataFields()) {
|
for (MetaDataFieldSkeleton field : fieldUploadWidget.getListOfMetadataFields()) {
|
||||||
|
|
||||||
field.removeError();
|
field.removeError();
|
||||||
|
|
|
@ -650,6 +650,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the JSON record.
|
* Gets the JSON record.
|
||||||
*
|
*
|
||||||
|
@ -729,4 +730,87 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
return ConvertToDataViewModel.getFileSetPaths();
|
return ConvertToDataViewModel.getFileSetPaths();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update record.
|
||||||
|
*
|
||||||
|
* @param itemId the item id
|
||||||
|
* @param jsonUpdate the json update
|
||||||
|
* @param recordType the record type
|
||||||
|
* @return the updated JSON string representing the itemId
|
||||||
|
* @throws Exception the exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ConcessioneDV updateSectionForRecord(String itemId, String recordType, String section, int pathIndex, GenericDatasetBean gDBean) throws Exception {
|
||||||
|
LOG.info("updateSectionForRecord called with itemId: " + itemId + ", section: " + section+", pathIndex: " + pathIndex+", gDBean: " + gDBean, "");
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (itemId == null)
|
||||||
|
throw new Exception("Item id is null");
|
||||||
|
|
||||||
|
if (recordType.equals(RECORD_TYPE.CONCESSIONE)) {
|
||||||
|
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
|
||||||
|
MongoServiceUtil serviceUtil = new MongoServiceUtil();
|
||||||
|
MongoConcessioni clientMongo = serviceUtil.getInstanceMongoConcessioni();
|
||||||
|
|
||||||
|
String toEditPath = null;
|
||||||
|
AddSectionToConcessioneRequest request = null;
|
||||||
|
|
||||||
|
List<TempFile> files = serviceUtil.toTemFiles(gDBean.getFilesUploaded());
|
||||||
|
if(files==null || files.isEmpty())
|
||||||
|
throw new Exception("Sorry, an error occurred on reading temp files. Refresh and try again");
|
||||||
|
|
||||||
|
if (section.contains("abstract_relazione")) {
|
||||||
|
|
||||||
|
toEditPath = Paths.ABSTRACT_RELAZIONE;
|
||||||
|
request = new AddSectionToConcessioneRequest(toEditPath, files);
|
||||||
|
|
||||||
|
} else if (section.contains("immagini")) {
|
||||||
|
toEditPath = Paths.imgByIndex(pathIndex);
|
||||||
|
request = new AddSectionToConcessioneRequest(toEditPath, files);
|
||||||
|
|
||||||
|
} else if (section.contains("relazione")) {
|
||||||
|
toEditPath = Paths.RELAZIONE;
|
||||||
|
request = new AddSectionToConcessioneRequest(toEditPath, files);
|
||||||
|
|
||||||
|
} else if (section.contains("posizionamentoScavo")) {
|
||||||
|
toEditPath = Paths.POSIZIONAMENTO;
|
||||||
|
request = new AddSectionToConcessioneRequest(toEditPath,
|
||||||
|
files);
|
||||||
|
|
||||||
|
} else if (section.contains("piante")) {
|
||||||
|
toEditPath = Paths.piantaByIndex(pathIndex);
|
||||||
|
request = new AddSectionToConcessioneRequest(
|
||||||
|
toEditPath, files);
|
||||||
|
}
|
||||||
|
// Unpublish
|
||||||
|
System.out.println("Unpublishing "+itemId);
|
||||||
|
clientMongo.unPublish(itemId);
|
||||||
|
|
||||||
|
// update Fileset
|
||||||
|
System.out.println("Removing old fileset.. ");
|
||||||
|
clientMongo.cleanFileSet(itemId,toEditPath);
|
||||||
|
|
||||||
|
System.out.println("Sending new Fileset ..");
|
||||||
|
|
||||||
|
//StorageUtils storage=new StorageUtils();
|
||||||
|
// Building TempFile
|
||||||
|
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
|
||||||
|
LOG.info("Registering FileSet into recordId " + itemId + " with request path: " +toEditPath + " and: " + files.size()
|
||||||
|
+ " file/s");
|
||||||
|
Concessione concessione = clientMongo.registerFileSet(itemId,request);
|
||||||
|
concessione = clientMongo.publish(itemId);
|
||||||
|
|
||||||
|
return ConvertToDataViewModel.toConcessione(concessione);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.error("Error on updating the project with item id: " + itemId, e);
|
||||||
|
throw new Exception(
|
||||||
|
"Error occurred on updating the project with id: " + itemId + ". Error: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue