net.grcomputing.opencms.search.lucene
Class JspDocument

java.lang.Object
  |
  +--net.grcomputing.opencms.search.lucene.JspDocument
All Implemented Interfaces:
I_DocumentConstants, I_DocumentFactory

public class JspDocument
extends java.lang.Object
implements I_DocumentConstants, I_DocumentFactory

This class serves as a document factory for OpenCMS resources. It produces Lucene Document objects that contain the correct fields for indexing OpenCMS resources. Unlike some of the other Lucene implementations, this one is highly coupled with the OpenCMS API - thereby taking advantage of properties security settings, etc.

Essentially, the main purpose of this method is to provide factories for Document instances that are specific to the types of resources in OpenCMS. For instance, we know that a Page will have a name, a title, and probably description and keywords. We also know that it is an XML document with HTML stored in the CDATA section. These bits of information provide information that we can use to generate an appropriate Document representation.

Author:
Matt Butcher mbutcher@grcomputing.net
See Also:
http://grcomputing.net

Field Summary
 
Fields inherited from interface net.grcomputing.opencms.search.lucene.I_DocumentConstants
FIELD_BODY, FIELD_DESC, FIELD_INITIAL_ADD, FIELD_KEYWORDS, FIELD_LAST_MOD, FIELD_PATH, FIELD_TITLE
 
Constructor Summary
JspDocument()
           
 
Method Summary
 Document Document(CmsObject cmso, CmsFile f)
          Right now, this is just a convenience function that calls BodylessDocument.
 Document Document(CmsObject cmso, CmsFile f, java.util.HashMap params)
          Right now, this is just a convenience function that calls BodylessDocument.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspDocument

public JspDocument()
Method Detail

Document

public Document Document(CmsObject cmso,
                         CmsFile f)
                  throws CmsException
Right now, this is just a convenience function that calls BodylessDocument. In the future, this may be extended to grab pCDATA out of the body for indexing (e.g. to search for text at the beginning of a form field.). Generally, it is not advisable to search JSP pages unless you know for a fact that they can be called correctly from a search engine link.

Specified by:
Document in interface I_DocumentFactory
Throws:
CmsException - it cannot work with the CmsFile or CmsObject.

Document

public Document Document(CmsObject cmso,
                         CmsFile f,
                         java.util.HashMap params)
                  throws CmsException
Right now, this is just a convenience function that calls BodylessDocument. In the future, this may be extended to grab pCDATA out of the body for indexing (e.g. to search for text at the beginning of a form field.). Generally, it is not advisable to search JSP pages unless you know for a fact that they can be called correctly from a search engine link.

Specified by:
Document in interface I_DocumentFactory
Throws:
CmsException - it cannot work with the CmsFile or CmsObject.


Copyright © 2003 Matt Butcher of Global Resources for Computing. Reporoduction and modification of this documents are allowed as in accordance with the GPL v2. Refer to COPYING.txt for information on acceptible use