1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.webui.component.admin.manager;
18
19 import org.exoplatform.ecm.webui.component.admin.UIECMAdminPortlet;
20 import org.exoplatform.ecm.webui.component.admin.UIECMAdminWorkingArea;
21 import org.exoplatform.ecm.webui.component.admin.drives.UIDriveManager;
22 import org.exoplatform.ecm.webui.component.admin.listener.UIECMAdminControlPanelActionListener;
23 import org.exoplatform.webui.config.annotation.ComponentConfig;
24 import org.exoplatform.webui.config.annotation.EventConfig;
25 import org.exoplatform.webui.event.Event;
26 import org.exoplatform.webui.ext.manager.UIAbstractManager;
27 import org.exoplatform.webui.ext.manager.UIAbstractManagerComponent;
28
29
30
31
32
33
34
35 @ComponentConfig(
36 events = {
37 @EventConfig(listeners = UIDriveManagerComponent.UIDriveManagerActionListener.class)
38 }
39 )
40 public class UIDriveManagerComponent extends UIAbstractManagerComponent {
41
42 public static class UIDriveManagerActionListener extends UIECMAdminControlPanelActionListener<UIDriveManagerComponent> {
43 public void processEvent(Event<UIDriveManagerComponent> event) throws Exception {
44 UIECMAdminPortlet portlet = event.getSource().getAncestorOfType(UIECMAdminPortlet.class);
45 UIECMAdminWorkingArea uiWorkingArea = portlet.getChild(UIECMAdminWorkingArea.class);
46 uiWorkingArea.getChild(UIDriveManager.class).update() ;
47 uiWorkingArea.setChild(UIDriveManager.class) ;
48 event.getRequestContext().addUIComponentToUpdateByAjax(uiWorkingArea) ;
49 }
50 }
51
52 @Override
53 public Class<? extends UIAbstractManager> getUIAbstractManagerClass() {
54 return UIDriveManager.class;
55 }
56 }