Package de.businesscode.bcdui.binding
Class StandardBindingSet
java.lang.Object
de.businesscode.bcdui.binding.StandardBindingSet
- All Implemented Interfaces:
BindingSet,Serializable,Cloneable
A BindingSet is a mapping from names to BindingItems. It is read from
a static XML file by the Bindings class usually from WEB-INF/bindings
That file must satisfy the Schema bindings.xsd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.businesscode.bcdui.binding.BindingSet
BindingSet.SECURITY_OPS -
Field Summary
Fields inherited from interface de.businesscode.bcdui.binding.BindingSet
DEFAULT_DATABASE_SOURCENAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRelation(Relation p_relation) adds a new relation into ArrayListvoidaddWrqModifier(String className) voidassurePermissionDefined(BindingSet.SECURITY_OPS operation) we check here if the application has set up the subjectSettings.voidassurePermitted(BindingSet.SECURITY_OPS operation) check if given operation is permitted according to permissions set on subject in scopeGets a BindingItem by its unique name and throws an Exception if it is not present.get(Collection<String> keys) Get binding items by ids.getBindingItemFromRelation(Relation pRelation, String itemName) Method getBindingItemFromRelationgetBindingItemNamesGets the database name the table of the BindingSet is located in.Retrieves the list of key BindingItems for this binding set which may contain no entries.getName()Gets the unique name of the BindingSet.List of use StandardBindingSetsReturns a table expression and if it is a complex one (subselect with where for example) it may come with variables to be bound as host variablesgetSubjectFilterExpression(WrqInfo wrqInfo, String wrqAlias, String sqlAlias) Generate the part of the where clause that is reflecting the bnd:BindingSet/bnd:SubjectSettings/bnd:SubjectFiltersGets theSubjectFiltersdefinition for this BindingSet which may be null.Returns a table reference.getTableReference(String tableAlias) getTableReference(Collection<String> reqBRefs, String tableAlias) A list of Wrq modifier classes to be applied on all requests for this BindingSet before generating the SQL This is completely transparent to the caller, the answer Wrs does show the original WrsRequestbooleanbooleantells if this binding-set contains an itembooleanTests if the BindingSet hat key BindingItems.booleanTells if the binding set has subject filters.booleanisAllowSelectAllColumnsbooleanisBackendCanBypassSubjectFiltervoidputItem(BindingItem item) putItemvoidsetAllowSelectAllColumns(boolean allowSelectAllColumns) voidsetBackendCanBypassSubjectFilter(boolean backendCanBypassSubjectFilter) voidsetDbSourceName(String dbSourceName) setDbSourceNamevoidsetHasCustomItem(boolean hasCustomItem) voidsetSecurity(Security security) voidsetSubjectFilters(SubjectFilters subjectFilters) sets theSubjectFiltersvoidsetTableName(String tableName) setTableName
-
Constructor Details
-
StandardBindingSet
StandardBindingSet- Parameters:
name-
-
StandardBindingSet
-
-
Method Details
-
getName
Description copied from interface:BindingSetGets the unique name of the BindingSet.- Specified by:
getNamein interfaceBindingSet- Returns:
- The unique BindingSet name.
- See Also:
-
getTableReference
- See Also:
-
getTableReference
public String getTableReference(Collection<String> reqBRefs, String tableAlias) throws BindingException - Throws:
BindingException- See Also:
-
setTableName
setTableName- Parameters:
tableName-
-
setSubjectFilters
sets theSubjectFilters- Parameters:
subjectFilters-
-
getSubjectFilterExpression
public SQLStatementWithParams getSubjectFilterExpression(WrqInfo wrqInfo, String wrqAlias, String sqlAlias) throws BindingException Generate the part of the where clause that is reflecting the bnd:BindingSet/bnd:SubjectSettings/bnd:SubjectFilters- Parameters:
wrqInfo-wrqAlias-sqlAlias-- Returns:
- Throws:
BindingException
-
putItem
putItem- Parameters:
item-
-
hasSubjectFilters
public boolean hasSubjectFilters()Description copied from interface:BindingSetTells if the binding set has subject filters.- Specified by:
hasSubjectFiltersin interfaceBindingSet- Returns:
- True, if there is at least one SubjectFilter inside this BindingSet.
- See Also:
-
getSubjectFilters
Description copied from interface:BindingSetGets theSubjectFiltersdefinition for this BindingSet which may be null.- Specified by:
getSubjectFiltersin interfaceBindingSet- Returns:
SubjectFiltersfor given BindingSet or null
-
getJdbcResourceName
Description copied from interface:BindingSetGets the database name the table of the BindingSet is located in.- Specified by:
getJdbcResourceNamein interfaceBindingSet- Returns:
- The dbSourceName attribute of the BindingSet.
- See Also:
-
setDbSourceName
setDbSourceName- Parameters:
dbSourceName-
-
isBackendCanBypassSubjectFilter
public boolean isBackendCanBypassSubjectFilter()Description copied from interface:BindingSetisBackendCanBypassSubjectFilter- Specified by:
isBackendCanBypassSubjectFilterin interfaceBindingSet- Returns:
- true if it is allowed for the backend to bypass SubjectFilters
- See Also:
-
setBackendCanBypassSubjectFilter
public void setBackendCanBypassSubjectFilter(boolean backendCanBypassSubjectFilter) - Parameters:
allowSelectAllColumns- the allowSelectAllColumns to set
-
isAllowSelectAllColumns
public boolean isAllowSelectAllColumns()Description copied from interface:BindingSetisAllowSelectAllColumns- Specified by:
isAllowSelectAllColumnsin interfaceBindingSet- Returns:
- true if it is allowed to select all columns from this BindingSet.
- See Also:
-
setAllowSelectAllColumns
public void setAllowSelectAllColumns(boolean allowSelectAllColumns) - Parameters:
allowSelectAllColumns- the allowSelectAllColumns to set
-
get
Description copied from interface:BindingSetGets a BindingItem by its unique name and throws an Exception if it is not present.- Specified by:
getin interfaceBindingSet- Parameters:
key- The name of the BindingItem.- Returns:
- A BindingItem with the specified name.
- Throws:
BindingNotFoundException- If there is no BindingItem with the denoted name.- See Also:
-
hasItem
Description copied from interface:BindingSettells if this binding-set contains an item- Specified by:
hasItemin interfaceBindingSet- Returns:
-
get
Description copied from interface:BindingSetGet binding items by ids.- Specified by:
getin interfaceBindingSet- Throws:
BindingNotFoundException- See Also:
-
getBindingItemFromRelation
public BindingItem getBindingItemFromRelation(Relation pRelation, String itemName) throws BindingException Description copied from interface:BindingSetMethod getBindingItemFromRelation- Specified by:
getBindingItemFromRelationin interfaceBindingSet- Parameters:
pRelation-itemName-- Returns:
- null if not found
- Throws:
BindingException
-
hasKeyBindingItems
public boolean hasKeyBindingItems()Description copied from interface:BindingSetTests if the BindingSet hat key BindingItems.- Specified by:
hasKeyBindingItemsin interfaceBindingSet- Returns:
- True, if there is a BindingItem which is declared as key item.
- See Also:
-
getKeyBindingItems
Description copied from interface:BindingSetRetrieves the list of key BindingItems for this binding set which may contain no entries.- Specified by:
getKeyBindingItemsin interfaceBindingSet- Returns:
- An array of the BindingItems with the isKey attribute set to "true".
- See Also:
-
addRelation
Description copied from interface:BindingSetadds a new relation into ArrayList- Specified by:
addRelationin interfaceBindingSet- See Also:
-
getRelations
- Specified by:
getRelationsin interfaceBindingSet- See Also:
-
getBindingItems
-
getBindingItemNames
Description copied from interface:BindingSetgetBindingItemNames- Specified by:
getBindingItemNamesin interfaceBindingSet- Returns:
- names of all items defined in the bindingSet
- See Also:
-
getWriteProcessing
- Specified by:
getWriteProcessingin interfaceBindingSet- See Also:
-
setSecurity
-
getSecurity
- Specified by:
getSecurityin interfaceBindingSet- Returns:
- security context to this binding, may be NULL if no security configured
-
hasCustomItem
public boolean hasCustomItem()- Specified by:
hasCustomItemin interfaceBindingSet- Returns:
- TRUE if contains at least one custom element from
StandardNamespaceContext.CUST_NAMESPACE
-
setHasCustomItem
public void setHasCustomItem(boolean hasCustomItem) - Parameters:
hasCustomItem- the hasCustomItem to set
-
addWrqModifier
- Throws:
ClassNotFoundException
-
getWrqModifiers
Description copied from interface:BindingSetA list of Wrq modifier classes to be applied on all requests for this BindingSet before generating the SQL This is completely transparent to the caller, the answer Wrs does show the original WrsRequest- Specified by:
getWrqModifiersin interfaceBindingSet- Returns:
-
assurePermissionDefined
public void assurePermissionDefined(BindingSet.SECURITY_OPS operation) throws SecurityMissingForBindingException Description copied from interface:BindingSetwe check here if the application has set up the subjectSettings. In case it is set up, the binding-set HAS TO define the Security context for given operation otherwise we throwSecurityMissingException- Specified by:
assurePermissionDefinedin interfaceBindingSet- Parameters:
operation- - to assure the permission is defined for- Throws:
SecurityMissingForBindingException
-
assurePermitted
Description copied from interface:BindingSetcheck if given operation is permitted according to permissions set on subject in scope- Specified by:
assurePermittedin interfaceBindingSet- Parameters:
operation- - to assure permission for- Throws:
SecurityException
-
getTableReference
Description copied from interface:BindingSetReturns a table reference. Can be a plain table name (with alias) or a join of tables- Specified by:
getTableReferencein interfaceBindingSet- Returns:
-
getSQLStatementWithParams
Description copied from interface:BindingSetReturns a table expression and if it is a complex one (subselect with where for example) it may come with variables to be bound as host variables- Specified by:
getSQLStatementWithParamsin interfaceBindingSet- Returns:
-
getResolvedBindingSets
List of use StandardBindingSets- Specified by:
getResolvedBindingSetsin interfaceBindingSet- Returns:
-