org.ceryle.xnode.search
Class XNodeDocumentFactory

java.lang.Object
  extended by org.ceryle.util.search.DocumentFactory
      extended by org.ceryle.xnode.search.XNodeDocumentFactory

public class XNodeDocumentFactory
extends DocumentFactory

A utility for making Lucene Documents for XNode documents, which may contain text, wiki, HTML, XHTML or other document formats. This extends DocumentFactory only in order to inherit some common fields.

Since:
JDK1.4
Version:
$Id: XNodeDocumentFactory.java,v 1.11 2007-06-15 12:10:33 altheim Exp $
Author:
Murray Altheim

Field Summary
static String FIELD_COLLECTION
          The token identifier for the XNode's parent collection ID.
static String FIELD_CONTRIBUTOR
          The token identifier for the XNode contributor field.
static String FIELD_CREATED
          The token identifier for the XNode created date field.
static String FIELD_CREATOR
          The token identifier for the XNode creator field.
static String FIELD_DESCRIPTION
          The token identifier for the XNode description field.
static String FIELD_SUBJECT
          The token identifier for the XNode subject field.
static String FIELD_UID
          The token identifier for the XNode UID field (used by the search engine).
 
Fields inherited from class org.ceryle.util.search.DocumentFactory
FIELD_CONTENT, FIELD_MODIFIED, FIELD_SYSTEMID, FIELD_TITLE
 
Method Summary
static org.apache.lucene.document.Document createDocument(String cid, XNode xnode)
          Creates a Lucene Document provided with a Collection ID and an XNode.
static String getCreatedDate(XNode xnode)
          Returns a 'created' date as a lexicographically-significant String (not the XNode timestamp format).
static String getLastModifiedDate(XNode xnode)
          Returns a 'last modified' date as a lexicographically-significant String (not the XNode timestamp format).
static String uid(String cid, String nid, String lastmod)
          Append Collection and Node IDs and the modification date into a String in such a way that lexicographic sorting gives the same results as a walk of the database hierarchy.
 
Methods inherited from class org.ceryle.util.search.DocumentFactory
createDocument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIELD_CREATOR

public static final String FIELD_CREATOR
The token identifier for the XNode creator field. This field is equivalent to DC.Creator and is searchable on the keyword "creator:". It is also used for showing document summaries on search responses.

See Also:
Constant Field Values

FIELD_CONTRIBUTOR

public static final String FIELD_CONTRIBUTOR
The token identifier for the XNode contributor field. This field is equivalent to DC.Contributor and is searchable on the keyword "contributor:". It is also used for showing document summaries on search responses.

See Also:
Constant Field Values

FIELD_COLLECTION

public static final String FIELD_COLLECTION
The token identifier for the XNode's parent collection ID. This field is called "collection" and is searchable using the "collection:" keyword.

See Also:
Constant Field Values

FIELD_CREATED

public static final String FIELD_CREATED
The token identifier for the XNode created date field. This field is called "created" and is searchable.

See Also:
Constant Field Values

FIELD_UID

public static final String FIELD_UID
The token identifier for the XNode UID field (used by the search engine).

See Also:
Constant Field Values

FIELD_SUBJECT

public static final String FIELD_SUBJECT
The token identifier for the XNode subject field. This field is equivalent to DC.Subject and is searchable on the keyword "subject:". It is also used for showing document summaries on search responses.

See Also:
Constant Field Values

FIELD_DESCRIPTION

public static final String FIELD_DESCRIPTION
The token identifier for the XNode description field. This field is equivalent to DC.Description and is searchable on the keyword "description:". It is also used for showing document summaries on search responses.

See Also:
Constant Field Values
Method Detail

uid

public static String uid(String cid,
                         String nid,
                         String lastmod)
Append Collection and Node IDs and the modification date into a String in such a way that lexicographic sorting gives the same results as a walk of the database hierarchy. Thus null () is used both to separate collection/node components and to separate the path from the date.


createDocument

public static org.apache.lucene.document.Document createDocument(String cid,
                                                                 XNode xnode)
                                                          throws XNodeException,
                                                                 InterruptedException
Creates a Lucene Document provided with a Collection ID and an XNode.

Throws:
XNodeException
InterruptedException

getCreatedDate

public static String getCreatedDate(XNode xnode)
Returns a 'created' date as a lexicographically-significant String (not the XNode timestamp format).


getLastModifiedDate

public static String getLastModifiedDate(XNode xnode)
Returns a 'last modified' date as a lexicographically-significant String (not the XNode timestamp format). If the XNode's "last modified" date is null, the created date (which cannot be) is used.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.