removed commented code
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@142706 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4ce9b3ae3a
commit
3cabd41cdf
|
@ -1176,13 +1176,18 @@ public class AppController implements SubscriberInterface {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(List<ExtendedWorkspaceACL> res) {
|
public void onSuccess(List<ExtendedWorkspaceACL> res) {
|
||||||
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
|
FileModel parent = wsPortlet.getToolBarPath().getLastParent();
|
||||||
GWT.log("Validating correct ACL id: "+parentId +" and "+parent.getIdentifier());
|
ConstantsExplorer.log("Validating correct ACL id: "+parentId +" and "+parent.getIdentifier());
|
||||||
if(parentId.compareTo(parent.getIdentifier())==0){
|
if(parentId.compareTo(parent.getIdentifier())==0){
|
||||||
if(res!=null && res.size()>0){
|
if(res!=null && res.size()>0){
|
||||||
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
|
wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
|
||||||
wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(appContrExplorer.myLogin, res.get(0));
|
wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(res!=null && res.size()>0){
|
||||||
|
// wsPortlet.getToolBarItemDetails().updateACLInfo(res.get(0));
|
||||||
|
// wsPortlet.getToolBarItemDetails().updateAddAdministatorInfo(AppControllerExplorer.myLogin, res.get(0));
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
package org.gcube.portlets.user.workspace.client.view.toolbars;
|
||||||
|
|
||||||
import org.gcube.portlets.user.workspace.client.AppController;
|
import org.gcube.portlets.user.workspace.client.AppController;
|
||||||
|
import org.gcube.portlets.user.workspace.client.ConstantsExplorer;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingHistoryEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
import org.gcube.portlets.user.workspace.client.event.AccountingReadersEvent;
|
||||||
import org.gcube.portlets.user.workspace.client.event.AddAdministratorEvent;
|
import org.gcube.portlets.user.workspace.client.event.AddAdministratorEvent;
|
||||||
|
@ -19,6 +20,7 @@ import com.extjs.gxt.ui.client.event.ButtonEvent;
|
||||||
import com.extjs.gxt.ui.client.event.SelectionListener;
|
import com.extjs.gxt.ui.client.event.SelectionListener;
|
||||||
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
|
||||||
import com.extjs.gxt.ui.client.widget.Label;
|
import com.extjs.gxt.ui.client.widget.Label;
|
||||||
|
import com.extjs.gxt.ui.client.widget.MessageBox;
|
||||||
import com.extjs.gxt.ui.client.widget.Text;
|
import com.extjs.gxt.ui.client.widget.Text;
|
||||||
import com.extjs.gxt.ui.client.widget.button.Button;
|
import com.extjs.gxt.ui.client.widget.button.Button;
|
||||||
import com.extjs.gxt.ui.client.widget.form.TextField;
|
import com.extjs.gxt.ui.client.widget.form.TextField;
|
||||||
|
@ -45,7 +47,7 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
protected static final String HISTORY = "History";
|
protected static final String HISTORY = "History";
|
||||||
private static final String EDIT_ADMINISTRATOR = "Edit Admnistrator/s";
|
private static final String EDIT_ADMINISTRATOR = "Edit Administrator/s";
|
||||||
|
|
||||||
private TextField<String> txfName = new TextField<String>();
|
private TextField<String> txfName = new TextField<String>();
|
||||||
private Text txtOwner = new Text("Empty");
|
private Text txtOwner = new Text("Empty");
|
||||||
|
@ -127,7 +129,6 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
btnAddAdmin = new Button(EDIT_ADMINISTRATOR);
|
btnAddAdmin = new Button(EDIT_ADMINISTRATOR);
|
||||||
//TODO CHANGE ICON
|
//TODO CHANGE ICON
|
||||||
btnAddAdmin.setIcon(Resources.getIconManageAdministrator());
|
btnAddAdmin.setIcon(Resources.getIconManageAdministrator());
|
||||||
|
@ -145,15 +146,7 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
setVisibleAddAdministrators(false);
|
setVisibleAddAdministrators(false);
|
||||||
|
|
||||||
aclDivInfo = new ACLDivInfo("", null);
|
aclDivInfo = new ACLDivInfo("", null);
|
||||||
|
|
||||||
//COMMENTED AT 29/08/2013
|
|
||||||
// add(new SeparatorToolItem());
|
|
||||||
// add(bRead);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add(btnGetTrash);
|
add(btnGetTrash);
|
||||||
// add(new SeparatorMenuItem());
|
|
||||||
add(btnGetInfo);
|
add(btnGetInfo);
|
||||||
add(bHistory);
|
add(bHistory);
|
||||||
|
|
||||||
|
@ -163,25 +156,13 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
|
|
||||||
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
|
hpItemsNumber.setHorizontalAlign(HorizontalAlignment.RIGHT);
|
||||||
hpItemsNumber.add(labelItemsNumber);
|
hpItemsNumber.add(labelItemsNumber);
|
||||||
|
|
||||||
// hpItemsNumber.addListener(Events.Render, new Listener<BaseEvent>() {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void handleEvent(BaseEvent be) {
|
|
||||||
// setItemsNumberToCenter();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
// add(new FillToolItem());
|
|
||||||
add(hpItemsNumber);
|
add(hpItemsNumber);
|
||||||
FillToolItem filler = new FillToolItem();
|
FillToolItem filler = new FillToolItem();
|
||||||
filler.setId("filler-item");
|
filler.setId("filler-item");
|
||||||
add(filler);
|
add(filler);
|
||||||
add(btnAddAdmin);
|
add(btnAddAdmin);
|
||||||
add(aclDivInfo);
|
add(aclDivInfo);
|
||||||
|
|
||||||
enableInfoHistoryButtons(false);
|
enableInfoHistoryButtons(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setVisibleAddAdministrators(boolean bool){
|
private void setVisibleAddAdministrators(boolean bool){
|
||||||
|
@ -214,19 +195,6 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * @param markAsRead
|
|
||||||
// */
|
|
||||||
// public void setRead(boolean markAsRead) {
|
|
||||||
// if(markAsRead)
|
|
||||||
// bRead.setIcon(Resources.getIconRead());
|
|
||||||
// else
|
|
||||||
// bRead.setIcon(Resources.getIconNotRead());
|
|
||||||
//
|
|
||||||
// bRead.setEnabled(markAsRead);
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
public void updateACLInfo(WorkspaceACL acl){
|
public void updateACLInfo(WorkspaceACL acl){
|
||||||
setVisibleAddAdministrators(false);
|
setVisibleAddAdministrators(false);
|
||||||
|
|
||||||
|
@ -234,12 +202,8 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
aclDivInfo.updateInfo(null, null);
|
aclDivInfo.updateInfo(null, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AbstractImagePrototype img = GetPermissionIconByACL.getImage(acl);
|
|
||||||
|
|
||||||
// if(acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
|
AbstractImagePrototype img = GetPermissionIconByACL.getImage(acl);
|
||||||
// setVisibleAddAdministrators(true);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
aclDivInfo.updateInfo(acl.getLabel(), img);
|
aclDivInfo.updateInfo(acl.getLabel(), img);
|
||||||
this.layout();
|
this.layout();
|
||||||
}
|
}
|
||||||
|
@ -248,11 +212,13 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
public void updateAddAdministatorInfo(String loginUserLogger, ExtendedWorkspaceACL acl){
|
public void updateAddAdministatorInfo(String loginUserLogger, ExtendedWorkspaceACL acl){
|
||||||
setVisibleAddAdministrators(false);
|
setVisibleAddAdministrators(false);
|
||||||
|
|
||||||
String loginOwner = acl.getLoginOwner();
|
if(loginUserLogger==null || loginUserLogger.isEmpty())
|
||||||
|
MessageBox.alert("Error", "I could not get you username yet.. please try again", null);
|
||||||
|
|
||||||
if(loginOwner!=null && !loginOwner.isEmpty() && loginUserLogger!=null && !loginUserLogger.isEmpty() && acl.isBaseSharedFolder()){
|
ConstantsExplorer.log("acl isBaseSharedFolder: "+acl.isBaseSharedFolder() +", user type: "+acl.getUserType() + ", owner: "+acl.getLoginOwner() + ", acl item id: "+acl.getWorkspaceItemId());
|
||||||
GWT.log("Comparing loginUserLogger: "+loginUserLogger +" and loginUserLogger: "+loginUserLogger +" to update AdministorInfo");
|
|
||||||
if((loginOwner.compareToIgnoreCase(loginUserLogger)==0) && acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
|
if(acl.isBaseSharedFolder()){
|
||||||
|
if(acl.getUserType().equals(USER_TYPE.ADMINISTRATOR)){
|
||||||
setVisibleAddAdministrators(true);
|
setVisibleAddAdministrators(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,8 +254,8 @@ public class GxtBottomToolBarItem extends ToolBar{
|
||||||
width = width.replace("px", "");
|
width = width.replace("px", "");
|
||||||
try{
|
try{
|
||||||
long intWidth = Long.parseLong(width);
|
long intWidth = Long.parseLong(width);
|
||||||
intWidth = (intWidth/2)-30; //calculate the center
|
intWidth = intWidth/2-30; //calculate the center
|
||||||
intWidth = intWidth-(60*3); //previous buttons
|
intWidth = intWidth-60*3; //previous buttons
|
||||||
GWT.log("refreshSize width is "+width);
|
GWT.log("refreshSize width is "+width);
|
||||||
// hpItemsNumber.setWidth(intWidth+"px");
|
// hpItemsNumber.setWidth(intWidth+"px");
|
||||||
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
|
hpItemsNumber.setStyleAttribute("margin-left", intWidth+"px");
|
||||||
|
|
Loading…
Reference in New Issue