diff --git a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java index f388093..91500ca 100644 --- a/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java +++ b/src/main/java/org/gcube/portlets/user/td/resourceswidget/client/ResourcesPanel.java @@ -147,8 +147,6 @@ public class ResourcesPanel extends FramedPanel { } - - public void open(TRId trId) { this.trId = trId; create(); @@ -204,27 +202,19 @@ public class ResourcesPanel extends FramedPanel { + "" + msgs.descriptionLabelFixed() + "" + "" - + SafeHtmlUtils.htmlEscape(value.getDescription()) + - + + SafeHtmlUtils.htmlEscape(value.getDescription()); + + /* "" + "" + "" + "" + msgs.creationDateLabelFixed() + "" + "" + SafeHtmlUtils.htmlEscape(value.getCreationDate()) + - /* - * "" + "" + "" + - * "" - * + msgs.creatorIdLabelFixed() + "" + - * "" - * + new SafeHtmlBuilder().append(value.getCreatorId()). - * toSafeHtml().asString() + - */ - - "" + "" + "" + "" - + msgs.typeLabelFixed() + "" - + "" - + SafeHtmlUtils.htmlEscape(value.getResourceType().toString()) + "" + ""; + "" + "" + "" + + "" + msgs.typeLabelFixed() + + "" + "" + + SafeHtmlUtils.htmlEscape(value.getResourceType().toString()) + "" + "";*/ ResourceTD resource = value.getResourceTD(); String resourceData = ""; @@ -273,15 +263,23 @@ public class ResourcesPanel extends FramedPanel { } else { if (resource instanceof SDMXResourceTD) { SDMXResourceTD sdmxResourceTD = (SDMXResourceTD) resource; - if (sdmxResourceTD.getName() != null && !sdmxResourceTD.getName().isEmpty()) { - resourceData = resourceData + "" - + "" - + msgs.sdmxNameIdLabelFixed() + "" - + "" - + "" + SafeHtmlUtils.htmlEscape(sdmxResourceTD.getName()) - + "" + "" + ""; - - } + /* + * if (sdmxResourceTD.getName() != null + * && + * !sdmxResourceTD.getName().isEmpty()) + * { resourceData = resourceData + + * "" + + * "" + * + msgs.sdmxNameIdLabelFixed() + + * "" + + * "" + * + "" + + * SafeHtmlUtils.htmlEscape( + * sdmxResourceTD.getName()) + "" + * + "" + ""; + * + * } + */ if (sdmxResourceTD.getResourceUrl() != null && !sdmxResourceTD.getResourceUrl().isEmpty()) { @@ -346,11 +344,11 @@ public class ResourcesPanel extends FramedPanel { }); expanderColumn.setHideable(false); - //SafeStylesBuilder styleB=new SafeStylesBuilder(); - //expanderColumn.setColumnStyle(styleB.margin(5.0, Unit.PX).toSafeStyles()); + // SafeStylesBuilder styleB=new SafeStylesBuilder(); + // expanderColumn.setColumnStyle(styleB.margin(5.0, + // Unit.PX).toSafeStyles()); expanderColumn.setVerticalAlignment(HasVerticalAlignment.ALIGN_TOP); - - + ColumnConfig nameCol = new ColumnConfig( props.name(), 140, msgs.nameCol()); @@ -452,33 +450,33 @@ public class ResourcesPanel extends FramedPanel { listOfActionCells) { // override the default layout @Override - protected void render(Cell.Context context, ResourceTDDescriptor value, - SafeHtmlBuilder sb, HasCell hasCell) { + protected void render(Cell.Context context, ResourceTDDescriptor value, SafeHtmlBuilder sb, + HasCell hasCell) { // Override individual cell layout Cell cell = hasCell.getCell(); - + // set the width of the text input cell - if (value!=null&&value.getResourceType()!=null) { - switch(value.getResourceType()){ + if (value != null && value.getResourceType() != null) { + switch (value.getResourceType()) { case CHART: sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); break; case CODELIST: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } break; case CSV: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } else { - if(((String)hasCell.getValue(value)).compareTo("save")==0){ + if (((String) hasCell.getValue(value)).compareTo("save") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); @@ -491,26 +489,26 @@ public class ResourcesPanel extends FramedPanel { sb.appendHtmlConstant(""); break; case GENERIC_TABLE: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } break; case GUESSER: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } break; case JSON: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } else { - if(((String)hasCell.getValue(value)).compareTo("save")==0){ + if (((String) hasCell.getValue(value)).compareTo("save") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); @@ -518,12 +516,12 @@ public class ResourcesPanel extends FramedPanel { } break; case MAP: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } else { - if(((String)hasCell.getValue(value)).compareTo("open")==0){ + if (((String) hasCell.getValue(value)).compareTo("open") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); @@ -531,12 +529,12 @@ public class ResourcesPanel extends FramedPanel { } break; case SDMX: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } else { - if(((String)hasCell.getValue(value)).compareTo("open")==0){ + if (((String) hasCell.getValue(value)).compareTo("open") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); @@ -544,25 +542,21 @@ public class ResourcesPanel extends FramedPanel { } break; default: - if(((String)hasCell.getValue(value)).compareTo("delete")==0){ + if (((String) hasCell.getValue(value)).compareTo("delete") == 0) { sb.appendHtmlConstant("
"); cell.render(context, hasCell.getValue(value), sb); sb.appendHtmlConstant("
"); } break; - + } - - - - } - - + + } + } }; - ColumnConfig actionColumn = new ColumnConfig( new IdentityValueProvider("Action")); @@ -651,7 +645,6 @@ public class ResourcesPanel extends FramedPanel { grid.getView().setEmptyText(msgs.gridEmptyText()); expanderColumn.initPlugin(grid); - createContextMenu(); @@ -674,6 +667,8 @@ public class ResourcesPanel extends FramedPanel { private boolean select(ResourceTDDescriptor item, String searchTerm) { if (item.getName() != null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true; + if (item.getCreationDate() != null && item.getCreationDate().toLowerCase().contains(searchTerm.toLowerCase())) + return true; return false; }