718: Workspace: breadcrumb problem on VRE Folders after a two consecutive selection
Task-Url: https://support.d4science.org/issues/718 Fixed method getChildrenSubTreeToRootByIdentifier git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@118956 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b47f382b2a
commit
a6be5fbd63
|
@ -217,5 +217,7 @@ public class ConstantsExplorer {
|
||||||
//PROPERTY
|
//PROPERTY
|
||||||
public static final String SPECIALFOLDERNAME = "SPECIALFOLDERNAME";
|
public static final String SPECIALFOLDERNAME = "SPECIALFOLDERNAME";
|
||||||
public static final String SPECIALFOLDERNAMEPROPERTIESFILE = "specialfoldername.properties";
|
public static final String SPECIALFOLDERNAMEPROPERTIESFILE = "specialfoldername.properties";
|
||||||
|
|
||||||
|
public static final String MY_SPECIAL_FOLDERS = "MySpecialFolders";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,6 +94,9 @@ import com.thoughtworks.xstream.XStream;
|
||||||
*/
|
*/
|
||||||
public class GWTWorkspaceBuilder {
|
public class GWTWorkspaceBuilder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
protected static final String IMAGE_SERVICE_URL = "ImageService";
|
protected static final String IMAGE_SERVICE_URL = "ImageService";
|
||||||
protected static Logger logger = Logger.getLogger(GWTWorkspaceBuilder.class);
|
protected static Logger logger = Logger.getLogger(GWTWorkspaceBuilder.class);
|
||||||
private InfoContactModel userLogged;
|
private InfoContactModel userLogged;
|
||||||
|
@ -1255,7 +1258,7 @@ public class GWTWorkspaceBuilder {
|
||||||
logger.debug("shared.getDisplayName(): "+shared.getDisplayName());
|
logger.debug("shared.getDisplayName(): "+shared.getDisplayName());
|
||||||
|
|
||||||
//MANAGEMENT SPECIAL FOLDER
|
//MANAGEMENT SPECIAL FOLDER
|
||||||
}else if(wsFolder.getName().compareTo("MySpecialFolders")==0 && wsFolder.getParent()!=null && wsFolder.getParent().isRoot()){
|
}else if(wsFolder.getName().compareTo(ConstantsExplorer.MY_SPECIAL_FOLDERS)==0 && wsFolder.getParent()!=null && wsFolder.getParent().isRoot()){
|
||||||
//MANAGEMENT SPECIAL FOLDER
|
//MANAGEMENT SPECIAL FOLDER
|
||||||
logger.debug("MANAGEMENT SPECIAL FOLDER NAME REWRITING AS: "+specialFolderName);
|
logger.debug("MANAGEMENT SPECIAL FOLDER NAME REWRITING AS: "+specialFolderName);
|
||||||
if(specialFolderName!=null && !specialFolderName.isEmpty())
|
if(specialFolderName!=null && !specialFolderName.isEmpty())
|
||||||
|
|
|
@ -1003,13 +1003,25 @@ public class GWTWorkspaceServiceImpl extends RemoteServiceServlet implements GWT
|
||||||
Collections.reverse(listSubTree); //reverse order of array
|
Collections.reverse(listSubTree); //reverse order of array
|
||||||
|
|
||||||
//SET THE ROOT
|
//SET THE ROOT
|
||||||
if(listSubTree.size()>0){
|
int lenght = listSubTree.size();
|
||||||
workspaceLogger.trace("set: "+listSubTree.get(0).getParent().getName() +" as root");
|
if(lenght>0){
|
||||||
|
FolderModel firstLevel = listSubTree.get(0).getParent(); //get root
|
||||||
|
workspaceLogger.trace("set: "+firstLevel.getName() +" as root");
|
||||||
listSubTree.get(0).getParent().setIsRoot(true);
|
listSubTree.get(0).getParent().setIsRoot(true);
|
||||||
|
//IF IT CASE - REWRITE SPECIAL FOLDER NAME
|
||||||
|
if(lenght>1){
|
||||||
|
FolderModel wsFolder = listSubTree.get(1).getParent(); //get first child
|
||||||
|
String nameSpecialFolder = getNameForSpecialFolder();
|
||||||
|
if(wsFolder.getName().compareTo(ConstantsExplorer.MY_SPECIAL_FOLDERS)==0 && firstLevel.isRoot()){
|
||||||
|
//MANAGEMENT SPECIAL FOLDER
|
||||||
|
workspaceLogger.debug("getChildrenSubTreeToRootByIdentifier MANAGEMENT SPECIAL FOLDER NAME REWRITING AS: "+nameSpecialFolder);
|
||||||
|
if(nameSpecialFolder!=null && !nameSpecialFolder.isEmpty())
|
||||||
|
listSubTree.get(1).getParent().setName(nameSpecialFolder);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
workspaceLogger.trace("getChildrenSubTreeToRootByIdentifier returning list SubTree: "+listSubTree);
|
|
||||||
|
|
||||||
|
workspaceLogger.trace("getChildrenSubTreeToRootByIdentifier returning list SubTree: "+listSubTree);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
workspaceLogger.error("Error in server find Item", e);
|
workspaceLogger.error("Error in server find Item", e);
|
||||||
throw new Exception(e.getMessage());
|
throw new Exception(e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue