Class FreemarkerQueryResolverStrategy
java.lang.Object
ch.tocco.nice2.templating.impl.freemarker.defaultvalue.FreemarkerResolverStrategy
ch.tocco.nice2.templating.impl.freemarker.defaultvalue.FreemarkerQueryResolverStrategy
- All Implemented Interfaces:
DefaultValueResolverStrategy
Resolver strategy for default values. The default value tag for relations can contain a freemarker template including
a query that is first run through the
TemplateEngine
and then processed as a query by the
QueryResolverStrategy
at the time of execution.-
Field Summary
Fields inherited from interface ch.tocco.nice2.model.base.spi.defaultvalue.spi.DefaultValueResolverStrategy
CURRENT_PRINCIPAL_VAL, CURRENT_USER_VAL, PRINCIPAL_ENTITY, USER_ENTITY
-
Constructor Summary
ConstructorDescriptionFreemarkerQueryResolverStrategy
(NiceDataModel dataModel, PrincipalService principalService, TypeManager typeManager, TemplateEngineFactory templateEngineFactory, QueryBuilderFactory queryBuilderFactory) -
Method Summary
Modifier and TypeMethodDescriptiongetResolvedValue
(DefaultValueDescriptor defaultValue) Return the display value that is presented to end users.getType()
boolean
isResolvable
(DefaultValueDescriptor descriptor) Checks whether this strategy is capable of resolving the given descriptor.Methods inherited from class ch.tocco.nice2.templating.impl.freemarker.defaultvalue.FreemarkerResolverStrategy
getTemplateValue
-
Constructor Details
-
FreemarkerQueryResolverStrategy
public FreemarkerQueryResolverStrategy(NiceDataModel dataModel, @Lazy PrincipalService principalService, TypeManager typeManager, TemplateEngineFactory templateEngineFactory, QueryBuilderFactory queryBuilderFactory)
-
-
Method Details
-
getType
- Specified by:
getType
in interfaceDefaultValueResolverStrategy
- Overrides:
getType
in classFreemarkerResolverStrategy
-
getResolvedValue
Description copied from interface:DefaultValueResolverStrategy
Return the display value that is presented to end users.- Specified by:
getResolvedValue
in interfaceDefaultValueResolverStrategy
- Overrides:
getResolvedValue
in classFreemarkerResolverStrategy
- Throws:
ResolvingException
-
isResolvable
Description copied from interface:DefaultValueResolverStrategy
Checks whether this strategy is capable of resolving the given descriptor.- Specified by:
isResolvable
in interfaceDefaultValueResolverStrategy
- Overrides:
isResolvable
in classFreemarkerResolverStrategy
-