Author: thomas.heute(a)jboss.com
Date: 2007-08-09 08:45:50 -0400 (Thu, 09 Aug 2007)
New Revision: 7881
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultCommandFactoryService.java
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultURLFactory.java
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/PropertyResolver.java
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/SearchBean.java
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/url/
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/url/SearchUrlFactory.java
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search.properties
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search_it.properties
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsf/
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsf/index.xhtml
Removed:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchConstants.java
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchPortlet.java
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource_it.properties
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsp/
Modified:
branches/JBoss_Portal_Branch_2_6/cms/.classpath
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/CommandFactory.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResult.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/commands/TestSearch.java
branches/JBoss_Portal_Branch_2_6/core-cms/.classpath
branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
branches/JBoss_Portal_Branch_2_6/core-search/.classpath
branches/JBoss_Portal_Branch_2_6/core-search/build.xml
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/portlet.xml
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/web.xml
Log:
- Refactored search service
- Started JSF Search portlet
Modified: branches/JBoss_Portal_Branch_2_6/cms/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_6/cms/.classpath 2007-08-09 12:38:58 UTC (rev 7880)
+++ branches/JBoss_Portal_Branch_2_6/cms/.classpath 2007-08-09 12:45:50 UTC (rev 7881)
@@ -38,10 +38,10 @@
<classpathentry combineaccessrules="false" kind="src"
path="/portlet"/>
<classpathentry kind="lib"
path="/thirdparty/sun-servlet/lib/servlet-api.jar"/>
<classpathentry combineaccessrules="false" kind="src"
path="/identity"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/search"/>
<classpathentry combineaccessrules="false" kind="src"
path="/workflow"/>
<classpathentry kind="lib"
path="/thirdparty/jackrabbit/lib/jackrabbit-core.jar"/>
<classpathentry combineaccessrules="false" kind="src"
path="/security"/>
<classpathentry kind="lib"
path="/thirdparty/jbpm/jaronly/lib/jbpm.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/search"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/CommandFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/CommandFactory.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -29,7 +29,7 @@
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 org.jboss.portal.search.Query;
/**
* Factory to create commands for the cms service.
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/JCRCommandFactory.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -53,7 +53,7 @@
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 org.jboss.portal.search.Query;
/**
* @author <a href="mailto:roy@jboss.org">Roy Russo</a>
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/impl/jcr/command/SearchCommand.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -36,8 +36,11 @@
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;
+import org.jboss.portal.search.Query;
+import org.jboss.portal.search.QueryConverter;
+import org.jboss.portal.search.impl.StandardQueryConverter;
+import org.jboss.portal.search.impl.jcr.JCRQuery;
+import org.jboss.portal.search.impl.jcr.JCRQueryConverter;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
@@ -62,33 +65,42 @@
Workspace workspace = session.getWorkspace();
QueryManager queryManager;
List files = new ArrayList();
+ String queryString = null;
try
{
queryManager = workspace.getQueryManager();
- String queryString = JCRQueryConverter.convert(query);
- if (! "".equals(queryString))
+ StandardQueryConverter standardConverter = new StandardQueryConverter();
+ query = standardConverter.convert(query);
+
+ QueryConverter converter = new JCRQueryConverter();
+ if (query != null)
{
- javax.jcr.query.Query jcrQuery = queryManager.createQuery(queryString,
javax.jcr.query.Query.XPATH);
- QueryResult queryResult=jcrQuery.execute();
- NodeIterator nodeIterator = queryResult.getNodes();
-
- while (nodeIterator.hasNext())
+ queryString = ((JCRQuery) converter.convert(query)).getJcrQuery();
+
+ if (!"".equals(queryString) && query != null)
{
- 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);
+ javax.jcr.query.Query jcrQuery = queryManager.createQuery(queryString,
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);
+ throw new CMSException("Cannot query the CMS with query: " +
queryString, e);
}
return files;
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSFederatedSearch.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -22,35 +22,30 @@
******************************************************************************/
package org.jboss.portal.cms.search;
+import java.util.Iterator;
+import java.util.List;
+
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.common.i18n.LocalizedString;
+import org.jboss.portal.search.Query;
+import org.jboss.portal.search.impl.AbstractFederatedSearcher;
import org.jboss.portal.search.result.ResultSet;
-import java.util.Iterator;
-import java.util.List;
-
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
-public class CMSFederatedSearch extends GenericSearchFederated
+public class CMSFederatedSearch extends AbstractFederatedSearcher
{
private CMS cms;
- private Info info;
- private String id;
private String urlPrefix;
public CMSFederatedSearch(String id)
{
- this.id = id;
- info = new Info();
- info.setStatus(Info.Status.AVAILABLE);
-
+ setId(id);
+ setDisplayName(new LocalizedString("Content Management System"));
this.urlPrefix = "portal/content";
}
@@ -59,28 +54,6 @@
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);
@@ -96,9 +69,5 @@
return results;
}
- public String getId()
- {
- return id;
- }
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResult.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResult.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResult.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -23,6 +23,7 @@
package org.jboss.portal.cms.search;
import org.jboss.portal.cms.model.File;
+import org.jboss.portal.common.i18n.LocalizedString;
import org.jboss.portal.search.result.Result;
import org.jboss.portal.search.result.ResultURL;
@@ -52,17 +53,21 @@
{
return url;
}
-
- public String getTitle()
+
+ public LocalizedString getTitle()
{
if (file.getTitle() != null)
{
- return file.getTitle();
+ return new LocalizedString(file.getTitle());
}
else
{
- return file.getName();
+ return new LocalizedString(file.getName());
}
}
+ public LocalizedString getType()
+ {
+ return new LocalizedString("CMS");
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/cms/search/CMSResultURL.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -23,25 +23,18 @@
package org.jboss.portal.cms.search;
import org.jboss.portal.cms.model.File;
-import org.jboss.portal.search.result.ResultURL;
+import org.jboss.portal.search.result.impl.SimpleResultURL;
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
* @version $Revision$
*/
-public class CMSResultURL implements ResultURL
+public class CMSResultURL extends SimpleResultURL
{
- private File file;
- private String prefix;
public CMSResultURL(String prefix, File file)
{
- this.file = file;
- this.prefix = prefix;
+ super("/" + prefix + file.getBasePath());
}
- public String toString()
- {
- return "/" + prefix + file.getBasePath();
- }
}
Modified:
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/commands/TestSearch.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/commands/TestSearch.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/cms/src/main/org/jboss/portal/test/cms/commands/TestSearch.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -22,20 +22,17 @@
******************************************************************************/
package org.jboss.portal.test.cms.commands;
+import java.util.List;
+
import junit.framework.TestSuite;
+
import org.jboss.portal.cms.CMSException;
import org.jboss.portal.cms.Command;
-import org.jboss.portal.cms.impl.ContentImpl;
-import org.jboss.portal.cms.impl.FileImpl;
-import org.jboss.portal.cms.model.Content;
import org.jboss.portal.cms.model.File;
-import org.jboss.portal.search.query.Query;
-import org.jboss.portal.search.query.impl.KeywordQueryTerm;
+import org.jboss.portal.search.Query;
+import org.jboss.portal.search.impl.QueryImpl;
-import java.util.List;
-import java.util.Locale;
-
/**
* @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
*/
@@ -54,8 +51,7 @@
/** Tests retrieval of the version labeled LIVE. */
public void testFileGet() throws CMSException
{
- Query query = new Query();
- query.addOptionalTerm(new KeywordQueryTerm("risks"));
+ Query query = new QueryImpl("risks");
Command searchCMD = service.getCommandFactory().createSearchCommand(query);
List list = (List)service.execute(searchCMD);
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/.classpath 2007-08-09 12:38:58 UTC (rev
7880)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/.classpath 2007-08-09 12:45:50 UTC (rev
7881)
@@ -18,11 +18,11 @@
<classpathentry combineaccessrules="false" kind="src"
path="/theme"/>
<classpathentry combineaccessrules="false" kind="src"
path="/workflow"/>
<classpathentry kind="lib"
path="/thirdparty/apache-fileupload/lib/commons-fileupload.jar"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/search"/>
<classpathentry combineaccessrules="false" kind="src"
path="/security"/>
<classpathentry kind="lib"
path="/thirdparty/jbpm/jaronly/lib/jbpm.jar"/>
<classpathentry kind="lib"
path="/thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
<classpathentry combineaccessrules="false" kind="src"
path="/core-admin"/>
<classpathentry kind="lib"
path="/thirdparty/hibernate/lib/hibernate3.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/search"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_6/core-cms/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-08-09 12:38:58 UTC (rev
7880)
+++ branches/JBoss_Portal_Branch_2_6/core-cms/build.xml 2007-08-09 12:45:50 UTC (rev
7881)
@@ -93,6 +93,7 @@
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.ant.classpath"/>
<path refid="apache.myfaces.classpath"/>
+ <path refid="apache.lucene.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
<path refid="sun.servlet.classpath"/>
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -169,7 +169,7 @@
try
{
SearchFederation searchFederationService =
(SearchFederation)getPortletContext().getAttribute("SearchFederationService");
- if (searchFederationService.getSearchFederated(CMSConstants.SEARCH_ID) == null)
+ if (searchFederationService.getFederatedSearcher(CMSConstants.SEARCH_ID) ==
null)
{
CMSFederatedSearch federatedSearch = new
CMSFederatedSearch(CMSConstants.SEARCH_ID);
federatedSearch.setCMS(CMSService);
Modified:
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-cms/src/main/org/jboss/portal/core/cms/ui/admin/CMSAdminPortlet.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -71,8 +71,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.search.Query;
+import org.jboss.portal.search.impl.QueryImpl;
import org.jboss.portal.security.PortalPermission;
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
@@ -309,8 +309,7 @@
rRes.setContentType("text/html");
String textQuery = rReq.getParameter("search");
-
- Query query = QueryConverter.convert(textQuery);
+ Query query = new QueryImpl(textQuery);
List files;
try
{
Modified: branches/JBoss_Portal_Branch_2_6/core-search/.classpath
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-search/.classpath 2007-08-09 12:38:58 UTC (rev
7880)
+++ branches/JBoss_Portal_Branch_2_6/core-search/.classpath 2007-08-09 12:45:50 UTC (rev
7881)
@@ -1,11 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry excluding="org/jboss/portal/search/" kind="src"
path="src/main"/>
+ <classpathentry excluding="org/jboss/portal/search/|services/"
kind="src" path="src/main"/>
<classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-system.jar"
sourcepath="/JBoss_AS_4.0.5/system/src/main"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-jmx.jar"
sourcepath="/JBoss_AS_4.0.5/jmx/src/main"/>
+ <classpathentry kind="lib"
path="/thirdparty/jbossas/core-libs/lib/jboss-common.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-lucene/lib/lucene.jar"/>
+ <classpathentry kind="lib"
path="/thirdparty/apache-myfaces/lib/myfaces-api.jar"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/core"/>
<classpathentry combineaccessrules="false" kind="src"
path="/api"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/core"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/portlet"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/server"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/common"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/jems"/>
<classpathentry combineaccessrules="false" kind="src"
path="/search"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/portlet"/>
- <classpathentry combineaccessrules="false" kind="src"
path="/cms"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/faces"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Modified: branches/JBoss_Portal_Branch_2_6/core-search/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-search/build.xml 2007-08-09 12:38:58 UTC (rev
7880)
+++ branches/JBoss_Portal_Branch_2_6/core-search/build.xml 2007-08-09 12:45:50 UTC (rev
7881)
@@ -92,6 +92,7 @@
<path refid="jbossas/core.libs.classpath"/>
<path refid="hibernate.hibernate.classpath"/>
<path refid="apache.ant.classpath"/>
+ <path refid="apache.lucene.classpath"/>
<path refid="apache.myfaces.classpath"/>
<path refid="apache.log4j.classpath"/>
<path refid="junit.junit.classpath"/>
@@ -126,6 +127,7 @@
<path refid="jboss.portal-portlet.classpath"/>
<path refid="jboss.portal-jems.classpath"/>
<path refid="jboss.portal-identity.classpath"/>
+ <path refid="jboss.portal-faces.classpath"/>
<path refid="jboss.portlet-api.classpath"/>
<path refid="jboss.portal-security.classpath"/>
<path refid="jboss.portal-theme.classpath"/>
@@ -218,25 +220,50 @@
<mkdir dir="${build.lib}"/>
- <!-- portal-core-search-lib.jar -->
- <jar jarfile="${build.lib}/portal-core-search-lib.jar">
- <fileset dir="${build.classes}">
+ <!-- portal-core-search-ui-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-search-ui-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/search/ui/**">
</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"/>
+ <!-- portal-core-search-service-lib.jar -->
+ <jar jarfile="${build.lib}/portal-core-search-service-lib.jar">
+ <fileset dir="${build.classes}"
includes="org/jboss/portal/core/search/service/**">
+ </fileset>
+ </jar>
+
+ <!-- portal-admin.war -->
+ <copy todir="${build.resources}/portal-search-war/WEB-INF/lib2">
+ <fileset dir="${build.lib}"
includes="portal-core-search-ui-lib.jar"/>
+ <fileset dir="${apache.myfaces.lib}"
includes="myfaces-api.jar,myfaces-impl.jar,jstl.jar"/>
+ <fileset dir="${jboss.portal-faces.root}/lib"
includes="portal-faces-lib.jar"/>
+ <fileset dir="../core-admin/src/etc/sun-jsf"
includes="jsf-example.jar"/>
+ <fileset dir="${facelets.facelets.lib}"
includes="jsf-facelets.jar"/>
+ <fileset dir="${el.el.lib}"
includes="el-api.jar,el-ri.jar"/>
+ <fileset dir="${commons.el.lib}"
includes="commons-el.jar"/>
+ <fileset dir="${apache.beanutils.lib}"
includes="commons-beanutils.jar"/>
+ <fileset dir="${apache.digester.lib}"
includes="commons-digester.jar"/>
+ <fileset dir="${apache.lang.lib}"
includes="commons-lang.jar"/>
+ </copy>
+
+
+ <!--copy todir="${build.resources}/portal-search-war">
+ <fileset dir="${source.bin}/portal-search-war"/>
+ </copy-->
+
+ <!-- portal-search.war -->
+ <copy todir="${build.resources}/portal-search-war">
+ <fileset dir="${build.resources}/portal-search-war"/>
</copy>
- <copy todir="${build.resources}/portal-search/lib">
- <fileset dir="${build.lib}"
includes="portal-core-search-lib.jar"/>
- <fileset dir="${jboss.portal-search.root}/lib"
includes="portal-search-lib.jar"/>
+
+ <copy todir="${build.resources}/portal-search-sar/lib">
+ <fileset dir="${build.lib}"
includes="portal-core-search-service-lib.jar"/>
+ <!--fileset dir="${jboss.portal-search.root}/lib"
includes="portal-search-lib.jar"/-->
+ <fileset dir="${apache.lucene.lib}"
includes="lucene.jar"/>
+ <fileset dir="${jboss.portal-faces.root}/lib"
includes="portal-faces-loader-lib.jar"/>
</copy>
- <!-- portal-search.war -->
- <copy todir="${build.resources}/portal-search/portal-search.war">
- <!--fileset dir="${source.bin}/portal-search-war"/-->
+ <copy
todir="${build.resources}/portal-search.sar/portal-search.war">
<fileset dir="${build.resources}/portal-search-war"/>
</copy>
@@ -249,14 +276,14 @@
<!-- Build configurations -->
<copy todir="${build.resources}/portal-search.sar">
- <fileset dir="${build.resources}/portal-search"
excludes="**/*.xml"/>
+ <fileset dir="${build.resources}/portal-search-sar"
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"/>
+ <fileset dir="${build.resources}/portal-search-sar"
includes="**/*.xml"/>
</copy>
<!-- Build archives -->
<implode
Deleted:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchConstants.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchConstants.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchConstants.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -1,35 +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.core.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";
-
-}
Deleted:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchPortlet.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchPortlet.java 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/SearchPortlet.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -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.core.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.QueryConverter;
-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:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultCommandFactoryService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultCommandFactoryService.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultCommandFactoryService.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.core.search.service;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.portlet.PortletParametersStateString;
+import org.jboss.portal.server.ServerInvocation;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchResultCommandFactoryService extends AbstractCommandFactory
+{
+ private static String TARGET_WINDOW = "targetWindow";
+
+ public ControllerCommand doMapping(ControllerContext controllerContext,
ServerInvocation invocation, String host, String contextPath, String requestPath)
+ {
+ Map parameters = invocation.getServerContext().getQueryParameterMap();
+
+ PortletParametersStateString renderParameters = new
PortletParametersStateString();
+
+ String targetWindowRef = null;
+ Iterator it = parameters.keySet().iterator();
+ while (it.hasNext())
+ {
+ String key = (String)it.next();
+ if (key.equals(TARGET_WINDOW))
+ {
+ targetWindowRef = ((String[])parameters.get(key))[0];
+ }
+ else
+ {
+ renderParameters.setValue(key, ((String[])parameters.get(key))[0]);
+ }
+ }
+
+ PortalObjectId targetWindowId = PortalObjectId.parse(targetWindowRef,
PortalObjectPath.LEGACY_FORMAT);
+
+ // Perform a render URL on the target window
+ return new InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW,
WindowState.MAXIMIZED, renderParameters);
+
+ }
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultURLFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultURLFactory.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/service/SearchResultURLFactory.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,79 @@
+/******************************************************************************
+ * 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.core.search.service;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.portal.jems.as.system.AbstractJBossService;
+import org.jboss.portal.search.result.ResultURL;
+import org.jboss.portal.search.result.impl.PortletResultURL;
+import org.jboss.portal.search.result.impl.SimpleResultURL;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchResultURLFactory extends AbstractJBossService
+{
+ private String path;
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public void setPath(String path)
+ {
+ this.path = path;
+ }
+
+ public String getURL(ResultURL resultURL, String contextPath)
+ {
+ if (resultURL instanceof SimpleResultURL)
+ {
+ return ((SimpleResultURL)resultURL).getStringURL();
+ }
+ else if (resultURL instanceof PortletResultURL)
+ {
+ StringBuffer buffer = new StringBuffer();
+ buffer.append(path + "?");
+ PortletResultURL portletResultURL = (PortletResultURL)resultURL;
+
+ buffer.append("targetWindow=" + portletResultURL.getWindowRef());
+
+ Map map = portletResultURL.getRenderParameters();
+ Iterator it = map.keySet().iterator();
+ while (it.hasNext())
+ {
+ buffer.append("&");
+ String key = (String)it.next();
+ buffer.append(key + "=" + map.get(key));
+ }
+ return buffer.toString();
+ }
+ return null;
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/PropertyResolver.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/PropertyResolver.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/PropertyResolver.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.core.search.ui;
+
+import java.util.Locale;
+
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.search.service.SearchResultURLFactory;
+import org.jboss.portal.faces.el.DelegatingPropertyResolver;
+import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
+import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
+import org.jboss.portal.search.result.Result;
+import org.jboss.portal.search.result.ResultURL;
+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 class PropertyResolver extends DelegatingPropertyResolver
+{
+
+ public PropertyResolver()
+ {
+ init();
+ }
+
+ public PropertyResolver(javax.faces.el.PropertyResolver delegate)
+ {
+ super(delegate);
+
+ //
+ init();
+ }
+
+
+ private void init()
+ {
+ SimpleBeanDecorator resultURLDecorator = new SimpleBeanDecorator();
+ resultURLDecorator.setProperty("value", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ ResultURL resultURL = (ResultURL)bean;
+ SearchResultURLFactory urlFactory = new SearchResultURLFactory();
+ urlFactory.setPath("/portal/search");
+ return (urlFactory.getURL(resultURL,
FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath()));
+ }
+ });
+ registerDecorator(ResultURL.class, resultURLDecorator);
+
+ SimpleBeanDecorator localizedStringDecorator = new SimpleBeanDecorator();
+ localizedStringDecorator.setProperty("value", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ LocalizedString string = (LocalizedString)bean;
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ Locale locale = ctx.getExternalContext().getRequestLocale();
+ return string.getString(locale, true);
+ }
+ });
+ registerDecorator(LocalizedString.class, localizedStringDecorator);
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/SearchBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/SearchBean.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/SearchBean.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,202 @@
+/******************************************************************************
+ * 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.core.search.ui;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.faces.model.SelectItem;
+import javax.portlet.PortletContext;
+
+import org.jboss.portal.core.search.service.SearchResultURLFactory;
+import org.jboss.portal.search.FederatedSearcher;
+import org.jboss.portal.search.Query;
+import org.jboss.portal.search.SearchingException;
+import org.jboss.portal.search.federation.SearchFederation;
+import org.jboss.portal.search.identity.UserSearcher;
+import org.jboss.portal.search.impl.QueryImpl;
+import org.jboss.portal.search.result.Result;
+import org.jboss.portal.search.result.ResultSet;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchBean
+{
+ public String textString;
+
+ private SearchFederation searchService;
+
+ private List selectedFederatedSearchers;
+
+ private int nbMaxResults = 20;
+
+ private int nbResults = 0;
+
+ private ListDataModel resultsDataModel;
+
+ public SearchBean()
+ {
+ PortletContext portletContext =
(PortletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();
+ searchService = (SearchFederation)
portletContext.getAttribute("SearchService");
+ org.jboss.portal.search.identity.UserSearcher searcher = new UserSearcher();
+ if (searchService.getFederatedSearcher(searcher.getId()) == null)
+ {
+ searchService.register(searcher);
+ }
+ }
+
+ public List getSearcher()
+ {
+ return searchService.getFederatedSearcherList();
+ }
+
+ public String getTextString()
+ {
+ return textString;
+ }
+
+ public void setTextString(String textString)
+ {
+ this.textString = textString;
+ }
+
+ public int getNbResults()
+ {
+ return nbResults;
+ }
+
+ public DataModel getResults()
+ {
+ return resultsDataModel;
+ }
+
+ public SelectItem[] getFederatedSearchers()
+ {
+ List list = searchService.getFederatedSearcherList();
+
+ SelectItem[] result = new SelectItem[list.size()];
+
+ int i = 0;
+ Iterator it = list.iterator();
+ while (it.hasNext())
+ {
+ FederatedSearcher searcher = (FederatedSearcher)it.next();
+ result[i] = new SelectItem(searcher.getId(),
searcher.getDisplayName().getValue(FacesContext.getCurrentInstance().getExternalContext().getRequestLocale(),
true).getString());
+ i++;
+ }
+
+ return result;
+ }
+
+ public void setSelectedFederatedSearchers(List list)
+ {
+ selectedFederatedSearchers = list;
+ }
+
+
+ public List getSelectedFederatedSearchers()
+ {
+ if (selectedFederatedSearchers == null)
+ {
+ selectedFederatedSearchers = new ArrayList();
+ Iterator it = searchService.getFederatedSearcherList().iterator();
+ while (it.hasNext())
+ {
+ FederatedSearcher searcher = (FederatedSearcher)it.next();
+ selectedFederatedSearchers.add(searcher.getId());
+ }
+ }
+ return selectedFederatedSearchers;
+ }
+
+ public void search()
+ {
+ List results = null;
+ Query query;
+ try
+ {
+ query = new QueryImpl(textString);
+ results = searchService.search(query, selectedFederatedSearchers);
+ }
+ catch (SearchingException e)
+ {
+ // FIXME
+ e.printStackTrace();
+ }
+
+ setResultsDataModel(results);
+ setNbResults(results);
+
+
+ }
+
+
+ private void setResultsDataModel(List results)
+ {
+ List returnList = new ArrayList();
+ if (results != null)
+ {
+ Iterator it = results.iterator();
+ int i=0;
+ while (it.hasNext())
+ {
+ ResultSet resultSet = (ResultSet)it.next();
+ Iterator itResults = resultSet.iterator();
+ while (itResults.hasNext() && i < nbMaxResults)
+ {
+ Result result = (Result)itResults.next();
+ returnList.add(result);
+ i++;
+ }
+ }
+ }
+ resultsDataModel = new ListDataModel(returnList);
+ }
+
+ private void setNbResults(List results)
+ {
+ int returnValue = 0;
+ if (results != null)
+ {
+ Iterator it = results.iterator();
+ while (it.hasNext())
+ {
+ ResultSet resultSet = (ResultSet)it.next();
+ returnValue += resultSet.size();
+ }
+ nbResults = returnValue;
+ }
+ else
+ {
+ nbResults = 0;
+ }
+ }
+
+}
+
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/url/SearchUrlFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/url/SearchUrlFactory.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/main/org/jboss/portal/core/search/ui/url/SearchUrlFactory.java 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.core.search.ui.url;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class SearchUrlFactory
+{
+
+}
+
Modified:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-sar/META-INF/jboss-service.xml 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-sar/META-INF/jboss-service.xml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -31,5 +31,37 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
</mbean>
+
+ <mbean
+
code="org.jboss.portal.core.search.service.SearchResultCommandFactoryService"
+ name="portal:commandFactory=SearchResult"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ </mbean>
+ <mbean
+
code="org.jboss.portal.core.controller.command.mapper.CommandFactoryDelegate"
+ name="portal:commandFactory=Delegate,path=search"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="Path">/search</attribute>
+ <depends
+ optional-attribute-name="DelegatingFactory"
+
proxy-type="attribute">portal:commandFactory=Delegating</depends>
+ <depends
+ optional-attribute-name="DelegateFactory"
+
proxy-type="attribute">portal:commandFactory=SearchResult</depends>
+ </mbean>
+
+ <!-- mbean
+ code="org.jboss.portal.core.search.service.SearchResultURLFactory"
+ name="portal:urlFactory=SearchResult"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="Path">portal/search</attribute>
+ </mbean-->
+
</server>
Deleted:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource.properties 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource.properties 2007-08-09
12:45:50 UTC (rev 7881)
@@ -1,25 +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. #
-################################################################################
-
-SEARCH_SEARCH=Search
-
\ No newline at end of file
Deleted:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource_it.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource_it.properties 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Resource_it.properties 2007-08-09
12:45:50 UTC (rev 7881)
@@ -1,25 +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. #
-################################################################################
-
-SEARCH_SEARCH=Ricerca
-
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search.properties
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search.properties 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,5 @@
+advancedSearch=Advanced Search
+search=Search
+noResult=No result was found
+oneResult=A unique result was found
+nbResults={0} results were found
\ No newline at end of file
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search_it.properties
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search_it.properties
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/classes/Search_it.properties 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1 @@
+search=Ricerca
\ No newline at end of file
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/faces-config.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/faces-config.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/faces-config.xml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,48 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+
+ <application>
+
<property-resolver>org.jboss.portal.core.search.ui.PropertyResolver</property-resolver>
+
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>search</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.search.ui.SearchBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+ <!-- navigation-rule>
+ <navigation-case>
+ <from-outcome>viewResults</from-outcome>
+ <to-view-id>/WEB-INF/jsf/viewResults.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule -->
+
+</faces-config>
Modified:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jboss-portlet.xml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -31,6 +31,19 @@
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
+ <header-content>
+ <script type="text/javascript" language="javascript">
+ function hideShow(id)
+ {
+ var navpoint = document.getElementById(id);
+ if (navpoint.className == 'hidden') {
+ navpoint.className = 'shown';
+ } else {
+ navpoint.className = 'hidden';
+ }
+ }
+ </script>
+ </header-content>
</portlet>
<service>
<service-name>SearchService</service-name>
Added:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsf/index.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsf/index.xhtml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/jsf/index.xhtml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -0,0 +1,57 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <f:loadBundle var="bundle" basename="Search" />
+
+ <h:form>
+ <h:commandButton
+ type="reset"
+ class="portlet-form-button"
+ value="#{bundle.advancedSearch}"
+ immediate="true"
+ onclick="hideShow('advanced');"/>
+ </h:form>
+
+ <h:form>
+
+ <div id="advanced" class="hidden">
+ <h:outputText value="#{bundle.advancedSearch}:"/>
+ <h:selectManyCheckbox
value="#{search.selectedFederatedSearchers}">
+ <f:selectItems value="#{search.federatedSearchers}"/>
+ </h:selectManyCheckbox>
+ </div>
+
+ <br/>
+
+ <h:inputText styleClass="portlet-form-input-field"
+ value="#{search.textString}"/>
+
+ <h:commandButton action="#{search.search}"
+ value="#{bundle.search}"
+ styleClass="portlet-form-button"/>
+
+ </h:form>
+
+ <br/>
+
+ <h:outputText value="#{bundle.noResult}"
rendered="#{search.nbResults == 0 and not empty search.textString}"/>
+ <h:outputFormat value="#{bundle.oneResult}"
rendered="#{search.nbResults == 1}">
+ <f:param value="#{search.nbResults}"/>
+ </h:outputFormat>
+ <h:outputFormat value="#{bundle.nbResults}"
rendered="#{search.nbResults > 1}">
+ <f:param value="#{search.nbResults}"/>
+ </h:outputFormat>
+
+ <h:dataTable value="#{search.results}" var="result">
+ <h:column>
+ <h:outputText value="#{result.type.value}"/>
+ </h:column>
+ <h:column>
+ <h:outputLink value="#{result.URL.value}"><h:outputText
value="#{result.title.value}"/></h:outputLink>
+ </h:column>
+ </h:dataTable>
+</div>
Modified:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/portlet.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/portlet.xml 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/portlet.xml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -32,7 +32,11 @@
<portlet-name>SearchPortlet</portlet-name>
<display-name>Search Portlet</display-name>
-
<portlet-class>org.jboss.portal.core.search.SearchPortlet</portlet-class>
+
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
+ <init-param>
+ <name>default-view</name>
+ <value>/WEB-INF/jsf/index.xhtml</value>
+ </init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
Modified:
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/web.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/web.xml 2007-08-09
12:38:58 UTC (rev 7880)
+++
branches/JBoss_Portal_Branch_2_6/core-search/src/resources/portal-search-war/WEB-INF/web.xml 2007-08-09
12:45:50 UTC (rev 7881)
@@ -1,6 +1,80 @@
<?xml version="1.0"?>
-<!DOCTYPE web-app PUBLIC
- "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
- "http://java.sun.com/dtd/web-app_2_3.dtd">
-<web-app>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app
+
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-app_2_4.xsd"
+ version="2.4">
+
+ <!-- MyFaces specific configuration -->
+ <context-param>
+ <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- Facelet configuration -->
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.SKIP_COMMENTS</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF configuration -->
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+
+ <!-- The JSF servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+
<servlet-class>org.jboss.portal.faces.loader.FacesLoaderServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
</web-app>