task_24166 #11
|
@ -203,7 +203,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
String errorMsg = "Sorry, an error occurrend when loading configurations. Please, contact the support";
|
String errorMsg = "Sorry, an error occurred when loading configurations. Please, contact the support";
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
try {
|
try {
|
||||||
|
@ -234,7 +234,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
String errorMsg = "Sorry, an error occurrend on istancing the application. Please, contact the support";
|
String errorMsg = "Sorry, an error occurred on istancing the application. Please, contact the support";
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
try {
|
try {
|
||||||
|
@ -315,7 +315,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
String errorMsg = "Sorry, an error occurrend on loading configurations. Please, contact the support";
|
String errorMsg = "Sorry, an error occurred on loading configurations. Please, contact the support";
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
try {
|
try {
|
||||||
|
@ -1569,7 +1569,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(),
|
UpdateRecord ur = new UpdateRecord(appManagerBus, resultDocumentDV.getProfileID(),
|
||||||
resultDocumentDV.getId(), height);
|
resultDocumentDV.getId(), width, height);
|
||||||
|
|
||||||
if (isNotInDRAFT) {
|
if (isNotInDRAFT) {
|
||||||
ur.noUpdateMode();
|
ur.noUpdateMode();
|
||||||
|
|
|
@ -79,7 +79,7 @@ public class ActionListPanel extends Composite {
|
||||||
Button butt = new Button();
|
Button butt = new Button();
|
||||||
butt.setText(actionDefinitionDV.getTitle());
|
butt.setText(actionDefinitionDV.getTitle());
|
||||||
butt.setTitle(actionDefinitionDV.getDescription());
|
butt.setTitle(actionDefinitionDV.getDescription());
|
||||||
butt.setType(ButtonType.LINK);
|
butt.setType(ButtonType.INFO);
|
||||||
butt.addClickHandler(new ClickHandler() {
|
butt.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class UpdateRecord extends Composite {
|
||||||
|
|
||||||
private HandlerManager appManagerBus;
|
private HandlerManager appManagerBus;
|
||||||
|
|
||||||
public UpdateRecord(HandlerManager appManagerBus, String profileID, String projectID, int modalHeight) {
|
public UpdateRecord(HandlerManager appManagerBus, String profileID, String projectID, int modalWidth, int modalHeight) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.appManagerBus = appManagerBus;
|
this.appManagerBus = appManagerBus;
|
||||||
this.profileID = profileID;
|
this.profileID = profileID;
|
||||||
|
@ -101,6 +101,8 @@ public class UpdateRecord extends Composite {
|
||||||
alertHTMLPanel.add(loaderProjectSections);
|
alertHTMLPanel.add(loaderProjectSections);
|
||||||
|
|
||||||
scrollSectionContent.setHeight((modalHeight-300)+"px");
|
scrollSectionContent.setHeight((modalHeight-300)+"px");
|
||||||
|
|
||||||
|
listBoxSections.setWidth((modalWidth-50)+"px");
|
||||||
|
|
||||||
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
GeoportalDataEntryServiceAsync.Util.getInstance().getProjectEdit(profileID, projectID,
|
||||||
new AsyncCallback<ProjectEdit>() {
|
new AsyncCallback<ProjectEdit>() {
|
||||||
|
@ -259,7 +261,7 @@ public class UpdateRecord extends Composite {
|
||||||
modal.setCloseVisible(true);
|
modal.setCloseVisible(true);
|
||||||
modal.setTitle("Error :-(");
|
modal.setTitle("Error :-(");
|
||||||
panelContainer.clear();
|
panelContainer.clear();
|
||||||
String errorMsg = "Sorry, an error occurrend when updating the project with id: "+projectID+". Please, try again. If the problem persists, please contact the support";
|
String errorMsg = "Sorry, an error occurred when updating the project with id: "+projectID+". Please, try again. If the problem persists, please contact the support";
|
||||||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||||
alert.setClose(false);
|
alert.setClose(false);
|
||||||
modal.add(alert);
|
modal.add(alert);
|
||||||
|
|
|
@ -180,7 +180,9 @@ public class FormDataObjectToJSON {
|
||||||
// value is a list
|
// value is a list
|
||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
for (String value : listValues) {
|
for (String value : listValues) {
|
||||||
array.put(value);
|
if(value!=null && !value.isEmpty()) {
|
||||||
|
array.put(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sectJSONObject.put(key, array);
|
sectJSONObject.put(key, array);
|
||||||
|
|
|
@ -293,32 +293,36 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
Document updatedDocument = Serialization.read(newDocJson.toString(), Document.class);
|
Document updatedDocument = Serialization.read(newDocJson.toString(), Document.class);
|
||||||
LOG.info("New document is: {}", updatedDocument.toJson());
|
LOG.info("New document is: {}", updatedDocument.toJson());
|
||||||
|
|
||||||
//Project project = client.updateProject(profileID, projectID, updatedDocument);
|
Project project = client.updateProject(profileID, projectID, updatedDocument);
|
||||||
Project project = client.getProjectByID(profileID, projectID);
|
// Project project = client.getProjectByID(profileID, projectID);
|
||||||
LOG.debug("Medatata Updated with document: {}", project.getTheDocument());
|
LOG.debug("Medatata Updated with document: {}", project.getTheDocument());
|
||||||
|
|
||||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||||
|
|
||||||
if(listFilePaths!=null) {
|
if (listFilePaths != null) {
|
||||||
|
|
||||||
//Cleaning all the fileset path of the section (defined in the UCD)
|
// Cleaning all the fileset path of the section (defined in the UCD)
|
||||||
for (FilePathDV filePath: listFilePaths) {
|
for (FilePathDV filePath : listFilePaths) {
|
||||||
|
|
||||||
String filesetFieldName = filePath.getFieldName();
|
String filesetFieldName = filePath.getFieldName();
|
||||||
String filesetPath = sectionPath+"."+filesetFieldName;
|
String filesetPath = sectionPath + "." + filesetFieldName;
|
||||||
//Replacing $.abc with $..abc
|
// Replacing $.abc with $..abc
|
||||||
filesetPath = filesetPath.replaceFirst("\\.", "..");
|
filesetPath = filesetPath.replaceFirst("\\.", "..");
|
||||||
LOG.info("Going to delete fileset path: {}", filesetPath);
|
LOG.info("Going to delete fileset path: {}", filesetPath);
|
||||||
//client.deleteFileset(profileID, projectID, filesetPath, true);
|
try {
|
||||||
|
client.deleteFileset(profileID, projectID, filesetPath, true);
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.warn("Error on into project id {} the fileset path {} ", projectID, filesetPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Registering new files
|
// Registering new files
|
||||||
List<? extends FileUploaded> filesUploaded = sectionBean.getFilesUploaded();
|
List<? extends FileUploaded> filesUploaded = sectionBean.getFilesUploaded();
|
||||||
if(filesUploaded!=null && !filesUploaded.isEmpty()) {
|
if (filesUploaded != null && !filesUploaded.isEmpty()) {
|
||||||
replaceFiles(project, sectionPath, section.getGcubeProfileDV(), filesUploaded);
|
replaceFiles(project, sectionPath, section.getGcubeProfileDV(), filesUploaded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.info("Project with id " + project.getId() + " updated correclty");
|
LOG.info("Project with id " + project.getId() + " updated correclty");
|
||||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||||
ProjectDV toProjectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
ProjectDV toProjectDV = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||||
|
@ -568,8 +572,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
||||||
Access access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument, sectionJSONPath);
|
Access access = ConvertToDataServiceModel.getAccessFromDocumentSection(theJSONDocument, sectionJSONPath);
|
||||||
|
|
||||||
LOG.info("Going to registrer files: " + Arrays.asList(fileset).toString());
|
LOG.info("Going to registrer files: " + Arrays.asList(fileset).toString());
|
||||||
// mongoService.registerFileSet(theProject.getProfileID(), theProject, sectionJSONPath,
|
mongoService.registerFileSet(theProject.getProfileID(), theProject, sectionJSONPath,
|
||||||
// filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
filePath.getFieldName(), filePath.getFieldDefinition(), access, fileset);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue