Java Doc for SearchGenerator.java in  » Content-Management-System » apache-lenya-2.0 » org » apache » cocoon » generation » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » apache lenya 2.0 » org.apache.cocoon.generation 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.cocoon.generation.AbstractGenerator
   org.apache.cocoon.generation.ServiceableGenerator
      org.apache.cocoon.generation.SearchGenerator

SearchGenerator
public class SearchGenerator extends ServiceableGenerator implements Contextualizable(Code)
Generates an XML representation of a search result.

This generator generates xml content representening an XML search. The generated xml content contains the search result, the search query information, and navigation information about the search results. The query is sent to the generator, either via the 'queryString' request parameter or the 'query' SiteMap parameter. The sitemap overides the request.

Search xml sample generated by this generator:


 <?xml version="1.0" encoding="UTF-8"?>
 <search:results date="1008437081064" query-string="cocoon"
 start-index="0" page-length="10"
 xmlns:search="http://apache.org/cocoon/search/1.0"
 xmlns:xlink="http://www.w3.org/1999/xlink">
 <search:hits total-count="125" count-of-pages="13">
 <search:hit rank="0" score="1.0"
 uri="http://localhost:8080/cocoon/documents/hosting.html">
 <search:field name="title">Document Title<search:field/>
 <search:hit/>
 ...
 </search:hits>
 <search:navigation total-count="125" count-of-pages="13"
 has-next="true" has-previous="false" next-index="10" previous-index="0">
 <search:navigation-page start-index="0"/>
 <search:navigation-page start-index="10"/>
 ...
 <search:navigation-page start-index="120"/>
 </search:navigation>
 </search:results>
 

author:
   Bernhard Huber
author:
   Vadim Gritsenko
author:
   Jeremy Quinn
author:
   Conal Tuohy
version:
   CVS $Id: SearchGenerator.java 465914 2006-10-19 22:38:41Z joerg $


Field Summary
final protected static  StringANALYZER_PARAM
     Setup parameter name of analyzer name, ie analyzer.
final protected static  StringANALYZER_PARAM_DEFAULT
     Default value of analyzer parameter analyzer, ie org.apache.lucene.analysis.standard.StandardAnalyzer.
final protected static  StringCDATA
    
final protected static  StringCOUNT_OF_PAGES_ATTRIBUTE
     Attribute count-of-pages of hits element.
final protected static  StringDATE_ATTRIBUTE
     Attribute date of results element.
final protected static  StringFIELD_ELEMENT
     Child element field of the hit element.
final protected static  StringHAS_NEXT_ATTRIBUTE
     Attribute has-next of navigation-page element.
final protected static  StringHAS_PREVIOUS_ATTRIBUTE
     Attribute has-next of navigation-page element.
final protected static  StringHITS_ELEMENT
     Child element of generated xml content, ie hits.
final protected static  StringHIT_ELEMENT
     Child element of generated xml content, ie hit.
final protected static  StringINDEX_PARAM
     Setup parameter name of index directory, ie index.
final protected static  StringINDEX_PARAM_DEFAULT
     Default value of setup parameter index, ie index.
final protected static  StringNAMESPACE
     The XML namespace for the output document.
final protected static  StringNAME_ATTRIBUTE
     Attribute name of hit element.
final protected static  StringNAVIGATION_ELEMENT
     Child element of generated xml content, ie navigation.
final protected static  StringNAVIGATION_PAGE_ELEMENT
     Child element of generated xml content, ie navigation-page.
final protected static  StringNEXT_INDEX_ATTRIBUTE
     Attribute next-index of navigation-page element.
final protected static  StringPAGE_LENGTH_ATTRIBUTE
     Attribute page-length of results element.
final protected static  intPAGE_LENGTH_DEFAULT
    
final protected static  StringPAGE_LENGTH_PARAM
     Setup parameter name specifying the name of page-length query parameter, ie page-length.
final protected static  StringPAGE_LENGTH_PARAM_DEFAULT
    
final protected static  StringPREFIX
     The XML namespace prefix for the output document.
final protected static  StringPREVIOUS_INDEX_ATTRIBUTE
     Attribute previous-index of navigation-page element.
