KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > dotmarketing > portlets > wysiwyg > action > ViewWysiwygAction


1 package com.dotmarketing.portlets.wysiwyg.action;
2
3 import javax.portlet.PortletConfig;
4 import javax.portlet.RenderRequest;
5 import javax.portlet.RenderResponse;
6
7 import org.apache.struts.action.ActionForm;
8 import org.apache.struts.action.ActionForward;
9 import org.apache.struts.action.ActionMapping;
10
11 import com.dotmarketing.util.Constants;
12 import com.dotmarketing.util.Logger;
13 import com.liferay.portal.struts.PortletAction;
14 /**
15  * @author Maria
16  */

17
18 public class ViewWysiwygAction extends PortletAction {
19     
20     public ActionForward render(
21             ActionMapping mapping, ActionForm form, PortletConfig config,
22             RenderRequest req, RenderResponse res)
23     throws Exception JavaDoc {
24         
25         String JavaDoc cmd = req.getParameter("cmd");
26
27         Logger.debug(this, "I'm running ViewWysiwygAction cmd= " + cmd);
28         
29         if ((cmd != null) && cmd.equals(Constants.WYSIWYG_EDIT_PICTURE)) {
30             return mapping.findForward("portlet.ext.wysiwyg.edit_picture");
31         }
32         else if ((cmd != null) && cmd.equals(Constants.WYSIWYG_EDIT_TABLE)) {
33             return mapping.findForward("portlet.ext.wysiwyg.edit_table");
34         }
35         else if ((cmd != null) && cmd.equals(Constants.WYSIWYG_EDIT_COLOR)) {
36             return mapping.findForward("portlet.ext.wysiwyg.edit_color");
37         }
38         else if ((cmd != null) && cmd.equals(Constants.WYSIWYG_CHAR_MAP)) {
39             return mapping.findForward("portlet.ext.wysiwyg.char_map");
40         }
41         return mapping.findForward("portlet.ext.wysiwyg.view_wysiwyg");
42     }
43 }
44
Popular Tags