Improved GUI and layout

This commit is contained in:
Francesco Mangiacrapa 2022-09-23 12:41:32 +02:00
parent f110ae1685
commit 6178b38bfa
8 changed files with 181 additions and 194 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -46,7 +47,8 @@
<wb-module deploy-name="geoportal-data-entry-app-3.0.0-SNAPSHOT">
@ -93,7 +95,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -140,7 +143,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -196,7 +200,8 @@
<dependent-module archiveName="geoportal-data-common-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -243,7 +248,8 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -290,7 +296,8 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -337,7 +344,8 @@
</wb-module>

View File

@ -9,6 +9,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescrip
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.RootPanel;
/**
* The Class ConstantsGeoPortalDataEntryApp.
@ -18,9 +19,9 @@ import com.google.gwt.core.client.GWT;
* Aug 6, 2021
*/
public class ConstantsGeoPortalDataEntryApp {
public static final String DIV_PORTLET_ID = "geoportal-data-entry";
public static final String DIV_LOADERS_ID = "geoportal-loaders";
public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT;
@ -30,11 +31,19 @@ public class ConstantsGeoPortalDataEntryApp {
public static final String HOURS_MINUTES_SEPARATOR = ConstantsMPFormBuilder.HOURS_MINUTES_SEPARATOR;
public static final int MAX_COLUMN_DISPLAYED_IN_THE_TABLE = 5;
public static final int PAGINATION_SIZE = 20;
public static final String DEFAULT_DOCUMENT_PROJECTION_NAME = "_theDocument";
public static final String CSS_CLASS_ANIMATE_FADE_IN_OUT = "animate-fadeInOut";
public static final RootPanel ROOT_PANEL_DIV_LOADERS = RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID);
public static final RootPanel ROOT_PANEL_DIV_PORTLET = RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID);
public static final String CSS_CLASS_GEOPORTAL_LOADERS_CENTER = "geoportal-loaders-center";
/**
* The Enum RECORD_TYPE.
*

View File

@ -101,13 +101,6 @@ import com.google.gwt.user.client.ui.VerticalPanel;
*/
public class GeoPortalDataEntryApp implements EntryPoint {
/**
* The message displayed to the user when the server cannot be reached or
* returns an error.
*/
private static final String SERVER_ERROR = "An error occurred while "
+ "attempting to contact the server. Please check your network " + "connection and try again.";
public static final GeoportalDataEntryServiceAsync geoportalDataEntryService = GWT
.create(GeoportalDataEntryService.class);
@ -184,15 +177,19 @@ public class GeoPortalDataEntryApp implements EntryPoint {
*/
geoportalCaches = new GeoPortalClientCaches();
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).add(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement()
.addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_GEOPORTAL_LOADERS_CENTER);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(loaderApplication);
mainTabPanel = new GeonaMainTabPanel(appManagerBus);
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
mainTabPanel.addFormPanel(geoNaMainForm);
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(mainTabPanel);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(mainTabPanel);
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).getElement().getStyle().setOpacity(0.4);
// ROOT_PANEL_DIV_PORTLET.getElement().getStyle().setOpacity(0.3);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.addClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeonaISConfig>() {
@ -202,11 +199,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
}
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(alert);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.add(alert);
Window.alert(errorMsg);
}
@ -232,11 +229,13 @@ public class GeoPortalDataEntryApp implements EntryPoint {
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
} catch (Exception e) {
}
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(alert);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert);
Window.alert(errorMsg);
}
@ -246,7 +245,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig);
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderApplication);
} catch (Exception e) {
}
@ -295,7 +294,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
GWT.log("loading GeoportalConfigsAndBuildCards in the scope: " + scope);
// orderedCards = new ArrayList<GeoNaFormCardModel>();
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).insert(loaderConfigurations, 0);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.insert(loaderConfigurations, 0);
} catch (Exception e) {
}
@ -304,13 +303,18 @@ public class GeoPortalDataEntryApp implements EntryPoint {
@Override
public void onFailure(Throwable caught) {
String errorMsg = "Sorry, an error occurrend on loading configurations. Please, contact the support";
Alert alert = new Alert(errorMsg, AlertType.ERROR);
alert.setClose(false);
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderConfigurations);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderConfigurations);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
} catch (Exception e) {
}
GWT.log("caught: " + caught);
Window.alert(caught.toString());
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.add(alert);
Window.alert(errorMsg);
}
@Override
@ -326,9 +330,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
// After loading of UCD I can instance the "List of Project" view
mainTabPanel.instanceAndShowListOfProjects();
try {
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).getElement().getStyle()
.setOpacity(1);
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderConfigurations);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET.getElement()
.removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_ANIMATE_FADE_IN_OUT);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.remove(loaderConfigurations);
ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_LOADERS.getElement()
.removeClassName(ConstantsGeoPortalDataEntryApp.CSS_CLASS_GEOPORTAL_LOADERS_CENTER);
} catch (Exception e) {
}
@ -370,7 +376,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
public void updateSize() {
try {
RootPanel workspace = RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID);
RootPanel workspace = ConstantsGeoPortalDataEntryApp.ROOT_PANEL_DIV_PORTLET;
int topBorder = workspace.getAbsoluteTop();
int footer = 85; // footer is bottombar + sponsor
int headerSize = 90;
@ -567,6 +573,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
public void onSuccess(CommitReport result) {
modalContainerPanel.clear();
modal.setCloseVisible(true);
modal.setTitle("Project Saved!");
LifecycleInformationDV lcDV = result.getLifecycleInformation();
@ -592,6 +599,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
break;
}
savedMap.put(result.getProjectID(), saveGeonaDataFormsEvent.getTreeNode());
LifecycleInformationPanel lip = new LifecycleInformationPanel(result.getProjectID(),
result.getProfileID(), result.getProjectAsJSON(), lcDV, true);
@ -776,17 +785,17 @@ public class GeoPortalDataEntryApp implements EntryPoint {
mainTabPanel.setFilteringParameters(seachingFilterParameters);
searchingFilter = mainTabPanel.getCurrentProjectsSearchingFilter();
//Searching in the cache if the list of relation names is present
// Searching in the cache if the list of relation names is present
List<String> listRelationNames = geoportalCaches.getListRelationNamesForProfileId(profileID);
// Loading list of Relation Names for ProfileID
if (listRelationNames == null || listRelationNames.isEmpty()) {
GeoPortalDataEntryApp.geoportalDataEntryService.getRelationshipNames(profileID,
new AsyncCallback<List<String>>() {
@Override
public void onSuccess(List<String> relationshipNames) {
GWT.log("getRelationshipNames for " + profileID + " are: "+relationshipNames);
GWT.log("getRelationshipNames for " + profileID + " are: " + relationshipNames);
geoportalCaches.putListRelationNamesForProfileID(profileID, relationshipNames);
mainTabPanel.setVisibleCreateRelationButton(
relationshipNames != null && !relationshipNames.isEmpty());

View File

@ -159,7 +159,7 @@ public class GeonaMainTabPanel extends Composite {
theDockLayoutPanel.setWidgetHidden(listOfProjectWorkflowActionsPanel, true);
detailsPanel.addStyleName("theDetailsPanel");
theDockLayoutPanel.addEast(detailsPanel, 500);
theDockLayoutPanel.addEast(detailsPanel, 450);
theDockLayoutPanel.setWidgetHidden(detailsPanel, true);
listOfProjectTablePanel = new ListOfProjectTablePanel(appManagerBus);

View File

@ -1,23 +1,16 @@
package org.gcube.portlets.user.geoportaldataentry.client.ui.relation;
import java.util.HashMap;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.RelationshipDV;
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
import org.gcube.portlets.user.geoportaldataentry.client.events.CloseCreateRelationGUIEvent;
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateRelationHandlerEvent;
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
import org.gcube.portlets.user.geoportaldataentry.client.ui.report.ReportTemplateToHTML;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
import com.github.gwtbootstrap.client.ui.Alert;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.Label;
import com.github.gwtbootstrap.client.ui.ListBox;
import com.github.gwtbootstrap.client.ui.constants.ButtonType;
import com.github.gwtbootstrap.client.ui.constants.IconSize;
import com.github.gwtbootstrap.client.ui.constants.IconType;
@ -35,7 +28,6 @@ import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Widget;
public class ViewRelationshipPanel extends Composite {

View File

@ -66,29 +66,6 @@ public class LifecycleInformationPanel extends FlowPanel {
}
lastOperationStatus.setHTML(lastOperationMsg);
// switch (lcDV.getLastOperationStatus()) {
// case OK: {
// String success = HTMLUtil.getHTMLElement(HTML_TAG.span, 14, "32CD32", null, "SUCCESS");
// String msg = lcDV.getLastInvokedStep() + " terminated with: " + success;
// lastOperationStatus.setHTML(msg);
// break;
// }
// case WARNING: {
// String warning = HTMLUtil.getHTMLElement(HTML_TAG.span, 14, "FF8000", null, "WARNING");
// String msg = lcDV.getLastInvokedStep() + " terminated with: " + warning;
// lastOperationStatus.setHTML(msg);
// break;
// }
// case ERROR: {
// String error = HTMLUtil.getHTMLElement(HTML_TAG.span, 14, "FF0000", "bold", "ERROR");
// String msg = lcDV.getLastInvokedStep() + " terminated with: " + error;
// lastOperationStatus.setHTML(msg);
// break;
// }
// default:
// break;
// }
add(htmlPhase);
add(htmlStep);
add(lastOperationStatus);

View File

@ -5,7 +5,10 @@ package org.gcube.portlets.user.geoportaldataentry.client.ui.table;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
@ -14,6 +17,7 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.BasicLifecycleInformationDV.Status;
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 com.github.gwtbootstrap.client.ui.ButtonCell;
@ -53,7 +57,23 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
private AbstractDataProvider<T> dataProvider;
private List<ItemFieldDV> displayFields;
private boolean isAsyncronusTable;
private boolean showColumnRelationship;
private Map<COLUMN_NAME, Column> mapColumns = new HashMap<COLUMN_NAME, Column>();
public enum COLUMN_NAME {
CREATED("Created"), CREATED_BY("Created by"), PHASE("Phase"), STATUS("Status"), RELATIONSHIPS("Relationships");
String title;
COLUMN_NAME(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
}
/**
* Instantiates a new items table.
@ -66,10 +86,6 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
this.eventBus = eventBus;
this.displayFields = displayFields;
}
public void setShowColumnRelationship(boolean showColumnRelationship) {
this.showColumnRelationship = showColumnRelationship;
}
/**
* Adds the items.
@ -97,7 +113,7 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
this.isAsyncronusTable = dataProvider instanceof ListDataProvider ? false : true;
setEmptyTableMessage(NO_DATA);
int i = 0;
int i = 1;
for (ItemFieldDV itemField : displayFields) {
@ -117,90 +133,19 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
DocumentDV documentDV = (DocumentDV) object;
try {
//removing the '_theDocument.' prefix for searching in the Document Map
String key = itemField.getJsonFields().get(0).replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME+".", "");
// 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();
} catch (Exception e) {
GWT.log("Error e: " + e);
}
/*
* if (displayName.equalsIgnoreCase("Name")) { return ((ConcessioneDV)
* object).getNome(); } else if (displayName.equalsIgnoreCase("Introduction")) {
* return ((ConcessioneDV) object).getIntroduzione(); } else if
* (displayName.equalsIgnoreCase("Author/s")) {
*
* String toDisplay = ""; if (object.getAuthors() != null) { toDisplay =
* toDisplayAuthors(((ConcessioneDV) object).getAuthors()); } return toDisplay;
* } else if (displayName.equalsIgnoreCase("Project Start/End Date")) {
*
* Date dS = null; Date dE = null; if (object.getDataInizioProgetto() != null) {
* dS = (((ConcessioneDV) object).getDataInizioProgetto()); }
*
* if (object.getDataFineProgetto() != null) { dE = (((ConcessioneDV)
* object).getDataFineProgetto()); }
*
* String dateFormat = ""; if (dS != null) { dateFormat += dtformat.format(dS);
* }
*
* dateFormat += " / ";
*
* if (dE != null) { dateFormat += dtformat.format(dE); }
*
* return dateFormat; } else if (displayName.equalsIgnoreCase("Published with"))
* { ValidationReportDV vr = ((ConcessioneDV) object).getValidationReport(); if
* (vr != null && vr.getStatus() != null) return vr.getStatus().getLabel();
* return ""; } else if (displayName.equalsIgnoreCase("Created")) { Date cd =
* ((ConcessioneDV) object).getCreationTime(); return dtformat.format(cd); }
* else if (displayName.equalsIgnoreCase("Created by")) { return
* ((ConcessioneDV) object).getCreationUser(); }else if
* (displayName.toLowerCase().contains("unpub")) { ValidationReportDV vr =
* ((ConcessioneDV) object).getValidationReport(); if (vr != null &&
* vr.getObjectName() != null) return vr.getObjectName(); }
*/
return "";
}
// // ADDING TOOLTIP
// @Override
// public void render(com.google.gwt.cell.client.Cell.Context context, T object, SafeHtmlBuilder sb) {
// if (object == null)
// return;
//
// if (displayName.equalsIgnoreCase("Published with")) {
// String value = getValue(object);
// String color = "#000";
// if (value.compareTo(ValidationStatus.PASSED.getLabel()) == 0) {
// color = "#32CD32";
// } else if (value.compareTo(ValidationStatus.WARNING.getLabel()) == 0) {
// color = "#FF8000";
// } else if (value.compareTo(ValidationStatus.ERROR.getLabel()) == 0) {
// color = "red";
// }
// sb.appendHtmlConstant("<span style=\"color:" + color + "\";>");
// super.render(context, object, sb);
// sb.appendHtmlConstant("</span>");
// } else
// super.render(context, object, sb);
//
// };
};
// if(i==0) {
// //name
// sortedCellTable.setColumnWidth(col, 20, Unit.PCT);
// }else if (i == 1) {
// // intro
// sortedCellTable.setColumnWidth(col, 30, Unit.PCT);
// } else if (i == 2) {
// sortedCellTable.setColumnWidth(col, 15, Unit.PCT);
// }else if(i==displayFields.size()-1) {
// sortedCellTable.setColumnWidth(col, 120, Unit.PX);
// }
sortedCellTable.addColumn(col, displayName, true);
i++;
}
@ -227,7 +172,8 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
};
sortedCellTable.addColumn(colCreated, "Created", true);
sortedCellTable.addColumn(colCreated, COLUMN_NAME.CREATED.getTitle(), true);
mapColumns.put(COLUMN_NAME.CREATED, colCreated);
// COL PUBLISHER
TextColumn<T> colPublisher = new TextColumn<T>() {
@ -252,7 +198,8 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
};
sortedCellTable.addColumn(colPublisher, "Created by", true);
sortedCellTable.addColumn(colPublisher, COLUMN_NAME.CREATED_BY.getTitle(), true);
mapColumns.put(COLUMN_NAME.CREATED_BY, colPublisher);
// COL PUBLICATION PHASE
TextColumn<T> colPublicationPhase = new TextColumn<T>() {
@ -274,7 +221,8 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
}
};
sortedCellTable.addColumn(colPublicationPhase, "Phase", true);
sortedCellTable.addColumn(colPublicationPhase, COLUMN_NAME.PHASE.getTitle(), true);
mapColumns.put(COLUMN_NAME.PHASE, colPublicationPhase);
// COL OPERTION STATUS
TextColumn<T> colOperationStatus = new TextColumn<T>() {
@ -316,19 +264,19 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
} else if (status.equals(Status.ERROR)) {
color = "red";
}
sb.appendHtmlConstant("<span style=\"color:" + color + "\";>");
sb.appendHtmlConstant("<span style='color:" + color + ";'>");
super.render(context, object, sb);
sb.appendHtmlConstant("</span>");
};
};
sortedCellTable.addColumn(colOperationStatus, "Status", true);
sortedCellTable.addColumn(colOperationStatus, COLUMN_NAME.STATUS.getTitle(), true);
mapColumns.put(COLUMN_NAME.STATUS, colOperationStatus);
// COL OPERTION STATUS
/*TextColumn<T> colRelationship = new TextColumn<T>() {
TextColumn<T> colRelationship = new TextColumn<T>() {
@Override
public String getValue(T object) {
@ -336,54 +284,75 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
return "";
ResultDocumentDV documentDV = (ResultDocumentDV) object;
String relationship = "N.A.";
try {
status = documentDV.getListRelationshipDV()!=null?
} catch (Exception e) {
// TODO: handle exception
}
return status;
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)
return;
ResultDocumentDV documentDV = (ResultDocumentDV) object;
Status status = null;
try {
status = documentDV.getLifecycleInfo().getLastOperationStatus();
} catch (Exception e) {
List<RelationshipDV> relations = documentDV.getListRelationshipDV();
String color = "#333";
if (relations==null || relations.isEmpty()) {
color = "#555";
}
String color = "#000";
if (status.equals(Status.OK)) {
color = "#32CD32";
} else if (status.equals(Status.WARNING)) {
color = "#FF8000";
} else if (status.equals(Status.ERROR)) {
color = "red";
}
sb.appendHtmlConstant("<span style=\"color:" + color + "\";>");
sb.appendHtmlConstant("<span style='color:" + color + "; font-style: italic;'>");
super.render(context, object, sb);
sb.appendHtmlConstant("</span>");
};
};
};
if(showColumnRelationship)
sortedCellTable.addColumn(colRelationship, "Relationship", true);
*/
sortedCellTable.addColumn(colRelationship, COLUMN_NAME.RELATIONSHIPS.getTitle(), true);
mapColumns.put(COLUMN_NAME.RELATIONSHIPS, colRelationship);
}
public void enableWriteOperations() {
public void removeColumn(COLUMN_NAME columnName) {
try {
Column theColumn = mapColumns.get(columnName);
if (theColumn != null) {
sortedCellTable.removeColumn(theColumn);
}
} catch (Exception e) {
}
}
private String toDisplayClusterOfRelationships(List<RelationshipDV> listRelations) {
if (listRelations == null || listRelations.isEmpty()) {
return "None";
}
LinkedHashMap<String, Integer> mapclusterOfRelationships = new LinkedHashMap<String, Integer>(
listRelations.size());
for (RelationshipDV relationshipDV : listRelations) {
Integer count = mapclusterOfRelationships.get(relationshipDV.getRelationshipName());
if (count == null)
count = 0;
count++;
mapclusterOfRelationships.put(relationshipDV.getRelationshipName(), count);
}
String html = "";
for (String relationName : mapclusterOfRelationships.keySet()) {
html += mapclusterOfRelationships.get(relationName) + " - " +relationName + "\n";
}
return html;
}
/**

View File

@ -48,6 +48,7 @@ h1 {
padding: 5px;
margin-left: 10px;
margin-bottom: 10px;
margin-right: 5px;
}
.my-html-table td {
@ -195,16 +196,38 @@ h1 {
margin: auto 0;
}
#geoportal-loaders {
text-align: center;
width: 100%;
.geoportal-loaders-center {
position: absolute;
left:40%;
padding: 200px 0;
z-index: 1000;
}
.geoportal-loaders-center table {
margin-bottom: 20px;
}
@keyframes fadeInOutAnimation {
0% {
opacity: 0.2;
}
100% {
opacity: 0.5;
}
}
.animate-fadeInOut {
animation: fadeInOutAnimation 1s infinite;
animation-direction: alternate;
animation-timing-function: linear;
}
.theDetailsPanel {
margin-left: 5px;
margin-right: 5px;
/*border-left: 1px solid #cdcdcd;*/
border-left: 1px solid #cdcdcd;
padding-left: 5px;
padding-right: 5px;
}
.theDetailsPanel .accordion-group {