final protected static  StringQUERY_PARAM
     Setup the actual query from generator parameter, ie query.
final protected static  StringQUERY_STRING_ATTRIBUTE
     Attribute query-string of results element.
final protected static  StringQUERY_STRING_PARAM
     Setup parameter name specifying the name of query-string query parameter, ie query-string.
final protected static  StringQUERY_STRING_PARAM_DEFAULT
     Default value of setup parameter query-string, ie queryString.
final protected static  StringQ_FIELD_ELEMENT
     QName of child element search:field of the hit element.
final protected static  StringQ_HITS_ELEMENT
     QName of child element of generated xml content, ie search:hits.
final protected static  StringQ_HIT_ELEMENT
     QName of child element of generated xml content, ie search:hit.
final protected static  StringQ_NAVIGATION_ELEMENT
     QName of child element of generated xml content, ie search:navigation.
final protected static  StringQ_NAVIGATION_PAGE_ELEMENT
     QName of child element of generated xml content, ie search:navigation-page.
final protected static  StringQ_RESULTS_ELEMENT
     Qualified name of root element of generated xml content, ie search:results.
final protected static  StringRANK_ATTRIBUTE
     Attribute rank of hit element.
final protected static  StringRESULTS_ELEMENT
     Name of root element of generated xml content, ie results.
final protected static  StringSCORE_ATTRIBUTE
     Attribute score of hit element.
final protected static  StringSTART_INDEX_ATTRIBUTE
     Attribute start-index of results element.
final protected static  intSTART_INDEX_DEFAULT
    
final protected static  StringSTART_INDEX_NEXT_PARAM
     Setup parameter name specifying the name of start-next-index query parameter, ie start-next-index.
final protected static  StringSTART_INDEX_NEXT_PARAM_DEFAULT
     Default value of setup parameter start-next-index, ie startNextIndex.
final protected static  StringSTART_INDEX_PARAM
     Setup parameter name specifying the name of start-index query parameter, ie start-index.
final protected static  StringSTART_INDEX_PARAM_DEFAULT
     Default value of setup parameter start-index, ie startIndex.
final protected static  StringSTART_INDEX_PREVIOUS_PARAM
     Setup parameter name specifying the name of start-previous-index query parameter, ie start-previous-index.
final protected static  StringSTART_INDEX_PREVIOUS_PARAM_DEFAULT
     Default value of setup parameter start-previous-index, ie startPreviousIndex.
final protected static  StringTOTAL_COUNT_ATTRIBUTE
     Attribute total-count of hits element.
final protected static  StringURI_ATTRIBUTE
     Attribute uri of hit element.
final protected static  StringXLINK_NAMESPACE
    


Method Summary
public  voidcontextualize(Context context)
     Contextualize this class.
public  voidgenerate()
     Generate xml content describing search results.
public  voidrecycle()
    
public  voidsetup(SourceResolver resolver, Map objectModel, String src, Parameters par)
     setup all members of this generator.

Field Detail
ANALYZER_PARAM
final protected static String ANALYZER_PARAM(Code)
Setup parameter name of analyzer name, ie analyzer.



ANALYZER_PARAM_DEFAULT
final protected static String ANALYZER_PARAM_DEFAULT(Code)
Default value of analyzer parameter analyzer, ie org.apache.lucene.analysis.standard.StandardAnalyzer.



CDATA
final protected static String CDATA(Code)
Description of the Field



COUNT_OF_PAGES_ATTRIBUTE
final protected static String COUNT_OF_PAGES_ATTRIBUTE(Code)
Attribute count-of-pages of hits element. The value describes number of pages needed for all hits.



DATE_ATTRIBUTE
final protected static String DATE_ATTRIBUTE(Code)
Attribute date of results element. It contains the date a long value, indicating when a search generated this xml content.



FIELD_ELEMENT
final protected static String FIELD_ELEMENT(Code)
Child element field of the hit element. This element contains value of the stored field of a hit.



HAS_NEXT_ATTRIBUTE
final protected static String HAS_NEXT_ATTRIBUTE(Code)
Attribute has-next of navigation-page element. The value is true if a next navigation control should be presented.



