org.apache.lenya.cms.publication
Class PageEnvelope

java.lang.Object
  extended by org.apache.lenya.cms.publication.PageEnvelope

public class PageEnvelope
extends java.lang.Object

A page envelope carries a set of information that are needed during the presentation of a document.


Field Summary
static java.lang.String AREA
          AREA The area
static java.lang.String BREADCRUMB_PREFIX
          BREADCRUMB_PREFIX The breadcrumb prefix of the publication, used for navigation
static java.lang.String CONTEXT
          CONTEXT The context prefix
static java.lang.String DEFAULT_LANGUAGE
          DEFAULT_LANGUAGE The default language of the publication
static java.lang.String DEFAULT_PREFIX
          DEFAULT_PREFIX The default prefix
static java.lang.String DOCUMENT
          DOCUMENT The current document
static java.lang.String DOCUMENT_EXTENSION
          DOCUMENT_EXTENSION The extension of the current document
static java.lang.String DOCUMENT_FILE
          DOCUMENT_FILE The file of the current document
static java.lang.String DOCUMENT_ID
          DOCUMENT_ID The document id of the current document
static java.lang.String DOCUMENT_LABEL
          DOCUMENT_LABEL The label of the current document
static java.lang.String DOCUMENT_LANGUAGE
          DOCUMENT_LANGUAGE The language of the current document
static java.lang.String DOCUMENT_LANGUAGES
          DOCUMENT_LANGUAGES The languages the current document is available in
static java.lang.String DOCUMENT_LANGUAGES_CSV
          DOCUMENT_LANGUAGES_CSV The languages the current document is available in, comma-seperated
static java.lang.String DOCUMENT_LASTMODIFIED
          DOCUMENT_LASTMODIFIED The last modified date of the current document
static java.lang.String DOCUMENT_NAME
          DOCUMENT_NAME The name of the current document
static java.lang.String DOCUMENT_PARENT
          DOCUMENT_PARENT The document id of the parent document
static java.lang.String DOCUMENT_PATH
          DOCUMENT_PATH The path of the current document
static java.lang.String DOCUMENT_SOURCE_EXTENSION
          DOCUMENT_SOURCE_EXTENSION The source extension of the current document
static java.lang.String DOCUMENT_TYPE
          DOCUMENT_TYPE The type of the current document
static java.lang.String DOCUMENT_URL
          DOCUMENT_URL The URL of the current document
static java.lang.String DOCUMENT_URL_WITHOUT_LANGUAGE
          DOCUMENT_URL_WITHOUT_LANGUAGE The URL of the current document without a language extension.
static java.lang.String DOCUMENT_UUID
          DOCUMENT_UUID The uuid of the current document
static java.lang.String IS_PUBLICATION
          IS_PUBLICATION If the current URL refers to a publication ("true" or "false").
static java.lang.String LANGUAGE
          This attribute returns the document language if the document exists, or the default language otherwise.
static java.lang.String NAMESPACE
          NAMESPACE The page envelope namespace
static java.lang.String[] PARAMETER_NAMES
          The names of the page envelope parameters.
static java.lang.String PUBLICATION
          PUBLICATION The publication
static java.lang.String PUBLICATION_ID
          PUBLICATION_ID The publication id
static java.lang.String PUBLICATION_LANGUAGES_CSV
          PUBLICATION_LANGUAGES_CSV A list of the publication's languages, comma-seperated
static java.lang.String SSL_PREFIX
          SSL_PREFIX The SSL prefix of the publication
 
Constructor Summary
protected PageEnvelope()
          Constructor.
  PageEnvelope(DocumentFactory map, java.lang.String contextPath, java.lang.String webappUrl, java.io.File servletContext, Publication publication)
          Creates a page envelope from an object model.
 
