|
||||||||
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.usecase.AbstractUsecase org.apache.lenya.cms.usecase.DocumentUsecase
public class DocumentUsecase
Extends AbstractUsecase with document helper methods.
Some parameters are initialized by default:
document
- the document
Field Summary | |
---|---|
protected static java.lang.String |
DOCUMENT
|
protected static java.lang.String |
TARGET_DOCUMENT
|
Fields inherited from interface org.apache.lenya.cms.usecase.Usecase |
---|
ROLE |
Constructor Summary | |
---|---|
DocumentUsecase()
Ctor. |
Method Summary | |
---|---|
protected void |
doCheckPreconditions()
Checks the preconditions. |
protected org.apache.lenya.cms.publication.Document |
getSourceDocument()
Returns the source document. |
java.lang.String |
getSourceURL()
|
protected org.apache.lenya.cms.publication.Document |
getTargetDocument(boolean success)
Returns the document to be redirected to after the usecase has been completed. |
java.lang.String |
getTargetURL(boolean success)
If setTargetDocument(Document) was not called, the URL of the
source document ( getSourceDocument() ) is returned. |
protected void |
setDefaultTargetURL(java.lang.String url)
Sets the default target URL which should be used if no explicit target URL is set. |
protected void |
setTargetDocument(org.apache.lenya.cms.publication.Document document)
Sets the target document for the case that the usecase execution succeeded (see getTargetDocument(boolean) ). |
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 static final java.lang.String DOCUMENT
protected static final java.lang.String TARGET_DOCUMENT
Constructor Detail |
---|
public DocumentUsecase()
Method Detail |
---|
protected void doCheckPreconditions() throws java.lang.Exception
AbstractUsecase
doCheckPreconditions
in class AbstractUsecase
java.lang.Exception
- if an error occurs.AbstractUsecase.doCheckPreconditions()
protected org.apache.lenya.cms.publication.Document getSourceDocument()
protected void setTargetDocument(org.apache.lenya.cms.publication.Document document)
getTargetDocument(boolean)
).
document
- A document.protected org.apache.lenya.cms.publication.Document getTargetDocument(boolean success)
success
is false, the source
document is returned (override this method to change this behaviour).
success
- If the usecase was successfully completed.
public java.lang.String getTargetURL(boolean success)
setTargetDocument(Document)
was not called, the URL of the
source document ( getSourceDocument()
) is returned.
getTargetURL
in interface Usecase
getTargetURL
in class AbstractUsecase
success
- If the usecase was completed successfully.
Usecase.getTargetURL(boolean)
public java.lang.String getSourceURL()
getSourceURL
in interface Usecase
getSourceURL
in class AbstractUsecase
AbstractUsecase.getSourceURL()
protected void setDefaultTargetURL(java.lang.String url)
AbstractUsecase
setDefaultTargetURL
in class AbstractUsecase
url
- A URL string.AbstractUsecase.setDefaultTargetURL(java.lang.String)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |