Package com.day.cq.wcm.api.designer
Interface Design
Provides methods to access design information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the node that holds special component stylesstatic final String
Name of the property that defines the doctype of a designstatic final String
Name of the property that defines components that are included when the style is generated via thegetStyle(Resource, boolean)
call -
Method Summary
Modifier and TypeMethodDescriptiongetComponentStyles
(Cell cell) Returns the component styles for the given cell.Returns the resource of the design content ornull
if this design has no content.Returns the path of the css file for this designgetDoctype
(Style currentStyle) Returns the doctype of the current style, as defined in the "cq:doctype" property.getId()
Returns the id of the design.getJSON()
Returns a json representation of this designReturns the time when the design was last modified ornull
if this information is not available or if the design has no content.getPath()
Returns the path of the designReturns the path of the static css file for this design ornull
if no such file exists.Returns the style for the given cell.Returns the style for the given cell path.Returns the style for the given resource.Returns the style for the given resourceboolean
Checks if this design has content attached.void
Writes the dynamic CSS of this design to the given writer.void
writeCssIncludes
(Writer out) Convenience method that writes the CSS include strings to the given writer.void
writeCssIncludes
(Writer out, Doctype doctype) Convenience method that writes the CSS include strings to the given writer.void
writeCssIncludes
(PageContext page) Convenience method that writes the CSS include strings to the response.
-
Field Details
-
PN_DOCTYPE
Name of the property that defines the doctype of a design- Since:
- 5.4
- See Also:
-
NN_STYLES
Name of the node that holds special component styles- Since:
- 5.4
- See Also:
-
PN_STYLE_EXCLUDED_COMPONENTS
Name of the property that defines components that are included when the style is generated via thegetStyle(Resource, boolean)
call- See Also:
-
-
Method Details
-
getPath
String getPath()Returns the path of the design- Returns:
- the path of the design
-
getId
String getId()Returns the id of the design.- Returns:
- the id of the design.
-
getContentResource
Resource getContentResource()Returns the resource of the design content ornull
if this design has no content.- Returns:
- resource or
null
- See Also:
-
hasContent
boolean hasContent()Checks if this design has content attached.- Returns:
true
if this design has content;false
otherwise.
-
getStyle
Returns the style for the given cell path. If the style is not defined and empty style is returned. Please note that this form of addressing does not respect style inheritance via the cell stack.- Parameters:
path
- the path of the cell- Returns:
- the style
-
getStyle
Returns the style for the given cell. The returned style will respect cell stack inheritance.- Parameters:
cell
- the cell- Returns:
- the style
-
getStyle
Returns the style for the given resource. Note that only the content structure of the resource is respected and not the component include hierarchy.- Parameters:
res
- resource- Returns:
- the style
- Since:
- 5.4
-
getStyle
Returns the style for the given resourceNote that only the content structure of the resource is respected and not the component include hierarchy.
The hierarchy may be modified by removing certain components based on the information from the request if the ignoreExcludedComponents parameter is set to true. Excluded components are defined in the design with the "cq:styleExcludedComponents" property.
- Parameters:
res
- the resourceignoreExcludedComponents
- whether to ignore excluded components- Returns:
- the style
- Since:
- 6.2
- See Also:
-
getCssPath
String getCssPath()Returns the path of the css file for this design- Returns:
- the path of the css file.
-
getStaticCssPath
String getStaticCssPath()Returns the path of the static css file for this design ornull
if no such file exists.- Returns:
- the path of the static css file or
null
-
writeCssIncludes
Convenience method that writes the CSS include strings to the given writer. This assumes a non XHTML doctype.- Parameters:
out
- the writer- Throws:
IOException
- if an I/O error occurs
-
writeCssIncludes
Convenience method that writes the CSS include strings to the given writer. The specified doctype ensures proper empty elements for XHTML types. Ifdoctype
isnull
,Doctype.HTML_401_STRICT
is used.- Parameters:
out
- the writerdoctype
- doctype of the document the include is written to.- Throws:
IOException
- if an I/O error occurs
-
writeCssIncludes
Convenience method that writes the CSS include strings to the response. It uses theDoctype
defined in the request or defaults toDoctype.HTML_401_STRICT
if non defined.- Parameters:
page
- the jsp page context- Throws:
IOException
- if an I/O error occurs- Since:
- 5.3
-
writeCSS
Writes the dynamic CSS of this design to the given writer.- Parameters:
out
- writer to write toincludeCustom
- iftrue
non-CSS rules are included as comments- Throws:
RepositoryException
- if a repository error occursIOException
- if an I/O error occurs
-
getDoctype
Returns the doctype of the current style, as defined in the "cq:doctype" property. If the property does not exist or ifcurrentStyle
isnull
, the property is searched on the toplevel node. the value of the property needs to be a name of aDoctype
enum. if any of the above fails,Doctype.XHTML_10_STRICT
is returned.- Parameters:
currentStyle
- current style ornull
- Returns:
- the doctype
- Since:
- 5.4
-
getComponentStyles
Returns the component styles for the given cell.- Parameters:
cell
- the cell- Returns:
- the map of component styles
- Since:
- 5.4
-
getJSON
String getJSON()Returns a json representation of this design- Returns:
- a json string
- Since:
- 5.4
-
getLastModified
Calendar getLastModified()Returns the time when the design was last modified ornull
if this information is not available or if the design has no content.- Returns:
- last modification date or
null
- Since:
- 5.4
-