1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.webui.component.admin.unlock;
18
19 import org.exoplatform.webui.config.annotation.ComponentConfig;
20 import org.exoplatform.webui.core.UIPopupWindow;
21 import org.exoplatform.webui.ext.manager.UIAbstractManager;
22
23
24
25
26
27
28
29
30 @ComponentConfig(template = "system:/groovy/webui/core/UITabPane.gtmpl")
31 public class UIUnLockManager extends UIAbstractManager {
32
33 public UIUnLockManager() throws Exception {
34 addChild(UILockNodeList.class, null, null).setRendered(true);
35 addChild(UILockHolderContainer.class, null, null).setRendered(false);
36 }
37
38 public void refresh() throws Exception {
39 update();
40 }
41
42 public void update() throws Exception{
43 UILockNodeList uiLockNodeList = getChild(UILockNodeList.class);
44 uiLockNodeList.refresh(uiLockNodeList.getUIPageIterator().getCurrentPage());
45 UILockHolderContainer uiHolderContainer = getChild(UILockHolderContainer.class);
46 if (uiHolderContainer != null) {
47 UILockHolderList uiLockHolderList = uiHolderContainer.getChild(UILockHolderList.class);
48 uiLockHolderList.refresh(uiLockHolderList.getUIPageIterator().getCurrentPage());
49 }
50 }
51
52 public void initFormPopup(String id) throws Exception {
53 removeChildById(id);
54 UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, id);
55 uiPopup.setShowMask(true);
56 uiPopup.setWindowSize(600, 500);
57 UIUnLockForm uiForm = createUIComponent(UIUnLockForm.class, null, null);
58 uiPopup.setUIComponent(uiForm);
59 uiPopup.setRendered(true);
60 uiPopup.setShow(true);
61 uiPopup.setResizable(true);
62 }
63
64 public void initPermissionPopup(String membership) throws Exception {
65 removeChildById("PermissionPopup");
66 UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, "PermissionPopup");
67 uiPopup.setShowMask(true);
68 uiPopup.setWindowSize(560, 300);
69 UIPermissionSelector uiECMPermission =
70 createUIComponent(UIPermissionSelector.class, null, "GroupsOrUsersBrowse");
71 uiECMPermission.setSelectedMembership(true);
72 if(membership != null && membership.indexOf(":/") > -1) {
73 String[] arrMember = membership.split(":/");
74 uiECMPermission.setCurrentPermission("/" + arrMember[1]);
75 }
76 uiPopup.setUIComponent(uiECMPermission);
77 UIUnLockForm uiForm = findFirstComponentOfType(UIUnLockForm.class);
78 uiECMPermission.setSourceComponent(uiForm, new String[] {UIUnLockForm.GROUPS_OR_USERS});
79 uiPopup.setRendered(true);
80 uiPopup.setShow(true);
81 uiPopup.setResizable(true);
82 }
83 }