|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.domain.ObservableDomainObject
com.arsdigita.kernel.ACSObject
com.arsdigita.kernel.Stylesheet
Nested Class Summary | |
static class |
Stylesheet.FileSource
Composite of a String and a boolean. |
Field Summary | |
static String |
versionId
|
Fields inherited from class com.arsdigita.kernel.ACSObject |
BASE_DATA_OBJECT_TYPE, CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE |
Constructor Summary | |
Stylesheet()
Creates an instance of a stylesheet. |
|
Stylesheet(BigDecimal id)
|
|
Stylesheet(DataObject dataObject)
|
|
Stylesheet(OID oid)
|
Method Summary | |
static Stylesheet |
combineStylesheets(Stylesheet[] ssList)
Loads a set of stylesheets and combines them into a single stylesheet. |
Stylesheet |
composeStylesheet(Stylesheet s)
Producer method that adds the rules of a specified stylesheet to the existing stylesheet object and returns the composed moby-stylesheet. |
static Stylesheet |
createStylesheet(String path)
|
static Stylesheet |
createStylesheet(String path,
Locale locale)
|
byte[] |
getAllStylesheetContents(javax.servlet.ServletContext ctx)
Returns a byte array that is the contents of a JAR file containing all the XSL stylesheets imported by this stylesheet plus the primary stylesheet (the root of the import tree). |
protected String |
getBaseDataObjectType()
Returns the base data object type for this domain object class. |
static String |
getDefaultOutputType()
Gets the default output type for new stylesheets. |
String |
getDisplayName()
Returns a display name for this stylesheet. |
List |
getImports()
Recurses the list of all stylesheets imported from this stylesheet, and returns a list of files. |
long |
getLastModified()
Gets the last modified time of this stylesheet, in Java system time (ms since 1970). |
Locale |
getLocale()
|
Properties |
getOutputProperties()
|
String |
getOutputType(String type)
|
String |
getPath()
Returns the pathname that was originally associated with this stylesheet object in the database. |
String |
getPrimaryStylesheetContents(javax.servlet.ServletContext ctx)
Returns a string representation of the primary stylesheet. |
List |
getSources()
Returns the list of all Filesources (with filenames relative to the context root) that should have contributed some part to this stylesheet. |
List |
getStylesheetList(javax.servlet.ServletContext ctx)
Returns a list of all stylesheet files that this stylesheet uses, including imported stylesheets (through xsl:import and xsl:include). |
void |
initialize()
Called from base class (DomainObject) constructors. |
void |
invalidate()
Marks this stylesheet as invalid. |
boolean |
isNewerThan(Stylesheet s)
Determines whether this stylesheet is newer than the specified stylesheet. |
boolean |
isValid()
Indicates whether this stylesheet is still "fresh" and valid. |
javax.xml.transform.Transformer |
newTransformer()
|
void |
setLocale(Locale locale)
|
void |
setLocale(Locale locale)
|
void |
setOutputType(String type)
|
void |
setPath(String path)
|
static void |
setTimeout(long ttl)
Sets the global lifetime for stylesheets before they are re-read. |
String |
toString()
Return the OID plus the flags N,M,D,U depending on
whether the object is new, modified, deleted, or unknown. |
Methods inherited from class com.arsdigita.kernel.ACSObject |
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getContainer, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID |
Methods inherited from class com.arsdigita.domain.ObservableDomainObject |
addObserver, getObservers |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, delete, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
Constructor Detail |
public Stylesheet()
DomainObject.DomainObject(String)
public Stylesheet(DataObject dataObject)
public Stylesheet(OID oid) throws DataObjectNotFoundException
public Stylesheet(BigDecimal id) throws DataObjectNotFoundException
Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class ACSObject
public void initialize()
ACSObject
initialize
in class ACSObject
public boolean isNewerThan(Stylesheet s)
s
- the stylesheet to compare against
true
if this stylesheet's last modified time is after
s's or if s is null; false
otherwise.public long getLastModified()
public void invalidate()
public boolean isValid()
isValid
in class DomainObject
true
if this stylesheet has not been invalidated and
the file sources on disk are all up-to-date. We only check the files
on disk every (s_ttl) milliseconds because we don't want to
constantly check the filesystem for file modifications.DataObject.isValid()
public static void setTimeout(long ttl)
public static Stylesheet combineStylesheets(Stylesheet[] ssList)
ssList
- the list of stylesheets to combine
public void setPath(String path)
public String getPath()
public String getDisplayName()
getDisplayName
in class ACSObject
ACSObject.getDisplayName()
public List getSources()
Stylesheet.FileSource
,
Stylesheet.FileSource.isValid()
public void setOutputType(String type)
public String getOutputType(String type)
public Locale getLocale()
public void setLocale(Locale locale)
public void setLocale(Locale locale)
public Stylesheet composeStylesheet(Stylesheet s)
s
- an XSL stylesheet object
public javax.xml.transform.Transformer newTransformer() throws javax.xml.transform.TransformerConfigurationException
newTransformer
in interface javax.xml.transform.Templates
javax.xml.transform.TransformerConfigurationException
public Properties getOutputProperties()
getOutputProperties
in interface javax.xml.transform.Templates
public static Stylesheet createStylesheet(String path)
public static Stylesheet createStylesheet(String path, Locale locale)
public String toString()
DomainObject
OID
plus the flags N,M,D,U depending on
whether the object is new, modified, deleted, or unknown. Unknown is for
objects that have been invalidated.
toString
in class DomainObject
public static String getDefaultOutputType()
public String getPrimaryStylesheetContents(javax.servlet.ServletContext ctx) throws IOException
ctx
- the current servlet context
IOException
public byte[] getAllStylesheetContents(javax.servlet.ServletContext ctx) throws IOException
ctx
- the current servlet context
IOException
public List getStylesheetList(javax.servlet.ServletContext ctx) throws IOException
ctx
- the current servlet context
IOException
public List getImports()
Stylesheet
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |