2518: Workspace Resources Explorer should visualise creation date
Task-Url: https://support.d4science.org/issues/2518 Added creation date item to Workspace Explorer Updated pom version at 1.2.0 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-explorer@124950 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
01b8052aae
commit
ddc2ca678a
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>workspace-explorer</artifactId>
|
||||
<version>1.1.1-SNAPSHOT</version>
|
||||
<version>1.2.0-SNAPSHOT</version>
|
||||
<name>gCube Workspace Explorer</name>
|
||||
<description>
|
||||
gCube Workspace Explorer widget allows to navigate (gcube) user workspace
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.gcube.portlets.widgets.wsexplorer.client.explore;
|
||||
|
||||
|
@ -58,7 +58,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
private ScrollPanel southPanel = new ScrollPanel();
|
||||
private String folderId;
|
||||
private String folderName;
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new workspace folder explorer select panel.
|
||||
*
|
||||
|
@ -83,12 +83,12 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
this.folderId = folderId;
|
||||
this.folderName = folderName;
|
||||
bindEvents();
|
||||
wsExplorer = new WorkspaceExplorer(eventBus, showableTypes, selectableTypes, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME});
|
||||
wsExplorer = new WorkspaceExplorer(eventBus, showableTypes, selectableTypes, new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME, DISPLAY_FIELD.CREATION_DATE});
|
||||
Item item = new Item(folderId, folderName, true);
|
||||
wsExplorer.loadFolder(item);
|
||||
initPanel("");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Instantiates a new workspace explorer select panel.
|
||||
*
|
||||
|
@ -106,15 +106,15 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
initExplorer(folderId, "", ItemType.values(), ItemType.values());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Bind events.
|
||||
*/
|
||||
private void bindEvents(){
|
||||
|
||||
|
||||
eventBus.addHandler(ClickItemEvent.TYPE, new ClickItemEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(final ClickItemEvent clickItemEvent) {
|
||||
isSelect = false;
|
||||
|
@ -125,17 +125,17 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
notifyNotValidSelection();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
notifySelectedItem(wsExplorer.getItemSelected());
|
||||
isSelect = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(LoadFolderEvent.TYPE, new LoadFolderEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onLoadFolder(LoadFolderEvent loadFolderEvent) {
|
||||
|
||||
|
||||
if(loadFolderEvent.getTargetItem()!=null && loadFolderEvent.getTargetItem().isFolder()){
|
||||
try {
|
||||
wsExplorer.loadFolder(loadFolderEvent.getTargetItem());
|
||||
|
@ -147,16 +147,16 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
eventBus.addHandler(BreadcrumbClickEvent.TYPE, new BreadcrumbClickEventHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onBreadcrumbClick(BreadcrumbClickEvent breadcrumbClickEvent) {
|
||||
eventBus.fireEvent(new LoadFolderEvent(breadcrumbClickEvent.getTargetItem()));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Load parent breadcrumb by item id.
|
||||
|
@ -185,7 +185,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Refresh root folder view.
|
||||
|
@ -194,14 +194,14 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
Item item = new Item(folderId, folderName, true);
|
||||
eventBus.fireEvent(new LoadFolderEvent(item));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Clear more info.
|
||||
*/
|
||||
private void clearMoreInfo(){
|
||||
southPanel.clear();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Inits the panel.
|
||||
*
|
||||
|
@ -211,20 +211,20 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
this.captionTxt = captionTxt;
|
||||
if(this.captionTxt!=null && !this.captionTxt.isEmpty())
|
||||
setTitle(this.captionTxt);
|
||||
|
||||
|
||||
add(breadcrumbs, DockPanel.NORTH);
|
||||
// centerScrollable.setSize(width+"px", height);
|
||||
setAlertConfirm("", false, null);
|
||||
|
||||
|
||||
mainVP.add(wsExplorer.getPanel());
|
||||
mainVP.add(footerHP);
|
||||
centerScrollable.add(mainVP);
|
||||
add(centerScrollable, DockPanel.CENTER);
|
||||
|
||||
|
||||
add(footerHP, DockPanel.SOUTH);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets the alert confirm.
|
||||
*
|
||||
|
@ -238,17 +238,17 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
}catch(Exception e){
|
||||
//silent
|
||||
}
|
||||
|
||||
|
||||
alertConfirm = new Alert();
|
||||
alertConfirm.setText(html);
|
||||
alertConfirm.setVisible(show);
|
||||
alertConfirm.setClose(true);
|
||||
alertConfirm.setType(AlertType.INFO);
|
||||
|
||||
|
||||
Button yes = new Button("Yes");
|
||||
yes.setType(ButtonType.LINK);
|
||||
yes.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
if(item!=null){
|
||||
|
@ -257,11 +257,11 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Button no = new Button("No");
|
||||
no.setType(ButtonType.LINK);
|
||||
no.addClickHandler(new ClickHandler() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
alertConfirm.close();
|
||||
|
@ -277,33 +277,33 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
* @param selected the selected
|
||||
*/
|
||||
private void notifySelectedItem(Item selected){
|
||||
|
||||
|
||||
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
|
||||
worskpaceExplorerNotificationListener.onSelectedItem(selected);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notify aborted.
|
||||
*/
|
||||
private void notifyAborted(){
|
||||
|
||||
|
||||
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
|
||||
worskpaceExplorerNotificationListener.onAborted();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Notify not valid selection.
|
||||
*/
|
||||
private void notifyNotValidSelection(){
|
||||
|
||||
|
||||
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
|
||||
worskpaceExplorerNotificationListener.onNotValidSelection();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Notify failed.
|
||||
*
|
||||
|
@ -311,12 +311,12 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private void notifyFailed(Throwable t){
|
||||
|
||||
|
||||
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
|
||||
worskpaceExplorerNotificationListener.onFailed(t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the caption txt.
|
||||
*
|
||||
|
@ -334,7 +334,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
public boolean isValidHide() {
|
||||
return isSelect;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.HasWorskpaceExplorerNotificationListener#addWorkspaceExplorerNotificationListener(org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.WorskpaceExplorerNotificationListener)
|
||||
*/
|
||||
|
@ -354,7 +354,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
listeners.remove(handler);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Item is selectable.
|
||||
*
|
||||
|
@ -366,7 +366,7 @@ public class WorkspaceResourcesExplorerPanel extends DockPanel implements HasWor
|
|||
GWT.log("item: "+item);
|
||||
if (item!=null){
|
||||
boolean selectable = wsExplorer.getSelectableTypes().contains(item.getType());
|
||||
return (selectable)?true:false;
|
||||
return selectable?true:false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -101,26 +101,6 @@ public abstract class AbstractItemsCellTable {
|
|||
}
|
||||
},
|
||||
DoubleClickEvent.getType());
|
||||
/*
|
||||
cellTable.addCellPreviewHandler(new CellPreviewEvent.Handler<Item> () {
|
||||
long lastClick=-1000;
|
||||
|
||||
@Override
|
||||
public void onCellPreview(CellPreviewEvent<Item> event) {
|
||||
long clictAt = System.currentTimeMillis();
|
||||
GWT.log("clickAt: "+(clictAt));
|
||||
GWT.log("lastClick: "+(lastClick));
|
||||
if(event.getNativeEvent().getType().contains("click")){
|
||||
GWT.log(""+(clictAt-lastClick));
|
||||
if(clictAt-lastClick < 300) { // dblclick on 2 clicks detected within 300 ms
|
||||
Window.alert("I am a double click crafted event!");
|
||||
}
|
||||
lastClick = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
}
|
||||
}); */
|
||||
|
||||
|
||||
MenuBar options = new MenuBar(true);
|
||||
ScheduledCommand openCommand = new ScheduledCommand() {
|
||||
|
@ -187,12 +167,6 @@ public abstract class AbstractItemsCellTable {
|
|||
cellTable.redraw();
|
||||
}
|
||||
|
||||
/*private void addItem(Item pckg) {
|
||||
dataProvider.getList().add(pckg);
|
||||
dataProvider.flush();
|
||||
dataProvider.refresh();
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Gets the cell tables.
|
||||
*
|
||||
|
|
|
@ -5,6 +5,7 @@ package org.gcube.portlets.widgets.wsexplorer.client.view.grid;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
@ -16,9 +17,11 @@ import org.gcube.portlets.widgets.wsexplorer.shared.Item;
|
|||
import com.github.gwtbootstrap.client.ui.Pagination;
|
||||
import com.google.gwt.cell.client.ButtonCell;
|
||||
import com.google.gwt.cell.client.Cell.Context;
|
||||
import com.google.gwt.cell.client.DateCell;
|
||||
import com.google.gwt.cell.client.ImageResourceCell;
|
||||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.i18n.shared.DateTimeFormat;
|
||||
import com.google.gwt.resources.client.ImageResource;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
|
@ -41,7 +44,8 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
private Column<Item, ImageResource> icon;
|
||||
private TextColumn<Item> name;
|
||||
private TextColumn<Item> owner;
|
||||
private Item selectedItem = null;
|
||||
public DateTimeFormat dtformat = DateTimeFormat.getFormat("dd MMM hh:mm aaa yyyy");
|
||||
// private Item selectedItem = null;
|
||||
|
||||
/**
|
||||
* The Enum DISPLAY_FIELD.
|
||||
|
@ -49,8 +53,9 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
||||
* Feb 1, 2016
|
||||
*/
|
||||
public static enum DISPLAY_FIELD{ICON, NAME, OWNER};
|
||||
public static enum DISPLAY_FIELD{ICON, NAME, OWNER, CREATION_DATE};
|
||||
private List<DISPLAY_FIELD> displayFields;
|
||||
private Column<Item, Date> dateColumn;
|
||||
|
||||
/**
|
||||
* Instantiates a new items table.
|
||||
|
@ -92,19 +97,19 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
* @see org.gcube.portlets.admin.gcubereleases.client.view.AbstractPackageTable#initTable(com.google.gwt.user.cellview.client.AbstractCellTable, com.google.gwt.user.cellview.client.SimplePager, com.github.gwtbootstrap.client.ui.Pagination)
|
||||
*/
|
||||
@Override
|
||||
public void initTable(final AbstractCellTable<Item> packageTable, final SimplePager pager, final Pagination pagination) {
|
||||
packageTable.setEmptyTableWidget(new Label("No data."));
|
||||
|
||||
//ICONS
|
||||
ImageResourceCell iconResourceCell = new ImageResourceCell() {
|
||||
public Set<String> getConsumedEvents() {
|
||||
HashSet<String> events = new HashSet<String>();
|
||||
events.add("click");
|
||||
return events;
|
||||
}
|
||||
};
|
||||
public void initTable(final AbstractCellTable<Item> abstractCellTable, final SimplePager pager, final Pagination pagination) {
|
||||
abstractCellTable.setEmptyTableWidget(new Label("No data."));
|
||||
|
||||
if(this.displayFields.contains(DISPLAY_FIELD.ICON)){
|
||||
//ICONS
|
||||
ImageResourceCell iconResourceCell = new ImageResourceCell() {
|
||||
public Set<String> getConsumedEvents() {
|
||||
HashSet<String> events = new HashSet<String>();
|
||||
events.add("click");
|
||||
return events;
|
||||
}
|
||||
};
|
||||
|
||||
icon = new Column<Item, ImageResource>(iconResourceCell) {
|
||||
@Override
|
||||
public ImageResource getValue(Item dataObj) {
|
||||
|
@ -120,8 +125,8 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
}
|
||||
};
|
||||
icon.setSortable(false);
|
||||
packageTable.addColumn(icon, "");
|
||||
packageTable.setColumnWidth(icon, 10.0, Unit.PCT);
|
||||
abstractCellTable.addColumn(icon, "");
|
||||
abstractCellTable.setColumnWidth(icon, 10.0, Unit.PCT);
|
||||
}
|
||||
|
||||
if(this.displayFields.contains(DISPLAY_FIELD.NAME)){
|
||||
|
@ -134,10 +139,10 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
};
|
||||
name.setSortable(true);
|
||||
|
||||
packageTable.addColumn(name, "Name");
|
||||
abstractCellTable.addColumn(name, "Name");
|
||||
|
||||
double width = displayFields.size()>1?50:90;
|
||||
packageTable.setColumnWidth(name, width, Unit.PCT);
|
||||
// double width = displayFields.size()>1?50:90;
|
||||
// abstractCellTable.setColumnWidth(name, width, Unit.PCT);
|
||||
|
||||
ListHandler<Item> nameColumnHandler = new ListHandler<Item>(dataProvider.getList());
|
||||
nameColumnHandler.setComparator(name, new Comparator<Item>() {
|
||||
|
@ -147,7 +152,7 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
}
|
||||
});
|
||||
|
||||
packageTable.addColumnSortHandler(nameColumnHandler);
|
||||
abstractCellTable.addColumnSortHandler(nameColumnHandler);
|
||||
|
||||
}
|
||||
|
||||
|
@ -161,9 +166,9 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
};
|
||||
|
||||
owner.setSortable(true);
|
||||
packageTable.addColumn(owner, "Owner");
|
||||
double width = displayFields.size()==2 ?90:40;
|
||||
packageTable.setColumnWidth(owner, width, Unit.PCT);
|
||||
abstractCellTable.addColumn(owner, "Owner");
|
||||
// double width = displayFields.size()==2 ?90:40;
|
||||
// abstractCellTable.setColumnWidth(owner, width, Unit.PCT);
|
||||
|
||||
ListHandler<Item> ownerColumnHandler = new ListHandler<Item>(dataProvider.getList());
|
||||
ownerColumnHandler.setComparator(owner, new Comparator<Item>() {
|
||||
|
@ -172,10 +177,33 @@ public class ItemsTable extends AbstractItemsCellTable implements SelectionItem{
|
|||
return o1.getOwner().compareTo(o2.getOwner());
|
||||
}
|
||||
});
|
||||
packageTable.addColumnSortHandler(ownerColumnHandler);
|
||||
abstractCellTable.addColumnSortHandler(ownerColumnHandler);
|
||||
|
||||
}
|
||||
|
||||
if(this.displayFields.contains(DISPLAY_FIELD.CREATION_DATE)){
|
||||
|
||||
DateCell date = new DateCell(dtformat);
|
||||
dateColumn = new Column<Item, Date>(date){
|
||||
|
||||
@Override
|
||||
public Date getValue(Item object) {
|
||||
return object.getCreationDate();
|
||||
}
|
||||
};
|
||||
|
||||
dateColumn.setSortable(true);
|
||||
ListHandler<Item> dateColumnHandler = new ListHandler<Item>(dataProvider.getList());
|
||||
dateColumnHandler.setComparator(dateColumn, new Comparator<Item>() {
|
||||
@Override
|
||||
public int compare(Item o1, Item o2) {
|
||||
return o1.getCreationDate().compareTo(o2.getCreationDate());
|
||||
}
|
||||
});
|
||||
abstractCellTable.addColumnSortHandler(dateColumnHandler);
|
||||
abstractCellTable.addColumn(dateColumn, "Created");
|
||||
}
|
||||
|
||||
/*final SingleSelectionModel<Item> selectionModel = new SingleSelectionModel<Item>();
|
||||
selectionModel.addSelectionChangeHandler(new Handler() {
|
||||
@Override
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
*/
|
||||
package org.gcube.portlets.widgets.wsexplorer.server;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -116,7 +118,7 @@ public class ItemBuilder {
|
|||
// if(workspaceItem instanceof FolderItem){
|
||||
// storageID = workspaceItem.getStorageID();
|
||||
// }
|
||||
item = new Item(parent, workspaceItem.getId(), itemName, type, workspaceItemPath, UserUtil.getUserFullName(workspaceItem.getOwner().getPortalLogin()), isFolder, false);
|
||||
item = new Item(parent, workspaceItem.getId(), itemName, type, workspaceItemPath, UserUtil.getUserFullName(workspaceItem.getOwner().getPortalLogin()), toDate(workspaceItem.getCreationTime()), isFolder, false);
|
||||
item.setSharedFolder(isSharedFolder);
|
||||
}catch(Exception e){
|
||||
_log.error("Error on getting item: "+itemName+" with id: "+workspaceItem.getId()+", from HL, so skipping item");
|
||||
|
@ -353,7 +355,7 @@ public class ItemBuilder {
|
|||
|
||||
//BUILDS A SIMPLE ITEM FOR BREADCRUMB
|
||||
String path = null; //wsFolder.getPath(); FORCED TO NULL BECAUSE IS SLOW CALL
|
||||
Item item = new Item(null, wsFolder.getId(), name, ItemType.FOLDER, path, null, true, isRoot);
|
||||
Item item = new Item(null, wsFolder.getId(), name, ItemType.FOLDER, path, null, null, true, isRoot);
|
||||
item.setSpecialFolder(isSpecialFolder);
|
||||
|
||||
_log.debug("breadcrumb returning: "+item);
|
||||
|
@ -375,6 +377,20 @@ public class ItemBuilder {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* To date.
|
||||
*
|
||||
* @param calendar the calendar
|
||||
* @return the date
|
||||
*/
|
||||
public static Date toDate(Calendar calendar)
|
||||
{
|
||||
if (calendar == null) return null;
|
||||
return calendar.getTime();
|
||||
|
||||
}
|
||||
/*
|
||||
public static void main(String[] args) {
|
||||
List<String> allowedFileExtension = new ArrayList<String>();
|
||||
|
|
|
@ -217,12 +217,12 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
|
|||
}else if(fullName.indexOf(".")>0){
|
||||
fullName = fullName.substring(0, fullName.indexOf("."));
|
||||
}
|
||||
item = new Item(null, root.getId(), fullName+"'s", ItemType.FOLDER, root.getPath(), root.getOwner().getPortalLogin(), true, true);
|
||||
item = new Item(null, root.getId(), fullName+"'s", ItemType.FOLDER, root.getPath(), root.getOwner().getPortalLogin(), null, true, true);
|
||||
break;
|
||||
}
|
||||
case VRE_FOLDER:{
|
||||
WorkspaceItem folder = workspace.getMySpecialFolders();
|
||||
item = new Item(null, folder.getId(), WorkspaceExplorerConstants.VRE_FOLDERS_LABEL, ItemType.FOLDER, folder.getPath(), folder.getOwner().getPortalLogin(), true, false);
|
||||
item = new Item(null, folder.getId(), WorkspaceExplorerConstants.VRE_FOLDERS_LABEL, ItemType.FOLDER, folder.getPath(), folder.getOwner().getPortalLogin(), null, true, false);
|
||||
//SET SPECIAL FOLDER /Workspace/MySpecialFolders
|
||||
item.setSpecialFolder(true);
|
||||
break;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
package org.gcube.portlets.widgets.wsexplorer.shared;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
import com.google.gwt.user.client.rpc.IsSerializable;
|
||||
|
||||
|
@ -28,6 +29,7 @@ public class Item implements IsSerializable, ItemInterface{
|
|||
private boolean isSpecialFolder = false;
|
||||
private boolean isSharedFolder = false;
|
||||
private boolean isRoot = false;
|
||||
private Date creationDate;
|
||||
|
||||
/**
|
||||
* Instantiates a new item.
|
||||
|
@ -56,16 +58,18 @@ public class Item implements IsSerializable, ItemInterface{
|
|||
* @param type the type
|
||||
* @param path the path
|
||||
* @param owner the owner
|
||||
* @param creationDate the creation date
|
||||
* @param isFolder the is folder
|
||||
* @param isRoot the is root
|
||||
*/
|
||||
public Item(Item parent, String id, String name, ItemType type, String path, String owner, boolean isFolder, boolean isRoot) {
|
||||
public Item(Item parent, String id, String name, ItemType type, String path, String owner, Date creationDate, boolean isFolder, boolean isRoot) {
|
||||
this(id, name, isFolder);
|
||||
this.parent = parent;
|
||||
this.type = type;
|
||||
this.path = path;
|
||||
this.children = new ArrayList<Item>();
|
||||
this.owner = owner;
|
||||
this.creationDate = creationDate;
|
||||
this.isRoot = isRoot;
|
||||
}
|
||||
|
||||
|
@ -302,6 +306,16 @@ public class Item implements IsSerializable, ItemInterface{
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the creationDate
|
||||
*/
|
||||
public Date getCreationDate() {
|
||||
|
||||
return creationDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the parent.
|
||||
*
|
||||
|
@ -318,7 +332,7 @@ public class Item implements IsSerializable, ItemInterface{
|
|||
public String toString() {
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("Item id=");
|
||||
builder.append("Item [id=");
|
||||
builder.append(id);
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
|
@ -338,7 +352,10 @@ public class Item implements IsSerializable, ItemInterface{
|
|||
builder.append(isSharedFolder);
|
||||
builder.append(", isRoot=");
|
||||
builder.append(isRoot);
|
||||
builder.append(", creationDate=");
|
||||
builder.append(creationDate);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue