1
22
23 package com.liferay.portal.editor.fckeditor.command;
24
25 import com.liferay.portal.kernel.util.StringPool;
26 import com.liferay.portal.theme.ThemeDisplay;
27
28 import java.util.StringTokenizer;
29
30 import javax.servlet.http.HttpServletRequest;
31
32
39 public class CommandArgument {
40
41 public CommandArgument(String command, String type, String currentFolder,
42 String newFolder, ThemeDisplay themeDisplay,
43 HttpServletRequest req) {
44
45 _command = command;
46 _type = type;
47 _currentFolder = currentFolder;
48 _newFolder = newFolder;
49 _themeDisplay = themeDisplay;
50 _req = req;
51 }
52
53 public String getCommand() {
54 return _command;
55 }
56
57 public String getType() {
58 return _type;
59 }
60
61 public String getCurrentFolder() {
62 return _currentFolder;
63 }
64
65 public String getNewFolder() {
66 return _newFolder;
67 }
68
69 public ThemeDisplay getThemeDisplay() {
70 return _themeDisplay;
71 }
72
73 public HttpServletRequest getHttpServletRequest() {
74 return _req;
75 }
76
77 public long getCompanyId() {
78 return _themeDisplay.getCompanyId();
79 }
80
81 public String getCurrentGroupName() {
82 if (_currentFolder.equals("/")) {
83 return StringPool.BLANK;
84 }
85 else {
86 StringTokenizer st = new StringTokenizer(_currentFolder, "/");
87
88 return st.nextToken();
89 }
90 }
91
92 public long getUserId() {
93 return _themeDisplay.getUserId();
94 }
95
96 public long getPlid() {
97 return _themeDisplay.getPlid();
98 }
99
100 private String _command;
101 private String _type;
102 private String _currentFolder;
103 private String _newFolder;
104 private ThemeDisplay _themeDisplay;
105 private HttpServletRequest _req;
106
107 }