diff --git a/ccm-cms/lib/javax.servlet.jsp.jstl-1.2.1.jar b/ccm-cms/lib/javax.servlet.jsp.jstl-1.2.1.jar new file mode 100644 index 000000000..a86a36579 Binary files /dev/null and b/ccm-cms/lib/javax.servlet.jsp.jstl-1.2.1.jar differ diff --git a/ccm-cms/lib/javax.servlet.jsp.jstl-api-1.2.1.jar b/ccm-cms/lib/javax.servlet.jsp.jstl-api-1.2.1.jar new file mode 100644 index 000000000..4b3b433c8 Binary files /dev/null and b/ccm-cms/lib/javax.servlet.jsp.jstl-api-1.2.1.jar differ diff --git a/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java b/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java index ad05fd26a..612584a17 100644 --- a/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java +++ b/ccm-cms/src/com/arsdigita/cms/portlet/ContentItemJSRPortlet.java @@ -18,8 +18,12 @@ */ package com.arsdigita.cms.portlet; +import com.arsdigita.cms.ContentBundle; +import com.arsdigita.cms.ContentItem; import com.arsdigita.cms.ContentSection; import com.arsdigita.cms.ContentSectionCollection; +import com.arsdigita.cms.ItemCollection; +import com.arsdigita.persistence.OID; import com.arsdigita.portal.JSRPortlet; import java.io.IOException; @@ -53,6 +57,7 @@ public class ContentItemJSRPortlet extends JSRPortlet { private static final Logger s_log = Logger.getLogger(ContentItemJSRPortlet.class); private static final String BACKING_BEAN = "comArsdigitaCMSContentItemJSRPortletAdmin"; private String selectedContentSection; + private String search; /** * @@ -78,10 +83,28 @@ public class ContentItemJSRPortlet extends JSRPortlet { request.setAttribute("contentSections", sections); request.setAttribute("selectedContentSection", selectedContentSection); + request.setAttribute("contentItemSearchString", search); + + if ((selectedContentSection != null)) { + final ContentSection selectedSection = new ContentSection(OID.valueOf( + selectedContentSection)); + final ItemCollection items = selectedSection.getItems(); + items.addFilter(String.format("(lower(name) LIKE lower('%%%s%%'))", search)); + items.addVersionFilter(true); + items.addEqualsFilter("isFolder", false); + items.addFilter("language != ''"); + + final List matchingItems = new ArrayList((int) items.size()); + while (items.next()) { + matchingItems.add(items.getContentItem()); + } + + request.setAttribute("matchingItems", matchingItems); + } request.setAttribute("helloworld", "Hello World Attribute"); - PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher( + final PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher( "/templates/portlets/ContentItemJSRPortletAdmin.jsp"); dispatcher.include(request, response); } @@ -123,7 +146,8 @@ public class ContentItemJSRPortlet extends JSRPortlet { final ActionResponse actionResponse) throws PortletException, IOException { if (actionRequest.getParameter("contentSectionSelect") != null) { - this.selectedContentSection = actionRequest.getParameter("contentSectionSelect"); + selectedContentSection = actionRequest.getParameter("contentSectionSelect"); + search = actionRequest.getParameter("contentItemSearchString"); } } diff --git a/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp b/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp index c8cfe108a..d85d54af8 100644 --- a/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp +++ b/ccm-cms/web/templates/portlets/ContentItemJSRPortletAdmin.jsp @@ -31,7 +31,8 @@ name="contentItemSearchString" type="text" maxlength="1000" - size="40"/> + size="40" + value="${contentItemSearchString}"/> @@ -49,8 +50,11 @@ ${matchingItem.path} - ${matchingItem.title} - This will be the select link for ${matchingItem.oid} + ${matchingItem.displayName} + + + Select + diff --git a/ccm-sci-bundle/web/themes/mandalay/layout/content-center.xml b/ccm-sci-bundle/web/themes/mandalay/layout/content-center.xml index 80979905a..c80c8e05c 100644 --- a/ccm-sci-bundle/web/themes/mandalay/layout/content-center.xml +++ b/ccm-sci-bundle/web/themes/mandalay/layout/content-center.xml @@ -20,95 +20,95 @@ --> - - - <separator> : </separator> - <showText> - <line>layout/page/head/title</line> - </showText> - <usePageTitle/> - - - - -
-
- - -
- - - - - -
- -
-
-
- - > - -
-
-
-
- - - - -
-
- -
-
-