|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.lenya.cms.publication.DefaultDocumentBuilder
public class DefaultDocumentBuilder
Default document builder implementation.
Field Summary | |
---|---|
protected org.apache.avalon.framework.service.ServiceManager |
manager
|
Fields inherited from interface org.apache.lenya.cms.publication.DocumentBuilder |
---|
ROLE |
Constructor Summary | |
---|---|
DefaultDocumentBuilder()
Ctor. |
Method Summary | |
---|---|
protected java.lang.String |
buildCanonicalDocumentUrl(DocumentFactory factory,
DocumentLocator locator)
Builds the canonical document URL. |
java.lang.String |
buildCanonicalUrl(DocumentFactory factory,
DocumentLocator doc)
Builds an URL corresponding to a CMS document. |
protected java.lang.String |
getExtension(java.lang.String url)
Returns the extension of a URL. |
protected java.lang.String |
getLanguage(java.lang.String urlWithoutSuffix)
Returns the language of a URL. |
DocumentLocator |
getLocator(DocumentFactory factory,
java.lang.String webappUrl)
Returns a document for a web application URL. |
protected DocumentLocator |
getLocatorWithoutCheck(DocumentFactory factory,
java.lang.String webappUrl)
Creates a document locator for a webapp URL without checking if the webapp URL refers to a locator first. |
boolean |
isDocument(DocumentFactory factory,
java.lang.String url)
Checks if an URL corresponds to a CMS document. |
boolean |
isValidDocumentName(java.lang.String documentName)
Checks if a document name is valid. |
protected java.lang.String |
removeExtensions(java.lang.String url)
Removes all "." |
void |
service(org.apache.avalon.framework.service.ServiceManager manager)
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.avalon.framework.service.ServiceManager manager
Constructor Detail |
---|
public DefaultDocumentBuilder()
Method Detail |
---|
public void service(org.apache.avalon.framework.service.ServiceManager manager)
service
in interface org.apache.avalon.framework.service.Serviceable
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
protected java.lang.String removeExtensions(java.lang.String url)
/foo.print.html
is transformed to /foo
).
url
- The URL to trim.
protected java.lang.String getLanguage(java.lang.String urlWithoutSuffix)
urlWithoutSuffix
- The URL without the suffix.
protected java.lang.String getExtension(java.lang.String url)
url
- The URL.
public boolean isDocument(DocumentFactory factory, java.lang.String url) throws DocumentBuildException
DocumentBuilder
isDocument
in interface DocumentBuilder
factory
- The document factory.url
- The URL of the form /{publication-id}/...
DocumentBuildException
- when something went wrong.DocumentBuilder.isDocument(DocumentFactory,
String)
protected java.lang.String buildCanonicalDocumentUrl(DocumentFactory factory, DocumentLocator locator)
factory
- The document factory.locator
- The document locator.
public java.lang.String buildCanonicalUrl(DocumentFactory factory, DocumentLocator doc)
DocumentBuilder
buildCanonicalUrl
in interface DocumentBuilder
factory
- The document factory.doc
- The locator.
public DocumentLocator getLocator(DocumentFactory factory, java.lang.String webappUrl) throws DocumentBuildException
DocumentBuilder
getLocator
in interface DocumentBuilder
factory
- The factory.webappUrl
- The web application URL.
DocumentBuildException
- if an error occurs.protected DocumentLocator getLocatorWithoutCheck(DocumentFactory factory, java.lang.String webappUrl) throws DocumentBuildException
factory
- The document factory.webappUrl
- The webapp URL.
null
if the URL doesn't
refer to a locator.
DocumentBuildException
- if an error occurs.public boolean isValidDocumentName(java.lang.String documentName)
DocumentBuilder
isValidDocumentName
in interface DocumentBuilder
documentName
- The document name.
DocumentBuilder.isValidDocumentName(java.lang.String)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |