1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.exoplatform.ecm.webui.component.explorer.symlink;
18
19 import org.exoplatform.services.log.ExoLogger;
20 import org.exoplatform.services.log.Log;
21 import org.exoplatform.webui.config.annotation.ComponentConfig;
22 import org.exoplatform.webui.core.UIContainer;
23 import org.exoplatform.webui.core.UIPopupComponent;
24 import org.exoplatform.webui.core.UIPopupWindow;
25 import org.exoplatform.webui.core.lifecycle.UIContainerLifecycle;
26
27
28
29
30
31
32
33 @ComponentConfig(
34 lifecycle = UIContainerLifecycle.class
35 )
36 public class UISymLinkManager extends UIContainer implements UIPopupComponent {
37 private static final Log LOG = ExoLogger.getLogger(UISymLinkManager.class.getName());
38
39 final static public String EXTARNAL_METADATA_POPUP = "AddMetadataPopup" ;
40
41 public UISymLinkManager() throws Exception {
42 addChild(UISymLinkForm.class, null, null);
43 addChild(UISymLinkContainer.class, null, null).setRendered(false);
44 }
45
46 public void enableLocalizationMode() {
47 UISymLinkForm linkForm = this.getChild(UISymLinkForm.class);
48 linkForm.enableLocalizationMode();
49 }
50
51 public UIPopupWindow initPopupTaxonomy(String id) throws Exception {
52 UIPopupWindow uiPopup = getChildById(id);
53 if (uiPopup == null) {
54 uiPopup = addChild(UIPopupWindow.class, null, id);
55 }
56 uiPopup.setWindowSize(700, 350);
57 uiPopup.setShow(false);
58 uiPopup.setResizable(true);
59 return uiPopup;
60 }
61
62 public void activate() {
63 try {
64 UISymLinkForm uiUploadForm = getChild(UISymLinkForm.class);
65 uiUploadForm.initFieldInput();
66 } catch (Exception e) {
67 if (LOG.isErrorEnabled()) {
68 LOG.error("Unexpected error!", e.getMessage());
69 }
70 }
71 }
72
73 public void deActivate() {}
74
75 public void initMetadataPopup() throws Exception {
76 removeChildById(EXTARNAL_METADATA_POPUP) ;
77 UIPopupWindow uiPopup = addChild(UIPopupWindow.class, null, EXTARNAL_METADATA_POPUP) ;
78 uiPopup.setShowMask(true);
79 uiPopup.setWindowSize(400, 400);
80 uiPopup.setRendered(true);
81 uiPopup.setShow(true) ;
82 uiPopup.setResizable(true) ;
83 }
84 public void useWorkspaceSelector() {
85 UISymLinkForm child = getChild(UISymLinkForm.class);
86 if (child!=null) {
87 child.useWorkspaceSelector();
88 }
89 }
90 }