@Target(value=TYPE) @Retention(value=RUNTIME) @Repeatable(value=AllowedChildrenConfig.class) public @interface AllowedChildren
AllowedChildren
annotation represents a single rule. One can specify any number of rules that are considered in the given order. If
an "empty" rule is specified, the current container doesn't allow any childrenAllowedChildrenConfig
Modifier and Type | Optional Element and Description |
---|---|
Class<?>[] |
classes
Used to specify the allowed children for the container.
|
PolicyMergeMode |
mode
Used to specify the mode of merging policies defined via
value() with original component
policies (designs). |
String[] |
pagePaths
Used to specify paths of the pages to which the current rule should be applied.
|
String[] |
pageResourceTypes
Used to specify page resource types to which the current rule is applied.
|
String[] |
parents
Used to specify resource types and/or groups of parent components.
|
String[] |
resourceNames
Used to specify node names of "parsys-like" containers to which the current rule should be applied.
|
PolicyTarget |
targetContainer
Used to specify target node for rules.
|
String[] |
templates
Used to specify page templates to which the current rule is applied.
|
String[] |
value
Used to specify the allowed children for the container.
|
public abstract Class<?>[] classes
This setting is combined with the data specified in value()
. If neither value
nor classes
are specified, no child components are allowed
Class
referencespublic abstract PolicyMergeMode mode
value()
with original component
policies (designs).
PolicyMergeMode.OVERRIDE
(default) removes from the component selection menu all the entries that are
defined by the conventional policy (design) and shows only the entries defined by AllowedChildren
;
PolicyMergeMode.MERGE
adds entries defined by AllowedChildren
to the original listPolicyMergeMode
optionspublic abstract String[] pagePaths
You can use wildcards, e.g. "/content/we-retail/language-masters/en/*", "*en/experience",
"*language-masters/en*"
.
String
value, or an array of stringspublic abstract String[] pageResourceTypes
You can use wildcards, e.g. "acme/pages/design2/*", "*design2/homepage",
"*pages/design2/*"
.
String
value, or an array of stringspublic abstract String[] parents
You can use wildcards, e.g. "acme/pages/design2/*", "*design2/homepage",
"*pages/design2/*"
.
Note: every item can represent either a single parent or a "chain" - a succession of
parents/groups. In this case, successive parents are divided with a space. E.g. "acme/pages/design2/*
*design2/homepage *pages/design2/*"
means that among the parents of the current resource there must be a component
with resource type matching "acme/pages/design2/*", and below it there must be another component with resource
type matching "*design2/homepage". They need not be direct parent and child: any level of nesting is allowed.
This works much like a sequence of CSS selectors.
Note: If you use sequences of parents within one entry and one of them is a group with a space in its
name, you should escape it with single quotes or backticks. E.g. "acme/pages/design2/* group:'My Group
Name' group:GroupName *pages/design2/*"
String
value, or an array of stringspublic abstract String[] resourceNames
String
value, or an array of stringspublic abstract PolicyTarget targetContainer
PolicyTarget.CURRENT
the rule applies
to the current annotated component. Otherwise, the rule is applied to a container nested within the current
component. E.g. if the current component is an inheritor of parsys, setting targetContainer
to PolicyTarget.CURRENT
means that the rule affects which components can be added to the current
one. But if the current component contains a parsys inside you need to skip targetContainer
or set it to
PolicyTarget.CHILD
so that the rule applies to the parsys.
Note: if the component contains more than one parsys, you can specify the particular target for the
rule using the resourceNames
setting
PolicyTarget
valuepublic abstract String[] templates
You can use wildcards, e.g. "/conf/acme/settings/wcm/*", "*templates/design2/homepage",
"*templates/design2/*"
.
String
value, or an array of stringspublic abstract String[] value
"acme/components/content/button", "group:My
Components"
This setting is combined with the data specified in classes()
. If neither
value
nor classes
are specified, no child components are allowed
String
values, non-blankCopyright © 2024 Exadel, Inc.. All rights reserved.