Author: thomas.heute(a)jboss.com
Date: 2007-03-06 17:53:50 -0500 (Tue, 06 Mar 2007)
New Revision: 6567
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
Log:
CMSContentEditorPortlet working
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-03-06
22:21:42 UTC (rev 6566)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSContentEditorPortlet.java 2007-03-06
22:53:50 UTC (rev 6567)
@@ -29,6 +29,7 @@
import javax.portlet.ActionResponse;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
import javax.portlet.PortletSecurityException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
@@ -45,9 +46,10 @@
*/
public class CMSContentEditorPortlet extends GenericPortlet
{
+ /** . */
+ private static final PortletMode EDIT_CONTENT = new
PortletMode("edit_content");
private CMS cmsService;
-
public void init() throws PortletException
{
@@ -57,42 +59,48 @@
public void processAction(ActionRequest req, ActionResponse resp) throws
PortletException, PortletSecurityException, IOException
{
- String uri = req.getParameter("uri");
- String path = req.getParameter("path");
- if (uri != null)
+ if (req.getPortletMode().equals(EDIT_CONTENT))
{
- resp.setRenderParameter("uri", uri);
+ String uri = req.getParameter("uri");
+ String path = req.getParameter("path");
+ if (uri != null)
+ {
+ resp.setRenderParameter("uri", uri);
+ }
+ if (path != null)
+ {
+ resp.setRenderParameter("path", path);
+ }
+ resp.setRenderParameter("meta_action", "blah");
}
- if (path != null)
- {
- resp.setRenderParameter("path", path);
- }
}
public void render(RenderRequest req, RenderResponse resp) throws PortletException,
PortletSecurityException, IOException
{
- resp.setContentType("text/html");
-
- String sPath = req.getParameter("path");
- if (sPath == null)
+ if (req.getPortletMode().equals(EDIT_CONTENT))
{
- sPath = "/";
- }
+ resp.setContentType("text/html");
- Command listCMD =
cmsService.getCommandFactory().createFolderGetListCommand(sPath);
- Folder mainFolder = (Folder)cmsService.execute(listCMD);
- List folders = mainFolder.getFolders();
- List files = mainFolder.getFiles();
+ String sPath = req.getParameter("path");
+ if (sPath == null)
+ {
+ sPath = "/";
+ }
- resp.setContentType("text/html");
- req.setAttribute("folders", folders);
- req.setAttribute("files", files);
- req.setAttribute("currpath", sPath);
-
-
- javax.portlet.PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher(CMSEditorConstants.CMS_EDITOR_JSP_PATH +
"/main.jsp");
- prd.include(req, resp);
+ Command listCMD =
cmsService.getCommandFactory().createFolderGetListCommand(sPath);
+ Folder mainFolder = (Folder)cmsService.execute(listCMD);
+ List folders = mainFolder.getFolders();
+ List files = mainFolder.getFiles();
+ resp.setContentType("text/html");
+ req.setAttribute("folders", folders);
+ req.setAttribute("files", files);
+ req.setAttribute("currpath", sPath);
+
+
+ javax.portlet.PortletRequestDispatcher prd =
getPortletContext().getRequestDispatcher(CMSEditorConstants.CMS_EDITOR_JSP_PATH +
"/main.jsp");
+ prd.include(req, resp);
+ }
}
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-03-06
22:21:42 UTC (rev 6566)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/editor/main.jsp 2007-03-06
22:53:50 UTC (rev 6567)
@@ -110,6 +110,7 @@
border="0"> <a href="<portlet:actionURL>
<portlet:param name="uri" value="<%= file.getBasePath()
%>"/>
<portlet:param name="path" value="<%= sCurrPath
%>"/>
+ <portlet:param name="meta_action" value="select"/>
</portlet:actionURL>"><%=
file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1,
file.getBasePath().length()) %>
</a>