Method Summary
protected  java.lang.String createExceptionMessage(org.apache.cocoon.environment.Request request)
          Creates the message to report when creating the envelope failed.
 java.lang.String getArea()
           
 java.lang.String getContext()
          Returns the context, e.g.
 Document getDocument()
          Returns the document or null if the current URL does not represent a document.
 DocumentFactory getDocumentFactory()
          Returns the document factory.
 java.lang.String getDocumentPath()
          Returns the document-path.
 java.lang.String getLanguage()
           
 Publication getPublication()
          Returns the publication of this PageEnvelope.
 RCEnvironment getRCEnvironment()
          Deprecated. We should detach the RC environment from the page envelope.
protected  void setContext(java.lang.String string)
           
 void setDocument(Document _document)
          Sets the document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_NAMES

public static final java.lang.String[] PARAMETER_NAMES
The names of the page envelope parameters.


PUBLICATION_ID

public static final java.lang.String PUBLICATION_ID
PUBLICATION_ID The publication id

See Also:
Constant Field Values

PUBLICATION

public static final java.lang.String PUBLICATION
PUBLICATION The publication

See Also:
Constant Field Values

IS_PUBLICATION

public static final java.lang.String IS_PUBLICATION
IS_PUBLICATION If the current URL refers to a publication ("true" or "false").

See Also:
Constant Field Values

PUBLICATION_LANGUAGES_CSV

public static final java.lang.String PUBLICATION_LANGUAGES_CSV
PUBLICATION_LANGUAGES_CSV A list of the publication's languages, comma-seperated

See Also:
Constant Field Values

CONTEXT

public static final java.lang.String CONTEXT
CONTEXT The context prefix

See Also:
Constant Field Values

AREA

public static final java.lang.String AREA
AREA The area

See Also:
Constant Field Values

DEFAULT_LANGUAGE

public static final java.lang.String DEFAULT_LANGUAGE
DEFAULT_LANGUAGE The default language of the publication

See Also:
Constant Field Values

DOCUMENT

public static final java.lang.String DOCUMENT
DOCUMENT The current document

See Also:
Constant Field Values

DOCUMENT_ID

public static final java.lang.String DOCUMENT_ID
DOCUMENT_ID The document id of the current document

See Also:
Constant Field Values

DOCUMENT_PARENT

public static final java.lang.String DOCUMENT_PARENT
DOCUMENT_PARENT The document id of the parent document

See Also:
Constant Field Values

DOCUMENT_NAME

public static final java.lang.String DOCUMENT_NAME
DOCUMENT_NAME The name of the current document

See Also:
Constant Field Values

DOCUMENT_TYPE

public static final java.lang.String DOCUMENT_TYPE
DOCUMENT_TYPE The type of the current document

See Also:
Constant Field Values

DOCUMENT_LABEL

public static final java.lang.String DOCUMENT_LABEL
DOCUMENT_LABEL The label of the current document

See Also:
Constant Field Values

DOCUMENT_URL

public static final java.lang.String DOCUMENT_URL
DOCUMENT_URL The URL of the current document

See Also:
Constant Field Values

DOCUMENT_URL_WITHOUT_LANGUAGE

public static final java.lang.String DOCUMENT_URL_WITHOUT_LANGUAGE
DOCUMENT_URL_WITHOUT_LANGUAGE The URL of the current document without a language extension.

See Also:
Constant Field Values

DOCUMENT_FILE

public static final java.lang.String DOCUMENT_FILE
DOCUMENT_FILE The file of the current document

See Also:
Constant Field Values

DOCUMENT_PATH

public static final java.lang.String DOCUMENT_PATH
DOCUMENT_PATH The path of the current document

See Also:
Constant Field Values

DOCUMENT_EXTENSION

public static final java.lang.String DOCUMENT_EXTENSION
DOCUMENT_EXTENSION The extension of the current document

See Also:
Constant Field Values

DOCUMENT_SOURCE_EXTENSION

public static final java.lang.String DOCUMENT_SOURCE_EXTENSION
DOCUMENT_SOURCE_EXTENSION The source extension of the current document

