| java.lang.Object org.apache.cocoon.bean.Target
Target | public class Target (Code) | | A Target is a single page for generation. It encapsulates the URI
arithmetic required to transform the URI of the page to be generated
(the source URI) into the URI to which the resulting page should be
written (the destination URI).
author: Upayavira version: CVS $Id: Target.java 433543 2006-08-22 06:22:54Z crossley $ |
confirmExtensions | public boolean confirmExtensions()(Code) | | boolean |
followLinks | public boolean followLinks()(Code) | | |
getDeparameterizedSourceURI | public String getDeparameterizedSourceURI()(Code) | | Gets the source URI for this target, with
parameters removed. This is the URI that is
to be passed to Cocoon in order to generate
the page.
|
getDestinationURI | public String getDestinationURI() throws ProcessingException(Code) | | Calculates the destination URI - the URI to which the generated
page should be written. This will be a URI that, when resolved
by a SourceResolver, will return a modifiableSource.
This calculation is only done once per target. It is therefore
necessary to ensure that the mime type has been set (if required)
before this method is called.
|
getExtension | public String getExtension()(Code) | | Gets the file extension for the source URI
|
getOriginalSourceURI | public String getOriginalSourceURI()(Code) | | Gets the original URI used to create this Target.
This URI is completely unprocessed.
|
getPageURI | public String getPageURI()(Code) | | Gets the filename from the source URI, without the path.
This is used to fill out relative URIs that have
parameters but no filename such as ?page=123
|
getParameters | public TreeMap getParameters()(Code) | | Gets the parameters that have been removed from
the URI. These need to be passed to Cocoon when
generating a page.
|
getParentURI | public String getParentURI()(Code) | | Gets the parent URI (the URI of the page that contained
a link to this URI). null is returned if this page was
not referred to in a link.
|
getPath | public String getPath()(Code) | | Gets the path from the source URI, without the filename.
This is used when absolutizing/relativizing link URIs.
|
getSourceURI | public String getSourceURI()(Code) | | Gets the source URI for this target, after
the URI has been 'prepared' by normalisation,
absolutization and deparameterization followed
by reparameterization. This final step is to
ensure that all parameters appear in a consistent
order. For example page?a=1&b=2 and page?b=2&a=1
should be considered the same resource, and thus
have the same sourceURI.
|
getTranslatedURI | public String getTranslatedURI(String path) throws ProcessingException(Code) | | Gets a translated version of a link, ready for insertion
into another page as a link. This link needs to be
relative to the original page.
|
hashCode | public int hashCode()(Code) | | |
setConfirmExtension | public void setConfirmExtension(boolean b)(Code) | | |
setDefaultFilename | public void setDefaultFilename(String filename)(Code) | | Sets the default filename. This filename is appended to URIs
that refer to a directory, i.e. end with a slash, as resources
referred to by such a URI cannot be written to a file system
without a filename.
This URI change will be taken into account in pages that link
to the current page.
If no default is specified, the Cocoon constants value will
be used.
|
setExtraExtension | public void setExtraExtension(String extension)(Code) | | Sets a file extension to be appended to the end of the destination
URI. The main use of this is to create broken link error files that
stand out, within the file structure of the generated site, by, for
example, adding '.error' to the end of the filename.
|
setFollowLinks | public void setFollowLinks(boolean b)(Code) | | |
setMimeType | public void setMimeType(String mimeType)(Code) | | Sets the mime type for the resource referenced by this target.
If a mime type is specified, the file extension of the
destination URI will be checked to see that it matches the
default extension for the specified mime type. If it doesn't,
the default extension will be appended to the destination URI.
This URI change will be taken into account in pages that link
to the current page.
If the mime type is not specified (and thus null), no extension
checking will take place.
|
setOriginalURI | public void setOriginalURI(String uri)(Code) | | Sets the original URI. This is used to record the URI that
caused the creation of this Target, for example as a link
in another page. It is needed for doing link translation, as
this is the URI that must be replaced by the translated one.
|
setParentURI | public void setParentURI(String uri)(Code) | | Sets the URI of the page that contained the link to this
URI. Used for reporting purposes.
|
|
|