Workspace: problem on breadcrumb

https://support.d4science.org/issues/1804

This issue has been fixed.

Updated pom version at 6.10.1

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@121819 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-12-14 14:12:54 +00:00
parent fdff172559
commit 8175958f2d
4 changed files with 208 additions and 35 deletions

View File

@ -5,7 +5,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<dependent-module archiveName="workspace-tree-widget-6.10.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-tree-widget-TRUNK/workspace-tree-widget-TRUNK">
<dependent-module archiveName="workspace-tree-widget-6.10.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-tree-widget-TRUNK/workspace-tree-widget-TRUNK">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="workspace-explorer-1.1.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/workspace-explorer/workspace-explorer">
<dependency-type>uses</dependency-type>
</dependent-module>

View File

@ -11,7 +11,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>workspace</artifactId>
<packaging>war</packaging>
<version>6.10.0-SNAPSHOT</version>
<version>6.10.1-SNAPSHOT</version>
<name>gCube Workspace Portlet</name>
<description>
gcube Workspace Portlet is a portlet for users workspace management

View File

@ -133,28 +133,30 @@ import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasWidgets;
/**
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* The Class AppController.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Dec 14, 2015
*/
public class AppController implements SubscriberInterface {
private final static HandlerManager eventBus = new HandlerManager(null);
private WorskpacePortlet wsPortlet = null;
private AppControllerExplorer appContrExplorer = null;
private String rootIdentifier = null;
// public static boolean isSearchActive = false;
private HasWidgets rootPanel;
private String selectedSmartFolderId;
private String selectedSmartFolderCategory;
// private Alert alertFeatures = new Alert();
private WorkspaceFeaturesView workspaceFeatures = new WorkspaceFeaturesView();
private WorkspaceQuotesView wsQuotesView = new WorkspaceQuotesView();
public static final Logger logger = Logger.getLogger("WsAppController");
/**
* Instantiates a new app controller.
*
* @param appControllerExplorer the app controller explorer
*/
public AppController(AppControllerExplorer appControllerExplorer) {
this.appContrExplorer = appControllerExplorer;
this.appContrExplorer.subscribe(this, new EventsTypeEnum[] {
@ -188,10 +190,18 @@ public class AppController implements SubscriberInterface {
}
/**
* Gets the event bus.
*
* @return the event bus
*/
public static HandlerManager getEventBus() {
return eventBus;
}
/**
* Bind.
*/
private void bind() {
//double click on URLs
eventBus.addHandler(OpenUrlEvent.TYPE, new OpenUrlEventHandler() {
@ -701,13 +711,11 @@ public class AppController implements SubscriberInterface {
if(wsPortlet.getGxtCardLayoutResultPanel().getActivePanel() instanceof GxtItemsPanel){ //If active panel is panel with file items
AppController.getEventBus().fireEvent(new SearchTextEvent(null, null));
}
doPathElementSelected(event);
}
private void doPathElementSelected(PathElementSelectedEvent event) {
// appContrExplorer.selectItemInTree(event.getSourceFile().getIdentifier());
appContrExplorer.expandFolder(event.getSourceFile().getIdentifier());
}
@ -1030,6 +1038,12 @@ public class AppController implements SubscriberInterface {
wsPortlet.getToolBarItemDetails().setRead(read);
}*/
/**
* Do element grid selected.
*
* @param isSelected the is selected
* @param target the target
*/
private void doElementGridSelected(boolean isSelected, FileModel target) {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().activeButtonsOnSelectForOperation(target, isSelected);
@ -1052,6 +1066,9 @@ public class AppController implements SubscriberInterface {
}
/**
* Disable buttons on breadcrumb special folder.
*/
private void disableButtonsOnBreadcrumbSpecialFolder(){
GxtBreadcrumbPathPanel breadCrumb = this.wsPortlet.getToolBarPath();
FileModel parent = breadCrumb.getLastParent();
@ -1059,10 +1076,18 @@ public class AppController implements SubscriberInterface {
wsPortlet.getGxtCardLayoutResultPanel().getToolBarItemFunctionalities().disableButtonSpecialFolderSelected();
}
/**
* Gets the grid selected item.
*
* @return the grid selected item
*/
private FileGridModel getGridSelectedItem(){
return wsPortlet.getGridGroupContainer().getSelectedItem();
}
/**
* Reset smart folder selected.
*/
private void resetSmartFolderSelected(){
selectedSmartFolderId = null;
selectedSmartFolderCategory = null;
@ -1070,8 +1095,9 @@ public class AppController implements SubscriberInterface {
/**
*
* @param item
* Load breadcrumb by file model.
*
* @param item the item
* @param isLastParent - if is true, load the item passed in input as last item of the list resulted
*/
private void loadBreadcrumbByFileModel(final FileModel item, final boolean isLastParent){
@ -1099,8 +1125,10 @@ public class AppController implements SubscriberInterface {
}
/**
*
* @param childItemId
* Load parent breadcrumb by item id.
*
* @param childItemId the child item id
* @param includeItemAsParent the include item as parent
*/
protected void loadParentBreadcrumbByItemId(final String childItemId, boolean includeItemAsParent){
@ -1123,6 +1151,11 @@ public class AppController implements SubscriberInterface {
}
/**
* Update breadcrumb.
*
* @param parents the parents
*/
private void updateBreadcrumb(List<FileModel> parents){
GWT.log("Updating Breadcrumb : "+parents);
//this.wsPortlet.getBasicTabContainer().setLabelPath(path); //Set path in breadcrumb
@ -1155,6 +1188,11 @@ public class AppController implements SubscriberInterface {
}
/**
* Sets the ACL info.
*
* @param parentId the new ACL info
*/
private void setACLInfo(final String parentId){
if(parentId==null){
@ -1188,8 +1226,9 @@ public class AppController implements SubscriberInterface {
}
/**
* init method
* @param rootPanel
* init method.
*
* @param rootPanel the root panel
*/
public void go(final HasWidgets rootPanel) {
@ -1300,6 +1339,16 @@ public class AppController implements SubscriberInterface {
CheckSession.getInstance().startPolling();
}
/**
* Inits the portlet.
*
* @param rootPanel the root panel
* @param instanceWithGrouping the instance with grouping
* @param isSearchForItemId the is search for item id
* @param searchParameter the search parameter
* @param itemIdParameter the item id parameter
* @param operationParameter the operation parameter
*/
private void initPortlet(final HasWidgets rootPanel, final boolean instanceWithGrouping, boolean isSearchForItemId, final String searchParameter, final String itemIdParameter, final String operationParameter){
boolean displayFeatures = readCookieWorkspaceAvailableFeatures();
@ -1358,6 +1407,12 @@ public class AppController implements SubscriberInterface {
rootPanel.add(wsQuotesView);
}
/**
* Sets the workspace user quotes.
*
* @param size the size
* @param totalItems the total items
*/
private void setWorkspaceUserQuotes(String size, long totalItems){
String msg;
@ -1375,7 +1430,8 @@ public class AppController implements SubscriberInterface {
/**
*
* Read cookie workspace grid view setting.
*
* @return true if exists a cookie with msg as true value (or not exists the cookie), false otherwise
*/
private boolean readCookieWorkspaceGridViewSetting() {
@ -1397,7 +1453,8 @@ public class AppController implements SubscriberInterface {
/**
*
* Read cookie workspace available features.
*
* @return true if exists a cookie with msg as true value (or not exists the cookie), false otherwise
*/
private boolean readCookieWorkspaceAvailableFeatures() {
@ -1416,6 +1473,13 @@ public class AppController implements SubscriberInterface {
return false;
}
/**
* Sets the cookie.
*
* @param name the name
* @param value the value
* @param days the days
*/
public static void setCookie(String name, String value, int days) {
if (value == null) {
@ -1430,11 +1494,21 @@ public class AppController implements SubscriberInterface {
Cookies.setCookie(name, value, expiringDate);
}
/**
* Sets the cookie grid view setting.
*
* @param value the new cookie grid view setting
*/
protected static void setCookieGridViewSetting(String value) {
setCookie(ConstantsPortlet.GCUBE_COOKIE_WORKSPACE_GRID_VIEW_SETTING, value, ConstantsPortlet.COOKIE_EXPIRE_DAYS);
}
/**
* Gets the main panel.
*
* @return the main panel
*/
public GxtBorderLayoutPanel getMainPanel(){
return wsPortlet.getBorderLayoutContainer();
}
@ -1443,10 +1517,21 @@ public class AppController implements SubscriberInterface {
// return wsPortlet.getExplorerPanel();
// }
/**
* Sets the size async tree panel.
*
* @param width the width
* @param height the height
*/
public void setSizeAsyncTreePanel(int width, int height) {
wsPortlet.getExplorerPanel().getAsycTreePanel().setSizeTreePanel(width-17, height-55);
}
/**
* Update store by rpc.
*
* @param folder the folder
*/
private void updateStoreByRpc(final FileModel folder){
resetSmartFolderSelected();
@ -1483,6 +1568,11 @@ public class AppController implements SubscriberInterface {
});
}
/**
* Gets the selected folder.
*
* @return the selected folder
*/
public FileModel getSelectedFolder(){
return this.appContrExplorer.getSelectedFolderInTree();
}
@ -1566,6 +1656,9 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#selectedItem(org.gcube.portlets.user.workspace.client.model.FileModel, java.util.List)
*/
@Override
public void selectedItem(FileModel item, List<FileModel> parents) {
GWT.log("selectedItem.. ");
@ -1606,8 +1699,9 @@ public class AppController implements SubscriberInterface {
}
/**
*
* @param item
* Updat grid view for selected item.
*
* @param item the item
*/
private void updatGridViewForSelectedItem(FileModel item){
@ -1620,11 +1714,17 @@ public class AppController implements SubscriberInterface {
updateStoreByRpc(item.getParentFileModel());
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#expandFolderItem(org.gcube.portlets.user.workspace.client.model.FolderModel)
*/
@Override
public void expandFolderItem(FolderModel folder) {
updateStoreByRpc(folder);
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#renameItem(java.lang.String, java.lang.String, java.lang.String)
*/
@Override
public boolean renameItem(String itemIdentifier, String newName, String extension) {
@ -1635,6 +1735,9 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#deleteItems(java.util.List)
*/
@Override
public boolean deleteItems(List<String> ids) {
@ -1650,17 +1753,26 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#rootLoaded(org.gcube.portlets.user.workspace.client.model.FileModel)
*/
@Override
public void rootLoaded(FileModel root) {
this.rootIdentifier = root.getIdentifier();
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#setParentItemSelected(java.util.ArrayList)
*/
@Override
public void setParentItemSelected(ArrayList<FileModel> listParents){
GWT.log("setParentItemSelected.. ");
updateBreadcrumb(listParents);
// updateBreadcrumb(listParents);
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#smartFolderSelected(java.lang.String, java.lang.String)
*/
@Override
public void smartFolderSelected(final String folderId, final String category) {
@ -1717,6 +1829,9 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#movedItems(java.lang.String, org.gcube.portlets.user.workspace.client.model.FileModel)
*/
@Override
public void movedItems(String sourceParentIdentifier, FileModel targetParent) {
updateStoreByRpc(targetParent);
@ -1724,6 +1839,9 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#switchView(org.gcube.portlets.user.workspace.client.ConstantsExplorer.ViewSwitchType)
*/
@Override
public void switchView(ViewSwitchType type){
@ -1744,6 +1862,9 @@ public class AppController implements SubscriberInterface {
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#refreshFolder(org.gcube.portlets.user.workspace.client.model.FileModel, boolean, boolean)
*/
@Override
public void refreshFolder(FileModel folderTarget, boolean forceRefreshContent, boolean forceRefreshBreadcrumb){
@ -1790,6 +1911,9 @@ public class AppController implements SubscriberInterface {
GWT.log("folderTarget is null, refresh skypped");
}
/* (non-Javadoc)
* @see org.gcube.portlets.user.workspace.client.interfaces.SubscriberInterface#createNewMessage(java.util.HashMap)
*/
@Override
public void createNewMessage(final HashMap<String, String> hashAttachs) {
GWT.runAsync(MailForm.class, new RunAsyncCallback() {
@ -1861,6 +1985,11 @@ public class AppController implements SubscriberInterface {
}
/**
* Show problems.
*
* @return the layout container
*/
private LayoutContainer showProblems() {
LayoutContainer errorPanel = new LayoutContainer();
errorPanel.setLayout(new FitLayout());
@ -1925,9 +2054,10 @@ public class AppController implements SubscriberInterface {
}
/**
*
* @param operation
* @param trashItemId
* Execute trash operation.
*
* @param operation the operation
* @param trashItemIds the trash item ids
*/
private void executeTrashOperation(final WorkspaceTrashOperation operation, List<FileModel> trashItemIds){
@ -2038,10 +2168,20 @@ public class AppController implements SubscriberInterface {
}
/**
* Sets the visible user quote.
*
* @param bool the new visible user quote
*/
private void setVisibleUserQuote(boolean bool){
wsQuotesView.setQuoteVisible(bool);
}
/**
* Sets the visible ws available features.
*
* @param bool the new visible ws available features
*/
private void setVisibleWsAvailableFeatures(boolean bool){
workspaceFeatures.setVisible(bool);
}

View File

@ -20,17 +20,15 @@ import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
/**
*
* The Class Breadcrumbs.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* @Jul 28, 2014
*
* Dec 14, 2015
*/
public class Breadcrumbs extends Composite {
/**
*
*/
public static final String DIVIDER = ">";
private String rootName;
private LinkedHashMap<String, FileModel> hashFileModel = new LinkedHashMap<String, FileModel>();// Ordered-HashMap
@ -40,9 +38,20 @@ public class Breadcrumbs extends Composite {
@UiField
com.github.gwtbootstrap.client.ui.Breadcrumbs breadcrumbs;
/**
* The Interface BreadcrumbsUiBinder.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Dec 14, 2015
*/
interface BreadcrumbsUiBinder extends UiBinder<Widget, Breadcrumbs> {
}
/**
* Instantiates a new breadcrumbs.
*
* @param rootName the root name
*/
public Breadcrumbs(String rootName) {
this.rootName = rootName;
initWidget(uiBinder.createAndBindUi(this));
@ -54,6 +63,11 @@ public class Breadcrumbs extends Composite {
ul.addClassName("Breadcrumbs-Personal");
}
/**
* Sets the path.
*
* @param parents the new path
*/
public void setPath(List<FileModel> parents) {
resetBreadcrumbs();
@ -73,11 +87,19 @@ public class Breadcrumbs extends Composite {
/**
* Reset breadcrumbs.
*/
private void resetBreadcrumbs() {
breadcrumbs.clear();
}
// @UiHandler("add")
/**
* Adds the navigation link.
*
* @param parent the parent
*/
public void addNavigationLink(FileModel parent) {
if (! parent.isRoot()) {
final NavLink navLink = new NavLink(parent.getName());
@ -90,9 +112,7 @@ public class Breadcrumbs extends Composite {
public void onClick(ClickEvent event) {
FileModel target = hashFileModel.get(navLink.getName());
AppController.getEventBus().fireEvent(
new PathElementSelectedEvent(target));
AppController.getEventBus().fireEvent(new PathElementSelectedEvent(target));
}
});
} else {
@ -101,6 +121,11 @@ public class Breadcrumbs extends Composite {
}
}
/**
* Breadcrumb is empty.
*
* @return true, if successful
*/
public boolean breadcrumbIsEmpty() {
if (hashFileModel.size() == 0)
@ -109,6 +134,11 @@ public class Breadcrumbs extends Composite {
return false;
}
/**
* Gets the last parent.
*
* @return the last parent
*/
public FileModel getLastParent() {
return lastParent;
}