See Also:
Constant Field Values

DOCUMENT_UUID

public static final java.lang.String DOCUMENT_UUID
DOCUMENT_UUID The uuid of the current document

See Also:
Constant Field Values

DOCUMENT_LANGUAGE

public static final java.lang.String DOCUMENT_LANGUAGE
DOCUMENT_LANGUAGE The language of the current document

See Also:
Constant Field Values

LANGUAGE

public static final java.lang.String LANGUAGE
This attribute returns the document language if the document exists, or the default language otherwise. This makes it suitable for 404 pages.

See Also:
Constant Field Values

DOCUMENT_LANGUAGES

public static final java.lang.String DOCUMENT_LANGUAGES
DOCUMENT_LANGUAGES The languages the current document is available in

See Also:
Constant Field Values

DOCUMENT_LANGUAGES_CSV

public static final java.lang.String DOCUMENT_LANGUAGES_CSV
DOCUMENT_LANGUAGES_CSV The languages the current document is available in, comma-seperated

See Also:
Constant Field Values

DOCUMENT_LASTMODIFIED

public static final java.lang.String DOCUMENT_LASTMODIFIED
DOCUMENT_LASTMODIFIED The last modified date of the current document

See Also:
Constant Field Values

BREADCRUMB_PREFIX

public static final java.lang.String BREADCRUMB_PREFIX
BREADCRUMB_PREFIX The breadcrumb prefix of the publication, used for navigation

See Also:
Constant Field Values

SSL_PREFIX

public static final java.lang.String SSL_PREFIX
SSL_PREFIX The SSL prefix of the publication

See Also:
Constant Field Values

NAMESPACE

public static final java.lang.String NAMESPACE
NAMESPACE The page envelope namespace

See Also:
Constant Field Values

DEFAULT_PREFIX

public static final java.lang.String DEFAULT_PREFIX
DEFAULT_PREFIX The default prefix

See Also:
Constant Field Values
Constructor Detail

PageEnvelope

protected PageEnvelope()
Constructor.


PageEnvelope

public PageEnvelope(DocumentFactory map,
                    java.lang.String contextPath,
                    java.lang.String webappUrl,
                    java.io.File servletContext,
                    Publication publication)
             throws PageEnvelopeException
Creates a page envelope from an object model.

Parameters:
map - The identity map to use.
contextPath - The servlet context prefix.
webappUrl - The web application URL.
servletContext - The servlet context directory.
publication - The publication.
Throws:
PageEnvelopeException - when something went wrong.
Method Detail

getDocumentFactory

public DocumentFactory getDocumentFactory()
Returns the document factory.

Returns:
A document factory.

createExceptionMessage

protected java.lang.String createExceptionMessage(org.apache.cocoon.environment.Request request)
Creates the message to report when creating the envelope failed.

Parameters:
request - The request.
Returns:
A string.

getPublication

public Publication getPublication()
Returns the publication of this PageEnvelope.

Returns:
a Publication value

getArea

public java.lang.String getArea()
Returns:
The current area.

getRCEnvironment

public RCEnvironment getRCEnvironment()
Deprecated. We should detach the RC environment from the page envelope.

Returns the rcEnvironment.

Returns:
a RCEnvironment value

getContext

public java.lang.String getContext()
Returns the context, e.g. "/lenya".

Returns:
a String value

getDocumentPath

public java.lang.String getDocumentPath()
Returns the document-path.

Returns:
a File value

setContext

protected void setContext(java.lang.String string)
Parameters:
string - The context.

getDocument

public Document getDocument()
Returns the document or null if the current URL does not represent a document.

Returns:
A document

setDocument

public void setDocument(Document _document)
Sets the document.

Parameters:
_document - A document.

getLanguage

public java.lang.String getLanguage()
Returns:
The document language or the default language if the document doesn't exist.
See Also:
LANGUAGE


Copyright 1999-2006 Apache Software Foundation. All Rights Reserved.