Package org.ametys.web.skin
Class SkinTemplateZone
java.lang.Object
org.ametys.web.skin.SkinTemplateZone
A zone definition in a template
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nizableText
Zone descriptionprotected String
Template id (e.g.The zone inheritance description.protected I18nizableText
Zone labelprotected String
Zone thumbnail 48pxprotected String
Zone thumbnail 32pxprotected String
The skin idprotected String
Zone thumbnail 16pxprotected String
The template idprotected String
Zone type (primary or secondary)protected Optional<ViewParametersModel>
The zone view parameters modelprotected Optional<ViewParametersModel>
The zone item view parameters modelstatic final String
The type of a primary zonestatic final String
The type of a secondary zone -
Constructor Summary
ConstructorDescriptionSkinTemplateZone
(String skinId, String templateId, String id, String type, I18nizableText label, I18nizableText description, String smallImage, String mediumImage, String largeImage, String inheritanceString, Optional<ViewParametersModel> viewParameters, Optional<ViewParametersModel> zoneItemViewParameters) Create a zone -
Method Summary
Modifier and TypeMethodDescriptionThe template descriptiongetId()
The template idgetInheritance
(String templateName) Get the name of the zone to inherit in the given templategetLabel()
The template labelThe large image file uriThe medium image file uriThe small image file urigetType()
Get the zone type (primary or secondary)Get the view parameters model for this zoneGet the view parameters model for zone item in this zoneboolean
Determine if this zone inherits another one
-
Field Details
-
TYPE_PRIMARY
The type of a primary zone- See Also:
-
TYPE_SECONDARY
The type of a secondary zone- See Also:
-
_skinId
The skin id -
_templateId
The template id -
_id
Template id (e.g. the directory name) -
_type
Zone type (primary or secondary) -
_label
Zone label -
_description
Zone description -
_smallImage
Zone thumbnail 16px -
_mediumImage
Zone thumbnail 32px -
_largeImage
Zone thumbnail 48px -
_inheritance
The zone inheritance description. The key is the name of a template and the value is the name of the zone in that template. This means that this zone will inherit the zone given as value in the parent page if it uses the template given as key -
_viewParameters
The zone view parameters model -
_zoneItemViewParameters
The zone item view parameters model
-
-
Constructor Details
-
SkinTemplateZone
public SkinTemplateZone(String skinId, String templateId, String id, String type, I18nizableText label, I18nizableText description, String smallImage, String mediumImage, String largeImage, String inheritanceString, Optional<ViewParametersModel> viewParameters, Optional<ViewParametersModel> zoneItemViewParameters) Create a zone- Parameters:
skinId
- The id of the skin owning the template owning the zonetemplateId
- The id of the template owning the zoneid
- The id of the zonetype
- The zone type between primary and secondary.label
- The label of the zonedescription
- The description of the zonesmallImage
- The small image to represent the zonemediumImage
- The medium image to represent the zonelargeImage
- The large image to represent the zoneinheritanceString
- The inheritance scheme following the pattern "TemplateName->,ZoneNameInThatTemplate,..." where TemplateName can be "*" or "". A completely empty string is equals to "*->CurrentZoneName". A blank string after the arrow means "no inheritance for this template".viewParameters
- the zone view parameters modelzoneItemViewParameters
- the zone item view parameters model
-
-
Method Details
-
getId
The template id- Returns:
- the id
-
getLabel
The template label- Returns:
- The label
-
getDescription
The template description- Returns:
- The description. Can not be null but can be empty
-
getSmallImage
The small image file uri- Returns:
- The small image file uri
-
getMediumImage
The medium image file uri- Returns:
- The medium image file uri
-
getLargeImage
The large image file uri- Returns:
- The large image file uri
-
hasInheritance
Determine if this zone inherits another one- Returns:
- true if a inheritance is declared.
-
getType
Get the zone type (primary or secondary)- Returns:
- the type
-
getInheritance
Get the name of the zone to inherit in the given template- Parameters:
templateName
- The name of the template. Cannot be empty, null or a joker.- Returns:
- The name of a zone in that template, or null is not applicable for this template.
-
getViewParameters
Get the view parameters model for this zone- Returns:
- the view parameters
-
getZoneItemViewParameters
Get the view parameters model for zone item in this zone- Returns:
- the view parameters
-