updated change permissions
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace@91623 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
60426d513d
commit
00f1b476e9
|
@ -17,7 +17,7 @@ public class ConstantsPortlet {
|
||||||
public static final String UPLOADFILE = "Upload";
|
public static final String UPLOADFILE = "Upload";
|
||||||
public static final String DOWNLOADITEM = "Download";
|
public static final String DOWNLOADITEM = "Download";
|
||||||
public static final String UPLOADARCHIVE = "Upload Archive";
|
public static final String UPLOADARCHIVE = "Upload Archive";
|
||||||
public static final String CHANGEPERMISSION = "Change Permission";
|
public static final String CHANGEPERMISSION = "VRE Folder CP";
|
||||||
|
|
||||||
//USED IN HTTP GET AS PARAMETERS
|
//USED IN HTTP GET AS PARAMETERS
|
||||||
public static final String GET_SEARCH_PARAMETER ="search";
|
public static final String GET_SEARCH_PARAMETER ="search";
|
||||||
|
|
|
@ -14,6 +14,7 @@ import org.gcube.portlets.user.workspace.shared.WorkspaceACL;
|
||||||
|
|
||||||
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
|
||||||
import com.extjs.gxt.ui.client.Style.Scroll;
|
import com.extjs.gxt.ui.client.Style.Scroll;
|
||||||
|
import com.extjs.gxt.ui.client.Style.VerticalAlignment;
|
||||||
import com.extjs.gxt.ui.client.event.ButtonEvent;
|
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.Dialog;
|
import com.extjs.gxt.ui.client.widget.Dialog;
|
||||||
|
@ -29,11 +30,11 @@ import com.google.gwt.user.client.ui.Label;
|
||||||
*/
|
*/
|
||||||
public class DialogPermission extends Dialog {
|
public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
private int widthDialog = 530;
|
private int widthDialog = 400;
|
||||||
private FileModel parentFolder = null;
|
private FileModel parentFolder = null;
|
||||||
|
|
||||||
private PanelTogglePermission permission;
|
private PanelTogglePermission permission;
|
||||||
private HorizontalPanel hpPermission = null;
|
private HorizontalPanel hpPermission = new HorizontalPanel();
|
||||||
private FileModel folder;
|
private FileModel folder;
|
||||||
|
|
||||||
private DialogPermission INSTANCE = this;
|
private DialogPermission INSTANCE = this;
|
||||||
|
@ -51,7 +52,7 @@ public class DialogPermission extends Dialog {
|
||||||
setScrollMode(Scroll.AUTOY);
|
setScrollMode(Scroll.AUTOY);
|
||||||
setBodyStyle("padding: 9px; background: none");
|
setBodyStyle("padding: 9px; background: none");
|
||||||
setWidth(widthDialog);
|
setWidth(widthDialog);
|
||||||
setHeight(200);
|
setHeight(140);
|
||||||
setResizable(true);
|
setResizable(true);
|
||||||
setButtonAlign(HorizontalAlignment.CENTER);
|
setButtonAlign(HorizontalAlignment.CENTER);
|
||||||
setWidth(widthDialog);
|
setWidth(widthDialog);
|
||||||
|
@ -68,8 +69,8 @@ public class DialogPermission extends Dialog {
|
||||||
Label labelProperty = new Label("Permissions");
|
Label labelProperty = new Label("Permissions");
|
||||||
|
|
||||||
hpPermission.add(labelProperty);
|
hpPermission.add(labelProperty);
|
||||||
|
hpPermission.setVerticalAlign(VerticalAlignment.MIDDLE);
|
||||||
hpPermission.mask("Permission Control");
|
hpPermission.mask("Checking authorization");
|
||||||
|
|
||||||
|
|
||||||
AsyncCallback<InfoContactModel> callcack = new AsyncCallback<InfoContactModel>() {
|
AsyncCallback<InfoContactModel> callcack = new AsyncCallback<InfoContactModel>() {
|
||||||
|
@ -106,14 +107,16 @@ public class DialogPermission extends Dialog {
|
||||||
});
|
});
|
||||||
|
|
||||||
initLayout(folder.getName());
|
initLayout(folder.getName());
|
||||||
this.setIcon(Resources.getIconSharedFolder());
|
this.setIcon(Resources.getIconVREFolder());
|
||||||
setHeading("Set permissions to folder: " + folder.getName());
|
setHeading("Change permissions to folder: " + folder.getName());
|
||||||
|
|
||||||
setWidth(widthDialog);
|
setWidth(widthDialog);
|
||||||
setButtons(Dialog.OKCANCEL);
|
setButtons(Dialog.OKCANCEL);
|
||||||
|
|
||||||
add(hpPermission);
|
add(hpPermission);
|
||||||
addListners();
|
addListners();
|
||||||
|
getButtonById(Dialog.OK).setEnabled(false);
|
||||||
|
enableFormDialog(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addListners() {
|
public void addListners() {
|
||||||
|
@ -143,7 +146,6 @@ public class DialogPermission extends Dialog {
|
||||||
|
|
||||||
private void permissionControl(String owner, boolean showAlert){
|
private void permissionControl(String owner, boolean showAlert){
|
||||||
GWT.log("DialogPermission control compare between owner: "+owner +" and my login: "+AppControllerExplorer.myLogin);
|
GWT.log("DialogPermission control compare between owner: "+owner +" and my login: "+AppControllerExplorer.myLogin);
|
||||||
|
|
||||||
if(AppControllerExplorer.myLogin.compareToIgnoreCase(owner)!=0){
|
if(AppControllerExplorer.myLogin.compareToIgnoreCase(owner)!=0){
|
||||||
enableFormDialog(false);
|
enableFormDialog(false);
|
||||||
if(showAlert)
|
if(showAlert)
|
||||||
|
|
|
@ -222,12 +222,11 @@ public class GxtToolBarItemFunctionality {
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
// toolBar.add(new SeparatorToolItem());
|
// toolBar.add(new SeparatorToolItem());
|
||||||
|
|
||||||
btnSetPermission= new Button(ConstantsPortlet.CHANGEPERMISSION,
|
btnSetPermission= new Button(ConstantsPortlet.CHANGEPERMISSION,Resources.getIconWriteAll());
|
||||||
Resources.getIconWriteAll());
|
|
||||||
btnSetPermission.setScale(ButtonScale.SMALL);
|
btnSetPermission.setScale(ButtonScale.SMALL);
|
||||||
btnSetPermission.setIconAlign(IconAlign.TOP);
|
btnSetPermission.setIconAlign(IconAlign.TOP);
|
||||||
btnSetPermission.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
btnSetPermission.setArrowAlign(ButtonArrowAlign.BOTTOM);
|
||||||
|
btnSetPermission.setToolTip("Change VRE Folder permissions");
|
||||||
toolBar.add(btnSetPermission);
|
toolBar.add(btnSetPermission);
|
||||||
|
|
||||||
|
|
||||||
|
@ -684,7 +683,6 @@ public class GxtToolBarItemFunctionality {
|
||||||
this.btnOpen.disable();
|
this.btnOpen.disable();
|
||||||
this.btnCopyItem.disable();
|
this.btnCopyItem.disable();
|
||||||
this.btnCutItem.disable();
|
this.btnCutItem.disable();
|
||||||
this.btnSetPermission.disable();
|
|
||||||
// this.btnGetInfo.disable();
|
// this.btnGetInfo.disable();
|
||||||
// this.btnGetSharedLink.disable();
|
// this.btnGetSharedLink.disable();
|
||||||
} else {
|
} else {
|
||||||
|
@ -694,7 +692,6 @@ public class GxtToolBarItemFunctionality {
|
||||||
this.btnOpen.enable();
|
this.btnOpen.enable();
|
||||||
this.btnCopyItem.enable();
|
this.btnCopyItem.enable();
|
||||||
this.btnCutItem.enable();
|
this.btnCutItem.enable();
|
||||||
this.btnSetPermission.enable();
|
|
||||||
// this.btnGetInfo.enable();
|
// this.btnGetInfo.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue