From 30881a9d302f1ffd61f675446ffaeae0117bf9f8 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Fri, 23 Sep 2022 15:40:11 +0200 Subject: [PATCH] Improved GUI and layout --- .../ConstantsGeoPortalDataEntryApp.java | 20 ++-- .../client/GeoPortalDataEntryApp.java | 11 +-- .../client/GeoportalDataEntryService.java | 11 --- .../GeoportalDataEntryServiceAsync.java | 8 +- .../client/ui/GeonaMainTabPanel.java | 14 +-- .../client/ui/GeonaRecordsPaginatedView.java | 9 ++ .../client/ui/action/ActionListPanel.ui.xml | 2 +- .../client/ui/edit/EditModeRecord.java | 6 +- .../client/ui/table/ItemsTable.java | 94 ++++++++++++++----- .../server/GeoportalDataEntryServiceImpl.java | 89 +++++------------- src/main/webapp/GeoPortalDataEntryApp.css | 2 +- 11 files changed, 130 insertions(+), 136 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java index 516b553..cdb02f0 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ConstantsGeoPortalDataEntryApp.java @@ -44,16 +44,16 @@ public class ConstantsGeoPortalDataEntryApp { public static final String CSS_CLASS_GEOPORTAL_LOADERS_CENTER = "geoportal-loaders-center"; - /** - * The Enum RECORD_TYPE. - * - * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it - * - * Aug 6, 2021 - */ - public enum RECORD_TYPE { - CONCESSIONE - } +// /** +// * The Enum RECORD_TYPE. +// * +// * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it +// * +// * Aug 6, 2021 +// */ +// public enum RECORD_TYPE { +// CONCESSIONE +// } /** * The Enum ACTION_PERFORMED_ON_ITEM. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java index d22818f..acc0c2c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoPortalDataEntryApp.java @@ -24,7 +24,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.Relationsh import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV; import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM; -import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig; import org.gcube.portlets.user.geoportaldataentry.client.events.ClickItemEvent; import org.gcube.portlets.user.geoportaldataentry.client.events.ClickItemEventHandler; @@ -110,9 +109,6 @@ public class GeoPortalDataEntryApp implements EntryPoint { private GeonaDataEntryMainForm geoNaMainForm = null; - // private Collection orderedCards = new - // ArrayList(); - private GeonaMainTabPanel mainTabPanel; private LinkedHashMap> savedMap = new LinkedHashMap>(); @@ -141,8 +137,6 @@ public class GeoPortalDataEntryApp implements EntryPoint { return numberOfCards; } - // private List listUCDescriptors; - private boolean dataEntryProjectCreated = false; private TreeItemPanel treeItemPanel; @@ -797,7 +791,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { public void onSuccess(List relationshipNames) { GWT.log("getRelationshipNames for " + profileID + " are: " + relationshipNames); geoportalCaches.putListRelationNamesForProfileID(profileID, relationshipNames); - mainTabPanel.setVisibleCreateRelationButton( + mainTabPanel.enableRelatioshipFacilities( relationshipNames != null && !relationshipNames.isEmpty()); } @@ -1251,8 +1245,7 @@ public class GeoPortalDataEntryApp implements EntryPoint { modal3.setCloseVisible(true); ((Element) modal3.getElement().getChildNodes().getItem(1)) .addClassName("modal-body-custom"); - EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV, - RECORD_TYPE.CONCESSIONE); + EditModeRecord emr = new EditModeRecord(appManagerBus, resultDocumentDV); modal3.add(emr); modal3.show(); break; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java index 72c0cbf..1bfb074 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryService.java @@ -14,7 +14,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescrip import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; -import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; @@ -105,16 +104,6 @@ public interface GeoportalDataEntryService extends RemoteService { */ FileSetPathsDV readFileSetPaths() throws Exception; - /** - * Gets the record. - * - * @param itemId the item id - * @param recordType the record type - * @return the record - * @throws Exception the exception - */ - ConcessioneDV getRecord(String itemId, RECORD_TYPE recordType) throws Exception; - /** * Update record. * diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java index aaef08f..fc718e0 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/GeoportalDataEntryServiceAsync.java @@ -14,7 +14,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescrip import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; -import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; import org.gcube.portlets.user.geoportaldataentry.shared.GNADataEntryExtConfigProfile; import org.gcube.portlets.user.geoportaldataentry.shared.GeoNaFormDataObject; @@ -30,7 +29,7 @@ import com.google.gwt.user.client.rpc.AsyncCallback; * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * - * Sep 1, 2022 + * Sep 1, 2022 */ public interface GeoportalDataEntryServiceAsync { @@ -52,7 +51,8 @@ public interface GeoportalDataEntryServiceAsync { } } - void saveGeonaDataForms(String profileID, Tree_Node tree_Node, AsyncCallback callback); + void saveGeonaDataForms(String profileID, Tree_Node tree_Node, + AsyncCallback callback); void getGeonaInitConfig(AsyncCallback callback); @@ -69,8 +69,6 @@ public interface GeoportalDataEntryServiceAsync { void readFileSetPaths(AsyncCallback callback); - void getRecord(String itemId, RECORD_TYPE recordType, AsyncCallback callback); - void updateSectionForRecord(String itemId, String recordType, String section, int pathIndex, List keepCurrentContent, GenericDatasetBean gDBean, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java index f2b11b8..8b414cc 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaMainTabPanel.java @@ -22,6 +22,7 @@ import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProje import org.gcube.portlets.user.geoportaldataentry.client.ui.projects.ListOfProjectWorkflowActionsPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.relation.CreateRelationProjectsPanel; import org.gcube.portlets.user.geoportaldataentry.client.ui.relation.ViewRelationshipPanel; +import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable.DEFAULT_DISPLAYING_COLUMN_NAME; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.UCD_Util; @@ -577,14 +578,13 @@ public class GeonaMainTabPanel extends Composite { viewRelationshipPanel = new ViewRelationshipPanel(appManagerBus, selectedDocument); detailsPanel.add(viewRelationshipPanel); } - - /** - * Sets the visible create relation. - * - * @param bool the new visible create relation - */ - public void setVisibleCreateRelationButton(boolean bool) { + + + public void enableRelatioshipFacilities(boolean bool) { navCreateRelation.setVisible(bool); + if(!bool) { + grpw.removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS); + } } } diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java index dd3d0f7..cfd1880 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/GeonaRecordsPaginatedView.java @@ -11,6 +11,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable; +import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable.DEFAULT_DISPLAYING_COLUMN_NAME; import org.gcube.portlets.user.geoportaldataentry.client.ui.table.SortedCellTable; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon; @@ -264,6 +265,14 @@ public class GeonaRecordsPaginatedView { itemsTable.getSelectionModel().setSelected(item, select); } } + + public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) { + try { + itemsTable.removeColumn(columnName); + }catch (Exception e) { + // TODO: handle exception + } + } /** * Gets the select items. diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/ActionListPanel.ui.xml b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/ActionListPanel.ui.xml index e2c1b51..b230cc9 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/ActionListPanel.ui.xml +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/action/ActionListPanel.ui.xml @@ -20,7 +20,7 @@ - WORKFLOW ACTIONS + MODERATION ACTIONS \ No newline at end of file diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java index c8dfe7f..0e89bf3 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/edit/EditModeRecord.java @@ -7,7 +7,6 @@ import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV; import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM; -import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp; import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEvent; import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEventHandler; @@ -63,8 +62,6 @@ public class EditModeRecord extends Composite { private ResultDocumentDV selectedProject; - private RECORD_TYPE recordType; - private JSONEditorWrapper jsEditor; private HandlerManager appManagerBus; @@ -81,10 +78,9 @@ public class EditModeRecord extends Composite { interface EditModeRecordUiBinder extends UiBinder { } - public EditModeRecord(HandlerManager appManagerBus, ResultDocumentDV selectedProject, RECORD_TYPE type) { + public EditModeRecord(HandlerManager appManagerBus, ResultDocumentDV selectedProject) { initWidget(uiBinder.createAndBindUi(this)); this.selectedProject = selectedProject; - this.recordType = type; this.appManagerBus = appManagerBus; this.filesUpdatePanel.setHeight("490px"); // filesUpdatePanel.getElement().getStyle().setProperty("maxHeight", "550px"); diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/table/ItemsTable.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/table/ItemsTable.java index 95f4e33..f5c621c 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/table/ItemsTable.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/client/ui/table/ItemsTable.java @@ -19,6 +19,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.project.BasicLifec import org.gcube.application.geoportalcommon.shared.geoportal.project.PublicationInfoDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV; import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp; +import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.StringUtil; import com.github.gwtbootstrap.client.ui.ButtonCell; import com.github.gwtbootstrap.client.ui.Pagination; @@ -51,6 +52,8 @@ import com.google.gwt.view.client.SingleSelectionModel; */ public class ItemsTable extends AbstractItemsCellTable { + private static final String CSS_CLASS_BACK_SYSTEM_CELL = "back-system-cell"; + private static final int MAX_TEXT_DIMENSION = 350; private static final int ITEMS_PER_PAGE = 10; private static final String NO_DATA = "No data"; public static DateTimeFormat dtformat = DateTimeFormat.getFormat(ConvertToDataViewModel.DATE_FORMAT); @@ -58,14 +61,14 @@ public class ItemsTable extends AbstractItemsCellTable private List displayFields; private boolean isAsyncronusTable; - private Map mapColumns = new HashMap(); + private Map mapColumns = new HashMap(); - public enum COLUMN_NAME { + public enum DEFAULT_DISPLAYING_COLUMN_NAME { CREATED("Created"), CREATED_BY("Created by"), PHASE("Phase"), STATUS("Status"), RELATIONSHIPS("Relationships"); String title; - COLUMN_NAME(String title) { + DEFAULT_DISPLAYING_COLUMN_NAME(String title) { this.title = title; } @@ -136,7 +139,8 @@ public class ItemsTable extends AbstractItemsCellTable // removing the '_theDocument.' prefix for searching in the Document Map String key = itemField.getJsonFields().get(0) .replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", ""); - return documentDV.getDocumentAsMap().get(key).toString(); + Object value = documentDV.getDocumentAsMap().get(key); + return value.toString(); } catch (Exception e) { GWT.log("Error e: " + e); } @@ -144,6 +148,43 @@ public class ItemsTable extends AbstractItemsCellTable return ""; } + @Override + public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) { + if (object == null) + return; + + DocumentDV documentDV = (DocumentDV) object; + String objectToRender = ""; + try { + // removing the '_theDocument.' prefix for searching in the Document Map + String key = itemField.getJsonFields().get(0) + .replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", ""); + Object value = documentDV.getDocumentAsMap().get(key); + // GWT.log("key: "+key+" is instance of: "+value.getClass()); + + if (value instanceof ArrayList) { + ArrayList arrayValues = (ArrayList) value; + String toReturn = "
    "; + for (Object arrayValue : arrayValues) { + toReturn += "
  • " + arrayValue + "
  • "; + } + toReturn += "
"; + GWT.log("Array returning: " + key + " is instance of: " + value.getClass() + " to return: " + + toReturn); + objectToRender = StringUtil.ellipsize(toReturn, MAX_TEXT_DIMENSION); + } else { + objectToRender = StringUtil.ellipsize(value.toString(), MAX_TEXT_DIMENSION); + } + + } catch (Exception e) { + GWT.log("Error e: " + e); + } + sb.appendHtmlConstant(objectToRender); +// super.render(context, object, sb); +// sb.appendHtmlConstant(""); + + }; + }; sortedCellTable.addColumn(col, displayName, true); i++; @@ -171,9 +212,10 @@ public class ItemsTable extends AbstractItemsCellTable } }; - - sortedCellTable.addColumn(colCreated, COLUMN_NAME.CREATED.getTitle(), true); - mapColumns.put(COLUMN_NAME.CREATED, colCreated); + + colCreated.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL); + sortedCellTable.addColumn(colCreated, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED.getTitle(), true); + mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.CREATED, colCreated); // COL PUBLISHER TextColumn colPublisher = new TextColumn() { @@ -197,9 +239,10 @@ public class ItemsTable extends AbstractItemsCellTable } }; - - sortedCellTable.addColumn(colPublisher, COLUMN_NAME.CREATED_BY.getTitle(), true); - mapColumns.put(COLUMN_NAME.CREATED_BY, colPublisher); + + colPublisher.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL); + sortedCellTable.addColumn(colPublisher, DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY.getTitle(), true); + mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.CREATED_BY, colPublisher); // COL PUBLICATION PHASE TextColumn colPublicationPhase = new TextColumn() { @@ -221,8 +264,9 @@ public class ItemsTable extends AbstractItemsCellTable } }; - sortedCellTable.addColumn(colPublicationPhase, COLUMN_NAME.PHASE.getTitle(), true); - mapColumns.put(COLUMN_NAME.PHASE, colPublicationPhase); + colPublicationPhase.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL); + sortedCellTable.addColumn(colPublicationPhase, DEFAULT_DISPLAYING_COLUMN_NAME.PHASE.getTitle(), true); + mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.PHASE, colPublicationPhase); // COL OPERTION STATUS TextColumn colOperationStatus = new TextColumn() { @@ -271,9 +315,10 @@ public class ItemsTable extends AbstractItemsCellTable }; }; - - sortedCellTable.addColumn(colOperationStatus, COLUMN_NAME.STATUS.getTitle(), true); - mapColumns.put(COLUMN_NAME.STATUS, colOperationStatus); + + colOperationStatus.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL); + sortedCellTable.addColumn(colOperationStatus, DEFAULT_DISPLAYING_COLUMN_NAME.STATUS.getTitle(), true); + mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.STATUS, colOperationStatus); // COL OPERTION STATUS TextColumn colRelationship = new TextColumn() { @@ -287,7 +332,7 @@ public class ItemsTable extends AbstractItemsCellTable String htmlValue = toDisplayClusterOfRelationships(documentDV.getListRelationshipDV()); return htmlValue; } - + @Override public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) { if (object == null) @@ -296,24 +341,25 @@ public class ItemsTable extends AbstractItemsCellTable ResultDocumentDV documentDV = (ResultDocumentDV) object; List relations = documentDV.getListRelationshipDV(); String color = "#333"; - if (relations==null || relations.isEmpty()) { + if (relations == null || relations.isEmpty()) { color = "#555"; } - + sb.appendHtmlConstant(""); super.render(context, object, sb); sb.appendHtmlConstant(""); }; - - }; - sortedCellTable.addColumn(colRelationship, COLUMN_NAME.RELATIONSHIPS.getTitle(), true); - mapColumns.put(COLUMN_NAME.RELATIONSHIPS, colRelationship); + }; + + colRelationship.setCellStyleNames(CSS_CLASS_BACK_SYSTEM_CELL); + sortedCellTable.addColumn(colRelationship, DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS.getTitle(), true); + mapColumns.put(DEFAULT_DISPLAYING_COLUMN_NAME.RELATIONSHIPS, colRelationship); } - public void removeColumn(COLUMN_NAME columnName) { + public void removeColumn(DEFAULT_DISPLAYING_COLUMN_NAME columnName) { try { Column theColumn = mapColumns.get(columnName); @@ -349,7 +395,7 @@ public class ItemsTable extends AbstractItemsCellTable for (String relationName : mapclusterOfRelationships.keySet()) { - html += mapclusterOfRelationships.get(relationName) + " - " +relationName + "\n"; + html += mapclusterOfRelationships.get(relationName) + " - " + relationName + "\n"; } return html; diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java index 8c30d53..cd07614 100644 --- a/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/geoportaldataentry/server/GeoportalDataEntryServiceImpl.java @@ -13,11 +13,7 @@ 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.lifecycle.LifecycleInformation; import org.gcube.application.geoportal.common.model.document.relationships.Relationship; -import org.gcube.application.geoportal.common.model.legacy.Concessione; -import org.gcube.application.geoportal.common.model.rest.AddSectionToConcessioneRequest; -import org.gcube.application.geoportal.common.model.rest.TempFile; import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDescriptor; -import org.gcube.application.geoportal.common.rest.MongoConcessioni; import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel; import org.gcube.application.geoportalcommon.ConvertToDataViewModel; import org.gcube.application.geoportalcommon.GeoportalCommon; @@ -49,7 +45,6 @@ import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV; import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV; import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV; import org.gcube.common.portal.PortalContext; -import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE; import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryService; import org.gcube.portlets.user.geoportaldataentry.client.ProjectFormCard; import org.gcube.portlets.user.geoportaldataentry.shared.CommitReport; @@ -570,39 +565,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen } } - /** - * Gets the record. - * - * @param itemId the item id - * @param recordType the record type - * @return the record - * @throws Exception the exception - */ - @Override - public ConcessioneDV getRecord(String itemId, RECORD_TYPE recordType) throws Exception { - LOG.info("getRecord called with itemId: " + itemId + ", recordType: " + recordType); - 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(); - Concessione concessione = clientMongo.getById(itemId); - return ConvertToDataViewModel.toConcessione(concessione); - } - - return null; - - } catch (Exception e) { - LOG.error("Error on reading the record with item id: " + itemId, e); - throw new Exception( - "Error occurred on reading the record with id: " + itemId + ". Error: " + e.getMessage()); - } - } - /** * Read file set paths. * @@ -635,6 +597,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen + pathIndex + ", gDBean: " + gDBean, ""); try { + throw new Exception("updateSectionForRecord not implemented!"); + /* if (itemId == null) throw new Exception("Item id is null"); @@ -663,29 +627,28 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen // TODO MUST BE REVISITED - /* - * 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); } - * - */ - + + 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 LOG.info("Unpublishing " + itemId); clientMongo.unPublish(itemId); @@ -712,8 +675,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen LOG.debug("returning concessione: " + concessione); return ConvertToDataViewModel.toConcessione(concessione); } - - return null; + + */ } catch (Exception e) { LOG.error("Error on updating the project with item id: " + itemId, e); diff --git a/src/main/webapp/GeoPortalDataEntryApp.css b/src/main/webapp/GeoPortalDataEntryApp.css index 4330175..b765177 100644 --- a/src/main/webapp/GeoPortalDataEntryApp.css +++ b/src/main/webapp/GeoPortalDataEntryApp.css @@ -69,7 +69,7 @@ h1 { overflow: hidden !important; } -.table-glor td:nth-last-child(-n+4) { +.back-system-cell { background-color: #d9edf7 !important; }