bug fixed Ticket #2692
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@92344 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
653ae71aff
commit
84c824d283
|
@ -294,10 +294,11 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
String parentDirectoryName = null;
|
||||
FileModel parent = null;
|
||||
|
||||
if(parentFileModel==null){ //PARENT IS ROOT
|
||||
parent = explorerPanel.getAsycTreePanel().getRootItem();
|
||||
sourceFileModel.setParentFileModel(parent);
|
||||
}
|
||||
//COMMENTED 26/02/2014
|
||||
// if(parentFileModel==null){ //PARENT IS ROOT
|
||||
// parent = explorerPanel.getAsycTreePanel().getRootItem();
|
||||
// sourceFileModel.setParentFileModel(parent);
|
||||
// }
|
||||
|
||||
if(sourceFileModel.isDirectory()){
|
||||
// explorerPanel.getAsycTreePanel().setExpandTreeLevel(sourceFileModel.getIdentifier(), true);
|
||||
|
@ -369,6 +370,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
new MessageBoxAlert("Error", caught.getMessage(), null);
|
||||
explorerPanel.unmask();
|
||||
explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -381,8 +383,9 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
else
|
||||
parentToRefresh = parentFileModel;
|
||||
|
||||
GWT.log("share completed refresh folder : "+parentToRefresh.getName() +" get id: "+parentToRefresh.getIdentifier());
|
||||
eventBus.fireEvent(new RefreshFolderEvent(parentToRefresh, true, false, false));
|
||||
GWT.log("share completed refresh folder : "+parentModel.getName());
|
||||
|
||||
}
|
||||
explorerPanel.unmask();
|
||||
}
|
||||
|
@ -618,7 +621,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
}
|
||||
|
||||
new MessageBoxAlert("Error", caught.getMessage()+"." , null);
|
||||
System.out.println(caught.getMessage());
|
||||
// System.out.println(caught.getMessage());
|
||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(pasteItemEvent.getFolderDestinationId(), false);
|
||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(pasteItemEvent.getFolderSourceId(), true);
|
||||
}
|
||||
|
@ -970,29 +973,9 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
explorerPanel.getAsycTreePanel().removeAllAndRecoveryRoot();
|
||||
}
|
||||
}
|
||||
// com.google.gwt.user.client.Window.open(ConstantsExplorer.DOWNLOAD_WORKSPACE_SERVICE+"?id="+fileDownloadEvent.getItemIdentifier(), "_self", "");
|
||||
|
||||
// if(fileDownloadEvent.getDownloadType().equals(DownloadType.SHOW)){
|
||||
// if(fileDownloadEvent.getItemName()!= null){
|
||||
//
|
||||
// new DialogDownload(fileDownloadEvent.getItemName(), "_blank", fileDownloadEvent.getItemIdentifier(), true).submitForm();
|
||||
// }
|
||||
//
|
||||
// }else{
|
||||
//
|
||||
// new DialogDownload("", "_self", fileDownloadEvent.getItemIdentifier(), false).submitForm();
|
||||
// }
|
||||
//
|
||||
|
||||
|
||||
markItemInTreeAsRead(fileDownloadEvent.getItemIdentifier(), true);
|
||||
|
||||
// FileModel file = explorerPanel.getAsycTreePanel().getFileModelByIdentifier(fileDownloadEvent.getItemIdentifier());
|
||||
//
|
||||
// if(file!=null){ //FILE CAN NOT LOADED IN TREE
|
||||
// file.setMarkAsRead(true);
|
||||
// }
|
||||
|
||||
notifySubscriber(fileDownloadEvent);
|
||||
}
|
||||
|
||||
|
@ -1216,7 +1199,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onSuccess(SmartFolderModel smart) {
|
||||
|
||||
System.out.println("In client: " + smart.getIdentifier());
|
||||
// System.out.println("In client: " + smart.getIdentifier());
|
||||
|
||||
explorerPanel.getShortuctsPanel().loadSmartFolder(smart);
|
||||
|
||||
|
@ -1236,7 +1219,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
@Override
|
||||
public void onSmartFolderSelected(SmartFolderSelectedEvent smartFolderSelectedEvent) {
|
||||
searching(true);
|
||||
System.out.println("Click smart folder : " + smartFolderSelectedEvent.getSmartFolderName());
|
||||
// System.out.println("Click smart folder : " + smartFolderSelectedEvent.getSmartFolderName());
|
||||
doSmartFolderSelected(smartFolderSelectedEvent);
|
||||
}
|
||||
|
||||
|
@ -1511,7 +1494,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
}
|
||||
|
||||
new MessageBoxAlert("Error", caught.getMessage()+"." , null);
|
||||
System.out.println(caught.getMessage());
|
||||
// System.out.println(caught.getMessage());
|
||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getTargetParentFileModel().getIdentifier(), false);
|
||||
explorerPanel.getAsycTreePanel().reloadTreeLevelAndExpandFolder(event.getFileSourceModel().getParentFileModel().getIdentifier(), true);
|
||||
}
|
||||
|
@ -1712,13 +1695,13 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
int last = currentUrl.lastIndexOf("/");
|
||||
String reportUrl = currentUrl.substring(0,last+1) + ConstantsExplorer.REPORTGENERATION;
|
||||
// Log.trace("Url: "+reportUrl);
|
||||
System.out.println("currentUrl " +currentUrl);
|
||||
System.out.println("reportUrl " +reportUrl);
|
||||
// System.out.println("currentUrl " +currentUrl);
|
||||
// System.out.println("reportUrl " +reportUrl);
|
||||
new WindowOpenUrl(reportUrl, "_self", "");
|
||||
}
|
||||
else{
|
||||
String reportUrl = url;
|
||||
System.out.println("reportUrl " +reportUrl);
|
||||
// System.out.println("reportUrl " +reportUrl);
|
||||
new WindowOpenUrl(reportUrl, "_self", "");
|
||||
}
|
||||
|
||||
|
@ -1805,6 +1788,7 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
FileModel item = explorerPanel.getAsycTreePanel().getFileModelByIdentifier(selectedEvent.getFileTarget().getIdentifier());
|
||||
|
||||
// System.out.println("selected item is "+item);
|
||||
listFileModel = getListParents(listFileModel,item); //used for update path bar
|
||||
|
||||
sub.selectedItem(selectedEvent.getFileTarget(), listFileModel);
|
||||
|
@ -1946,15 +1930,19 @@ public class AppControllerExplorer implements EventHandler, TreeAppControllerInt
|
|||
|
||||
private void getParents(List<FileModel> listParents, FileModel item){
|
||||
|
||||
// System.out.println("item is: "+item);
|
||||
// System.out.println("parent is: "+item.getParentFileModel());
|
||||
if(item==null || item.getParentFileModel()==null){
|
||||
// listParents.add(item);
|
||||
return;
|
||||
}
|
||||
|
||||
if(item.getParentFileModel().isRoot()){
|
||||
listParents.add(item.getParentFileModel());
|
||||
return;
|
||||
}
|
||||
|
||||
listParents.add(item.getParentFileModel());
|
||||
|
||||
getParents(listParents, item.getParentFileModel());
|
||||
|
||||
}
|
||||
|
||||
public void subscribe(SubscriberInterface subscriber, EventsTypeEnum[] keys)
|
||||
|
|
|
@ -274,7 +274,7 @@ public class FileModel extends BaseModelData implements Serializable {
|
|||
}
|
||||
|
||||
public FileModel getParentFileModel(){
|
||||
return get(ConstantsExplorer.PARENT);
|
||||
return (FileModel) get(ConstantsExplorer.PARENT);
|
||||
}
|
||||
|
||||
public boolean isDirectory(){
|
||||
|
@ -328,14 +328,18 @@ public class FileModel extends BaseModelData implements Serializable {
|
|||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("FileModel [test=");
|
||||
builder.append(test);
|
||||
builder.append(", infoContacts=");
|
||||
builder.append(infoContacts);
|
||||
builder.append(", isRoot=");
|
||||
builder.append(isRoot);
|
||||
builder.append(", isVreFolder=");
|
||||
builder.append(isVreFolder);
|
||||
builder.append("FileModel [isShareable()=");
|
||||
builder.append(isShareable());
|
||||
builder.append(", isShared()=");
|
||||
builder.append(isShared());
|
||||
builder.append(", getIdentifier()=");
|
||||
builder.append(getIdentifier());
|
||||
builder.append(", getName()=");
|
||||
builder.append(getName());
|
||||
builder.append(", isDirectory()=");
|
||||
builder.append(isDirectory());
|
||||
builder.append(", isRoot()=");
|
||||
builder.append(isRoot());
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ public class ContextMenuTree {
|
|||
createShareFolder.addSelectionListener(new SelectionListener<MenuEvent>() {
|
||||
public void componentSelected(MenuEvent ce) {
|
||||
|
||||
final FileModel sourceFileModel = listSelectedItems.get(0);
|
||||
FileModel sourceFileModel = listSelectedItems.get(0);
|
||||
|
||||
if (sourceFileModel != null) {
|
||||
eventBus.fireEvent(new CreateSharedFolderEvent(sourceFileModel, sourceFileModel.getParentFileModel(), true));
|
||||
|
@ -373,11 +373,11 @@ public class ContextMenuTree {
|
|||
|
||||
share.addSelectionListener(new SelectionListener<MenuEvent>() {
|
||||
public void componentSelected(MenuEvent ce) {
|
||||
for (FileModel target : listSelectedItems) {
|
||||
|
||||
FileModel sourceFileModel = listSelectedItems.get(0);
|
||||
|
||||
if(target.getIdentifier()!=null){
|
||||
eventBus.fireEvent(new CreateSharedFolderEvent(target, target.getParentFileModel(),false));
|
||||
}
|
||||
if (sourceFileModel != null) {
|
||||
eventBus.fireEvent(new CreateSharedFolderEvent(sourceFileModel, sourceFileModel.getParentFileModel(),false));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue