1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.wcm.webui.selector.content.folder;
18
19 import org.exoplatform.ecm.webui.selector.UISelectable;
20 import org.exoplatform.wcm.webui.selector.content.UIContentBrowsePanel;
21 import org.exoplatform.webui.config.annotation.ComponentConfig;
22 import org.exoplatform.webui.config.annotation.EventConfig;
23 import org.exoplatform.webui.core.lifecycle.Lifecycle;
24 import org.exoplatform.webui.event.Event;
25 import org.exoplatform.webui.event.EventListener;
26
27
28
29
30
31
32
33 @ComponentConfig(
34 lifecycle = Lifecycle.class,
35 template = "classpath:groovy/wcm/webui/selector/content/folder/UIContentBrowsePanel.gtmpl",
36 events = {
37 @EventConfig(listeners = UIContentBrowsePanel.ChangeContentTypeActionListener.class),
38 @EventConfig(listeners = UIContentBrowsePanelFolder.SelectActionListener.class)
39 }
40 )
41
42 public class UIContentBrowsePanelFolder extends UIContentBrowsePanel{
43
44 private String _initPath = "";
45 private String _initDrive = "";
46
47 public void setInitPath(String initDrive, String initPath) {
48 this._initPath = initPath;
49 this._initDrive = initDrive;
50 }
51
52 public String getInitDrive() { return this._initDrive; }
53 public String getInitPath() { return this._initPath; }
54
55 public static class SelectActionListener extends EventListener<UIContentBrowsePanel> {
56 public void execute(Event<UIContentBrowsePanel> event) throws Exception {
57 UIContentBrowsePanel contentBrowsePanel = event.getSource();
58 String returnFieldName = contentBrowsePanel.getReturnFieldName();
59 ((UISelectable) (contentBrowsePanel.getSourceComponent())).doSelect(returnFieldName,
60 event.getRequestContext()
61 .getRequestParameter(OBJECTID));
62 }
63 }
64 }