Package com.day.cq.wcm.api.designer
Interface Designer
-
@ProviderType public interface Designer
Specifies the interface of the designer. It provides methods for retrieving design information. Designs mirror the contents structure to some extend. The pages hold path references to the designs. If not path reference is specified or not inherited, the default design provided bygetDefaultDesign()is used.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_DESIGN_PATHDeprecated.since 5.8.static java.lang.StringDESIGN_HOMEDeprecated.since 5.8.static java.lang.StringNT_DESIGNnode type for design nodes.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DesigngetDefaultDesign()Returns the defaultDesignDesigngetDesign(Page page)Returns the design for the given page.DesigngetDesign(java.lang.String id)Returns a design by id.java.lang.StringgetDesignPath(Page page)Returns the path to the design of the given page.StylegetStyle(Resource res)Returns the style for a given resource.StylegetStyle(Resource res, java.lang.String cellPath)Returns the style for a given resource and cell path.booleanhasDesign(java.lang.String id)Checks if the design with the given id exists.
-
-
-
Field Detail
-
DESIGN_HOME
static final java.lang.String DESIGN_HOME
Deprecated.since 5.8.Home of the designs- See Also:
- Constant Field Values
-
DEFAULT_DESIGN_PATH
static final java.lang.String DEFAULT_DESIGN_PATH
Deprecated.since 5.8. usegetDefaultDesign()instead.path to default design- See Also:
- Constant Field Values
-
NT_DESIGN
static final java.lang.String NT_DESIGN
node type for design nodes. use pages for now.- See Also:
- Constant Field Values
-
-
Method Detail
-
getDesignPath
java.lang.String getDesignPath(Page page)
Returns the path to the design of the given page. If it does not specify such a path, the page's parent design path is returned or if the page does not have a parent, default designgetDefaultDesign()is returned- Parameters:
page- the page- Returns:
- the design path or
nullifpageisnull;
-
getDesign
Design getDesign(Page page)
Returns the design for the given page.- Parameters:
page- the page to retrieve the design from.- Returns:
- the design or
nullif thepageisnull.
-
hasDesign
boolean hasDesign(java.lang.String id)
Checks if the design with the given id exists.- Parameters:
id- the design id- Returns:
- true if the design exists.
-
getDesign
Design getDesign(java.lang.String id)
Returns a design by id.- Parameters:
id- id of the design- Returns:
- the design or the default design if it does not exist.
- See Also:
Design.getId()
-
getStyle
Style getStyle(Resource res, java.lang.String cellPath)
Returns the style for a given resource and cell path. It's a convenience method that retrieves the containing page of the resource, resolves its design and then gets the style. ifcellPathisnullthe name of the resource is used.- Parameters:
res- the resourcecellPath- the path of the design cell- Returns:
- the style or
null - See Also:
PageManager.getContainingPage(Resource),getDesign(Page),Design.getStyle(String)
-
getStyle
Style getStyle(Resource res)
Returns the style for a given resource. It's a convenience method that retrieves the containing page of the resource, resolves its design and then gets the style. the cell path is constructed by walking the content path.- Parameters:
res- the resource- Returns:
- the style or
null - See Also:
PageManager.getContainingPage(Resource),getDesign(Page),Design.getStyle(String)
-
-