JBoss Portal SVN: r6193 - /.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 14:31:07 -0500 (Thu, 08 Feb 2007)
New Revision: 6193
Removed:
portal-search/
Log:
"Moved" to trunk
19 years, 2 months
JBoss Portal SVN: r6192 - trunk/portal-search.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 14:29:16 -0500 (Thu, 08 Feb 2007)
New Revision: 6192
Modified:
trunk/portal-search/
Log:
Ignore bin and output
Property changes on: trunk/portal-search
___________________________________________________________________
Name: svn:ignore
+ output
bin
19 years, 2 months
JBoss Portal SVN: r6191 - in trunk/portal-search: src and 11 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 14:27:00 -0500 (Thu, 08 Feb 2007)
New Revision: 6191
Added:
trunk/portal-search/.classpath
trunk/portal-search/.project
trunk/portal-search/build.bat
trunk/portal-search/build.sh
trunk/portal-search/build.xml
trunk/portal-search/src/
trunk/portal-search/src/main/
trunk/portal-search/src/main/org/
trunk/portal-search/src/main/org/jboss/
trunk/portal-search/src/main/org/jboss/portal/
trunk/portal-search/src/main/org/jboss/portal/search/
trunk/portal-search/src/main/org/jboss/portal/search/SearchConstants.java
trunk/portal-search/src/main/org/jboss/portal/search/SearchPortlet.java
trunk/portal-search/src/resources/
trunk/portal-search/src/resources/portal-search-sar/
trunk/portal-search/src/resources/portal-search-sar/META-INF/
trunk/portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
trunk/portal-search/src/resources/portal-search-war/
trunk/portal-search/src/resources/portal-search-war/WEB-INF/
trunk/portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml
trunk/portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/
trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp
trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp
trunk/portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld
trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml
Log:
3rd try... let's put it at the correct place this time...
- Search Federation prototype JBPORTAL-1155
- CMS Search prototype
- Eclipse project files update
Added: trunk/portal-search/.classpath
===================================================================
--- trunk/portal-search/.classpath (rev 0)
+++ trunk/portal-search/.classpath 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/api"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/search"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/cms"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/portal-search/.project
===================================================================
--- trunk/portal-search/.project (rev 0)
+++ trunk/portal-search/.project 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>portal-search</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/portal-search/build.bat
===================================================================
--- trunk/portal-search/build.bat (rev 0)
+++ trunk/portal-search/build.bat 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1015 2005-11-04 20:15:13Z mholzner $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: trunk/portal-search/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portal-search/build.sh
===================================================================
--- trunk/portal-search/build.sh (rev 0)
+++ trunk/portal-search/build.sh 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1015 2005-11-04 20:15:13Z mholzner $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: trunk/portal-search/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portal-search/build.xml
===================================================================
--- trunk/portal-search/build.xml (rev 0)
+++ trunk/portal-search/build.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.cache.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="apache.myfaces.classpath"/>
+ <path refid="apache.tomahawk.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="jakarta.cactus.classpath"/>
+ <path refid="apache.fileupload.classpath"/>
+ <path refid="jakarta.io.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.javamail.classpath"/>
+ <path refid="jwebunit.jwebunit.classpath"/>
+ <path refid="dbunit.dbunit.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="portals.bridges.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="facelets.facelets.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ <pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-cms.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-search.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-theme.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
+ <path refid="jboss.portal-workflow.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <path id="hibernate.classpath">
+ <path refid="apache.commons.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="odmg.odmg.classpath"/>
+ <path refid="ehcache.ehcache.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ </path>
+
+ <path id="aop.classpath">
+ <pathelement path="${jbossas/core.libs.lib}/jboss-aspect-library.jar"/>
+ <pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ </path>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-jbp-search-lib.jar -->
+ <jar jarfile="${build.lib}/portal-jbp-search-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+
+ <!-- portal-search.sar -->
+ <copy todir="${build.resources}/portal-search">
+ <!--fileset dir="${source.bin}/portal-search-sar"/-->
+ <fileset dir="${build.resources}/portal-search-sar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-search/lib">
+ <fileset dir="${build.lib}" includes="portal-jbp-search-lib.jar"/>
+ <fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
+ </copy>
+
+ <!-- portal-search.war -->
+ <copy todir="${build.resources}/portal-search/portal-search.war">
+ <!--fileset dir="${source.bin}/portal-search-war"/-->
+ <fileset dir="${build.resources}/portal-search-war"/>
+ </copy>
+
+ </target>
+
+
+
+ <!-- Build the portal-search.sar -->
+ <target name="output" depends="artifacts">
+
+ <!-- Build configurations -->
+ <copy todir="${build.resources}/portal-search.sar">
+ <fileset dir="${build.resources}/portal-search" excludes="**/*.xml"/>
+ </copy>
+
+ <copy todir="${build.resources}/portal-search.sar">
+ <filterset>
+ <filtersfile file="../build/etc/single.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-search" includes="**/*.xml"/>
+ </copy>
+ <!-- Build archives -->
+ <implode
+ dir="${build.resources}/portal-search.sar"
+ tofile="${build.lib}/portal-search.sar"/>
+ </target>
+
+ <!-- create artifacts for running the portlet tests (except TCK) target output should have already been executed -->
+ <target name="package-tests" depends="init">
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Deploy the application
+ -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ </target>
+
+ <!--
+ | Undeploy the application
+ -->
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>
+ </target>
+
+ <target name="tests" depends="init, _buildmagic:configure:deployment">
+ </target>
+</project>
Added: trunk/portal-search/src/main/org/jboss/portal/search/SearchConstants.java
===================================================================
--- trunk/portal-search/src/main/org/jboss/portal/search/SearchConstants.java (rev 0)
+++ trunk/portal-search/src/main/org/jboss/portal/search/SearchConstants.java 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchConstants
+{
+ public static final String OP_DOSEARCH = "do_search";
+ public static final String OP_VIEWSEARCHRESULTS = "view_search_results";
+ public static String SEARCH_JSP_PATH = "/WEB-INF/jsp";
+
+}
Added: trunk/portal-search/src/main/org/jboss/portal/search/SearchPortlet.java
===================================================================
--- trunk/portal-search/src/main/org/jboss/portal/search/SearchPortlet.java (rev 0)
+++ trunk/portal-search/src/main/org/jboss/portal/search/SearchPortlet.java 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+
+import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.search.federation.SearchFederation;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchPortlet extends JBossPortlet
+{
+
+ private SearchFederation searchService;
+
+ public void init()
+ {
+ searchService = (SearchFederation)getPortletContext().getAttribute("SearchService");
+ }
+
+
+ public void doView(JBossRenderRequest rReq, JBossRenderResponse rRes) throws PortletException, IOException
+ {
+ rRes.setContentType("text/html");
+ String op = rReq.getParameter("op");
+
+ if ((op == null) || ("".equals(op)))
+ {
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(SearchConstants.SEARCH_JSP_PATH + "/search.jsp");
+ try
+ {
+ prd.include(rReq, rRes);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else if (op.equals(SearchConstants.OP_VIEWSEARCHRESULTS))
+ {
+ rRes.setContentType("text/html");
+
+ String textQuery = rReq.getParameter("search");
+
+ Query query = QueryConverter.convert(textQuery);
+
+ List results = searchService.search(query);
+
+ rReq.setAttribute("results", results);
+
+
+ PortalNode root = rReq.getPortalNode().getRoot();
+
+ rReq.setAttribute("rootNode", root);
+ rReq.setAttribute("JBossRenderResponse", rRes);
+
+
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(SearchConstants.SEARCH_JSP_PATH + "/viewResults.jsp");
+ prd.include(rReq, rRes);
+ }
+
+ }
+
+ public void processAction(ActionRequest aReq, ActionResponse aRes)
+ {
+ String search = (String) aReq.getParameter("search");
+
+ aRes.setRenderParameter("search", search);
+ aRes.setRenderParameter("op", SearchConstants.OP_VIEWSEARCHRESULTS);
+
+ }
+}
Added: trunk/portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml (rev 0)
+++ trunk/portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <mbean
+ code="org.jboss.portal.search.federation.impl.SearchFederationService"
+ name="portal:service=SearchFederationService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+</server>
Property changes on: trunk/portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <page>
+ <page-name>default</page-name>
+ <window>
+ <window-name>SearchPortletWindow</window-name>
+ <instance-ref>SearchPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </page>
+ </deployment>
+</deployments>
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,41 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <portlet>
+ <portlet-name>SearchPortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ </portlet>
+ <service>
+ <service-name>SearchService</service-name>
+ <service-class>org.jboss.portal.search.federation.SearchFederation</service-class>
+ <service-ref>:service=SearchFederationService</service-ref>
+ </service>
+
+</portlet-app>
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,19 @@
+<%@ page import="org.jboss.portal.search.SearchConstants" %>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+
+<form method="post" action="<portlet:actionURL>
+ <portlet:param name="op" value="<%= SearchConstants.OP_DOSEARCH %>"/>
+ </portlet:actionURL>">
+ <input type="text"
+ size="15"
+ maxlength="80"
+ name="search"
+ class="portlet-form-input-field"/>
+ <input type="submit" name="search" value="${n:i18n("SEARCH_SEARCH")}" class="portlet-form-button"/>
+</form>
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,50 @@
+<%@ page import="org.jboss.portal.search.SearchConstants" %>
+<%@ page import="org.jboss.portal.search.result.ResultSet" %>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<%@page import="java.util.Iterator"%>
+<%@page import="org.jboss.portal.search.result.Result"%>
+<%@page import="org.jboss.portal.search.result.impl.SimpleResult"%>
+<%@page import="org.jboss.portal.cms.model.File"%>
+<%@page import="org.jboss.portal.api.node.PortalNode"%>
+<%@page import="org.jboss.portal.api.node.PortalNodeURL"%>
+<%@page import="org.jboss.portlet.JBossRenderResponse"%>
+<%@page import="java.util.List"%>
+<portlet:defineObjects/>
+
+
+<%
+ List listResults = (List)request.getAttribute("results");
+ PortalNode rootNode = (PortalNode)request.getAttribute("rootNode");
+ JBossRenderResponse jbossResponse = (JBossRenderResponse)request.getAttribute("JBossRenderResponse");
+
+
+ Iterator listIt = listResults.iterator();
+ while (listIt.hasNext())
+ {
+ ResultSet results = (ResultSet)listIt.next();
+ Iterator it = results.iterator();
+
+ out.println("<h2>" + results.getSearchFederated().getName(renderRequest.getLocale()) + "</h2>");
+
+ out.println("<table>");
+ out.println("<tr><td>Name</td></tr>");
+
+ while (it.hasNext())
+ {
+ Result result = (Result)it.next();
+// PortalNode node = rootNode.resolve("default/default/CMSWindow");
+// PortalNode node = rootNode.resolve(result.getURL().getTargetWindow());
+// PortalNodeURL windowURL = jbossResponse.createRenderURL(node);
+// windowURL.setParameter("path", file.getBasePath());
+ out.println("<tr><td><a href=\"" + result.getURL().toString() +"\">" + result.getTitle() + "</a></td>");
+ out.println("</tr>");
+ }
+ out.println("</table>");
+ }
+
+%>
+
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,104 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+ version="2.0">
+ <tlib-version>1.1</tlib-version>
+ <short-name>JBoss-Portal-tags</short-name>
+
+ <tag>
+ <name>if</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>iterate</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>include</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>page</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>error</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>key</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>errors</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorsTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+
+ <tag>
+ <name>success</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.SuccessTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+ <function>
+ <name>i18n</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String getMessage(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>out</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String out(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>i18nout</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature>
+ </function>
+
+</taglib>
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>SearchPortletInstance</instance-id>
+ <portlet-ref>SearchPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Property changes on: trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml
===================================================================
--- trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml (rev 0)
+++ trunk/portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml 2007-02-08 19:27:00 UTC (rev 6191)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Search Portlet</description>
+ <portlet-name>SearchPortlet</portlet-name>
+ <display-name>Search Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.search.SearchPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Search Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
19 years, 2 months
JBoss Portal SVN: r6190 - trunk.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 14:25:55 -0500 (Thu, 08 Feb 2007)
New Revision: 6190
Added:
trunk/portal-search/
Log:
3rd try... let's put it at the correct place this time...
- Search Federation prototype JBPORTAL-1155
- CMS Search prototype
- Eclipse project files update
19 years, 2 months
JBoss Portal SVN: r6189 - in portal-search: src and 11 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 13:57:30 -0500 (Thu, 08 Feb 2007)
New Revision: 6189
Added:
portal-search/.classpath
portal-search/.project
portal-search/build.bat
portal-search/build.sh
portal-search/build.xml
portal-search/src/
portal-search/src/main/
portal-search/src/main/org/
portal-search/src/main/org/jboss/
portal-search/src/main/org/jboss/portal/
portal-search/src/main/org/jboss/portal/search/
portal-search/src/main/org/jboss/portal/search/SearchConstants.java
portal-search/src/main/org/jboss/portal/search/SearchPortlet.java
portal-search/src/resources/
portal-search/src/resources/portal-search-sar/
portal-search/src/resources/portal-search-sar/META-INF/
portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
portal-search/src/resources/portal-search-war/
portal-search/src/resources/portal-search-war/WEB-INF/
portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml
portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
portal-search/src/resources/portal-search-war/WEB-INF/jsp/
portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp
portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp
portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld
portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml
Log:
- Search Federation prototype JBPORTAL-1155
- CMS Search prototype
- Eclipse project files update
Added: portal-search/.classpath
===================================================================
--- portal-search/.classpath (rev 0)
+++ portal-search/.classpath 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/api"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/search"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/cms"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: portal-search/.project
===================================================================
--- portal-search/.project (rev 0)
+++ portal-search/.project 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>portal-search</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: portal-search/build.bat
===================================================================
--- portal-search/build.bat (rev 0)
+++ portal-search/build.bat 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,54 @@
+@echo off
+rem
+rem Invokes a script of the same name in the 'tools' module.
+rem
+rem The 'tools' module is expected to be a peer directory of the directory
+rem in which this script lives.
+rem
+rem @author Jason Dillon <jason(a)planet57.com>
+rem
+
+rem $Id: build.bat 1015 2005-11-04 20:15:13Z mholzner $
+
+setlocal
+
+set PROGNAME=%~nx0
+set DIRNAME=%~dp0
+
+rem Legacy shell support
+if x%PROGNAME%==x set PROGNAME=build.bat
+if x%DIRNAME%==x set DIRNAME=.\
+
+set MODULE_ROOT=%DIRNAME%
+if x%TOOLS_ROOT%==x set TOOLS_ROOT=%DIRNAME%..\tools
+set TARGET=%TOOLS_ROOT%\bin\build.bat
+set ARGS=%*
+
+rem Start'er up yo
+goto main
+
+:debug
+if not x%DEBUG%==x echo %PROGNAME%: %*
+goto :EOF
+
+:main
+call :debug PROGNAME=%PROGNAME%
+call :debug DIRNAME=%DIRNAME%
+call :debug TOOLS_ROOT=%TOOLS_ROOT%
+call :debug TARGET=%TARGET%
+
+if exist %TARGET% call :call-script & goto :EOF
+rem else fail, we can not go on
+
+echo %PROGNAME%: *ERROR* The target executable does not exist:
+echo %PROGNAME%:
+echo %PROGNAME%: %TARGET%
+echo %PROGNAME%:
+echo %PROGNAME%: Please make sure you have checked out the 'tools' module
+echo %PROGNAME%: and make sure it is up to date.
+goto :EOF
+
+:call-script
+call :debug Executing %TARGET% %ARGS%
+call %TARGET% %ARGS%
+goto :EOF
Property changes on: portal-search/build.bat
___________________________________________________________________
Name: svn:executable
+ *
Added: portal-search/build.sh
===================================================================
--- portal-search/build.sh (rev 0)
+++ portal-search/build.sh 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,49 @@
+#!/bin/sh
+##
+## Invokes a script of the same name in the 'tools' module.
+##
+## The 'tools' module is expected to be a peer directory of the directory
+## in which this script lives.
+##
+## @author Jason Dillon <jason(a)planet57.com>
+##
+
+# $Id: build.sh 1015 2005-11-04 20:15:13Z mholzner $
+
+PROGNAME=`basename $0`
+DIRNAME=`dirname $0`
+
+# Buss it yo
+main() {
+ if [ "x$TOOLS_ROOT" = "x" ]; then
+ TOOLS_ROOT=`cd $DIRNAME/../tools && pwd`
+ fi
+
+ MODULE_ROOT=`cd $DIRNAME; pwd`
+ export TOOLS_ROOT MODULE_ROOT DEBUG TRACE
+
+ # Where is the target script?
+ target="$TOOLS_ROOT/bin/$PROGNAME"
+ if [ ! -f "$target" ]; then
+ echo "${PROGNAME}: *ERROR* The target executable does not exist:"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: $target"
+ echo "${PROGNAME}:"
+ echo "${PROGNAME}: Please make sure you have checked out the 'tools' module"
+ echo "${PROGNAME}: and make sure it is up to date."
+ exit 2
+ fi
+
+ # Get busy yo!
+ if [ "x$DEBUG" != "x" ]; then
+ echo "${PROGNAME}: Executing: /bin/sh $target $@"
+ fi
+ if [ "x$TRACE" = "x" ]; then
+ exec /bin/sh $target "$@"
+ else
+ exec /bin/sh -x $target "$@"
+ fi
+}
+
+# Lets get ready to rumble!
+main "$@"
Property changes on: portal-search/build.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: portal-search/build.xml
===================================================================
--- portal-search/build.xml (rev 0)
+++ portal-search/build.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE project [
+ <!ENTITY libraries SYSTEM "../thirdparty/libraries.ent">
+ <!ENTITY buildmagic SYSTEM "../tools/etc/buildfragments/buildmagic.ent">
+ <!ENTITY tools SYSTEM "../tools/etc/buildfragments/tools.ent">
+ <!ENTITY modules SYSTEM "../tools/etc/buildfragments/modules.ent">
+ <!ENTITY defaults SYSTEM "../tools/etc/buildfragments/defaults.ent">
+ <!ENTITY targets SYSTEM "../tools/etc/buildfragments/targets.ent">
+ ]>
+
+<!--+======================================================================+-->
+<!--| JBoss Portal (The OpenSource Portal) Build File |-->
+<!--| |-->
+<!--| Distributable under LGPL license. |-->
+<!--| See terms of license at http://www.gnu.org. |-->
+<!--| |-->
+<!--| This file has been designed to work with the 'tools' module and |-->
+<!--| Buildmagic extentions. |-->
+<!--+======================================================================+-->
+
+<project default="main" name="JBoss Portal">
+
+ <!--+====================================================================+-->
+ <!--| Setup |-->
+ <!--| |-->
+ <!--| Include the common build elements. |-->
+ <!--| |-->
+ <!--| This defines several different targets, properties and paths. |-->
+ <!--| It also sets up the basic extention tasks amoung other things. |-->
+ <!--+====================================================================+-->
+
+ &buildmagic;
+ &modules;
+ &defaults;
+ &tools;
+ &targets;
+
+ <!-- ================================================================== -->
+ <!-- Initialization -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Initialize the build system. Must depend on '_buildmagic:init'.
+ | Other targets should depend on 'init' or things will mysteriously fail.
+ -->
+
+ <target name="init" unless="init.disable" depends="_buildmagic:init">
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Configuration |-->
+ <!--| |-->
+ <!--| This target is invoked by the Buildmagic initialization logic |-->
+ <!--| and should contain module specific configuration elements. |-->
+ <!--+====================================================================+-->
+
+ <target name="configure" unless="configure.disable">
+
+ <!-- Configure some properties -->
+ <property name="jboss-junit-configuration" value=""/>
+ <property name="junit.formatter.usefile" value="true"/>
+
+ <!-- Configure thirdparty libraries -->
+ &libraries;
+
+ <path id="library.classpath">
+ <path refid="jboss.jbossxb.classpath"/>
+ <path refid="jboss.cache.classpath"/>
+ <path refid="jbossas/core.libs.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ <path refid="apache.ant.classpath"/>
+ <path refid="apache.myfaces.classpath"/>
+ <path refid="apache.tomahawk.classpath"/>
+ <path refid="apache.log4j.classpath"/>
+ <path refid="junit.junit.classpath"/>
+ <path refid="sun.servlet.classpath"/>
+ <path refid="jakarta.cactus.classpath"/>
+ <path refid="apache.fileupload.classpath"/>
+ <path refid="jakarta.io.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="sun.javamail.classpath"/>
+ <path refid="jwebunit.jwebunit.classpath"/>
+ <path refid="dbunit.dbunit.classpath"/>
+ <path refid="sun.jaf.classpath"/>
+ <path refid="portals.bridges.classpath"/>
+ <path refid="beanshell.beanshell.classpath"/>
+ <path refid="facelets.facelets.classpath"/>
+ <path refid="dom4j.dom4j.classpath"/>
+ <path refid="jboss.aop.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ <pathelement location="${source.etc}/sun-jsf/jsf-example.jar"/>
+ <!-- jbpm integration -->
+ <path refid="jbpm.jbpm.classpath"/>
+ </path>
+
+ <!-- Configure modules -->
+ <call target="configure-modules"/>
+ <path id="dependentmodule.classpath">
+ <path refid="jboss.portal-common.classpath"/>
+ <path refid="jboss.portal-cms.classpath"/>
+ <path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-search.classpath"/>
+ <path refid="jboss.portal-portlet.classpath"/>
+ <path refid="jboss.portal-jems.classpath"/>
+ <path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portlet-api.classpath"/>
+ <path refid="jboss.portal-security.classpath"/>
+ <path refid="jboss.portal-theme.classpath"/>
+ <path refid="jboss.portal-test.classpath"/>
+ <path refid="jboss.portal-core.classpath"/>
+ <path refid="jboss.portal-workflow.classpath"/>
+ </path>
+
+ <!--+=======================================+-->
+ <!--| Override any default properties here. |-->
+ <!--+=======================================+-->
+
+ <!-- Configure defaults & build tools -->
+ <call target="configure-defaults"/>
+ <call target="configure-tools"/>
+
+ <!--+=======================================+-->
+ <!--| Define module specific elements here. |-->
+ <!--+=======================================+-->
+ <property name="javadoc.private" value="true"/>
+ <property name="javadoc.protected" value="false"/>
+
+ <path id="hibernate.classpath">
+ <path refid="apache.commons.classpath"/>
+ <path refid="asm.asm.classpath"/>
+ <path refid="cglib.cglib.classpath"/>
+ <path refid="antlr.antlr.classpath"/>
+ <path refid="odmg.odmg.classpath"/>
+ <path refid="ehcache.ehcache.classpath"/>
+ <path refid="hibernate.hibernate.classpath"/>
+ </path>
+
+ <path id="aop.classpath">
+ <pathelement path="${jbossas/core.libs.lib}/jboss-aspect-library.jar"/>
+ <pathelement path="${jboss.aop.lib}/jboss-aop.jar"/>
+ <path refid="javassist.javassist.classpath"/>
+ <path refid="oswego.concurrent.classpath"/>
+ <path refid="trove.trove.classpath"/>
+ <path refid="qdox.qdox.classpath"/>
+ </path>
+
+ <taskdef name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ <taskdef name="implode"
+ classname="org.jboss.portal.common.ant.Implode"
+ classpathref="explode.task.classpath"/>
+
+ </target>
+
+ <target name="configure-explode">
+ <path id="explode.task.classpath">
+ <pathelement location="${project.tools}/lib/explode.jar"/>
+ <path refid="apache.ant.classpath"/>
+ </path>
+ <taskdef
+ name="explode"
+ classname="org.jboss.portal.common.ant.Explode"
+ classpathref="explode.task.classpath"/>
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Compile |-->
+ <!--| |-->
+ <!--| This target should depend on other compile-* targets for each |-->
+ <!--| different type of compile that needs to be performed, short of |-->
+ <!--| documentation compiles. |-->
+ <!--+====================================================================+-->
+
+ <target name="compile"
+ description="Compile all source files."
+ depends="_default:compile-classes,
+ _default:compile-etc,
+ _default:compile-resources">
+ <!-- Add module specific elements here. -->
+
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Generate Output |-->
+ <!--| |-->
+ <!--| Generates the target output for this module. Target output is |-->
+ <!--| the output which is ment to be released or used by external |-->
+ <!--| modules. |-->
+ <!--+====================================================================+-->
+
+ <target name="artifacts"
+ description="Generate all target output."
+ depends="compile">
+
+ <mkdir dir="${build.lib}"/>
+
+ <!-- portal-jbp-search-lib.jar -->
+ <jar jarfile="${build.lib}/portal-jbp-search-lib.jar">
+ <fileset dir="${build.classes}">
+ </fileset>
+ </jar>
+
+ <!-- portal-search.sar -->
+ <copy todir="${build.resources}/portal-search">
+ <!--fileset dir="${source.bin}/portal-search-sar"/-->
+ <fileset dir="${build.resources}/portal-search-sar"/>
+ </copy>
+ <copy todir="${build.resources}/portal-search/lib">
+ <fileset dir="${build.lib}" includes="portal-jbp-search-lib.jar"/>
+ <fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
+ </copy>
+
+ <!-- portal-search.war -->
+ <copy todir="${build.resources}/portal-search/portal-search.war">
+ <!--fileset dir="${source.bin}/portal-search-war"/-->
+ <fileset dir="${build.resources}/portal-search-war"/>
+ </copy>
+
+ </target>
+
+
+
+ <!-- Build the portal-search.sar -->
+ <target name="output" depends="artifacts">
+
+ <!-- Build configurations -->
+ <copy todir="${build.resources}/portal-search.sar">
+ <fileset dir="${build.resources}/portal-search" excludes="**/*.xml"/>
+ </copy>
+
+ <copy todir="${build.resources}/portal-search.sar">
+ <filterset>
+ <filtersfile file="../build/etc/single.properties"/>
+ </filterset>
+ <fileset dir="${build.resources}/portal-search" includes="**/*.xml"/>
+ </copy>
+ <!-- Build archives -->
+ <implode
+ dir="${build.resources}/portal-search.sar"
+ tofile="${build.lib}/portal-search.sar"/>
+ </target>
+
+ <!-- create artifacts for running the portlet tests (except TCK) target output should have already been executed -->
+ <target name="package-tests" depends="init">
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Cleaning -->
+ <!-- ================================================================== -->
+
+ <!-- Clean up all build output -->
+ <target name="clean" depends="_default:clean">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!--+====================================================================+-->
+ <!--| Documents |-->
+ <!--| |-->
+ <!--| Generate all documentation for this module. |-->
+ <!--+====================================================================+-->
+
+ <target name="docs" depends="_default:docs">
+ <!-- Add module specific elements here. -->
+ </target>
+
+ <!-- ================================================================== -->
+ <!-- Misc. -->
+ <!-- ================================================================== -->
+
+ <target name="main" depends="most"/>
+ <target name="all" depends="_default:all"/>
+ <target name="most" depends="_default:most"/>
+ <target name="help" depends="_default:help"/>
+
+ <!-- ================================================================== -->
+ <!-- Deployment -->
+ <!-- ================================================================== -->
+
+ <!--
+ | Deploy the application
+ -->
+
+ <target name="deploy"
+ description="Deploy."
+ depends="output">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <copy file="${build.lib}/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
+ </target>
+
+ <!--
+ | Undeploy the application
+ -->
+ <target name="undeploy"
+ description="Undeploy."
+ depends="init">
+ <require file="${jboss.home}/server/${portal.deploy.dir}"/>
+ <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>
+ </target>
+
+ <target name="tests" depends="init, _buildmagic:configure:deployment">
+ </target>
+</project>
Added: portal-search/src/main/org/jboss/portal/search/SearchConstants.java
===================================================================
--- portal-search/src/main/org/jboss/portal/search/SearchConstants.java (rev 0)
+++ portal-search/src/main/org/jboss/portal/search/SearchConstants.java 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchConstants
+{
+ public static final String OP_DOSEARCH = "do_search";
+ public static final String OP_VIEWSEARCHRESULTS = "view_search_results";
+ public static String SEARCH_JSP_PATH = "/WEB-INF/jsp";
+
+}
Added: portal-search/src/main/org/jboss/portal/search/SearchPortlet.java
===================================================================
--- portal-search/src/main/org/jboss/portal/search/SearchPortlet.java (rev 0)
+++ portal-search/src/main/org/jboss/portal/search/SearchPortlet.java 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+
+import org.jboss.portal.api.node.PortalNode;
+import org.jboss.portal.search.federation.SearchFederation;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portlet.JBossPortlet;
+import org.jboss.portlet.JBossRenderRequest;
+import org.jboss.portlet.JBossRenderResponse;
+
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchPortlet extends JBossPortlet
+{
+
+ private SearchFederation searchService;
+
+ public void init()
+ {
+ searchService = (SearchFederation)getPortletContext().getAttribute("SearchService");
+ }
+
+
+ public void doView(JBossRenderRequest rReq, JBossRenderResponse rRes) throws PortletException, IOException
+ {
+ rRes.setContentType("text/html");
+ String op = rReq.getParameter("op");
+
+ if ((op == null) || ("".equals(op)))
+ {
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(SearchConstants.SEARCH_JSP_PATH + "/search.jsp");
+ try
+ {
+ prd.include(rReq, rRes);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ else if (op.equals(SearchConstants.OP_VIEWSEARCHRESULTS))
+ {
+ rRes.setContentType("text/html");
+
+ String textQuery = rReq.getParameter("search");
+
+ Query query = QueryConverter.convert(textQuery);
+
+ List results = searchService.search(query);
+
+ rReq.setAttribute("results", results);
+
+
+ PortalNode root = rReq.getPortalNode().getRoot();
+
+ rReq.setAttribute("rootNode", root);
+ rReq.setAttribute("JBossRenderResponse", rRes);
+
+
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(SearchConstants.SEARCH_JSP_PATH + "/viewResults.jsp");
+ prd.include(rReq, rRes);
+ }
+
+ }
+
+ public void processAction(ActionRequest aReq, ActionResponse aRes)
+ {
+ String search = (String) aReq.getParameter("search");
+
+ aRes.setRenderParameter("search", search);
+ aRes.setRenderParameter("op", SearchConstants.OP_VIEWSEARCHRESULTS);
+
+ }
+}
Added: portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
===================================================================
--- portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml (rev 0)
+++ portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <mbean
+ code="org.jboss.portal.search.federation.impl.SearchFederationService"
+ name="portal:service=SearchFederationService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+</server>
Property changes on: portal-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/default-object.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portal Object 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <parent-ref>default</parent-ref>
+ <page>
+ <page-name>default</page-name>
+ <window>
+ <window-name>SearchPortletWindow</window-name>
+ <instance-ref>SearchPortletInstance</instance-ref>
+ <region>center</region>
+ <height>1</height>
+ </window>
+ </page>
+ </deployment>
+</deployments>
Added: portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,41 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE portlet-app PUBLIC
+ "-//JBoss Portal//DTD JBoss Portlet 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-portlet_2_6.dtd">
+
+<portlet-app>
+ <portlet>
+ <portlet-name>SearchPortlet</portlet-name>
+ <transaction>
+ <trans-attribute>Required</trans-attribute>
+ </transaction>
+ </portlet>
+ <service>
+ <service-name>SearchService</service-name>
+ <service-class>org.jboss.portal.search.federation.SearchFederation</service-class>
+ <service-ref>:service=SearchFederationService</service-ref>
+ </service>
+
+</portlet-app>
Added: portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/jsp/search.jsp 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,19 @@
+<%@ page import="org.jboss.portal.search.SearchConstants" %>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+
+<form method="post" action="<portlet:actionURL>
+ <portlet:param name="op" value="<%= SearchConstants.OP_DOSEARCH %>"/>
+ </portlet:actionURL>">
+ <input type="text"
+ size="15"
+ maxlength="80"
+ name="search"
+ class="portlet-form-input-field"/>
+ <input type="submit" name="search" value="${n:i18n("SEARCH_SEARCH")}" class="portlet-form-button"/>
+</form>
Added: portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/jsp/viewResults.jsp 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,50 @@
+<%@ page import="org.jboss.portal.search.SearchConstants" %>
+<%@ page import="org.jboss.portal.search.result.ResultSet" %>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ page isELIgnored="false" %>
+
+<%@page import="java.util.Iterator"%>
+<%@page import="org.jboss.portal.search.result.Result"%>
+<%@page import="org.jboss.portal.search.result.impl.SimpleResult"%>
+<%@page import="org.jboss.portal.cms.model.File"%>
+<%@page import="org.jboss.portal.api.node.PortalNode"%>
+<%@page import="org.jboss.portal.api.node.PortalNodeURL"%>
+<%@page import="org.jboss.portlet.JBossRenderResponse"%>
+<%@page import="java.util.List"%>
+<portlet:defineObjects/>
+
+
+<%
+ List listResults = (List)request.getAttribute("results");
+ PortalNode rootNode = (PortalNode)request.getAttribute("rootNode");
+ JBossRenderResponse jbossResponse = (JBossRenderResponse)request.getAttribute("JBossRenderResponse");
+
+
+ Iterator listIt = listResults.iterator();
+ while (listIt.hasNext())
+ {
+ ResultSet results = (ResultSet)listIt.next();
+ Iterator it = results.iterator();
+
+ out.println("<h2>" + results.getSearchFederated().getName(renderRequest.getLocale()) + "</h2>");
+
+ out.println("<table>");
+ out.println("<tr><td>Name</td></tr>");
+
+ while (it.hasNext())
+ {
+ Result result = (Result)it.next();
+// PortalNode node = rootNode.resolve("default/default/CMSWindow");
+// PortalNode node = rootNode.resolve(result.getURL().getTargetWindow());
+// PortalNodeURL windowURL = jbossResponse.createRenderURL(node);
+// windowURL.setParameter("path", file.getBasePath());
+ out.println("<tr><td><a href=\"" + result.getURL().toString() +"\">" + result.getTitle() + "</a></td>");
+ out.println("</tr>");
+ }
+ out.println("</table>");
+ }
+
+%>
+
Added: portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/portal-lib.tld 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,104 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
+ version="2.0">
+ <tlib-version>1.1</tlib-version>
+ <short-name>JBoss-Portal-tags</short-name>
+
+ <tag>
+ <name>if</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IfTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>iterate</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IterateTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>ctx</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>include</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.IncludeTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>page</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>error</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorTag</tag-class>
+ <body-content>JSP</body-content>
+ <attribute>
+ <name>key</name>
+ <required>true</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+
+ <tag>
+ <name>errors</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.ErrorsTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+
+ <tag>
+ <name>success</name>
+ <tag-class>org.jboss.portal.core.servlet.jsp.taglib.SuccessTag</tag-class>
+ <body-content>JSP</body-content>
+ </tag>
+ <function>
+ <name>i18n</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String getMessage(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>out</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String out(java.lang.String)</function-signature>
+ </function>
+
+ <function>
+ <name>i18nout</name>
+ <function-class>org.jboss.portal.core.servlet.jsp.taglib.PortalLib</function-class>
+ <function-signature>java.lang.String i18nOut(java.lang.String)</function-signature>
+ </function>
+
+</taglib>
Added: portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,36 @@
+<?xml version="1.0" standalone="yes"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE deployments PUBLIC
+ "-//JBoss Portal//DTD Portlet Instances 2.6//EN"
+ "http://www.jboss.org/portal/dtd/portlet-instances_2_6.dtd">
+
+<deployments>
+ <deployment>
+ <instance>
+ <instance-id>SearchPortletInstance</instance-id>
+ <portlet-ref>SearchPortlet</portlet-ref>
+ </instance>
+ </deployment>
+</deployments>
\ No newline at end of file
Property changes on: portal-search/src/resources/portal-search-war/WEB-INF/portlet-instances.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml
===================================================================
--- portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml (rev 0)
+++ portal-search/src/resources/portal-search-war/WEB-INF/portlet.xml 2007-02-08 18:57:30 UTC (rev 6189)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<portlet-app
+ xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
+ version="1.0">
+ <portlet>
+ <description>Search Portlet</description>
+ <portlet-name>SearchPortlet</portlet-name>
+ <display-name>Search Portlet</display-name>
+
+ <portlet-class>org.jboss.portal.search.SearchPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Search Portlet</title>
+ </portlet-info>
+ </portlet>
+</portlet-app>
19 years, 2 months
JBoss Portal SVN: r6188 - /.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 13:34:08 -0500 (Thu, 08 Feb 2007)
New Revision: 6188
Added:
portal-search/
Log:
- Search Federation prototype JBPORTAL-1155
- CMS Search prototype
- Eclipse project files update
19 years, 2 months
JBoss Portal SVN: r6187 - in trunk: cms and 36 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-02-08 11:51:26 -0500 (Thu, 08 Feb 2007)
New Revision: 6187
Added:
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java
trunk/cms/src/main/org/jboss/portal/cms/search/
trunk/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java
trunk/cms/src/main/org/jboss/portal/cms/search/CMSResult.java
trunk/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
trunk/core-samples/.classpath
trunk/core-samples/.project
trunk/search/src/main/org/jboss/portal/search/QueryConverter.java
trunk/search/src/main/org/jboss/portal/search/SearchFederated.java
trunk/search/src/main/org/jboss/portal/search/federated/
trunk/search/src/main/org/jboss/portal/search/federated/jcr/
trunk/search/src/main/org/jboss/portal/search/federated/jcr/JCRQueryConverter.java
trunk/search/src/main/org/jboss/portal/search/federated/lucene/
trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java
trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java
trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java
trunk/search/src/main/org/jboss/portal/search/impl/
trunk/search/src/main/org/jboss/portal/search/impl/GenericSearchFederated.java
trunk/search/src/main/org/jboss/portal/search/result/ResultSet.java
trunk/search/src/resources/
trunk/search/src/resources/portal-search-sar/
trunk/search/src/resources/portal-search-sar/META-INF/
trunk/search/src/resources/portal-search-sar/META-INF/jboss-service.xml
Removed:
trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java
trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java
trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java
trunk/search/src/main/org/jboss/portal/search/federation/SearchFederated.java
trunk/search/src/main/org/jboss/portal/search/result/Results.java
Modified:
trunk/build/build.xml
trunk/cms/.classpath
trunk/cms/build.xml
trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java
trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
trunk/core-cms/.classpath
trunk/core-cms/build.xml
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSConstants.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_es.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
trunk/core-management/.classpath
trunk/core/.classpath
trunk/core/build.xml
trunk/registration/
trunk/search/
trunk/search/build.xml
trunk/search/src/main/org/jboss/portal/search/federation/SearchFederation.java
trunk/search/src/main/org/jboss/portal/search/federation/impl/SearchFederationService.java
trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java
trunk/search/src/main/org/jboss/portal/search/result/Result.java
trunk/search/src/main/org/jboss/portal/search/result/ResultURL.java
trunk/search/src/main/org/jboss/portal/search/result/impl/SimpleResult.java
trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java
trunk/search/src/main/org/jboss/portal/search/test/FederationTest.java
trunk/search/src/main/org/jboss/portal/search/test/LuceneQueryTest.java
trunk/search/src/main/org/jboss/portal/search/test/TestLuceneSearchFederated.java
trunk/tools/etc/buildfragments/modules.ent
trunk/workflow/
trunk/workflow/.classpath
trunk/wsrp/.classpath
Log:
- Search Federation prototype JBPORTAL-1155
- CMS Search prototype
- Eclipse project files update
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/build/build.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -129,6 +129,7 @@
<module name="core"/>
<module name="core-cms"/>
<module name="core-management"/>
+ <module name="search"/>
<module name="core-samples"/>
<module name="wsrp"/>
<module name="registration"/>
@@ -138,7 +139,7 @@
<group name="portal">
<include
- modules="common, test, api, faces, jems, server, security, identity, format, portlet, portlet-federation, theme, workflow, cms, bridge, samples, registration, wsrp, core, core-cms, core-management, core-samples"/>
+ modules="common, test, api, faces, jems, server, security, identity, search, format, portlet, portlet-federation, theme, workflow, cms, bridge, samples, registration, wsrp, core, core-cms, core-management, core-samples"/>
</group>
<group name="cms">
Modified: trunk/cms/.classpath
===================================================================
--- trunk/cms/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -41,6 +41,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/search"/>
<classpathentry combineaccessrules="false" kind="src" path="/workflow"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/lib/jbpm-3.1.2.jar"/>
- <classpathentry kind="lib" path="/thirdparty/jackrabbit/lib/jackrabbit-core-1.1.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jackrabbit/lib/jackrabbit-core.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/security"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/cms/build.xml
===================================================================
--- trunk/cms/build.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/build.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -129,7 +129,8 @@
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-test.classpath"/>
- <!-- fine grained security integration -->
+ <path refid="jboss.portal-search.classpath"/>
+ <!-- fine grained security integration -->
<path refid="jboss.portal-identity.classpath"/>
<path refid="jboss.portal-security.classpath"/>
<!-- clustered testcases related -->
@@ -198,11 +199,15 @@
<fileset dir="${apache.collections.root}/lib" includes="commons-collections.jar"/>
<fileset dir="${apache.lucene.root}/lib" includes="lucene.jar"/>
+ <!-- cms indexing integration -->
+ <fileset dir="${jackrabbit.jackrabbit.lib}" includes="jackrabbit-index-filters.jar"/>
+ <fileset dir="${nekohtml.nekohtml.lib}" includes="nekohtml.jar"/>
+
+
<!-- cms optimization integration -->
<fileset dir="${jackrabbit.jackrabbit.lib}" includes="jackrabbit-core.jar"/>
- <fileset dir="${jboss.cache.lib}" includes="jboss-cache.jar"/>
- <fileset dir="${jgroups.jgroups.lib}" includes="jgroups.jar"/>
-
+ <fileset dir="${jboss.cache.lib}" includes="jboss-cache.jar"/>
+ <fileset dir="${jgroups.jgroups.lib}" includes="jgroups.jar"/>
<fileset dir="${slf4j.slf4j.lib}" includes="slf4j-log4j12.jar"/>
</jar>
Modified: trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,14 +22,15 @@
******************************************************************************/
package org.jboss.portal.cms;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.search.query.Query;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Locale;
-
/**
* Factory to create commands for the cms service.
*
@@ -82,5 +83,7 @@
Command createFileGetListCommand(String sFilePath);
- Command createGetArchiveCommand(String sRootPath, String sLanguage);
+ Command createGetArchiveCommand(String sRootPath, String sLanguage);
+
+ Command createSearchCommand(Query query);
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/interceptors/ACLInterceptor.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -257,7 +257,24 @@
folder.setFolders(filteredFolders);
folder.setFiles(filteredFiles);
}
+ else if (filteredResponse instanceof List)
+ {
+ List list = (List)filteredResponse;
+ List filteredFiles = new ArrayList();
+ for(Iterator itr=list.iterator();itr.hasNext();)
+ {
+ File cour = (File)itr.next();
+ securityContext.setAttribute("path",cour.getBasePath());
+ PortalPermission cmsPermission = new CMSPermission(securityContext);
+ boolean allow = this.authorizationManager.checkPermission(cmsPermission);
+ if(allow)
+ {
+ filteredFiles.add(cour);
+ }
+ }
+ filteredResponse = filteredFiles;
}
+ }
catch(Exception e)
{
tx.rollback();
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,6 +22,10 @@
******************************************************************************/
package org.jboss.portal.cms.impl.jcr;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Locale;
+
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.CommandFactory;
import org.jboss.portal.cms.impl.jcr.command.ContentCreateCommand;
@@ -42,17 +46,15 @@
import org.jboss.portal.cms.impl.jcr.command.ItemExistsCommand;
import org.jboss.portal.cms.impl.jcr.command.MoveCommand;
import org.jboss.portal.cms.impl.jcr.command.RenameCommand;
+import org.jboss.portal.cms.impl.jcr.command.SearchCommand;
import org.jboss.portal.cms.impl.jcr.command.StoreArchiveCommand;
import org.jboss.portal.cms.impl.jcr.composite.NewFileCommand;
import org.jboss.portal.cms.impl.jcr.composite.UpdateFileCommand;
import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
+import org.jboss.portal.search.query.Query;
-import java.io.InputStream;
-import java.util.List;
-import java.util.Locale;
-
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -177,4 +179,9 @@
{
return new GetArchiveCommand(sRootPath, sLanguage);
}
+
+ public Command createSearchCommand(Query query)
+ {
+ return new SearchCommand(query);
+ }
}
Modified: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/ACLEnforcer.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -136,8 +136,13 @@
if(cmsSecurityContext.getAttribute("applyFilter")!=null)
{
String path = (String)cmsSecurityContext.getAttribute("applyFilter");
- hasAccess = this.computeToolAccess(loggedInUser,path);
+ hasAccess = this.computeToolAccess(loggedInUser, path);
}
+ else if(cmsSecurityContext.getAttribute("path")!=null)
+ {
+ String path = (String)cmsSecurityContext.getAttribute("applyFilter");
+ hasAccess = this.computeAccess(loggedInUser, path, "read");
+ }
//check if workflow management protection needs to be enforced
else if(cmsSecurityContext.getAttribute("manageWorkflow")!=null)
{
@@ -503,7 +508,7 @@
return toolAccess;
}
-
+
/**
*
* @param user
Added: trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.impl.jcr.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+import javax.jcr.query.QueryManager;
+import javax.jcr.query.QueryResult;
+
+import org.jboss.portal.cms.CMSException;
+import org.jboss.portal.cms.impl.FileImpl;
+import org.jboss.portal.cms.impl.jcr.JCRCommand;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.search.federated.jcr.JCRQueryConverter;
+import org.jboss.portal.search.query.Query;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchCommand extends JCRCommand
+{
+
+ private static final long serialVersionUID = 2614067614144410297L;
+
+ private Query query;
+
+ public SearchCommand(Query query)
+ {
+ this.query = query;
+ }
+
+
+ public Object execute() throws CMSException
+ {
+ Session session = context.getSession();
+ Workspace workspace = session.getWorkspace();
+ QueryManager queryManager;
+ List files = new ArrayList();
+ try
+ {
+ queryManager = workspace.getQueryManager();
+ javax.jcr.query.Query jcrQuery = queryManager.createQuery(JCRQueryConverter.convert(query), javax.jcr.query.Query.XPATH);
+ QueryResult queryResult=jcrQuery.execute();
+ NodeIterator nodeIterator = queryResult.getNodes();
+
+ while (nodeIterator.hasNext())
+ {
+ Node node;
+ node = nodeIterator.nextNode().getParent();
+ File file = new FileImpl();
+ file.setBasePath(node.getPath());
+ file.setCreationDate(node.getProperty("jcr:created").getDate().getTime());
+ file.setLastModified(node.getProperty("jcr:lastModified").getDate().getTime());
+ file.setName(node.getName());
+ files.add(file);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new CMSException("Cannot query the CMS", e);
+ }
+ return files;
+ }
+
+}
Added: trunk/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.search;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+
+import javax.portlet.Portlet;
+
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.federation.Info;
+import org.jboss.portal.search.impl.GenericSearchFederated;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.result.ResultSet;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CMSFederatedSearch extends GenericSearchFederated
+{
+ private CMS cms;
+ private Info info;
+ private String id;
+
+ public CMSFederatedSearch(Portlet portlet, String id)
+ {
+ this.id = id;
+ info = new Info();
+ info.setStatus(Info.Status.AVAILABLE);
+ }
+
+ public void setCMS(CMS cms)
+ {
+ this.cms = cms;
+ }
+
+ public void create() throws IndexingException
+ {
+ info.setStatus(Info.Status.AVAILABLE);
+ }
+
+ public void destroy() throws IndexingException
+ {
+ // Indexing should be managed by the JCR implementation
+
+ }
+
+ public Info getInfo()
+ {
+ return info;
+ }
+
+ public String getMarkup(ResultSet results, int markupLevel)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ResultSet search(Query query)
+ {
+ Command searchCommand = cms.getCommandFactory().createSearchCommand(query);
+ List files = (List)cms.execute(searchCommand);
+ ResultSet results = new ResultSet(this);
+
+ Iterator it = files.iterator();
+ while (it.hasNext())
+ {
+ File file = (File)it.next();
+ results.add(new CMSResult(file));
+ }
+ return results;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+}
Added: trunk/cms/src/main/org/jboss/portal/cms/search/CMSResult.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/search/CMSResult.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/search/CMSResult.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.search;
+
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.search.result.Result;
+import org.jboss.portal.search.result.ResultURL;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CMSResult implements Result
+{
+
+ private File file;
+ private ResultURL url;
+
+ public CMSResult(File file)
+ {
+ this.file = file;
+ this.url = new CMSResultURL("portal/content", file);
+ }
+
+ public float getScore()
+ {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ public ResultURL getURL()
+ {
+ return url;
+ }
+
+ public String getTitle()
+ {
+ if (file.getTitle() != null)
+ {
+ return file.getTitle();
+ }
+ else
+ {
+ return file.getName();
+ }
+ }
+
+}
Added: trunk/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java (rev 0)
+++ trunk/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.cms.search;
+
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.search.result.ResultURL;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class CMSResultURL implements ResultURL
+{
+ private File file;
+ private String prefix;
+
+ public CMSResultURL(String prefix, File file)
+ {
+ this.file = file;
+ this.prefix = prefix;
+ }
+
+ public String toString()
+ {
+ return "/" + prefix + file.getBasePath();
+ }
+}
Modified: trunk/core/.classpath
===================================================================
--- trunk/core/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -44,9 +44,9 @@
<classpathentry combineaccessrules="false" kind="src" path="/theme"/>
<classpathentry combineaccessrules="false" kind="src" path="/identity"/>
<classpathentry combineaccessrules="false" kind="src" path="/format"/>
- <classpathentry combineaccessrules="false" kind="src" path="/federation"/>
<classpathentry combineaccessrules="false" kind="src" path="/registration"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/lib/jbpm-3.1.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/workflow"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet-federation"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/core/build.xml
===================================================================
--- trunk/core/build.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core/build.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -328,6 +328,7 @@
<fileset dir="${jboss.portlet-api.root}/lib" includes="portal-api-lib.jar"/>
<fileset dir="${jboss.portal-theme.root}/lib" includes="portal-theme-lib.jar"/>
<fileset dir="${jboss.portal-security.root}/lib" includes="portal-security-lib.jar"/>
+ <fileset dir="${jboss.portal-search.root}/lib" includes="portal-search-lib.jar"/>
<fileset dir="${jboss.portal-identity.root}/lib" includes="portal-identity-lib.jar"/>
<fileset dir="${jboss.portal-registration.root}/lib" includes="portal-registration-lib.jar"/>
<fileset dir="${jboss.portal-samples.root}/lib" includes="portal-samples-lib.jar"/>
Modified: trunk/core-cms/.classpath
===================================================================
--- trunk/core-cms/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -19,5 +19,7 @@
<classpathentry combineaccessrules="false" kind="src" path="/workflow"/>
<classpathentry kind="lib" path="/thirdparty/apache-fileupload/lib/commons-fileupload.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbpm/lib/jbpm-3.1.2.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/search"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/security"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/core-cms/build.xml
===================================================================
--- trunk/core-cms/build.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/build.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -123,6 +123,7 @@
<path refid="jboss.portal-common.classpath"/>
<path refid="jboss.portal-cms.classpath"/>
<path refid="jboss.portal-server.classpath"/>
+ <path refid="jboss.portal-search.classpath"/>
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-identity.classpath"/>
@@ -243,6 +244,12 @@
<fileset dir="${jcr.jcr.lib}" includes="jcr-1.0.jar"/>
<fileset dir="${apache.collections.lib}" includes="commons-collections.jar"/>
<fileset dir="${apache.lucene.lib}" includes="lucene.jar"/>
+
+ <!-- cms indexing integration -->
+ <fileset dir="${jackrabbit.jackrabbit.lib}" includes="jackrabbit-index-filters.jar"/>
+ <fileset dir="${nekohtml.nekohtml.lib}" includes="nekohtml.jar"/>
+
+
<!-- cms optimization integration - this contains a clustered cache enabled version -->
<fileset dir="${jackrabbit.jackrabbit.lib}" includes="jackrabbit-core.jar"/>
<fileset dir="${jboss.cache.lib}" includes="jboss-cache.jar"/>
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSConstants.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSConstants.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSConstants.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -33,4 +33,6 @@
* CMS integration by the command mapper.
*/
public static final String DEFAULT_CMS_WINDOW_REF_CONFIG_PROPERTY_NAME = "cms.default_window_ref";
+
+ public static final String SEARCH_ID = "CMS";
}
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,32 +22,37 @@
******************************************************************************/
package org.jboss.portal.core.cms.ui;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Locale;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletException;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSecurityException;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
import org.apache.log4j.Logger;
import org.jboss.portal.cms.CMS;
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.File;
+import org.jboss.portal.cms.search.CMSFederatedSearch;
import org.jboss.portal.cms.util.FileUtil;
+import org.jboss.portal.core.cms.CMSConstants;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.search.federation.SearchFederation;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portlet.JBossRenderRequest;
-import javax.portlet.GenericPortlet;
-import javax.portlet.PortletException;
-import javax.portlet.PortletPreferences;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletSecurityException;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-import javax.portlet.PortletURL;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Locale;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* Displays content from the CMS.
*
@@ -125,17 +130,33 @@
/** . */
private CMS CMSService;
-
+
/** . */
private String indexpage;
public void init() throws PortletException
{
CMSService = (CMS)getPortletContext().getAttribute("CMS");
+
if (CMSService == null)
{
throw new PortletException("Cannot start CMS portlet due to service unavailability");
}
+
+ try
+ {
+ SearchFederation searchFederationService = (SearchFederation)getPortletContext().getAttribute("SearchFederationService");
+ if (searchFederationService.getSearchFederated(CMSConstants.SEARCH_ID) == null)
+ {
+ CMSFederatedSearch federatedSearch = new CMSFederatedSearch(this, CMSConstants.SEARCH_ID);
+ federatedSearch.setCMS(CMSService);
+ searchFederationService.register(federatedSearch);
+ }
+ }
+ catch (UndeclaredThrowableException e)
+ {
+ log.error("Cannot start CMS portlet search service due to service unavailability");
+ }
}
public void doView(RenderRequest req, RenderResponse resp) throws PortletException, PortletSecurityException, IOException
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminConstants.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -40,6 +40,8 @@
public static final String OP_LIST = "list";
+ public static final String OP_DOSEARCH = "dosearch";
+
public static final String OP_EDIT = "edit";
public static final String OP_EDIT_BINARY = "editbinary";
@@ -101,4 +103,6 @@
public static final String OP_DENY = "deny";
public static final String OP_VIEWPENDING = "view_pending_items";
+
+ public static final String OP_VIEWSEARCHRESULTS = "view_search_results";
}
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,6 +22,25 @@
******************************************************************************/
package org.jboss.portal.core.cms.ui.admin;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.Collection;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.naming.InitialContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.UnavailableException;
+
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.portlet.PortletFileUpload;
@@ -51,6 +70,8 @@
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.identity.User;
import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.search.QueryConverter;
+import org.jboss.portal.search.query.Query;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
@@ -62,24 +83,6 @@
import org.jboss.portlet.JBossRenderRequest;
import org.jboss.portlet.JBossRenderResponse;
-import javax.naming.InitialContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletSession;
-import javax.portlet.UnavailableException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintWriter;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Set;
-import java.util.Vector;
-
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -123,7 +126,7 @@
throw new PortletException("Authorization Service not found");
}
- this.initializeApprovePublishWorkflow();
+ this.initializeApprovePublishWorkflow();
}
protected void doView(final JBossRenderRequest rReq, final JBossRenderResponse rRes)
@@ -299,6 +302,21 @@
javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/viewfile.jsp");
prd.include(rReq, rRes);
}
+ else if (CMSAdminConstants.OP_VIEWSEARCHRESULTS.equals(op))
+ {
+ rRes.setContentType("text/html");
+
+ String textQuery = rReq.getParameter("search");
+
+ Query query = QueryConverter.convert(textQuery);
+ Command searchCommand = CMSService.getCommandFactory().createSearchCommand(query);
+
+ List files = (List)CMSService.execute(searchCommand);
+ rReq.setAttribute("files", files);
+
+ javax.portlet.PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher(CMSAdminConstants.CMS_JSP_PATH + "/searchResults.jsp");
+ prd.include(rReq, rRes);
+ }
else if (CMSAdminConstants.OP_UPLOADARCHIVECONFIRM.equals(op))
{
String sPath = rReq.getParameter("path");
@@ -733,6 +751,13 @@
}
aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWFILE);
}
+ else if (CMSAdminConstants.OP_DOSEARCH.equals(op))
+ {
+ String search = (String) aReq.getParameter("search");
+
+ aRes.setRenderParameter("search", search);
+ aRes.setRenderParameter("op", CMSAdminConstants.OP_VIEWSEARCHRESULTS);
+ }
else if (CMSAdminConstants.OP_UPLOADARCHIVE.equals(op))
{
try
Modified: trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-sar/META-INF/jboss-service.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -125,6 +125,15 @@
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="path" value="${wsp.home}/index"/>
+ <param name="textFilterClasses" value="
+ org.apache.jackrabbit.core.query.MsExcelTextFilter,
+ org.apache.jackrabbit.core.query.MsPowerPointTextFilter,
+ org.apache.jackrabbit.core.query.MsWordTextFilter,
+ org.apache.jackrabbit.core.query.PdfTextFilter,
+ org.apache.jackrabbit.core.query.HTMLTextFilter,
+ org.apache.jackrabbit.core.query.XMLTextFilter,
+ org.apache.jackrabbit.core.query.RTFTextFilter,
+ org.apache.jackrabbit.core.query.OpenOfficeTextFilter" />
<param name="useCompoundFile" value="true"/>
<param name="minMergeDocs" value="100"/>
<param name="volatileIdleTime" value="3"/>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-02-08 16:51:26 UTC (rev 6187)
@@ -35,6 +35,7 @@
TITLE_UPLOAD=Upload File
TITLE_SECURECONFIRM=Secure Node
+CMS_SEARCH=Search
CMS_MENU=Action Menu
CMS_ACTION=Action
CMS_NAME=Name
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_es.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_es.properties 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_es.properties 2007-02-08 16:51:26 UTC (rev 6187)
@@ -32,3 +32,5 @@
TITLE_EDIT=Editar fichero
TITLE_CREATE=Crear fichero
TITLE_UPLOAD=Subir fichero
+
+CMS_SEARCH=B�squeda
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_fr.properties 2007-02-08 16:51:26 UTC (rev 6187)
@@ -33,3 +33,4 @@
TITLE_CREATE=Creer le fichier
TITLE_UPLOAD=Charger le fichier
TITLE_SECURECONFIRM=S\u00E9curiser le noeud
+CMS_SEARCH=Chercher
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource_pt_BR.properties 2007-02-08 16:51:26 UTC (rev 6187)
@@ -34,6 +34,7 @@
TITLE_CREATE=Criar Arquivo
TITLE_UPLOAD=Enviar Arquivo
+CMS_SEARCH=Pesquisar
CMS_MENU=Menu de A��es
CMS_ACTION=A��o
CMS_NAME=Nome
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jboss-portlet.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -101,4 +101,9 @@
<service-class>org.jboss.portal.portlet.federation.FederatingPortletInvoker</service-class>
<service-ref>:service=PortletInvoker,type=Federating</service-ref>
</service>
+ <service>
+ <service-name>SearchFederationService</service-name>
+ <service-class>org.jboss.portal.search.federation.SearchFederation</service-class>
+ <service-ref>:service=SearchFederationService</service-ref>
+ </service>
</portlet-app>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/main.jsp 2007-02-08 16:51:26 UTC (rev 6187)
@@ -28,6 +28,20 @@
<hr/>
+<div align="right">
+
+<form method="post" action="<portlet:actionURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_DOSEARCH %>"/>
+ </portlet:actionURL>">
+ <input type="text"
+ size="15"
+ maxlength="80"
+ name="search"
+ class="portlet-form-input-field"/>
+ <input type="submit" name="search" value="${n:i18n("CMS_SEARCH")}" class="portlet-form-button"/>
+</form>
+</div>
+
<!-- Currently browsing -->
Browsing: <a href="<portlet:renderURL>
<portlet:param name="op" value="<%= CMSAdminConstants.OP_MAIN %>"/>
Added: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp (rev 0)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,80 @@
+<%@ page import="org.jboss.portal.core.cms.ui.admin.CMSAdminConstants" %>
+<%@ page import="java.util.Locale" %>
+<%@ page import="java.util.List" %>
+<%@ page import="java.text.Format" %>
+<%@ page import="java.text.SimpleDateFormat" %>
+<%@ page import="org.jboss.portal.cms.model.File" %>
+<%@ page language="java" extends="org.jboss.portal.core.servlet.jsp.PortalJsp" %>
+<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="/WEB-INF/portal-lib.tld" prefix="n" %>
+<%@ page isELIgnored="false" %>
+
+<portlet:defineObjects/>
+
+<table>
+<%
+ List files = (List)request.getAttribute("files");
+ String createDate = "";
+ String modifiedDate = "";
+
+ if (files.size() > 0)
+ {
+ for (int i = 0; i < files.size(); i++)
+ {
+ File file = (File)files.get(i);
+%>
+<tr onmouseover="this.className='portlet-section-alternate';" onmouseout="this.className='portlet-section-body';">
+ <td><img src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH%>/file.gif"
+ alt="${n:i18n("CMS_FILE")}"
+ border="0"> <a href="<portlet:renderURL>
+ <portlet:param name="op" value="<%= CMSAdminConstants.OP_VIEWFILE %>"/>
+ <portlet:param name="path"
+ value="<%= file.getBasePath() %>"/>
+ </portlet:renderURL>"><%=
+ file.getBasePath().substring(file.getBasePath().lastIndexOf("/") + 1, file.getBasePath().length()) %>
+ </a>
+ </td>
+ <td>
+ <form method="POST" style="padding:0;margin:0;" action="<portlet:actionURL>
+ <portlet:param name="path" value="<%= file.getBasePath() %>"/>
+ <portlet:param name="type" value="fi"/>
+ <portlet:param name="dispatch" value="1"/>
+ </portlet:actionURL>">
+ <select name="op">
+ <option value="<%= CMSAdminConstants.OP_VIEWFILE %>">${n:i18n("CMS_VIEW")}</option>
+ <option value="<%= CMSAdminConstants.OP_CONFIRMCOPY %>">${n:i18n("CMS_COPY")}</option>
+ <option value="<%= CMSAdminConstants.OP_CONFIRMMOVE %>">${n:i18n("CMS_MOVE")}</option>
+ <option value="<%= CMSAdminConstants.OP_CONFIRMDELETE %>">${n:i18n("CMS_DELETE")}</option>
+ </select>
+ <input type="submit" value="Go" name="Go" class="portlet-form-button"/>
+ </form>
+ </td>
+ <td>
+ <%
+ if (file.getCreationDate() != null)
+ {
+ Format formatter;
+ formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+ createDate = formatter.format(file.getCreationDate());
+ }
+ %>
+ <%= createDate %>
+ </td>
+ <td>
+ <%
+ if (file.getLastModified() != null)
+ {
+ Format formatter;
+ formatter = new SimpleDateFormat("MM/dd/yy HH:mm");
+ modifiedDate = formatter.format(file.getLastModified());
+ }
+ %>
+ <%= modifiedDate %>
+ </td>
+</tr>
+<%
+ }
+ }
+%>
+</table>
+</form>
Property changes on: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/searchResults.jsp
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/core-management/.classpath
===================================================================
--- trunk/core-management/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/core-management/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -6,8 +6,8 @@
<classpathentry combineaccessrules="false" kind="src" path="/jems"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/federation"/>
<classpathentry combineaccessrules="false" kind="src" path="/portlet"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet-federation"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: trunk/core-samples/.classpath
===================================================================
--- trunk/core-samples/.classpath (rev 0)
+++ trunk/core-samples/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path=""/>
+</classpath>
Added: trunk/core-samples/.project
===================================================================
--- trunk/core-samples/.project (rev 0)
+++ trunk/core-samples/.project 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>core-samples</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Property changes on: trunk/registration
___________________________________________________________________
Name: svn:ignore
- output
+ bin
output
Property changes on: trunk/search
___________________________________________________________________
Name: svn:ignore
- Test
output
test
+ Test
output
test
bin
Modified: trunk/search/build.xml
===================================================================
--- trunk/search/build.xml 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/build.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -68,6 +68,7 @@
<path refid="jbossas/core.libs.classpath"/>
<path refid="apache.lucene.classpath"/>
<path refid="junit.junit.classpath"/>
+ <path refid="jcr.jcr.classpath"/>
</path>
<!-- Configure modules -->
@@ -132,6 +133,13 @@
<exclude name="org/jboss/portal/search/test/**/*"/>
</fileset>
</jar>
+ <copy todir="${build.resources}/portal-search-sar">
+ <fileset dir="${build.lib}" includes="portal-search-lib.jar"/>
+ </copy>
+ <jar jarfile="${build.lib}/portal-search.sar">
+ <fileset dir="${build.resources}/portal-search-sar" includes="**/*"/>
+ </jar>
+
</target>
Added: trunk/search/src/main/org/jboss/portal/search/QueryConverter.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/QueryConverter.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/QueryConverter.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,43 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.query.impl.KeywordQueryTerm;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class QueryConverter
+{
+
+ // TODO: implemement this
+ public static Query convert(String textQuery)
+ {
+ Query query = new Query();
+ query.addOptionalTerm(new KeywordQueryTerm(textQuery));
+
+ return query;
+ }
+}
Copied: trunk/search/src/main/org/jboss/portal/search/SearchFederated.java (from rev 6150, trunk/search/src/main/org/jboss/portal/search/federation/SearchFederated.java)
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/SearchFederated.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/SearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,93 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search;
+
+import java.util.Locale;
+
+import org.jboss.portal.search.federation.Info;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.result.ResultSet;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public interface SearchFederated
+{
+
+ /**
+ * Get the ID for this federated search
+ * @return String representing this particular federated search
+ */
+ public String getId();
+
+ /**
+ * Get a localized name for this federated search
+ * @return String
+ */
+ public String getName(Locale locale);
+
+ /**
+ * Method called when this federated search is not used anymore.
+ * This could be the place to destry any index
+ * @throws IndexingException
+ */
+ public void destroy() throws IndexingException;
+
+ /**
+ * The create method should index the required components
+ * @throws IndexingException
+ */
+ public void create() throws IndexingException;
+
+ /**
+ * Info should return information on the current status
+ * if the federated search
+ * @return
+ */
+ public Info getInfo();
+
+ /**
+ * From the query object this method is responsible to return the
+ * results of the query
+ * @param query
+ * @return
+ */
+ public ResultSet search(Query query);
+
+ /**
+ * TODO: Subject to change...
+ * get the markup fragment for this federated search. A markup level is used
+ * to define different amount of information to provide.
+ * @param results
+ * @param markupLevel
+ * @return
+ */
+ public String getMarkup(ResultSet results, int markupLevel);
+
+ public interface MarkupLevel
+ {
+ public static final int FULL = 0;
+ public static final int REDUCED = 1;
+ }
+}
Added: trunk/search/src/main/org/jboss/portal/search/federated/jcr/JCRQueryConverter.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federated/jcr/JCRQueryConverter.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/federated/jcr/JCRQueryConverter.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.federated.jcr;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.query.impl.KeywordQueryTerm;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class JCRQueryConverter
+{
+
+ //TODO, just for testing, would only work with at least one KeywordQueryTerm and nothing else
+ public static String convert(Query query)
+ {
+ StringBuffer result = new StringBuffer();
+
+ List optional = query.getOptionalTerms();
+ Iterator it = optional.iterator();
+ result.append("//*[");
+
+ result.append("jcr:contains(., '" + ((KeywordQueryTerm)it.next()).getKeyWord() + "')");
+
+ while(it.hasNext())
+ {
+ result.append("or jcr:contains(., '" + ((KeywordQueryTerm)it.next()).getKeyWord() + "')");
+ }
+ result.append("]");
+ return result.toString();
+ }
+
+}
Copied: trunk/search/src/main/org/jboss/portal/search/federated/lucene (from rev 5960, trunk/search/src/main/org/jboss/portal/search/lucene)
Deleted: trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/lucene/GenericDocument.java 2007-01-08 10:34:19 UTC (rev 5960)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -1,73 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.lucene;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class GenericDocument
-{
- private String title;
-
- private long date;
-
- private Map fields;
-
- public Map getFields()
- {
- return fields;
- }
-
- public long getDate()
- {
- return date;
- }
-
- public void setDate(long date)
- {
- this.date = date;
- }
-
- public String getTitle()
- {
- return title;
- }
-
- public void setTitle(String title)
- {
- this.title = title;
- }
-
- public void addField(String name, String value)
- {
- if (fields == null)
- {
- fields = new HashMap();
- }
- fields.put(name, value);
- }
-}
Copied: trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java (from rev 6186, trunk/search/src/main/org/jboss/portal/search/lucene/GenericDocument.java)
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/GenericDocument.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.federated.lucene;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class GenericDocument
+{
+ private String title;
+
+ private long date;
+
+ private Map fields;
+
+ public Map getFields()
+ {
+ return fields;
+ }
+
+ public long getDate()
+ {
+ return date;
+ }
+
+ public void setDate(long date)
+ {
+ this.date = date;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public void addField(String name, String value)
+ {
+ if (fields == null)
+ {
+ fields = new HashMap();
+ }
+ fields.put(name, value);
+ }
+}
Deleted: trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/lucene/LuceneQueryConverter.java 2007-01-08 10:34:19 UTC (rev 5960)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -1,106 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.lucene;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.query.QueryTerm;
-import org.jboss.portal.search.query.impl.BetweenDatesTerm;
-import org.jboss.portal.search.query.impl.DateTerm;
-import org.jboss.portal.search.query.impl.FieldQueryTerm;
-import org.jboss.portal.search.query.impl.KeywordQueryTerm;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class LuceneQueryConverter
-{
-
- public static String convert(Query query)
- {
- StringBuffer result = new StringBuffer();
- Iterator it;
-
- List terms = query.getMandatoryTerms();
- if (terms != null)
- {
- it = terms.iterator();
- while (it.hasNext())
- {
- QueryTerm term = (QueryTerm) it.next();
- convert(result, term, "+");
- }
- }
-
- terms = query.getNotTerms();
- if (terms != null)
- {
- it = terms.iterator();
- while (it.hasNext())
- {
- QueryTerm term = (QueryTerm) it.next();
- convert(result, term, "-");
- }
- }
-
- terms = query.getOptionalTerms();
- if (terms != null)
- {
- it = terms.iterator();
- while (it.hasNext())
- {
- QueryTerm term = (QueryTerm) it.next();
- convert(result, term, "");
- }
- }
- return result.toString();
- }
-
- private static void convert(StringBuffer result, QueryTerm term, String prefix)
- {
- if (term instanceof FieldQueryTerm)
- {
- FieldQueryTerm convertedTerm = (FieldQueryTerm) term;
- result.append(" " + prefix + convertedTerm.getName() + ":\"" + convertedTerm.getValue()+"\"");
- }
- else if (term instanceof KeywordQueryTerm)
- {
- KeywordQueryTerm convertedTerm = (KeywordQueryTerm) term;
- result.append(" " + prefix + convertedTerm.getKeyWord());
- }
- else if (term instanceof BetweenDatesTerm)
- {
- BetweenDatesTerm convertedTerm = (BetweenDatesTerm) term;
- result.append(" " + prefix + convertedTerm.getField() + ":[" + convertedTerm.getFromTime() + "," + convertedTerm.getToTime() + "]");
- }
- else if (term instanceof DateTerm)
- {
- DateTerm convertedTerm = (DateTerm) term;
- result.append(" " + prefix + convertedTerm.getField() + ":[" + convertedTerm.getTime() + "," + (convertedTerm.getTime() + 24*60*60*1000) + "}");
- }
- }
-
-}
Copied: trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java (from rev 6186, trunk/search/src/main/org/jboss/portal/search/lucene/LuceneQueryConverter.java)
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneQueryConverter.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,106 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.federated.lucene;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.query.QueryTerm;
+import org.jboss.portal.search.query.impl.BetweenDatesTerm;
+import org.jboss.portal.search.query.impl.DateTerm;
+import org.jboss.portal.search.query.impl.FieldQueryTerm;
+import org.jboss.portal.search.query.impl.KeywordQueryTerm;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class LuceneQueryConverter
+{
+
+ public static String convert(Query query)
+ {
+ StringBuffer result = new StringBuffer();
+ Iterator it;
+
+ List terms = query.getMandatoryTerms();
+ if (terms != null)
+ {
+ it = terms.iterator();
+ while (it.hasNext())
+ {
+ QueryTerm term = (QueryTerm) it.next();
+ convert(result, term, "+");
+ }
+ }
+
+ terms = query.getNotTerms();
+ if (terms != null)
+ {
+ it = terms.iterator();
+ while (it.hasNext())
+ {
+ QueryTerm term = (QueryTerm) it.next();
+ convert(result, term, "-");
+ }
+ }
+
+ terms = query.getOptionalTerms();
+ if (terms != null)
+ {
+ it = terms.iterator();
+ while (it.hasNext())
+ {
+ QueryTerm term = (QueryTerm) it.next();
+ convert(result, term, "");
+ }
+ }
+ return result.toString();
+ }
+
+ private static void convert(StringBuffer result, QueryTerm term, String prefix)
+ {
+ if (term instanceof FieldQueryTerm)
+ {
+ FieldQueryTerm convertedTerm = (FieldQueryTerm) term;
+ result.append(" " + prefix + convertedTerm.getName() + ":\"" + convertedTerm.getValue()+"\"");
+ }
+ else if (term instanceof KeywordQueryTerm)
+ {
+ KeywordQueryTerm convertedTerm = (KeywordQueryTerm) term;
+ result.append(" " + prefix + convertedTerm.getKeyWord());
+ }
+ else if (term instanceof BetweenDatesTerm)
+ {
+ BetweenDatesTerm convertedTerm = (BetweenDatesTerm) term;
+ result.append(" " + prefix + convertedTerm.getField() + ":[" + convertedTerm.getFromTime() + "," + convertedTerm.getToTime() + "]");
+ }
+ else if (term instanceof DateTerm)
+ {
+ DateTerm convertedTerm = (DateTerm) term;
+ result.append(" " + prefix + convertedTerm.getField() + ":[" + convertedTerm.getTime() + "," + (convertedTerm.getTime() + 24*60*60*1000) + "}");
+ }
+ }
+
+}
Deleted: trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java 2007-01-08 10:34:19 UTC (rev 5960)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -1,183 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.lucene;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.lucene.analysis.standard.StandardAnalyzer;
-import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
-import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.queryParser.QueryParser;
-import org.apache.lucene.search.Hits;
-import org.apache.lucene.search.IndexSearcher;
-import org.apache.lucene.search.Searcher;
-import org.jboss.portal.search.IndexingException;
-import org.jboss.portal.search.federation.Info;
-import org.jboss.portal.search.federation.SearchFederated;
-import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
-import org.jboss.portal.search.result.impl.AbstractResult;
-import org.jboss.portal.search.result.impl.SimpleResult;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public abstract class LuceneSearchFederated implements SearchFederated
-{
-
- private IndexWriter index;
-
- private String id;
-
- private Info info;
-
- private String indexPath;
-
- private String defaultField;
-
- public LuceneSearchFederated(String id, String indexPath, String defaultField)
- {
- this.id = id;
- this.indexPath = indexPath;
- this.defaultField = defaultField;
- info = new Info();
- }
-
- public void create() throws IndexingException
- {
-
- try
- {
- index = new IndexWriter(indexPath, new StandardAnalyzer(), true);
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- info.setStatus(Info.Status.INDEXING);
- try
- {
- List documents = getLuceneDocuments();
- Iterator it = documents.iterator();
- while (it.hasNext())
- {
- Document document = (Document)it.next();
- index.addDocument(document);
- }
- index.optimize();
- index.close();
- }
- catch (IOException e)
- {
- throw new IndexingException("Cannot index document", e);
- }
- info.setStatus(Info.Status.STARTED);
- }
-
- public List getLuceneDocuments()
- {
- List documents = getDocuments();
- Iterator it = documents.iterator();
- while (it.hasNext())
- {
- GenericDocument genericDoc = (GenericDocument) it.next();
- Document doc = new Document();
- if (genericDoc.getTitle() != null)
- doc.add(Field.Text("title", genericDoc.getTitle()));
- if (genericDoc.getDate() != 0)
- doc.add(Field.Text("date", genericDoc.getDate()+""));
- if (genericDoc.getFields() != null)
- {
- Map map = genericDoc.getFields();
- Iterator itKeys = map.keySet().iterator();
- while (itKeys.hasNext())
- {
- String key = (String)itKeys.next();
- doc.add(Field.Text(key, (String)map.get(key)));
- }
- }
- documents.add(doc);
- }
- return documents;
- }
-
- public abstract List getDocuments();
-
- public void destroy()
- {
- info.setStatus(Info.Status.STOPPED);
- }
-
- public String getId()
- {
- return id;
- }
-
- public Info getInfo()
- {
- return info;
- }
-
- public Results search(Query query)
- {
- Results result = new Results();
- String luceneQueryString = LuceneQueryConverter.convert(query);
- QueryParser parser = new QueryParser(defaultField, new StandardAnalyzer());
- try
- {
- org.apache.lucene.search.Query luceneQuery = parser.parse(luceneQueryString);
- Searcher searcher = new IndexSearcher(indexPath);
- Hits hits = searcher.search(luceneQuery);
- for (int i=0; i<hits.length(); i++)
- {
- result.add(new SimpleResult(id, hits.doc(i)));
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- return result;
- }
-
- public String getMarkup(Results results, int markupLevel)
- {
- StringBuffer buffer = new StringBuffer();
- Iterator it = results.iterator();
- while (it.hasNext())
- {
- AbstractResult result = (AbstractResult) it.next();
- Document document = (Document)((SimpleResult)result).getValue();
- buffer.append("Id:" + document.getField("id").stringValue());
- buffer.append(" ");
- }
- return buffer.toString();
- }
-
-}
Copied: trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java (from rev 6186, trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java)
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/federated/lucene/LuceneSearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,187 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.federated.lucene;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.lucene.analysis.standard.StandardAnalyzer;
+import org.apache.lucene.document.Document;
+import org.apache.lucene.document.Field;
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.queryParser.QueryParser;
+import org.apache.lucene.search.Hits;
+import org.apache.lucene.search.IndexSearcher;
+import org.apache.lucene.search.Searcher;
+import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.SearchFederated;
+import org.jboss.portal.search.federation.Info;
+import org.jboss.portal.search.query.Query;
+import org.jboss.portal.search.result.ResultSet;
+import org.jboss.portal.search.result.impl.AbstractResult;
+import org.jboss.portal.search.result.impl.SimpleResult;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public abstract class LuceneSearchFederated implements SearchFederated
+{
+
+ private IndexWriter index;
+
+ private String id;
+
+ private Info info;
+
+ private String indexPath;
+
+ private String defaultField;
+
+ public LuceneSearchFederated(String id, String indexPath, String defaultField)
+ {
+ this.id = id;
+ this.indexPath = indexPath;
+ this.defaultField = defaultField;
+ info = new Info();
+ }
+
+ public void create() throws IndexingException
+ {
+
+ try
+ {
+ index = new IndexWriter(indexPath, new StandardAnalyzer(), true);
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ info.setStatus(Info.Status.INDEXING);
+ try
+ {
+ List documents = getLuceneDocuments();
+ Iterator it = documents.iterator();
+ while (it.hasNext())
+ {
+ Document document = (Document)it.next();
+ index.addDocument(document);
+ }
+ index.optimize();
+ index.close();
+ }
+ catch (IOException e)
+ {
+ throw new IndexingException("Cannot index document", e);
+ }
+ info.setStatus(Info.Status.STARTED);
+ }
+
+ public List getLuceneDocuments()
+ {
+ List documents = getDocuments();
+ Iterator it = documents.iterator();
+ while (it.hasNext())
+ {
+ GenericDocument genericDoc = (GenericDocument) it.next();
+ Document doc = new Document();
+ if (genericDoc.getTitle() != null)
+ doc.add(Field.Text("title", genericDoc.getTitle()));
+ if (genericDoc.getDate() != 0)
+ doc.add(Field.Text("date", genericDoc.getDate()+""));
+ if (genericDoc.getFields() != null)
+ {
+ Map map = genericDoc.getFields();
+ Iterator itKeys = map.keySet().iterator();
+ while (itKeys.hasNext())
+ {
+ String key = (String)itKeys.next();
+ doc.add(Field.Text(key, (String)map.get(key)));
+ }
+ }
+ documents.add(doc);
+ }
+ return documents;
+ }
+
+ /**
+ * List of GenericDocument
+ * @return
+ */
+ public abstract List getDocuments();
+
+ public void destroy()
+ {
+ info.setStatus(Info.Status.STOPPED);
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public Info getInfo()
+ {
+ return info;
+ }
+
+ public ResultSet search(Query query)
+ {
+ ResultSet result = new ResultSet(this);
+ String luceneQueryString = LuceneQueryConverter.convert(query);
+ QueryParser parser = new QueryParser(defaultField, new StandardAnalyzer());
+ try
+ {
+ org.apache.lucene.search.Query luceneQuery = parser.parse(luceneQueryString);
+ Searcher searcher = new IndexSearcher(indexPath);
+ Hits hits = searcher.search(luceneQuery);
+ for (int i=0; i<hits.length(); i++)
+ {
+ result.add(new SimpleResult(id, hits.doc(i)));
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ public String getMarkup(ResultSet results, int markupLevel)
+ {
+ StringBuffer buffer = new StringBuffer();
+ Iterator it = results.iterator();
+ while (it.hasNext())
+ {
+ AbstractResult result = (AbstractResult) it.next();
+ Document document = (Document)((SimpleResult)result).getValue();
+ buffer.append("Id:" + document.getField("id").stringValue());
+ buffer.append(" ");
+ }
+ return buffer.toString();
+ }
+
+}
Deleted: trunk/search/src/main/org/jboss/portal/search/federation/SearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federation/SearchFederated.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/federation/SearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -1,77 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.federation;
-
-import org.jboss.portal.search.IndexingException;
-import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public interface SearchFederated
-{
-
- /**
- * Get the ID for this federated search
- * @return String representing this particular federated search
- */
- public String getId();
-
- /**
- * Method called when this federated search is not used anymore.
- * This could be the place to destry any index
- * @throws IndexingException
- */
- public void destroy() throws IndexingException;
-
- /**
- * The create method should index the required components
- * @throws IndexingException
- */
- public void create() throws IndexingException;
-
- /**
- * Info should return information on the current status
- * if the federated search
- * @return
- */
- public Info getInfo();
-
- /**
- * From the query object this method is responsible to return the
- * results of the query
- * @param query
- * @return
- */
- public Results search(Query query);
-
- public String getMarkup(Results results, int markupLevel);
-
- public interface MarkupLevel
- {
- public static final int FULL = 0;
- public static final int REDUCED = 1;
- }
-}
Modified: trunk/search/src/main/org/jboss/portal/search/federation/SearchFederation.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federation/SearchFederation.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/federation/SearchFederation.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -24,8 +24,8 @@
import java.util.List;
+import org.jboss.portal.search.SearchFederated;
import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -43,6 +43,6 @@
public SearchFederated getSearchFederated(String id);
- public Results search(Query query);
+ public List search(Query query);
}
Modified: trunk/search/src/main/org/jboss/portal/search/federation/impl/SearchFederationService.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/federation/impl/SearchFederationService.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/federation/impl/SearchFederationService.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -31,11 +31,11 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.SearchFederated;
import org.jboss.portal.search.federation.Info;
-import org.jboss.portal.search.federation.SearchFederated;
import org.jboss.portal.search.federation.SearchFederation;
import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.ResultSet;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -136,16 +136,16 @@
return (SearchFederated)registry.get(id);
}
- public Results search(Query query)
+ public List search(Query query)
{
- Results results = new Results();
+ List results = new ArrayList();
Iterator it = registry.values().iterator();
while (it.hasNext())
{
SearchFederated federated = (SearchFederated)it.next();
if (federated.getInfo().getStatus() == Info.Status.AVAILABLE)
{
- results.addAll(federated.search(query));
+ results.add(federated.search(query));
}
}
return results;
Added: trunk/search/src/main/org/jboss/portal/search/impl/GenericSearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/impl/GenericSearchFederated.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/impl/GenericSearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.impl;
+
+import java.util.Locale;
+
+import org.jboss.portal.search.SearchFederated;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public abstract class GenericSearchFederated implements SearchFederated
+{
+ public String getName(Locale locale)
+ {
+ return getId();
+ }
+}
Modified: trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/lucene/LuceneSearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -36,10 +36,10 @@
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Searcher;
import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.SearchFederated;
import org.jboss.portal.search.federation.Info;
-import org.jboss.portal.search.federation.SearchFederated;
import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.ResultSet;
import org.jboss.portal.search.result.impl.AbstractResult;
import org.jboss.portal.search.result.impl.SimpleResult;
@@ -143,9 +143,9 @@
return info;
}
- public Results search(Query query)
+ public ResultSet search(Query query)
{
- Results result = new Results();
+ ResultSet result = new ResultSet(this);
String luceneQueryString = LuceneQueryConverter.convert(query);
QueryParser parser = new QueryParser(defaultField, new StandardAnalyzer());
try
@@ -166,7 +166,7 @@
return result;
}
- public String getMarkup(Results results, int markupLevel)
+ public String getMarkup(ResultSet results, int markupLevel)
{
StringBuffer buffer = new StringBuffer();
Iterator it = results.iterator();
Modified: trunk/search/src/main/org/jboss/portal/search/result/Result.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/result/Result.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/result/Result.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -30,7 +30,7 @@
{
public float getScore();
- public String getFederatedId();
-
public ResultURL getURL();
+
+ public String getTitle();
}
Copied: trunk/search/src/main/org/jboss/portal/search/result/ResultSet.java (from rev 6150, trunk/search/src/main/org/jboss/portal/search/result/Results.java)
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/result/ResultSet.java (rev 0)
+++ trunk/search/src/main/org/jboss/portal/search/result/ResultSet.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.search.result;
+
+import java.util.ArrayList;
+
+import org.jboss.portal.search.SearchFederated;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class ResultSet extends ArrayList
+{
+ private static final long serialVersionUID = -334471675564695554L;
+
+ private SearchFederated searchFederated;
+
+ public ResultSet(SearchFederated searchFederated)
+ {
+ this.searchFederated = searchFederated;
+ }
+
+ public SearchFederated getSearchFederated()
+ {
+ return searchFederated;
+ }
+
+ public Result getResult(int i)
+ {
+ return (Result)get(i);
+ }
+
+
+ public void add(Result result)
+ {
+ super.add(result);
+ }
+
+}
Modified: trunk/search/src/main/org/jboss/portal/search/result/ResultURL.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/result/ResultURL.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/result/ResultURL.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -28,5 +28,5 @@
*/
public interface ResultURL
{
-
+
}
Deleted: trunk/search/src/main/org/jboss/portal/search/result/Results.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/result/Results.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/result/Results.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -1,41 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.search.result;
-
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class Results extends ArrayList
-{
-
- private static final long serialVersionUID = -334471675564695554L;
-
- public Result getResult(int i)
- {
- return (Result)get(i);
- }
-
-}
Modified: trunk/search/src/main/org/jboss/portal/search/result/impl/SimpleResult.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/result/impl/SimpleResult.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/result/impl/SimpleResult.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -46,5 +46,5 @@
{
this.value = value;
}
-
+
}
Modified: trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/test/DummySearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,11 +22,13 @@
******************************************************************************/
package org.jboss.portal.search.test;
+import java.util.Locale;
+
import org.jboss.portal.search.IndexingException;
+import org.jboss.portal.search.SearchFederated;
import org.jboss.portal.search.federation.Info;
-import org.jboss.portal.search.federation.SearchFederated;
import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.ResultSet;
import org.jboss.portal.search.result.impl.SimpleResult;
/**
@@ -64,18 +66,24 @@
return info;
}
- public String getMarkup(Results results, int markupLevel)
+ public String getMarkup(ResultSet results, int markupLevel)
{
return null;
}
- public Results search(Query query)
+ public ResultSet search(Query query)
{
- Results results = new Results();
+ ResultSet results = new ResultSet(this);
results.add(new SimpleResult(getId(), "Result 1"));
results.add(new SimpleResult(getId(), "Result 2"));
results.add(new SimpleResult(getId(), "Result 3"));
return results;
}
+
+ public String getName(Locale locale)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/search/src/main/org/jboss/portal/search/test/FederationTest.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/test/FederationTest.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/test/FederationTest.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -22,11 +22,13 @@
******************************************************************************/
package org.jboss.portal.search.test;
+import java.util.List;
+
import org.jboss.portal.search.federation.SearchFederation;
import org.jboss.portal.search.federation.impl.SearchFederationService;
import org.jboss.portal.search.query.Query;
import org.jboss.portal.search.query.impl.FieldQueryTerm;
-import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.ResultSet;
import org.jboss.portal.search.result.impl.SimpleResult;
import junit.framework.TestCase;
@@ -47,8 +49,8 @@
Query query = new Query();
query.addMandatoryTerm(new FieldQueryTerm("id", "1"));
- Results results = federation.search(query);
-
+ List list = federation.search(query);
+ ResultSet results = (ResultSet)list.get(0);
assertEquals("Result 1", (((SimpleResult)results.getResult(0)).getValue()));
assertEquals("Result 2", (((SimpleResult)results.getResult(1)).getValue()));
assertEquals("Result 3", (((SimpleResult)results.getResult(2)).getValue()));
Modified: trunk/search/src/main/org/jboss/portal/search/test/LuceneQueryTest.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/test/LuceneQueryTest.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/test/LuceneQueryTest.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -23,12 +23,12 @@
package org.jboss.portal.search.test;
import org.jboss.portal.search.IndexingException;
-import org.jboss.portal.search.lucene.LuceneQueryConverter;
-import org.jboss.portal.search.lucene.LuceneSearchFederated;
+import org.jboss.portal.search.federated.lucene.LuceneQueryConverter;
+import org.jboss.portal.search.federated.lucene.LuceneSearchFederated;
import org.jboss.portal.search.query.Query;
import org.jboss.portal.search.query.impl.BetweenDatesTerm;
import org.jboss.portal.search.query.impl.FieldQueryTerm;
-import org.jboss.portal.search.result.Results;
+import org.jboss.portal.search.result.ResultSet;
import junit.framework.TestCase;
@@ -63,7 +63,7 @@
Query query = new Query();
query.addMandatoryTerm(new FieldQueryTerm("id", "1"));
- Results results = fed.search(query);
+ ResultSet results = fed.search(query);
System.out.println(fed.getMarkup(results, 0));
assertEquals("Id:1 Id:1 cat ", fed.getMarkup(results, 0));
}
Modified: trunk/search/src/main/org/jboss/portal/search/test/TestLuceneSearchFederated.java
===================================================================
--- trunk/search/src/main/org/jboss/portal/search/test/TestLuceneSearchFederated.java 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/search/src/main/org/jboss/portal/search/test/TestLuceneSearchFederated.java 2007-02-08 16:51:26 UTC (rev 6187)
@@ -24,10 +24,11 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Locale;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
-import org.jboss.portal.search.lucene.LuceneSearchFederated;
+import org.jboss.portal.search.federated.lucene.LuceneSearchFederated;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -61,4 +62,10 @@
return null;
}
+ public String getName(Locale locale)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
Added: trunk/search/src/resources/portal-search-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/search/src/resources/portal-search-sar/META-INF/jboss-service.xml (rev 0)
+++ trunk/search/src/resources/portal-search-sar/META-INF/jboss-service.xml 2007-02-08 16:51:26 UTC (rev 6187)
@@ -0,0 +1,36 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+
+ <!-- Management MBean -->
+ <mbean
+ code="org.jboss.portal.search.federation.impl.SearchFederationService"
+ name="portal:service=SearchFederationService"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+
+
+</server>
Property changes on: trunk/search/src/resources/portal-search-sar/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: trunk/tools/etc/buildfragments/modules.ent
===================================================================
--- trunk/tools/etc/buildfragments/modules.ent 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/tools/etc/buildfragments/modules.ent 2007-02-08 16:51:26 UTC (rev 6187)
@@ -24,6 +24,13 @@
<pathelement path="${jboss.portal-cms.lib}/portal-cms-lib.jar"/>
</path>
+ <!-- search -->
+ <property name="jboss.portal-search.root" value="${project.root}/search/output"/>
+ <property name="jboss.portal-search.lib" value="${jboss.portal-search.root}/lib"/>
+ <path id="jboss.portal-search.classpath">
+ <pathelement path="${jboss.portal-search.lib}/portal-search-lib.jar"/>
+ </path>
+
<!-- server -->
<property name="jboss.portal-server.root" value="${project.root}/server/output"/>
<property name="jboss.portal-server.lib" value="${jboss.portal-server.root}/lib"/>
Property changes on: trunk/workflow
___________________________________________________________________
Name: svn:ignore
- output
+ output
bin
Modified: trunk/workflow/.classpath
===================================================================
--- trunk/workflow/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/workflow/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -12,5 +12,6 @@
<classpathentry kind="lib" path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/thirdparty/junit/lib/junit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/common"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/identity"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: trunk/wsrp/.classpath
===================================================================
--- trunk/wsrp/.classpath 2007-02-07 20:53:41 UTC (rev 6186)
+++ trunk/wsrp/.classpath 2007-02-08 16:51:26 UTC (rev 6187)
@@ -23,10 +23,10 @@
<classpathentry kind="lib" path="/thirdparty/sun-jaf/lib/activation.jar"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/namespace.jar"/>
<classpathentry kind="lib" path="/thirdparty/ibm-wsdl4j/lib/wsdl4j.jar"/>
- <classpathentry combineaccessrules="false" kind="src" path="/federation"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-xml-binding.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/jems"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/registration"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/portlet-federation"/>
<classpathentry kind="output" path="output/classes"/>
</classpath>
19 years, 2 months
JBoss Portal SVN: r6186 - trunk/wsrp/src/resources/portal-wsrp-sar/META-INF.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-07 15:53:41 -0500 (Wed, 07 Feb 2007)
New Revision: 6186
Modified:
trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
Log:
- Removed useless registration policy definition.
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-02-07 20:52:40 UTC (rev 6185)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2007-02-07 20:53:41 UTC (rev 6186)
@@ -91,13 +91,6 @@
<depends optional-attribute-name="PersistenceManager" proxy-type="attribute">portal.wsrp:service=PersistenceManager</depends>
</mbean>
- <!-- Registration policy -->
- <mbean code="org.jboss.portal.registration.policies.DefaultRegistrationPolicy"
- name="portal.wsrp:service=RegistrationPolicy" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
<!-- Persistence manager for registrations -->
<mbean code="org.jboss.portal.registration.impl.RegistrationPersistenceManagerImpl"
name="portal.wsrp:service=PersistenceManager" xmbean-dd=""
19 years, 2 months
JBoss Portal SVN: r6185 - in trunk/wsrp/src: main/org/jboss/portal/wsrp/producer/config and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-07 15:52:40 -0500 (Wed, 07 Feb 2007)
New Revision: 6185
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/TestRegistrationPolicy.java
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/custom-policy.xml
trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/invalid3.xml
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- More validation on configuration and associated tests.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-02-07 15:53:15 UTC (rev 6184)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2007-02-07 20:52:40 UTC (rev 6185)
@@ -61,13 +61,21 @@
factory = new ProducerConfigurationFactory();
}
+ public void testCustomPolicyUnmarshalling() throws Exception
+ {
+ ProducerConfiguration producerConfiguration = getProducerConfiguration("custom-policy.xml");
+ ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
+ assertNotNull(requirements);
+ RegistrationPolicy policy = requirements.getPolicy();
+ assertTrue(policy instanceof TestRegistrationPolicy);
+ }
+
public void testExtendedUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration = getProducerConfiguration("extended.xml");
ProducerRegistrationRequirements requirements = producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
RegistrationPolicy policy = requirements.getPolicy();
- assertNotNull(policy);
assertTrue(policy instanceof DefaultRegistrationPolicy);
RegistrationPropertyValidator propertyValidator = ((DefaultRegistrationPolicy)policy).getValidator();
assertNotNull(propertyValidator);
@@ -113,6 +121,15 @@
catch (Exception expected)
{
}
+
+ try
+ {
+ getProducerConfiguration("invalid3.xml");
+ fail("Doesn't make sense to define a property validator if a registration policy other than DefaultRegistrationPolicy");
+ }
+ catch (Exception expected)
+ {
+ }
}
private ProducerConfiguration getProducerConfiguration(String fileName)
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/TestRegistrationPolicy.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/TestRegistrationPolicy.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/TestRegistrationPolicy.java 2007-02-07 20:52:40 UTC (rev 6185)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.wsrp.config;
+
+import org.jboss.portal.registration.InvalidConsumerDataException;
+import org.jboss.portal.registration.RegistrationException;
+import org.jboss.portal.registration.RegistrationManager;
+import org.jboss.portal.registration.RegistrationPolicy;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class TestRegistrationPolicy implements RegistrationPolicy
+{
+ public void validateRegistrationDataFor(Map registrationProperties, String consumerIdentity) throws IllegalArgumentException, RegistrationException
+ {
+ }
+
+ public String createRegistrationHandleFor(String registrationId) throws IllegalArgumentException
+ {
+ return null;
+ }
+
+ public String getAutomaticGroupNameFor(String consumerName) throws IllegalArgumentException
+ {
+ return null;
+ }
+
+ public String getConsumerIdFrom(String consumerName, Map registrationProperties) throws IllegalArgumentException, InvalidConsumerDataException
+ {
+ return null;
+ }
+
+ public void validateConsumerName(String consumerName) throws IllegalArgumentException, RegistrationException
+ {
+ }
+
+ public void validateConsumerGroupName(String groupName) throws IllegalArgumentException, RegistrationException
+ {
+ }
+
+ public RegistrationManager getManager()
+ {
+ return null;
+ }
+
+ public void setManager(RegistrationManager manager)
+ {
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/config/TestRegistrationPolicy.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-02-07 15:53:15 UTC (rev 6184)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2007-02-07 20:52:40 UTC (rev 6185)
@@ -208,6 +208,11 @@
System.out.println("addchild conf regReq " + localName);
}
+ if (!ProducerRegistrationRequirementsImpl.DEFAULT_POLICY_CLASS_NAME.equals(regReq.getPolicyClassName()) && regReq.getValidatorClassName() != null)
+ {
+ throw new IllegalStateException("Doesn't make sense to define a property validator without using DefaultRegistrationPolicy!");
+ }
+
if (conf.getRegistrationRequirements() != null)
{
throw new IllegalStateException("ProducerConfiguration already has registration information set!");
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-02-07 15:53:15 UTC (rev 6184)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-02-07 20:52:40 UTC (rev 6185)
@@ -55,6 +55,7 @@
/** property name (QName) -> PropertyDescription */
private Map registrationProperties;
+ public final static String DEFAULT_POLICY_CLASS_NAME = "org.jboss.portal.registration.policies.DefaultRegistrationPolicy";
public ProducerRegistrationRequirementsImpl(boolean requiresMarshalling, boolean requiresRegistration, boolean fullServiceDescriptionRequiresRegistration)
{
@@ -270,8 +271,23 @@
this.policyClassName = policyClassName;
}
+ public String getPolicyClassName()
+ {
+ if (policyClassName == null)
+ {
+ return DEFAULT_POLICY_CLASS_NAME;
+ }
+
+ return policyClassName;
+ }
+
public void setValidatorClassName(String validatorClassName)
{
this.validatorClassName = validatorClassName;
}
+
+ public String getValidatorClassName()
+ {
+ return validatorClassName;
+ }
}
Added: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/custom-policy.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/custom-policy.xml (rev 0)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/custom-policy.xml 2007-02-07 20:52:40 UTC (rev 6185)
@@ -0,0 +1,28 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<producer-configuration>
+ <registration-configuration>
+ <registration-policy>org.jboss.portal.test.wsrp.config.TestRegistrationPolicy</registration-policy>
+ </registration-configuration>
+</producer-configuration>
\ No newline at end of file
Added: trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/invalid3.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/invalid3.xml (rev 0)
+++ trunk/wsrp/src/resources/tests/test-producer-configuration-lib-jar/invalid3.xml 2007-02-07 20:52:40 UTC (rev 6185)
@@ -0,0 +1,28 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<producer-configuration>
+ <registration-configuration>
+ <registration-policy>org.jboss.portal.test.wsrp.config.TestRegistrationPolicy</registration-policy>
+ <registration-property-validator>org.test.package.SomePropertyValidator</registration-property-validator>
+ </registration-configuration>
+</producer-configuration>
19 years, 2 months
JBoss Portal SVN: r6184 - in trunk: registration/src/main/org/jboss/portal/registration/impl and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-02-07 10:53:15 -0500 (Wed, 07 Feb 2007)
New Revision: 6184
Modified:
trunk/registration/src/main/org/jboss/portal/registration/RegistrationPolicy.java
trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java
trunk/registration/src/main/org/jboss/portal/registration/policies/DefaultRegistrationPolicy.java
trunk/registration/src/main/org/jboss/portal/test/registration/RegistrationManagerTestCase.java
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml
Log:
- Added javadoc for RegistrationPolicy.
- Renamed getGroupNameFor to getAutomaticGroupNameFor for clarity.
- Removed un-needed RegistrationPolicy service (if producer configuration doesn't define one, DefaultRegistrationPolicy is automatically used) in test-wsrp-producer-sar.
Modified: trunk/registration/src/main/org/jboss/portal/registration/RegistrationPolicy.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/RegistrationPolicy.java 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/registration/src/main/org/jboss/portal/registration/RegistrationPolicy.java 2007-02-07 15:53:15 UTC (rev 6184)
@@ -26,37 +26,104 @@
import java.util.Map;
/**
+ * An interface allowing users of the Registration service to customize different aspects of how Consumers are handled.
+ * Methods of this interface are used by RegistrationManager to make appropriate decisions.
+ *
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
* @since 2.6
*/
public interface RegistrationPolicy
{
+ /**
+ * Examines and determines whether the given registration properties are adequate for the Consumer associated with
+ * the given identity. This method is called before a Registration is created and thus allows users to decide whether
+ * or not to reject a given registration if not satisfied with the given registration properties.
+ *
+ * @param registrationProperties a Map containing the registration properties in the form of property name (QName) -
+ * property value (Object) mappings
+ * @param consumerIdentity the Consumer identity (as returned by {@link #getConsumerIdFrom(String,
+ *java.util.Map)}) for which the registration properties must be ascertained
+ * @throws IllegalArgumentException if any of the registration properties is invalid for the specified Consumer
+ * @throws RegistrationException if an exception occured in the registration service
+ */
void validateRegistrationDataFor(Map registrationProperties, String consumerIdentity)
- throws IllegalArgumentException, RegistrationException, DuplicateRegistrationException;
+ throws IllegalArgumentException, RegistrationException;
- String createRegistrationHandleFor(String registrationId);
+ /**
+ * Generates a registration handle based on the database identity of the Registration. This allows users to customize
+ * the registration handle format if they want to prevent exposure of database-related data.
+ *
+ * @param registrationId the database identity of the Registration for which a handle is required.
+ * @return a registration handle for the Registration associated with the specified identifier.
+ * @throws IllegalArgumentException if the specified registration identity if <code>null</code> or empty
+ */
+ String createRegistrationHandleFor(String registrationId) throws IllegalArgumentException;
- String getGroupNameFor(String consumerName);
+ /**
+ * Determines the ConsumerGroup name to which the Consumer associated with the specified name should be assigned with
+ * or <code>null</code> if the Consumer should not be automatically assigned to a ConsumerGroup. This method is
+ * called during the Consumer creation process to see if the Consumer should be automatically added to a
+ * ConsumerGroup.
+ *
+ * @param consumerName the name of the Consumer being created
+ * @return the name of the ConsumerGroup the Consumer must be automatically added to or <code>null</code> if the
+ * Consumer will not be automatically to a ConsumerGroup at creation
+ * @throws IllegalArgumentException if the specified Consumer name if <code>null</code> or empty
+ */
+ String getAutomaticGroupNameFor(String consumerName) throws IllegalArgumentException;
/**
- * Obtain a consumer id in function of the consumer name and registration properties.
+ * Obtains a consumer identity which uniquely identifies a Consumer in function of the consumer name and registration
+ * properties. This is potentially necessary because Consumer names are not guaranteed to be unique (even though the
+ * specification states that they should).
*
* @param consumerName the consumer name
- * @param registrationProperties the provided registration properties
- * @return the consumer id
- * @throws IllegalArgumentException
- * @throws InvalidConsumerDataException
+ * @param registrationProperties a Map containing the registration properties in the form of property name (QName) -
+ * property value (Object) mappings. Producer implementations might use the
+ * registration properties to provide secure Consumer identity.
+ * @return the consumer identity
+ * @throws InvalidConsumerDataException if the Policy examines the specified registration properties to determine the
+ * Consumer identity and decides that they are not in a proper state
+ * @throws IllegalArgumentException if the specified Consumer name if <code>null</code> or empty
*/
String getConsumerIdFrom(String consumerName, Map registrationProperties)
throws IllegalArgumentException, InvalidConsumerDataException;
+ /**
+ * Determines if the specified Consumer name is acceptable. This method is called before a Consumer is created and
+ * before a unique Consumer identity is created. This is in particular used if the Policy mandates that Consumer
+ * names must be unique.
+ *
+ * @param consumerName the name of the Consumer as passed during the registration process
+ * @throws IllegalArgumentException if the specified Consumer name if <code>null</code> or empty
+ * @throws RegistrationException if an exception occurred in the Registration service
+ */
void validateConsumerName(String consumerName)
throws IllegalArgumentException, RegistrationException;
+ /**
+ * Determines if the specified ConsumerGroup name is acceptable. This method is called before a ConsumerGroup is
+ * created.
+ *
+ * @param groupName the name of the ConsumerGroup to be created
+ * @throws IllegalArgumentException if the specified ConsumerGroup name if <code>null</code> or empty
+ * @throws RegistrationException if an exception occurred in the Registration service
+ */
void validateConsumerGroupName(String groupName) throws IllegalArgumentException, RegistrationException;
+ /**
+ * Retrieves the RegistrationManager with which this RegistrationPolicy is associated.
+ *
+ * @return the RegistrationManager with which this RegistrationPolicy is associated.
+ */
RegistrationManager getManager();
+ /**
+ * Associates this RegistrationPolicy with the specified RegistrationManager. This method should not be called
+ * directly by client code as it used in the wiring process of the Registration service.
+ *
+ * @param manager the RegistrationManager with which this RegistrationPolicy should be associated.
+ */
void setManager(RegistrationManager manager);
}
Modified: trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/registration/src/main/org/jboss/portal/registration/impl/RegistrationManagerImpl.java 2007-02-07 15:53:15 UTC (rev 6184)
@@ -119,7 +119,7 @@
// deal with group if needed
// let the policy decide if there should be a group associated with the Consumer and if yes, with which id
- String groupName = policy.getGroupNameFor(name);
+ String groupName = policy.getAutomaticGroupNameFor(name);
if (groupName != null)
{
addConsumerToGroupNamed(name, groupName, true, false);
Modified: trunk/registration/src/main/org/jboss/portal/registration/policies/DefaultRegistrationPolicy.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/registration/policies/DefaultRegistrationPolicy.java 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/registration/src/main/org/jboss/portal/registration/policies/DefaultRegistrationPolicy.java 2007-02-07 15:53:15 UTC (rev 6184)
@@ -105,7 +105,7 @@
}
/** Doesn't support automatic ConsumerGroups so always return <code>null</code>. */
- public String getGroupNameFor(String consumerName)
+ public String getAutomaticGroupNameFor(String consumerName)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(consumerName, "Consumer name", null);
return null;
Modified: trunk/registration/src/main/org/jboss/portal/test/registration/RegistrationManagerTestCase.java
===================================================================
--- trunk/registration/src/main/org/jboss/portal/test/registration/RegistrationManagerTestCase.java 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/registration/src/main/org/jboss/portal/test/registration/RegistrationManagerTestCase.java 2007-02-07 15:53:15 UTC (rev 6184)
@@ -145,7 +145,7 @@
// use a different policy: now specifies that when creating a consumer, it should be added to a group with the same name
DefaultRegistrationPolicy policy = new DefaultRegistrationPolicy()
{
- public String getGroupNameFor(String consumerName)
+ public String getAutomaticGroupNameFor(String consumerName)
{
return "group_" + consumerName;
}
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/META-INF/jboss-service.xml 2007-02-07 15:53:15 UTC (rev 6184)
@@ -164,19 +164,11 @@
proxy-type="attribute">portal:service=WebAppRegistry</depends>
</mbean>
- <!-- Use DefaultRegistrationPolicy for registration -->
- <mbean code="org.jboss.portal.registration.policies.DefaultRegistrationPolicy"
- name="portal.wsrp:service=RegistrationPolicy" xmbean-dd=""
- xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
- <xmbean/>
- </mbean>
-
<!-- Registration manager -->
<mbean code="org.jboss.portal.registration.impl.RegistrationManagerImpl"
name="portal.wsrp:service=RegistrationManager" xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
- <depends optional-attribute-name="Policy" proxy-type="attribute">portal.wsrp:service=RegistrationPolicy</depends>
<depends optional-attribute-name="PersistenceManager" proxy-type="attribute">portal.wsrp:service=PersistenceManager</depends>
</mbean>
Modified: trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml
===================================================================
--- trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml 2007-02-07 15:25:12 UTC (rev 6183)
+++ trunk/wsrp/src/resources/tests/test-wsrp-producer-sar/producer-config.xml 2007-02-07 15:53:15 UTC (rev 6184)
@@ -1,6 +1,6 @@
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ Copyright 2007, Red Hat Middleware, LLC, and individual ~
~ contributors as indicated by the @authors tag. See the ~
~ copyright.txt in the distribution for a full listing of ~
~ individual contributors. ~
19 years, 2 months