net.grcomputing.opencms.search.lucene
Class PlainDocument

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

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

Handles Plain ResourceTypes, converting them into Lucene Documents.

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
PlainDocument()
           
 
Method Summary
 Document Document(CmsObject cmso, CmsFile f)
          Takes a Plain instance and builds a Lucene Document suitable for index generation.
 Document Document(CmsObject cmso, CmsFile f, java.util.HashMap p)
          Takes a Plain instance and builds a Lucene Document suitable for index generation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainDocument

public PlainDocument()
Method Detail

Document

public Document Document(CmsObject cmso,
                         CmsFile f,
                         java.util.HashMap p)
                  throws CmsException
Takes a Plain instance and builds a Lucene Document suitable for index generation. Note that there is really very little that we know for sure about a plain document, so indexing is fairly generic. This may return stylesheets, JavaScript, or whatever if it is handed a Plain file that contains such information.

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)
                  throws CmsException
Takes a Plain instance and builds a Lucene Document suitable for index generation. Note that there is really very little that we know for sure about a plain document, so indexing is fairly generic. This may return stylesheets, JavaScript, or whatever if it is handed a Plain file that contains such information.

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