@Component(value="cuba_ConditionDescriptorsTreeBuilder") @Scope(value="prototype") public class ConditionDescriptorsTreeBuilder extends java.lang.Object implements ConditionDescriptorsTreeBuilderAPI
Tree
of AbstractConditionDescriptor
. These
descriptors are used in a new condition dialog.Modifier and Type | Class and Description |
---|---|
protected static class |
ConditionDescriptorsTreeBuilder.ConditionDescriptorComparator |
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
AGGREGATE_JPQL_FUNCTION_PATTERN |
protected ConditionsTree |
conditionsTree |
protected static java.lang.String |
CUSTOM_CONDITIONS_PERMISSION |
protected static java.util.List<java.lang.String> |
defaultExcludedProps |
protected DynamicAttributes |
dynamicAttributes |
protected java.lang.String |
entityAlias |
protected MetaClass |
entityMetaClass |
protected java.util.List<java.lang.String> |
excludedProperties |
protected boolean |
excludePropertiesRecursively |
protected Filter |
filter |
protected java.lang.String |
filterComponentName |
protected boolean |
hideCustomConditions |
protected boolean |
hideDynamicAttributes |
protected int |
hierarchyDepth |
protected boolean |
isKeyValueMetaClass |
protected MetadataTools |
metadataTools |
protected QueryTransformerFactory |
queryTransformerFactory |
protected Security |
security |
protected java.lang.String |
storeName |
NAME
Constructor and Description |
---|
ConditionDescriptorsTreeBuilder(Filter filter,
int hierarchyDepth,
boolean hideDynamicAttributes,
boolean hideCustomConditions,
ConditionsTree conditionsTree) |
Modifier and Type | Method and Description |
---|---|
protected void |
addMultiplePropertyDescriptors(org.dom4j.Element element,
java.util.List<AbstractConditionDescriptor> descriptors,
Filter filter) |
protected void |
addMultiplePropertyDescriptors(java.lang.String includeRe,
java.lang.String excludeRe,
java.util.List<AbstractConditionDescriptor> descriptors,
Filter filter) |
Tree<AbstractConditionDescriptor> |
build() |
protected PropertyConditionDescriptor |
createConditionDescriptorForKeyValueMetaProperty(java.lang.String messagesPack,
java.lang.String propertyName,
java.lang.String propertyCaption)
Method parses the JPQL from a datasource or a dataLoader associated with a generic filter and creates a PropertyConditionDescriptor for a
KeyValueEntity property with a given name.
|
protected java.lang.String |
getFilterComponentName() |
protected boolean |
isAggregateFunction(java.lang.String expression) |
protected boolean |
isPropertyAllowed(MetaClass metaClass,
MetaProperty property) |
protected void |
recursivelyFillPropertyDescriptors(Node<AbstractConditionDescriptor> parentNode,
int currentDepth) |
protected static final java.util.List<java.lang.String> defaultExcludedProps
protected static final java.lang.String CUSTOM_CONDITIONS_PERMISSION
protected static final java.util.regex.Pattern AGGREGATE_JPQL_FUNCTION_PATTERN
protected Filter filter
protected int hierarchyDepth
protected Security security
protected java.lang.String filterComponentName
protected MetadataTools metadataTools
protected DynamicAttributes dynamicAttributes
protected java.util.List<java.lang.String> excludedProperties
protected final java.lang.String storeName
protected final MetaClass entityMetaClass
protected final java.lang.String entityAlias
protected final boolean hideDynamicAttributes
protected final boolean hideCustomConditions
protected ConditionsTree conditionsTree
protected boolean excludePropertiesRecursively
protected final boolean isKeyValueMetaClass
protected QueryTransformerFactory queryTransformerFactory
public ConditionDescriptorsTreeBuilder(Filter filter, int hierarchyDepth, boolean hideDynamicAttributes, boolean hideCustomConditions, ConditionsTree conditionsTree)
filter
- filterhierarchyDepth
- max level of properties hierarchyhideDynamicAttributes
- hide dynamic attributes conditions from wizardpublic Tree<AbstractConditionDescriptor> build()
build
in interface ConditionDescriptorsTreeBuilderAPI
@Nullable protected PropertyConditionDescriptor createConditionDescriptorForKeyValueMetaProperty(java.lang.String messagesPack, java.lang.String propertyName, java.lang.String propertyCaption)
For example, we have the following keyValueCollection:
<keyValueCollection id="myKeyValueCollectionDc">
<loader id="myKeyValueCollectionDl">
<query>select u.login, ur.role.name from sec$User u join u.userRoles ur</query>
</loader>
<properties>
<property datatype="string" name="myLogin"/>
<property datatype="string" name="myRoleName"/>
</properties>
</keyValueCollection>
When we need to build a PropertyConditionDescriptor for the "myRoleName" property then we need:
protected boolean isAggregateFunction(java.lang.String expression)
protected void recursivelyFillPropertyDescriptors(Node<AbstractConditionDescriptor> parentNode, int currentDepth)
protected void addMultiplePropertyDescriptors(org.dom4j.Element element, java.util.List<AbstractConditionDescriptor> descriptors, Filter filter)
protected void addMultiplePropertyDescriptors(java.lang.String includeRe, java.lang.String excludeRe, java.util.List<AbstractConditionDescriptor> descriptors, Filter filter)
protected boolean isPropertyAllowed(MetaClass metaClass, MetaProperty property)
protected java.lang.String getFilterComponentName()