diff --git a/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java b/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java index 0c0593b2b..ad05fd26a 100644 --- a/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java +++ b/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java @@ -18,10 +18,14 @@ */ package com.arsdigita.cms.portlet; +import com.arsdigita.cms.ContentSection; +import com.arsdigita.cms.ContentSectionCollection; import com.arsdigita.portal.JSRPortlet; import java.io.IOException; import java.io.PrintWriter; +import java.util.ArrayList; +import java.util.List; import javax.portlet.ActionRequest; import javax.portlet.ActionResponse; import javax.portlet.PortletException; @@ -37,6 +41,7 @@ import org.apache.log4j.Logger; * WORK IN PROGRESS! * * @author pb + * @author Jens Pelzetter */ public class ContentItemJSRPortlet extends JSRPortlet { @@ -46,6 +51,8 @@ public class ContentItemJSRPortlet extends JSRPortlet { * com.arsdigita.portal.JSRPortlet=DEBUG by uncommenting or adding the line. */ private static final Logger s_log = Logger.getLogger(ContentItemJSRPortlet.class); + private static final String BACKING_BEAN = "comArsdigitaCMSContentItemJSRPortletAdmin"; + private String selectedContentSection; /** * @@ -56,11 +63,24 @@ public class ContentItemJSRPortlet extends JSRPortlet { * @throws IOException */ @Override - protected void doEdit(RenderRequest request, RenderResponse response) + protected void doEdit(final RenderRequest request, final RenderResponse response) throws PortletException, IOException { //response.setContentType("text/html"); //PrintWriter writer = new PrintWriter(response.getWriter()); //writer.println("You're now in Edit mode."); + final ContentSectionCollection contentSections = ContentSection.getAllSections(); + final List sections = new ArrayList((int) contentSections + .size()); + + while (contentSections.next()) { + sections.add(contentSections.getContentSection()); + } + + request.setAttribute("contentSections", sections); + request.setAttribute("selectedContentSection", selectedContentSection); + + request.setAttribute("helloworld", "Hello World Attribute"); + PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher( "/templates/portlets/ContentItemJSRPortletAdmin.jsp"); dispatcher.include(request, response); @@ -100,9 +120,11 @@ public class ContentItemJSRPortlet extends JSRPortlet { @Override public void processAction(final ActionRequest actionRequest, - final ActionResponse actionResponse) - throws PortletException, IOException { - + final ActionResponse actionResponse) throws PortletException, + IOException { + if (actionRequest.getParameter("contentSectionSelect") != null) { + this.selectedContentSection = actionRequest.getParameter("contentSectionSelect"); + } } } diff --git a/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp b/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp new file mode 100644 index 000000000..c8cfe108a --- /dev/null +++ b/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp @@ -0,0 +1,66 @@ +<%-- + Document : ContentItemJSRPortletAdmin + Created on : 20.06.2014, 13:08:01 + Author : Jens Pelzetter +--%> + +<%@page contentType="text/html" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" + prefix="c" %> +<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%> + + +
+

Hello World from ContentItemJSRPortletAdmin.jsp

+ +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
PathTitle
${matchingItem.path}${matchingItem.title}This will be the select link for ${matchingItem.oid}
+
+ + <%--

Content Sections

+
    + +
  • ${section.displayName}
  • +
    +
--%> +
\ No newline at end of file