HAS_PREVIOUS_ATTRIBUTE
final protected static String HAS_PREVIOUS_ATTRIBUTE(Code)
Attribute has-next of navigation-page element. The value is true if a previous navigation control should be presented.



HITS_ELEMENT
final protected static String HITS_ELEMENT(Code)
Child element of generated xml content, ie hits. This element describes all hits.



HIT_ELEMENT
final protected static String HIT_ELEMENT(Code)
Child element of generated xml content, ie hit. This element describes a single hit.



INDEX_PARAM
final protected static String INDEX_PARAM(Code)
Setup parameter name of index directory, ie index.



INDEX_PARAM_DEFAULT
final protected static String INDEX_PARAM_DEFAULT(Code)
Default value of setup parameter index, ie index.



NAMESPACE
final protected static String NAMESPACE(Code)
The XML namespace for the output document.



NAME_ATTRIBUTE
final protected static String NAME_ATTRIBUTE(Code)
Attribute name of hit element.



NAVIGATION_ELEMENT
final protected static String NAVIGATION_ELEMENT(Code)
Child element of generated xml content, ie navigation. This element describes some hints for easier navigation.



NAVIGATION_PAGE_ELEMENT
final protected static String NAVIGATION_PAGE_ELEMENT(Code)
Child element of generated xml content, ie navigation-page. This element describes the start-index of page containing hits.



NEXT_INDEX_ATTRIBUTE
final protected static String NEXT_INDEX_ATTRIBUTE(Code)
Attribute next-index of navigation-page element. The value describes the start-index of the next-to-be-presented page.



PAGE_LENGTH_ATTRIBUTE
final protected static String PAGE_LENGTH_ATTRIBUTE(Code)
Attribute page-length of results element. Echoes the pageLenth query parameter.



PAGE_LENGTH_DEFAULT
final protected static int PAGE_LENGTH_DEFAULT(Code)



PAGE_LENGTH_PARAM
final protected static String PAGE_LENGTH_PARAM(Code)
Setup parameter name specifying the name of page-length query parameter, ie page-length.



PAGE_LENGTH_PARAM_DEFAULT
final protected static String PAGE_LENGTH_PARAM_DEFAULT(Code)



PREFIX
final protected static String PREFIX(Code)
The XML namespace prefix for the output document.



PREVIOUS_INDEX_ATTRIBUTE
final protected static String PREVIOUS_INDEX_ATTRIBUTE(Code)
Attribute previous-index of navigation-page element. The value describes the start-index of the previous-to-be-presented page.



QUERY_PARAM
final protected static String QUERY_PARAM(Code)
Setup the actual query from generator parameter, ie query.



QUERY_STRING_ATTRIBUTE
final protected static String QUERY_STRING_ATTRIBUTE(Code)
Attribute query-string of results element. Echos the queryString query parameter.



QUERY_STRING_PARAM
final protected static String QUERY_STRING_PARAM(Code)
Setup parameter name specifying the name of query-string query parameter, ie query-string.



QUERY_STRING_PARAM_DEFAULT
final protected static String QUERY_STRING_PARAM_DEFAULT(Code)
Default value of setup parameter query-string, ie queryString.



Q_FIELD_ELEMENT
final protected static String Q_FIELD_ELEMENT(Code)
QName of child element search:field of the hit element.



Q_HITS_ELEMENT
final protected static String Q_HITS_ELEMENT(Code)
QName of child element of generated xml content, ie search:hits. This element describes all hits.



Q_HIT_ELEMENT
final protected static String Q_HIT_ELEMENT(Code)
QName of child element of generated xml content, ie search:hit. This element describes a single hit.



Q_NAVIGATION_ELEMENT
final protected static String Q_NAVIGATION_ELEMENT(Code)
QName of child element of generated xml content, ie search:navigation.



Q_NAVIGATION_PAGE_ELEMENT
final protected static String Q_NAVIGATION_PAGE_ELEMENT(Code)
QName of child element of generated xml content, ie search:navigation-page. This element describes the start-index of page containing hits.



