You are viewing a plain text version of this content. The canonical link for it is here.
Posted to portalapps-dev@portals.apache.org by wo...@apache.org on 2010/05/18 16:11:28 UTC
svn commit: r945664 - in
/portals/applications/sandbox/content/trunk/src/main:
java/org/apache/portals/applications/content/ webapp/WEB-INF/
webapp/WEB-INF/classes/ webapp/WEB-INF/view/
Author: woonsan
Date: Tue May 18 14:11:28 2010
New Revision: 945664
URL: http://svn.apache.org/viewvc?rev=945664&view=rev
Log:
Adding simple xpath (or sql) based search portlet
Added:
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp (with props)
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp (with props)
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp (with props)
Modified:
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericQueryContentPortlet.java
portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericSearchQueryContentPortlet.java
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/classes/log4j.properties
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-query-content-help.jsp
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-help.jsp
portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-view.jsp
Modified: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java (original)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericContentPortlet.java Tue May 18 14:11:28 2010
@@ -53,7 +53,8 @@ public class GenericContentPortlet exten
private String contentBeanAttributeName = "contentBean";
@Override
- public void init(PortletConfig config) throws PortletException {
+ public void init(PortletConfig config) throws PortletException
+ {
super.init(config);
String param = StringUtils.trim(getInitParameterFromConfigOrContext(config, "repositoryJndiName", null));
@@ -244,6 +245,6 @@ public class GenericContentPortlet exten
value = config.getPortletContext().getInitParameter(name);
}
- return (value != null ? value : defaultValue);
+ return (value != null ? value.trim() : defaultValue);
}
}
Modified: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericQueryContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericQueryContentPortlet.java?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericQueryContentPortlet.java (original)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericQueryContentPortlet.java Tue May 18 14:11:28 2010
@@ -21,6 +21,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
+import javax.portlet.PortletConfig;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
import javax.portlet.RenderRequest;
@@ -44,6 +45,21 @@ public class GenericQueryContentPortlet
{
private static Logger log = LoggerFactory.getLogger(GenericQueryContentPortlet.class);
+ private String defaultQueryLanguage = javax.jcr.query.Query.XPATH;
+
+ @Override
+ public void init(PortletConfig config) throws PortletException
+ {
+ super.init(config);
+
+ String param = StringUtils.trim(getInitParameterFromConfigOrContext(config, "defaultQueryLanguage", null));
+
+ if (!StringUtils.isBlank(param))
+ {
+ defaultQueryLanguage = param;
+ }
+ }
+
@Override
public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
{
@@ -74,7 +90,7 @@ public class GenericQueryContentPortlet
{
try
{
- pageIndex = Math.max(1, Integer.parseInt(param));
+ pageIndex = Math.max(1, Integer.parseInt(param.trim()));
}
catch (NumberFormatException e)
{
@@ -86,16 +102,17 @@ public class GenericQueryContentPortlet
try
{
- QueryManager queryManager = ocm.getQueryManager();
Class<?> queryClass = Thread.currentThread().getContextClassLoader().loadClass(queryClassName);
- Filter filter = createFilter(request, queryManager, queryClass, contentPath);
- Query query = queryManager.createQuery(filter);
- String jcrExpression = queryManager.buildJCRExpression(query);
- String queryOrderByClause = request.getPreferences().getValue("queryOrderByClause", null);
- if (!StringUtils.isBlank(queryOrderByClause))
+ String jcrExpression = getParameterOrPreference(request, "fullQueryJcrExpression", null);
+
+ if (!StringUtils.isBlank(jcrExpression))
{
- jcrExpression += " order by " + queryOrderByClause;
+ request.setAttribute("fullQueryJcrExpression", jcrExpression);
+ }
+ else
+ {
+ jcrExpression = buildFullQueryJcrExpression(request, ocm, queryClass, contentPath);
}
if (log.isDebugEnabled())
@@ -103,7 +120,8 @@ public class GenericQueryContentPortlet
log.debug("Executing jcr query: " + jcrExpression);
}
- Collection result = ocm.getObjects(jcrExpression, javax.jcr.query.Query.XPATH);
+ String queryLanguage = request.getPreferences().getValue("queryLanguage", defaultQueryLanguage);
+ Collection result = ocm.getObjects(jcrExpression, queryLanguage);
int itemCount = result.size();
if (pageSize > 0)
@@ -161,6 +179,23 @@ public class GenericQueryContentPortlet
}
}
+ protected String buildFullQueryJcrExpression(final PortletRequest request, final ObjectContentManager ocm, Class<?> queryClass, String scope)
+ {
+ QueryManager queryManager = ocm.getQueryManager();
+ Filter filter = createFilter(request, queryManager, queryClass, scope);
+ Query query = queryManager.createQuery(filter);
+
+ String jcrExpression = queryManager.buildJCRExpression(query);
+ String queryOrderByClause = request.getPreferences().getValue("queryOrderByClause", null);
+
+ if (!StringUtils.isBlank(queryOrderByClause))
+ {
+ jcrExpression += " order by " + queryOrderByClause;
+ }
+
+ return jcrExpression;
+ }
+
protected Filter createFilter(final PortletRequest request, final QueryManager queryManager, Class<?> queryClass, String scope)
{
Filter filter = queryManager.createFilter(queryClass);
@@ -211,7 +246,7 @@ public class GenericQueryContentPortlet
return filter;
}
- private String getParameterOrPreference(final PortletRequest request, String name, String defaultValue)
+ protected String getParameterOrPreference(final PortletRequest request, String name, String defaultValue)
{
String value = request.getParameter(name);
@@ -220,6 +255,6 @@ public class GenericQueryContentPortlet
value = request.getPreferences().getValue(name, null);
}
- return (value != null ? value : defaultValue);
+ return (value != null ? value.trim() : defaultValue);
}
}
Modified: portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericSearchQueryContentPortlet.java
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericSearchQueryContentPortlet.java?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericSearchQueryContentPortlet.java (original)
+++ portals/applications/sandbox/content/trunk/src/main/java/org/apache/portals/applications/content/GenericSearchQueryContentPortlet.java Tue May 18 14:11:28 2010
@@ -23,6 +23,7 @@ import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
+import org.apache.commons.lang.StringUtils;
import org.apache.jackrabbit.ocm.manager.ObjectContentManager;
@@ -40,25 +41,31 @@ public class GenericSearchQueryContentPo
String queryNode = request.getParameter("queryNode");
String queryOperator = request.getParameter("queryOperator");
String queryJcrExpression = request.getParameter("queryJcrExpression");
+ String fullQueryJcrExpression = request.getParameter("fullQueryJcrExpression");
if (query != null)
{
- response.setRenderParameter("query", query);
+ response.setRenderParameter("query", query.trim());
}
if (queryNode != null)
{
- response.setRenderParameter("queryNode", queryNode);
+ response.setRenderParameter("queryNode", queryNode.trim());
}
if (queryOperator != null)
{
- response.setRenderParameter("queryOperator", queryOperator);
+ response.setRenderParameter("queryOperator", queryOperator.trim());
}
if (queryJcrExpression != null)
{
- response.setRenderParameter("queryJcrExpression", queryJcrExpression);
+ response.setRenderParameter("queryJcrExpression", queryJcrExpression.trim());
+ }
+
+ if (fullQueryJcrExpression != null)
+ {
+ response.setRenderParameter("fullQueryJcrExpression", fullQueryJcrExpression.trim());
}
super.processAction(request, response);
@@ -68,8 +75,9 @@ public class GenericSearchQueryContentPo
protected Object getContentBean(final PortletRequest request, final ObjectContentManager ocm, final String contentPath) throws PortletException
{
String query = request.getParameter("query");
+ String fullQueryJcrExpression = request.getParameter("fullQueryJcrExpression");
- if (query == null)
+ if (StringUtils.isBlank(query) && StringUtils.isBlank(fullQueryJcrExpression))
{
return null;
}
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/classes/log4j.properties
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/classes/log4j.properties?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/classes/log4j.properties (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/classes/log4j.properties Tue May 18 14:11:28 2010
@@ -26,7 +26,7 @@
#
log4j.rootLogger = ERROR, pa
-log4j.category.org.apache.portals.applications.content = ERROR, pa
+log4j.category.org.apache.portals.applications.content = DEBUG, pa
log4j.additivity.org.apache.portals.applications.content = false
log4j.category.org.apache.jackrabbit.ocm.manager = DEBUG, ocm
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/portlet.xml Tue May 18 14:11:28 2010
@@ -168,6 +168,65 @@
</portlet-preferences>
</portlet>
+ <portlet id="SimpleSearchQueryContentPortlet">
+ <description>Simple Search Query Content Portlet</description>
+ <portlet-name>SimpleSearchQueryContentPortlet</portlet-name>
+ <display-name>Simple Search Query Content</display-name>
+ <portlet-class>org.apache.portals.applications.content.GenericSearchQueryContentPortlet</portlet-class>
+ <init-param>
+ <name>ViewPage</name>
+ <value>/WEB-INF/view/simple-search-query-content-view.jsp</value>
+ </init-param>
+ <init-param>
+ <name>EditPage</name>
+ <value>/WEB-INF/view/simple-search-query-content-edit.jsp</value>
+ </init-param>
+ <init-param>
+ <name>HelpPage</name>
+ <value>/WEB-INF/view/simple-search-query-content-help.jsp</value>
+ </init-param>
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>EDIT</portlet-mode>
+ <portlet-mode>VIEW</portlet-mode>
+ <portlet-mode>HELP</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+ <resource-bundle>org.apache.portals.applications.content.resources.GenericSearchQueryContentPortlet</resource-bundle>
+ <portlet-info>
+ <title>Simple Search Query Content</title>
+ <short-title>Simple Search Query Content</short-title>
+ <keywords>content,simple,search,query</keywords>
+ </portlet-info>
+ <portlet-preferences>
+ <preference>
+ <name>contentPath</name>
+ <value>//</value>
+ </preference>
+ <preference>
+ <name>contentUrlBase</name>
+ <value>/content/documents/en</value>
+ </preference>
+ <preference>
+ <name>queryLanguage</name>
+ <value>xpath</value>
+ </preference>
+ <preference>
+ <name>queryClass</name>
+ <value>org.apache.portals.applications.content.demo.beans.TextPage</value>
+ </preference>
+ <preference>
+ <name>pageSize</name>
+ <value>10</value>
+ </preference>
+ <preference>
+ <name>queryOrderByClause</name>
+ <value>@jcr:score descending</value>
+ </preference>
+ </portlet-preferences>
+ </portlet>
+
<portlet>
<description>News Item Portlet</description>
<portlet-name>NewsItemPortlet</portlet-name>
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-query-content-help.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-query-content-help.jsp?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-query-content-help.jsp (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-query-content-help.jsp Tue May 18 14:11:28 2010
@@ -21,5 +21,5 @@ limitations under the License.
<portlet:defineObjects/>
<fmt-portlet:setBundle/>
-<h1>Content query result help page</h1>
+<h1>Content query help page</h1>
<hr/>
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-help.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-help.jsp?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-help.jsp (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-help.jsp Tue May 18 14:11:28 2010
@@ -21,5 +21,5 @@ limitations under the License.
<portlet:defineObjects/>
<fmt-portlet:setBundle/>
-<h1>Content search query result help page</h1>
+<h1>Content search query help page</h1>
<hr/>
Modified: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-view.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-view.jsp?rev=945664&r1=945663&r2=945664&view=diff
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-view.jsp (original)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/generic-search-query-content-view.jsp Tue May 18 14:11:28 2010
@@ -31,7 +31,7 @@ limitations under the License.
</c:if>
<c:set var="portalServletPath" value="${requestContext.request.servletPath}" />
-<h1>Content search query result</h1>
+<h1>Content search query</h1>
<hr/>
<form action="<portlet:actionURL/>">
Added: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp?rev=945664&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp (added)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp Tue May 18 14:11:28 2010
@@ -0,0 +1,25 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt-portlet" uri="http://portals.apache.org/applications/gems/fmt-portlet" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+<fmt-portlet:setBundle/>
+
+<h1>Simple search query result edit page</h1>
+<hr/>
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-edit.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp?rev=945664&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp (added)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp Tue May 18 14:11:28 2010
@@ -0,0 +1,92 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="fmt-portlet" uri="http://portals.apache.org/applications/gems/fmt-portlet" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+<fmt-portlet:setBundle/>
+
+<h1>Simple XPath JCR Sample Queries</h1>
+<hr/>
+
+<p>This page contains some examples XPath queries that can be used in this portlet.</p>
+
+<p> </p>
+
+<h2>All documents of 'onehippo:document' type:</h2>
+<table>
+ <tr>
+ <td class="portlet-section-body">
+ <code>
+ //element(*, onehippo:document)
+ </code>
+ </td>
+ </tr>
+</table>
+
+<p> </p>
+
+<h2>All documents of 'onehippo:document' type under /jcr:root/content/documents/en/ folder:</h2>
+<table>
+ <tr>
+ <td class="portlet-section-body">
+ <code>
+ /jcr:root/content/documents/en//element(*, onehippo:document)
+ </code>
+ </td>
+ </tr>
+</table>
+
+<p> </p>
+
+<h2>All documents of 'onehippo:document' type under /jcr:root/content/documents/en/ folder with full text search by 'cms':</h2>
+<table>
+ <tr>
+ <td class="portlet-section-body">
+ <code>
+ /jcr:root/content/documents/en//element(*, onehippo:document) [jcr:contains(., 'cms')]
+ </code>
+ </td>
+ </tr>
+</table>
+
+<p> </p>
+
+<h2>All documents of 'onehippo:document' type under /jcr:root/content/documents/en/ folder with full text search by 'cms' ordered by jcr:score:</h2>
+<table>
+ <tr>
+ <td class="portlet-section-body">
+ <code>
+ /jcr:root/content/documents/en//element(*, onehippo:document) [jcr:contains(., 'cms')] order by @jcr:score descending
+ </code>
+ </td>
+ </tr>
+</table>
+
+<p> </p>
+
+<h2>All documents of 'onehippo:document' type under /jcr:root/content/documents/en/ folder with full text search by 'cms' ordered by onehippo:documentdate:</h2>
+<table>
+ <tr>
+ <td class="portlet-section-body">
+ <code>
+ /jcr:root/content/documents/en//element(*, onehippo:document) [jcr:contains(., 'cms')] order by @onehippo:documentdate descending
+ </code>
+ </td>
+ </tr>
+</table>
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-help.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp
URL: http://svn.apache.org/viewvc/portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp?rev=945664&view=auto
==============================================================================
--- portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp (added)
+++ portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp Tue May 18 14:11:28 2010
@@ -0,0 +1,70 @@
+<%--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+--%>
+<%@ page import="org.apache.jetspeed.request.RequestContext"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
+<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt" %>
+<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
+<%@ taglib prefix="fmt-portlet" uri="http://portals.apache.org/applications/gems/fmt-portlet" %>
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+<portlet:defineObjects/>
+<fmt-portlet:setBundle/>
+
+<c_rt:set var="requestContext" value="<%=request.getAttribute(RequestContext.REQUEST_PORTALENV)%>"/>
+<c:set var="portalContextPath" value="${requestContext.request.contextPath}" />
+<c:if test="${empty portalContextPath}">
+ <c:set var="portalContextPath" value="/"/>
+</c:if>
+<c:set var="portalServletPath" value="${requestContext.request.servletPath}" />
+
+<h1>Simple search query</h1>
+<hr/>
+
+<form action="<portlet:actionURL/>">
+Enter XPath Query:<br/>
+<textarea name="fullQueryJcrExpression" style="WIDTH: 90%" cols="80" rows="4">${fullQueryJcrExpression}</textarea>
+<br/>
+<input type="submit" name="submit" value="Search"/>
+</form>
+
+<hr/>
+
+<c:forEach var="contentItem" items="${contentBean}">
+<h3><a href="${portalContextPath}${portalServletPath}/content${fn:substringAfter(contentItem.path, contentUrlBase)}">${contentItem.title}</a></h3>
+<div align="right">(${contentItem.documentDate})</div>
+<div>${contentItem.introduction}</div>
+<p> </p>
+</c:forEach>
+
+<hr/>
+
+Pages:
+<c:forEach begin="1" end="${pageCount}" var="index">
+
+ <c:choose>
+ <c:when test="${index == pageIndex}">
+ ${index}
+ </c:when>
+ <c:otherwise>
+ <portlet:renderURL var="pageURL">
+ <portlet:param name="page" value="${index}"/>
+ </portlet:renderURL>
+ <a href="${pageURL}">${index}</a>
+ </c:otherwise>
+ </c:choose>
+
+</c:forEach>
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp
------------------------------------------------------------------------------
svn:keywords = Id
Propchange: portals/applications/sandbox/content/trunk/src/main/webapp/WEB-INF/view/simple-search-query-content-view.jsp
------------------------------------------------------------------------------
svn:mime-type = text/plain