@Component(value="cuba_RelatedEntities") public class RelatedEntitiesBean extends java.lang.Object implements RelatedEntitiesAPI
Modifier and Type | Class and Description |
---|---|
protected static class |
RelatedEntitiesBean.MetaDataDescriptor |
RelatedEntitiesAPI.RelatedScreenDescriptor
Modifier and Type | Field and Description |
---|---|
protected ExtendedEntities |
extendedEntities |
protected FilterParser |
filterParser |
protected Messages |
messages |
protected MessageTools |
messageTools |
protected Metadata |
metadata |
protected MetadataTools |
metadataTools |
protected ConditionParamBuilder |
paramBuilder |
protected RelatedEntitiesService |
relatedEntitiesService |
protected UserSessionSource |
userSessionSource |
protected WindowConfig |
windowConfig |
protected WindowManagerProvider |
windowManagerProvider |
NAME
Constructor and Description |
---|
RelatedEntitiesBean() |
Modifier and Type | Method and Description |
---|---|
protected void |
applyFilter(Filter component,
java.util.Collection<? extends Entity> selectedParents,
RelatedEntitiesAPI.RelatedScreenDescriptor descriptor,
RelatedEntitiesBean.MetaDataDescriptor metaDataDescriptor) |
RelatedEntitiesBuilder |
builder(FrameOwner frameOwner)
Creates a related screen builder.
|
protected Screen |
buildScreen(RelatedEntitiesBuilder builder) |
protected Screen |
createScreen(RelatedEntitiesBuilder builder,
MetaClass metaClass,
MetaProperty metaProperty) |
protected org.dom4j.Element |
getConditionXmlElement(java.lang.String conditionName,
MetaClass metaClass) |
protected MetaClass |
getFilterMetaClass(Filter filter) |
protected AbstractCondition |
getManyToManyCondition(java.util.List<java.lang.Object> parentIds,
MetaClass metaClass,
java.lang.String filterComponentName,
java.lang.String relatedPrimaryKey,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
protected AbstractCondition |
getManyToOneCondition(java.util.List<java.lang.Object> parentIds,
MetaClass metaClass,
java.lang.String filterComponentName,
java.lang.String relatedPrimaryKey,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
protected MetaClass |
getMetaClassNN(RelatedEntitiesBuilder builder) |
protected MetaProperty |
getMetaPropertyNN(RelatedEntitiesBuilder builder,
MetaClass metaClass) |
protected PropertyCondition |
getNonOptimizedCondition(MetaClass metaClass,
java.util.List<java.lang.Object> ids,
Filter component,
java.lang.String filterComponentName,
java.lang.String primaryKey) |
protected AbstractCondition |
getOneToManyCondition(java.util.List<java.lang.Object> parentIds,
MetaClass metaClass,
java.lang.String filterComponentName,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
protected AbstractCondition |
getOptimizedCondition(java.util.List<java.lang.Object> parentIds,
MetaClass metaClass,
java.lang.String filterComponentName,
java.lang.String relatedPrimaryKey,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
protected CustomCondition |
getParentEntitiesCondition(java.util.List<java.lang.Object> parentIds,
java.lang.String parentPrimaryKey,
MetaClass metaClass,
java.lang.String filterComponentName,
MetaClass parentMetaClass) |
protected Param |
getParentEntitiesParam(java.util.List<java.lang.Object> parentIds,
java.lang.String parentPrimaryKey,
MetaClass metaClass,
java.lang.Class parentPrimaryKeyClass,
java.lang.String paramName,
MetaClass parentMetaClass) |
protected java.util.List<java.lang.Object> |
getParentIds(java.util.Collection<? extends Entity> selectedParents) |
protected java.lang.String |
getRelatedEntitiesFilterXml(MetaClass relatedMetaCLass,
java.util.Collection<? extends Entity> selectedEntities,
Filter component,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
protected java.util.List<java.lang.Object> |
getRelatedIds(java.util.Collection<? extends Entity> selectedParents,
RelatedEntitiesBean.MetaDataDescriptor descriptor) |
void |
openRelatedScreen(java.util.Collection<? extends Entity> selectedEntities,
MetaClass metaClass,
MetaProperty metaProperty)
Shows found related entities in default browse screen.
|
void |
openRelatedScreen(java.util.Collection<? extends Entity> selectedEntities,
MetaClass metaClass,
MetaProperty metaProperty,
RelatedEntitiesAPI.RelatedScreenDescriptor descriptor)
Shows found related entities in chosen screen.
|
<T extends Entity> |
openRelatedScreen(java.util.Collection<T> selectedEntities,
java.lang.Class<T> clazz,
java.lang.String property)
Shows found related entities in default browse screen.
|
<T extends Entity> |
openRelatedScreen(java.util.Collection<T> selectedEntities,
java.lang.Class<T> clazz,
java.lang.String property,
RelatedEntitiesAPI.RelatedScreenDescriptor descriptor)
Shows found related entities in chosen screen.
|
@Inject protected ExtendedEntities extendedEntities
@Inject protected RelatedEntitiesService relatedEntitiesService
@Inject protected Messages messages
@Inject protected MessageTools messageTools
@Inject protected WindowConfig windowConfig
@Inject protected WindowManagerProvider windowManagerProvider
@Inject protected UserSessionSource userSessionSource
@Inject protected Metadata metadata
@Inject protected MetadataTools metadataTools
@Inject protected FilterParser filterParser
@Inject protected ConditionParamBuilder paramBuilder
public RelatedEntitiesBuilder builder(FrameOwner frameOwner)
RelatedEntitiesAPI
Note, it is necessary to set MetaClass or entity class and property or MetaProperty to builder.
Example of creating screen with entity class and property:
RelatedEntitiesBuilder builder = relatedEntitiesAPI.builder(this);
Screen colourBrowser = builder
.withEntityClass(Car.class)
.withProperty("colour")
.withSelectedEntities(carsTable.getSelected())
.withScreenClass(ColourBrowser.class)
.build();
colourBrowser.show();
builder
in interface RelatedEntitiesAPI
frameOwner
- invoking screenpublic void openRelatedScreen(java.util.Collection<? extends Entity> selectedEntities, MetaClass metaClass, MetaProperty metaProperty)
RelatedEntitiesAPI
openRelatedScreen
in interface RelatedEntitiesAPI
selectedEntities
- set of entities which represents one side of relationmetaClass
- metaClass of single entity from selectedEntities
metaProperty
- chosen field to find related entities. Can be obtained from metaClass
public void openRelatedScreen(java.util.Collection<? extends Entity> selectedEntities, MetaClass metaClass, MetaProperty metaProperty, RelatedEntitiesAPI.RelatedScreenDescriptor descriptor)
RelatedEntitiesAPI
openRelatedScreen
in interface RelatedEntitiesAPI
selectedEntities
- set of entities which represents one side of relationmetaClass
- metaClass of single entity from selectedEntities
metaProperty
- chosen field to find related entities. Can be obtained from metaClass
descriptor
- descriptor contains screen id, WindowManager.OpenType
and
generated filter captionpublic <T extends Entity> void openRelatedScreen(java.util.Collection<T> selectedEntities, java.lang.Class<T> clazz, java.lang.String property)
RelatedEntitiesAPI
openRelatedScreen
in interface RelatedEntitiesAPI
selectedEntities
- set of entities which represents one side of relationclazz
- class of single entity from selectedEntities
property
- chosen field to find related entitiespublic <T extends Entity> void openRelatedScreen(java.util.Collection<T> selectedEntities, java.lang.Class<T> clazz, java.lang.String property, RelatedEntitiesAPI.RelatedScreenDescriptor descriptor)
RelatedEntitiesAPI
openRelatedScreen
in interface RelatedEntitiesAPI
selectedEntities
- set of entities which represents one side of relationclazz
- class of single entity from selectedEntities
property
- chosen field to find related entitiesdescriptor
- descriptor contains screen id, WindowManager.OpenType
and
generated filter captionprotected void applyFilter(Filter component, java.util.Collection<? extends Entity> selectedParents, RelatedEntitiesAPI.RelatedScreenDescriptor descriptor, RelatedEntitiesBean.MetaDataDescriptor metaDataDescriptor)
protected java.lang.String getRelatedEntitiesFilterXml(MetaClass relatedMetaCLass, java.util.Collection<? extends Entity> selectedEntities, Filter component, RelatedEntitiesBean.MetaDataDescriptor descriptor)
@Nullable protected AbstractCondition getOptimizedCondition(java.util.List<java.lang.Object> parentIds, MetaClass metaClass, java.lang.String filterComponentName, java.lang.String relatedPrimaryKey, RelatedEntitiesBean.MetaDataDescriptor descriptor)
@Nullable protected AbstractCondition getOneToManyCondition(java.util.List<java.lang.Object> parentIds, MetaClass metaClass, java.lang.String filterComponentName, RelatedEntitiesBean.MetaDataDescriptor descriptor)
@Nullable protected AbstractCondition getManyToManyCondition(java.util.List<java.lang.Object> parentIds, MetaClass metaClass, java.lang.String filterComponentName, java.lang.String relatedPrimaryKey, RelatedEntitiesBean.MetaDataDescriptor descriptor)
@Nullable protected AbstractCondition getManyToOneCondition(java.util.List<java.lang.Object> parentIds, MetaClass metaClass, java.lang.String filterComponentName, java.lang.String relatedPrimaryKey, RelatedEntitiesBean.MetaDataDescriptor descriptor)
protected Param getParentEntitiesParam(java.util.List<java.lang.Object> parentIds, java.lang.String parentPrimaryKey, MetaClass metaClass, java.lang.Class parentPrimaryKeyClass, java.lang.String paramName, MetaClass parentMetaClass)
protected CustomCondition getParentEntitiesCondition(java.util.List<java.lang.Object> parentIds, java.lang.String parentPrimaryKey, MetaClass metaClass, java.lang.String filterComponentName, MetaClass parentMetaClass)
protected org.dom4j.Element getConditionXmlElement(java.lang.String conditionName, MetaClass metaClass)
protected PropertyCondition getNonOptimizedCondition(MetaClass metaClass, java.util.List<java.lang.Object> ids, Filter component, java.lang.String filterComponentName, java.lang.String primaryKey)
protected java.util.List<java.lang.Object> getRelatedIds(java.util.Collection<? extends Entity> selectedParents, RelatedEntitiesBean.MetaDataDescriptor descriptor)
protected java.util.List<java.lang.Object> getParentIds(java.util.Collection<? extends Entity> selectedParents)
protected Screen buildScreen(RelatedEntitiesBuilder builder)
protected MetaClass getMetaClassNN(RelatedEntitiesBuilder builder)
protected MetaProperty getMetaPropertyNN(RelatedEntitiesBuilder builder, MetaClass metaClass)
protected Screen createScreen(RelatedEntitiesBuilder builder, MetaClass metaClass, MetaProperty metaProperty)