Compare commits

..

No commits in common. "master" and "bug_20991" have entirely different histories.

8 changed files with 21 additions and 2362 deletions

View File

@ -1,119 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v2.2.0] - 2021-03-26
### Bug fixes
[#21153] Upgrade the maven-portal-bom to 3.6.1 version
[#20991] Conflict with Bootstrap Modal fixed
### Enhancements
[#21045] Added a new behavior: startable on an input folder and
being able to navigate from the Workspace Root
## [v2.1.2] - 2019-12-19
Updated to Git and Jenkins
## [v2.1.1] - 2019-09-10
Rebuilt due to storagehub exceptions added since gCube 4.14
## [v2.1.0] - 2019-08-02
Changed ItemBuilder to read the new method getMetadata
## [v2.0.1] - 2019-03-10
[Incident #77436] Fixing class cast Exception for FolderItem son of a SharedFolder
[Task #10943] Removed final to a Constant
Fixed breadcrumb on SelectDialaog
## [v2.0.0] - 2018-09-16
[Task #10943] Migrated to StorageHub
## [v1.8.0] - 2018-01-16
[Task #10943] Added breadcrumb changed event
## [v1.7.0] - 2017-07-06
[Feature #9114] Add pagination to Workspace Explorer
## [v1.6.1] - 2017-02-06
[Bug #6601] fixed
## [v1.6.0] - 2016-11-21
Removed ASL Dependency, ported to gCube Client Context
## [v1.5.0] - 2016-09-21
[Feature #5091] Added load for folder ID to SelectDialog and SelectPanel
Bug fixed on breadcrumb when item is null
## [v1.4.0] - 2016-05-31
[Feature #4128] Migration to Liferay 6.2
## [v1.3.0] - 2016-05-04
[Feature #2546] Endow Workspace Resources Explorer with filtering and display features
## [v1.2.1] - 2016-03-22
[Incident #2903] Bug fixed
## [v1.2.0] - 2016-02-26
Bug fix in Item.java
[Bug #2350] Bug fix
## [v1.1.1] - 2016-02-26
Bug fix in Item.java
[Bug #2350] Bug fix
## [v1.1.0] - 2016-02-02
[Feature #1657] Added Resource Explorer
Feature #2099] Add new facility: create a new folder
## [v1.0.0] - 2015-07-16
First Release
## [v0.0.1] - 2015-06-24
Started project

View File

@ -10,7 +10,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>workspace-explorer</artifactId>
<version>2.2.0</version>
<version>2.1.3-SNAPSHOT</version>
<name>gCube Workspace Explorer</name>
<description>
gCube Workspace Explorer widget allows to navigate (gCube) Workspace
@ -39,7 +39,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>3.6.1</version>
<version>3.6.0</version>
<type>pom</type>
<scope>import</scope>
<exclusions>

View File

@ -20,17 +20,14 @@
<source path='client' />
<source path='shared' />
<stylesheet src='workspaceExplorer.css' />
<!-- UNCOMMENT THIS TO RECOVER THE OLD BEHAVIOUR -->
<!--Override Bootstrap Css -->
<!-- <source path='resources' /> -->
<!-- <replace-with -->
<!-- class="org.gcube.portlets.widgets.wsexplorer.resources.BootstrapConfigurator"> -->
<!-- <when-type-is -->
<!-- class="com.github.gwtbootstrap.client.ui.config.Configurator" /> -->
<!-- </replace-with> -->
<source path='resources' />
<replace-with
class="org.gcube.portlets.widgets.wsexplorer.resources.BootstrapConfigurator">
<when-type-is
class="com.github.gwtbootstrap.client.ui.config.Configurator" />
</replace-with>
<!--Commented due to #20991 -->
<!-- <public path="resources"> -->
<!-- <exclude name="** /*.java" /> -->

View File

@ -32,6 +32,7 @@ import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.view.client.ListDataProvider;
// TODO: Auto-generated Javadoc
/**
* The Class WorkspaceResourcesExplorerPanel.
*

View File

@ -1,667 +0,0 @@
/**
*
*/
package org.gcube.portlets.widgets.wsexplorer.client.explore;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.widgets.wsexplorer.client.Util;
import org.gcube.portlets.widgets.wsexplorer.client.WorkspaceExplorerConstants;
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEvent;
import org.gcube.portlets.widgets.wsexplorer.client.event.BreadcrumbClickEventHandler;
import org.gcube.portlets.widgets.wsexplorer.client.event.ClickItemEvent;
import org.gcube.portlets.widgets.wsexplorer.client.event.ClickItemEventHandler;
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadFolderEvent;
import org.gcube.portlets.widgets.wsexplorer.client.event.LoadFolderEventHandler;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.HasWorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.view.Breadcrumbs;
import org.gcube.portlets.widgets.wsexplorer.client.view.WorkspaceExplorer;
import org.gcube.portlets.widgets.wsexplorer.client.view.grid.ItemsTable.DISPLAY_FIELD;
import org.gcube.portlets.widgets.wsexplorer.shared.FilterCriteria;
import org.gcube.portlets.widgets.wsexplorer.shared.Item;
import org.gcube.portlets.widgets.wsexplorer.shared.ItemType;
import com.github.gwtbootstrap.client.ui.constants.AlertType;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.view.client.ListDataProvider;
/**
* The Class WorkspaceResourcesEnhancedExplorerPanel.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* the difference with {@link WorkspaceResourcesExplorerPanel} is that the parameter {@link WorkspaceResourcesExplorerPanel#folderId}
* is used to select the folder and the breadcrumb (so the navigation) always starts from Workspace Root
*
* Mar 25, 2021
*/
public class WorkspaceResourcesEnhancedExplorerPanel extends DockPanel implements HasWorskpaceExplorerSelectNotificationListener{
/** The Constant ITEMS_PER_PAGE. */
protected static final int ITEMS_PER_PAGE = WorkspaceExplorerConstants.ITEMS_PER_PAGE;
/** The Constant ITEM_START_INDEX. */
protected static final int ITEM_START_INDEX = WorkspaceExplorerConstants.ITEM_START_INDEX;
/** The event bus. */
public final HandlerManager eventBus = new HandlerManager(null);
/** The breadcrumbs. */
protected Breadcrumbs breadcrumbs = new Breadcrumbs(eventBus);
/** The is select. */
protected boolean isSelect = false;
/** The caption txt. */
protected String captionTxt;
/** The listeners. */
protected List<WorskpaceExplorerSelectNotificationListener> listeners = new ArrayList<WorskpaceExplorerSelectNotificationListener>();
/** The ws explorer. */
protected WorkspaceExplorer wsExplorer;
/** The center scrollable. */
protected VerticalPanel centerScrollable = new VerticalPanel();
/** The folder id. */
// private ScrollPanel southPanel = new ScrollPanel();
protected String folderId;
/** The folder name. */
protected String folderName;
/** The show properties. */
protected List<String> showProperties;
/** The filter criteria. */
protected FilterCriteria filterCriteria;
/** The offset breadcrumb. */
protected final int offsetBreadcrumb = 40;
/** The parent height. */
protected int parentHeight = -1;
/**
* On load.
*/
/* (non-Javadoc)
* @see com.google.gwt.user.client.ui.Widget#onLoad()
*/
@Override
protected void onLoad() {
// TODO Auto-generated method stub
super.onLoad();
int newHeight = getValidAncestorsHeight(this.getElement());
if (newHeight>-1){
int nh = getNewHeightForContainer(newHeight);
Util.console("Height founded through ancestors is: "+nh);
if(nh>0){
parentHeight = nh;
Util.console("WorkspaceResourcesExplorerPanel Set new height to center panel: "+nh);
wsExplorer.getPanel().setHeight(nh+"px");
}
}else
Util.console("No height found through anchestors");
}
/**
* Gets the valid ancestors height.
*
* @param ele the ele
* @return the valid ancestors height
*/
public int getValidAncestorsHeight(Element ele){
try{
if (ele == null)
return -1;
Element parent = ele.getParentElement();
if(parent==null){
return -1;
}
String height = parent.getStyle().getHeight();
if(height!=null && !height.isEmpty() && height.contains("px")){
String purgedHeight = height.replaceAll("px", "");
return Integer.parseInt(purgedHeight);
}
return getValidAncestorsHeight(ele.getParentElement());
}catch (Exception e){
GWT.log(e.getMessage());
return -1;
}
}
/**
* Instantiates a new workspace resources explorer panel.
*/
public WorkspaceResourcesEnhancedExplorerPanel(){
}
/**
* Instantiates a new workspace folder explorer panel.
*
* @param folderId the folder id like root folder to explore
* @param folderName the folder name
* @throws Exception the exception
*/
public WorkspaceResourcesEnhancedExplorerPanel(String folderId, String folderName) throws Exception {
initExplorer(folderId, folderName, ItemType.values(), ItemType.values(), null, null, false, null);
}
/**
* Instantiates a new workspace explorer panel.
*
* @param folderId the folder id
* @param showOnlyFolders the show only folders
* @throws Exception the exception
*/
public WorkspaceResourcesEnhancedExplorerPanel(String folderId, boolean showOnlyFolders) throws Exception {
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
initExplorer(folderId, "", itemsType, itemsType, null, null, false, null);
wsExplorer.getItTables().setEmptyTableMessage(WorkspaceExplorerConstants.NO_FOLDER);
}else{
initExplorer(folderId, "", ItemType.values(), ItemType.values(), null, null, false, null);
}
}
/**
* Instantiates a new workspace explorer panel.
*
* @param folderId the folder id
* @param showOnlyFolders the show only folders
* @param showProperties the show properties - show the input properties as column/s
* @param filter the filter - get only workspace item/s with input key=value like GcubeProperty
* @throws Exception the exception
*/
public WorkspaceResourcesEnhancedExplorerPanel(String folderId, boolean showOnlyFolders, List<String> showProperties, FilterCriteria filter) throws Exception {
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
initExplorer(folderId, "", itemsType, itemsType, showProperties, filter, false, null);
wsExplorer.getItTables().setEmptyTableMessage(WorkspaceExplorerConstants.NO_FOLDER);
}else{
initExplorer(folderId, "", ItemType.values(), ItemType.values(), showProperties, filter, false, null);
}
}
/**
* Instantiates a new workspace explorer panel.
*
* @param folderId the folder id
* @param showOnlyFolders the show only folders
* @param showProperties the show properties - show the input properties as column/s
* @param filter the filter - get only workspace item/s with input key=value like GcubeProperty
* @param showGcubeInfo the show gcube info - if true shows all the properties associated to a file (or a gcube item) by opening a popup window when clicking on the item
* @param sortByColumn the sort by column
* @throws Exception the exception
*/
public WorkspaceResourcesEnhancedExplorerPanel(String folderId, boolean showOnlyFolders, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn) throws Exception {
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
initExplorer(folderId, "", itemsType, itemsType, showProperties, filter, showGcubeInfo, sortByColumn);
wsExplorer.getItTables().setEmptyTableMessage(WorkspaceExplorerConstants.NO_FOLDER);
}else{
initExplorer(folderId, "", ItemType.values(), ItemType.values(), showProperties, filter, showGcubeInfo, sortByColumn);
}
}
/**
* Instantiates a new workspace explorer panel.
*
* @param folderId the folder id
* @param showOnlyFolders the show only folders
* @param showProperties the show properties - show the input properties as column/s
* @param filter the filter - get only workspace item/s with input key=value like GcubeProperty
* @param showGcubeInfo the show gcube info - if true shows all the properties associated to a file (or a gcube item) by opening a popup window when clicking on the item
* @param sortByColumn the sort by column
* @param displayFields the display fields
* @throws Exception the exception
*/
public WorkspaceResourcesEnhancedExplorerPanel(String folderId, boolean showOnlyFolders, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn, DISPLAY_FIELD... displayFields) throws Exception {
if(showOnlyFolders){
ItemType[] itemsType = new ItemType[4];
itemsType[0] = ItemType.FOLDER;
itemsType[1] = ItemType.PRIVATE_FOLDER;
itemsType[2] = ItemType.SHARED_FOLDER;
itemsType[3] = ItemType.VRE_FOLDER;
initExplorer(folderId, "", itemsType, itemsType, showProperties, filter, showGcubeInfo, sortByColumn, displayFields);
wsExplorer.getItTables().setEmptyTableMessage(WorkspaceExplorerConstants.NO_FOLDER);
}else{
initExplorer(folderId, "", ItemType.values(), ItemType.values(), showProperties, filter, showGcubeInfo, sortByColumn, displayFields);
}
}
/**
* Inits the explorer.
*
* @param folderId the folder id
* @param folderName the folder name
* @param selectableTypes the selectable types
* @param showableTypes the showable types
* @param showProperties the show properties
* @param filter the filter
* @param showGcubeInfo the show gcube info
* @param sortByColumn the sort by column
* @param displayFields the display fields
* @throws Exception the exception
*/
protected void initExplorer(String folderId, String folderName, ItemType[] selectableTypes, ItemType[] showableTypes, List<String> showProperties, FilterCriteria filter, boolean showGcubeInfo, DISPLAY_FIELD sortByColumn, DISPLAY_FIELD... displayFields) throws Exception{
GWT.log("Using base init");
setParameters(folderId, folderName, showProperties, filter);
bindEvents();
DISPLAY_FIELD[] showTheFields;
if(displayFields==null || displayFields.length==0)
showTheFields = new DISPLAY_FIELD[]{DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,DISPLAY_FIELD.CREATION_DATE};
else
showTheFields = displayFields;
wsExplorer = new WorkspaceExplorer(eventBus, filter, showableTypes, selectableTypes, showProperties, showGcubeInfo, sortByColumn, showTheFields);
wsExplorer.initTable(new ListDataProvider<Item>());
Item item = new Item(folderId, folderName, true);
initPanel("");
eventBus.fireEvent(new LoadFolderEvent<Item>(item));
}
/**
* Sets the parameters.
*
* @param folderId the folder id
* @param folderName the folder name
* @param showProperties the show properties
* @param filterCriteria the filter criteria
*/
protected void setParameters(
String folderId, String folderName, List<String> showProperties,
FilterCriteria filterCriteria) {
this.folderId = folderId;
this.folderName = folderName;
this.showProperties = showProperties;
this.filterCriteria = filterCriteria;
}
/**
* Bind events.
*/
private void bindEvents(){
eventBus.addHandler(ClickItemEvent.TYPE, new ClickItemEventHandler() {
@Override
public <T> void onClick(final ClickItemEvent<T> clickItemEvent) {
isSelect = false;
Item item = wsExplorer.getItemSelected();
//Return if item is not selectable
if(!itemIsSelectable(item)){
notifyNotValidSelection();
return;
}
notifySelectedItem(wsExplorer.getItemSelected());
isSelect = true;
}
});
eventBus.addHandler(LoadFolderEvent.TYPE, new LoadFolderEventHandler() {
@Override
public <T> void onLoadFolder(LoadFolderEvent<T> loadFolderEvent) {
if(loadFolderEvent.getTargetItem()!=null){
if(loadFolderEvent.getTargetItem() instanceof Item){
Item item = (Item) loadFolderEvent.getTargetItem();
if(item.isFolder()){
try {
wsExplorer.loadFolder(item, true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
loadParentBreadcrumbByItemId(item.getId(), true, null);
clearMoreInfo();
} catch (Exception e) {
GWT.log(e.getMessage());
}
}
}
}
}
});
eventBus.addHandler(BreadcrumbClickEvent.TYPE, new BreadcrumbClickEventHandler() {
@Override
public void onBreadcrumbClick(BreadcrumbClickEvent breadcrumbClickEvent) {
eventBus.fireEvent(new LoadFolderEvent<Item>(breadcrumbClickEvent.getTargetItem()));
}
});
}
/**
* Load parent breadcrumb by item id.
*
* @param itemIdentifier the item identifier
* @param includeItemAsParent the include item as parent
*/
protected void loadParentBreadcrumbByItemId(final String itemIdentifier, boolean includeItemAsParent, String parentLimit){
GWT.log("Reload Parent Breadcrumb: [Item id: "+itemIdentifier+"]");
WorkspaceExplorerConstants.workspaceNavigatorService.getBreadcrumbsByItemIdentifierToParentLimit(itemIdentifier, parentLimit, includeItemAsParent, new AsyncCallback<List<Item>>() {
@Override
public void onFailure(Throwable caught) {
GWT.log(caught.getMessage());
wsExplorer.setAlert(caught.getMessage(), AlertType.ERROR);
}
@Override
public void onSuccess(List<Item> result) {
if(result!=null){
breadcrumbs.setPath(result);
clearMoreInfo();
}
}
});
}
/**
* Refresh root folder view.
*/
public void refreshRootFolderView(){
Item item = new Item(folderId, folderName, true);
eventBus.fireEvent(new LoadFolderEvent<Item>(item));
}
/**
* Clear more info.
*/
protected void clearMoreInfo(){
// southPanel.clear();
}
/**
* Inits the panel.
*
* @param captionTxt the caption txt is the tool-tip
*/
protected void initPanel(String captionTxt) {
this.captionTxt = captionTxt;
if(this.captionTxt!=null && !this.captionTxt.isEmpty())
setTitle(this.captionTxt);
add(breadcrumbs, DockPanel.NORTH);
setCellHeight(breadcrumbs, offsetBreadcrumb+"px");
centerScrollable.add(wsExplorer.getPanel());
add(centerScrollable, DockPanel.CENTER);
}
/**
* Gets the north panel height.
*
* @return the north panel height
*/
public void getNorthPanelHeight(){
}
/**
* Notify selected item.
*
* @param selected the selected
*/
protected void notifySelectedItem(Item selected){
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
worskpaceExplorerNotificationListener.onSelectedItem(selected);
}
}
/**
* Notify aborted.
*/
protected void notifyAborted(){
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
worskpaceExplorerNotificationListener.onAborted();
}
}
/**
* Notify not valid selection.
*/
protected void notifyNotValidSelection(){
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
worskpaceExplorerNotificationListener.onNotValidSelection();
}
}
/**
* Notify failed.
*
* @param t the t
*/
@SuppressWarnings("unused")
protected void notifyFailed(Throwable t){
for (WorskpaceExplorerSelectNotificationListener worskpaceExplorerNotificationListener : listeners) {
worskpaceExplorerNotificationListener.onFailed(t);
}
}
/**
* Gets the caption txt.
*
* @return the captionTxt
*/
public String getCaptionTxt() {
return captionTxt;
}
/**
* Checks if is valid hide.
*
* @return the isValidHide
*/
public boolean isValidHide() {
return isSelect;
}
/**
* Adds the workspace explorer select notification listener.
*
* @param handler the handler
*/
/* (non-Javadoc)
* @see org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.HasWorskpaceExplorerNotificationListener#addWorkspaceExplorerNotificationListener(org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.WorskpaceExplorerNotificationListener)
*/
@Override
public void addWorkspaceExplorerSelectNotificationListener(WorskpaceExplorerSelectNotificationListener handler) {
if(handler!=null)
listeners.add(handler);
}
/**
* Removes the workspace explorer select notification listener.
*
* @param handler the handler
*/
/* (non-Javadoc)
* @see org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.HasWorskpaceExplorerNotificationListener#removeWorkspaceExplorerNotificationListener(org.gcube.portlets.widgets.wsexplorer.client.notification.WorskpaceExplorerNotification.WorskpaceExplorerNotificationListener)
*/
@Override
public void removeWorkspaceExplorerSelectNotificationListener(WorskpaceExplorerSelectNotificationListener handler) {
if(handler!=null){
if(listeners.contains(handler))
listeners.remove(handler);
}
}
/**
* Item is selectable.
*
* @param item the item
* @return true, if successful
*/
public boolean itemIsSelectable(Item item){
//GWT.log("Selectable type: "+wsExplorer.getSelectableTypes());
//GWT.log("item: "+item);
if (item!=null){
boolean selectable = wsExplorer.getSelectableTypes().contains(item.getType());
return selectable?true:false;
}
return false;
}
/**
* Gets the filter criteria.
*
* @return the filterCriteria
*/
public FilterCriteria getFilterCriteria() {
return filterCriteria;
}
/**
* Updates filter criteria.
*
* @param filterCriteria the filter criteria
*/
public void updatesFilterCriteria(FilterCriteria filterCriteria) {
this.filterCriteria = filterCriteria;
wsExplorer.setNewFilterCriteria(filterCriteria);
try {
wsExplorer.loadFolder(wsExplorer.getDisplayingFolderItem(), true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
}
catch (Exception e) {
wsExplorer.setAlert("Sorry, an error occurred during filter update", AlertType.ERROR);
}
}
/**
* Updates filter criteria.
*
* @param showProperties the show properties
*/
public void updatesShowProperties(List<String> showProperties) {
this.showProperties = showProperties;
wsExplorer.setNewShowProperties(showProperties);
try {
wsExplorer.loadFolder(wsExplorer.getDisplayingFolderItem(), true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
}
catch (Exception e) {
wsExplorer.setAlert("Sorry, an error occurred during show properties update", AlertType.ERROR);
}
}
/**
* Updates filters and properties.
*
* @param filterCriteria the filter criteria
* @param showProperties the show properties
*/
public void updatesFiltersAndProperties(FilterCriteria filterCriteria, List<String> showProperties) {
this.filterCriteria = filterCriteria;
this.showProperties = showProperties;
wsExplorer.setNewFilterCriteria(filterCriteria);
wsExplorer.setNewShowProperties(showProperties);
try {
wsExplorer.loadFolder(wsExplorer.getDisplayingFolderItem(), true, ITEM_START_INDEX, ITEMS_PER_PAGE, true);
}
catch (Exception e) {
wsExplorer.setAlert("Sorry, an error occurred during filters or properties update", AlertType.ERROR);
}
}
/**
* Gets the show properties.
*
* @return the showProperties
*/
public List<String> getShowProperties() {
return showProperties;
}
/**
* Gets the new height for container.
*
* @param parentHeight the parent height
* @return the new height for container
*/
protected int getNewHeightForContainer(int parentHeight){
GWT.log("getNewHeightForContainer: "+parentHeight);
if(parentHeight>0){
int bh = breadcrumbs.getHeight();
bh = bh>offsetBreadcrumb?bh:offsetBreadcrumb;
if(parentHeight>bh)
return parentHeight-bh;
}
return -1;
}
/**
* Sets the height to internal scroll.
*
* @param height the new height to internal scroll
*/
public void setHeightToInternalScroll(int height){
GWT.log("setHeightToInternalScroll: "+height);
int nh = getNewHeightForContainer(height);
if(nh>0){
Util.console("Set new height to center panel: "+nh);
wsExplorer.getPanel().setHeight(nh+"px");
}
}
}

View File

@ -241,8 +241,7 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
public ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifier(
String itemIdentifier, String itemName, boolean includeItemAsParent)
throws Exception {
_log.debug("called getBreadcrumbsByItemIdentifier id="+ itemIdentifier + ", name="+itemName);
System.out.println("ListParents By Item id "+ itemIdentifier + " name="+itemName);
try {
List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier);
ArrayList<org.gcube.portlets.widgets.wsexplorer.shared.Item> toReturn = new ArrayList<>(parents.size());
@ -263,7 +262,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
String theClickedFolderName = itemName == null || itemName.equals("") ? "current folder" : itemName;
toReturn.add(new org.gcube.portlets.widgets.wsexplorer.shared.Item(itemIdentifier, theClickedFolderName, true)); //this is the last non clickable item on the BC
_log.debug("returning breadcrumbs: "+ toReturn);
return toReturn;
} catch (Exception e) {
_log.error("Error in get List Parents By Item Identifier ", e);
@ -282,13 +280,8 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
*/
@Override
public List<org.gcube.portlets.widgets.wsexplorer.shared.Item> getBreadcrumbsByItemIdentifierToParentLimit(String itemIdentifier, String parentLimit, boolean includeItemAsParent) throws Exception {
_log.debug("getBreadcrumbsByItemIdentifierToParentLimit by Item Identifier: " + itemIdentifier +" and limit: "+parentLimit);
_log.trace("getBreadcrumbsByItemIdentifierToParentLimit by Item Identifier " + itemIdentifier +" and limit: "+parentLimit);
if(parentLimit==null) {
_log.debug("parentLimit is null, so calling default getBreadcrumbsByItemIdentifier");
return getBreadcrumbsByItemIdentifier(itemIdentifier, null, includeItemAsParent);
}
parentLimit = parentLimit!=null?parentLimit:"";
try {
List<? extends Item> parents = StorageHubServiceUtil.getParents(getThreadLocalRequest(), itemIdentifier);
@ -321,7 +314,6 @@ public class WorkspaceExplorerServiceImpl extends RemoteServiceServlet implement
if (found)
toReturn.add(item);
}
_log.debug("returning breadcrumb untit to folder: "+ toReturn);
return toReturn;
} catch (Exception e) {
_log.error("Error in get List Parents By Item Identifier ", e);

View File

@ -20,17 +20,14 @@
<source path='client' />
<source path='shared' />
<stylesheet src='workspaceExplorer.css' />
<!-- UNCOMMENT THIS TO RECOVER THE OLD BEHAVIOUR -->
<!--Override Bootstrap Css -->
<!-- <source path='resources' /> -->
<!-- <replace-with -->
<!-- class="org.gcube.portlets.widgets.wsexplorer.resources.BootstrapConfigurator"> -->
<!-- <when-type-is -->
<!-- class="com.github.gwtbootstrap.client.ui.config.Configurator" /> -->
<!-- </replace-with> -->
<source path='resources' />
<replace-with
class="org.gcube.portlets.widgets.wsexplorer.resources.BootstrapConfigurator">
<when-type-is
class="com.github.gwtbootstrap.client.ui.config.Configurator" />
</replace-with>
<!--Commented due to #20991 -->
<!-- <public path="resources"> -->
<!-- <exclude name="** /*.java" /> -->