Class RelevantCharacteristicAdditionalPropertyResolver
- java.lang.Object
-
- org.openbravo.client.kernel.reference.materialmgmt.RelevantCharacteristicAdditionalPropertyResolver
-
- All Implemented Interfaces:
Prioritizable
,AdditionalPropertyResolver
public class RelevantCharacteristicAdditionalPropertyResolver extends Object implements AdditionalPropertyResolver
Resolves additional properties that reference to relevant characteristics and provides the data source properties required to filter and sort by the characteristic values linked to the relevant characteristic in the client side.
-
-
Constructor Summary
Constructors Constructor Description RelevantCharacteristicAdditionalPropertyResolver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canResolve(Entity entity, String additionalProperty)
Determines if the value of the given property can be resolved for the business objects of the given entity.List<DataSourceProperty>
getDataSourceProperties(Entity entity, String additionalProperty)
Provides the list ofDataSourceProperty
that must be included in the standard data sources when the provided entity and additional property are requested.Set<String>
getPropertyNames(Entity entity)
Retrieves the set of names of the additional properties that can be resolved with thisAdditionalPropertyResolver
for the givenEntity
.Map<String,Object>
resolve(BaseOBObject bob, String additionalProperty)
Resolves an additional property.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openbravo.base.Prioritizable
getPriority
-
-
-
-
Method Detail
-
canResolve
public boolean canResolve(Entity entity, String additionalProperty)
Description copied from interface:AdditionalPropertyResolver
Determines if the value of the given property can be resolved for the business objects of the given entity.- Specified by:
canResolve
in interfaceAdditionalPropertyResolver
- Parameters:
entity
- The entity that may be linked to the given property, although without having direct relationship through the data modeladditionalProperty
- The additional property path- Returns:
true
if the value of the property can be resolved with thisAdditionalPropertyResolver
or in any other case
-
resolve
public Map<String,Object> resolve(BaseOBObject bob, String additionalProperty)
Description copied from interface:AdditionalPropertyResolver
Resolves an additional property. If null or an empty map is returned, then the additional property will be tried to be resolved with anAdditionalPropertyResolver
with less priority, if any. If there is noAdditionalPropertyResolver
returning a map with values, then the standard logic of theDataToJsonConverter
will be used to resolve the additional property.- Specified by:
resolve
in interfaceAdditionalPropertyResolver
- Parameters:
bob
- The sourceBaseOBObject
additionalProperty
- The path to the additional property to be resolved- Returns:
- a Map with the values resolved for the additional property where the keys are the property names and values are the property values
- See Also:
DataToJsonConverter.toJsonObject(org.openbravo.base.structure.BaseOBObject, org.openbravo.service.json.DataResolvingMode)
-
getDataSourceProperties
public List<DataSourceProperty> getDataSourceProperties(Entity entity, String additionalProperty)
Description copied from interface:AdditionalPropertyResolver
Provides the list ofDataSourceProperty
that must be included in the standard data sources when the provided entity and additional property are requested. This is needed in order to support filtering and sorting in the client side by the given additional property. If null or an empty list is returned, then the properties will be tried to be retrieved with anAdditionalPropertyResolver
with less priority, if any. If there is noAdditionalPropertyResolver
returning a list with properties, then no data source properties will be added for the given additional property.- Specified by:
getDataSourceProperties
in interfaceAdditionalPropertyResolver
- Parameters:
entity
- The base entityadditionalProperty
- The additional property path- Returns:
- the list of
DataSourceProperty
to be included in the data source - See Also:
DefaultDataSourceService.getDataSourceProperties(java.util.Map<java.lang.String, java.lang.Object>)
-
getPropertyNames
public Set<String> getPropertyNames(Entity entity)
Description copied from interface:AdditionalPropertyResolver
Retrieves the set of names of the additional properties that can be resolved with thisAdditionalPropertyResolver
for the givenEntity
. It is used to display these names as part of the list of available properties calculated by theModelDataSourceService
.- Specified by:
getPropertyNames
in interfaceAdditionalPropertyResolver
- Parameters:
entity
- The entity whose additional properties would be resolved- Returns:
- the set of names of the additional properties that can be resolved for the given entity
with this
AdditionalPropertyResolver
- See Also:
ModelDataSourceService.fetch(java.util.Map<java.lang.String, java.lang.String>)
-
-