Q_RESULTS_ELEMENT
final protected static String Q_RESULTS_ELEMENT(Code)
Qualified name of root element of generated xml content, ie search:results.



RANK_ATTRIBUTE
final protected static String RANK_ATTRIBUTE(Code)
Attribute rank of hit element. The value describes the count index of this hits, ranging between 0, and total-count minus 1.



RESULTS_ELEMENT
final protected static String RESULTS_ELEMENT(Code)
Name of root element of generated xml content, ie results.



SCORE_ATTRIBUTE
final protected static String SCORE_ATTRIBUTE(Code)
Attribute score of hit element. The value describes the score of this hits, ranging between 0, and 1.0.



START_INDEX_ATTRIBUTE
final protected static String START_INDEX_ATTRIBUTE(Code)
Attribute start-index of results element. Echoes the startIndex query parameter.



START_INDEX_DEFAULT
final protected static int START_INDEX_DEFAULT(Code)



START_INDEX_NEXT_PARAM
final protected static String START_INDEX_NEXT_PARAM(Code)
Setup parameter name specifying the name of start-next-index query parameter, ie start-next-index.



START_INDEX_NEXT_PARAM_DEFAULT
final protected static String START_INDEX_NEXT_PARAM_DEFAULT(Code)
Default value of setup parameter start-next-index, ie startNextIndex.



START_INDEX_PARAM
final protected static String START_INDEX_PARAM(Code)
Setup parameter name specifying the name of start-index query parameter, ie start-index.



START_INDEX_PARAM_DEFAULT
final protected static String START_INDEX_PARAM_DEFAULT(Code)
Default value of setup parameter start-index, ie startIndex.



START_INDEX_PREVIOUS_PARAM
final protected static String START_INDEX_PREVIOUS_PARAM(Code)
Setup parameter name specifying the name of start-previous-index query parameter, ie start-previous-index.



START_INDEX_PREVIOUS_PARAM_DEFAULT
final protected static String START_INDEX_PREVIOUS_PARAM_DEFAULT(Code)
Default value of setup parameter start-previous-index, ie startPreviousIndex.



TOTAL_COUNT_ATTRIBUTE
final protected static String TOTAL_COUNT_ATTRIBUTE(Code)
Attribute total-count of hits element. The value describes total number of hits found by the search engine.



URI_ATTRIBUTE
final protected static String URI_ATTRIBUTE(Code)
Attribute uri of hit element. The value describes the uri of a document matching the search query.



XLINK_NAMESPACE
final protected static String XLINK_NAMESPACE(Code)
The XML namespace for xlink





Method Detail
contextualize
public void contextualize(Context context) throws ContextException(Code)
Contextualize this class.

Especially retrieve the work directory. If the index directory is specified relativly, the working directory is used as home directory of the index directory.


Parameters:
  context - Context to use
exception:
  ContextException - If contextualizing fails.



generate
public void generate() throws IOException, SAXException, ProcessingException(Code)
Generate xml content describing search results. Entry point of the ComposerGenerator. The xml content is generated from the hits object.
exception:
  IOException - when there is a problem reading the from file system.
throws:
  SAXException - when there is a problem creating the output SAX events.
throws:
  ProcessingException - when there is a problem obtaining the hits



recycle
public void recycle()(Code)
Recycle the generator



setup
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)
setup all members of this generator.



Fields inherited from org.apache.cocoon.generation.ServiceableGenerator
protected ServiceManager manager(Code)(Java Doc)

Methods inherited from org.apache.cocoon.generation.ServiceableGenerator
public void dispose()(Code)(Java Doc)
public void service(ServiceManager manager) throws ServiceException(Code)(Java Doc)

Fields inherited from org.apache.cocoon.generation.AbstractGenerator
protected Map objectModel(Code)(Java Doc)
protected Parameters parameters(Code)(Java Doc)
protected SourceResolver resolver(Code)(Java Doc)
protected String source(Code)(Java Doc)

Methods inherited from org.apache.cocoon.generation.AbstractGenerator
public void recycle()(Code)(Java Doc)
public void setup(SourceResolver resolver, Map objectModel, String src, Parameters par) throws ProcessingException, SAXException, IOException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.