1
14
15 package com.liferay.portal.editor.fckeditor;
16
17 import com.liferay.portal.editor.fckeditor.command.Command;
18 import com.liferay.portal.editor.fckeditor.command.CommandArgument;
19 import com.liferay.portal.editor.fckeditor.command.CommandFactory;
20 import com.liferay.portal.kernel.log.Log;
21 import com.liferay.portal.kernel.log.LogFactoryUtil;
22 import com.liferay.portal.kernel.util.ParamUtil;
23 import com.liferay.portal.theme.ThemeDisplay;
24 import com.liferay.portal.util.WebKeys;
25
26 import javax.servlet.http.HttpServletRequest;
27 import javax.servlet.http.HttpServletResponse;
28
29 import org.apache.struts.action.Action;
30 import org.apache.struts.action.ActionForm;
31 import org.apache.struts.action.ActionForward;
32 import org.apache.struts.action.ActionMapping;
33
34
39 public class ConnectorAction extends Action {
40
41 public ActionForward execute(
42 ActionMapping mapping, ActionForm form, HttpServletRequest request,
43 HttpServletResponse response)
44 throws Exception {
45
46 try {
47 String command = request.getParameter("Command");
48 String type = request.getParameter("Type");
49 String currentFolder = request.getParameter("CurrentFolder");
50 String newFolder = ParamUtil.getString(request, "NewFolderName");
51
52 if (_log.isDebugEnabled()) {
53 _log.debug("Command " + command);
54 _log.debug("Type " + type);
55 _log.debug("Current folder " + currentFolder);
56 _log.debug("New folder " + newFolder);
57 }
58
59 ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(
60 WebKeys.THEME_DISPLAY);
61
62 CommandArgument argument = new CommandArgument(
63 command, type, currentFolder, newFolder, themeDisplay, request);
64
65 Command commandObj = CommandFactory.getCommand(command);
66
67 commandObj.execute(argument, request, response);
68 }
69 catch (Exception e) {
70 _log.error(e, e);
71 }
72
73 return null;
74 }
75
76 private static Log _log = LogFactoryUtil.getLog(ConnectorAction.class);
77
78 }