A
- B
- L
- public abstract class RelationshipLinkManager<A extends AppUser,B extends DataObject,L extends LinkManager.Link<A,B>> extends LinkManager<L,A,B> implements RelationshipProvider<A,B>
LinkManager
s that implement RelationshipProvider
.LinkManager.JoinLinkFilterIterator, LinkManager.JoinLinkMapper, LinkManager.LeftAcceptFilter, LinkManager.Link<L extends DataObject,R extends DataObject>, LinkManager.LinkInput, LinkManager.LinkResult, LinkManager.RightAcceptFilter
IndexedLinkManager.LinkFilter, IndexedLinkManager.LinkProvider<T extends IndexedLinkManager.Link<L,R>,L extends Indexed,R extends Indexed>, IndexedLinkManager.LinkUpdater, IndexedLinkManager.SQLLinkFilter
DataObjectFactory.AbstractDataObjectInput, DataObjectFactory.AbstractFinder<X>, DataObjectFactory.DataObjectAcceptFilter, DataObjectFactory.DataObjectInput, DataObjectFactory.DataObjectIntegerInput, DataObjectFactory.DestAcceptFilter<T extends DataObject>, DataObjectFactory.FilterAdapter, DataObjectFactory.FilterCounter, DataObjectFactory.FilterExists, DataObjectFactory.FilterIterator, DataObjectFactory.FilterSelector, DataObjectFactory.FilterSet, DataObjectFactory.Finder, DataObjectFactory.MakeRemoteFilterVisitor<R extends DataObject>, DataObjectFactory.MatchFilter, DataObjectFactory.ReferencedAdapter<I extends Indexed>, DataObjectFactory.ReferenceIterator<I extends Indexed>, DataObjectFactory.SortingDataObjectInput, DataObjectFactory.TimeAcceptFilter<T extends DataObject>, DataObjectFactory.TimeFilter
USE_JOIN
AUTO_CREATE_TABLES_FEATURE, COMPOSITES_SUFFIX, REJECT_MULTIPLE_RESULT_FEATURE, res
Modifier | Constructor and Description |
---|---|
protected |
RelationshipLinkManager(AppContext c,
java.lang.String tag,
java.lang.String person_field,
DataObjectFactory<B> b_fac,
java.lang.String field) |
Modifier and Type | Method and Description |
---|---|
void |
addRelationships(java.util.Set<java.lang.String> roles)
Add known roles to a set.
|
protected abstract BaseFilter<L> |
getFilterFromRole(java.lang.String role)
get a filter corresponding to the role.
|
DataObjectFactory<B> |
getTargetFactory()
Get the factory for the target object.
|
BaseFilter<B> |
getTargetFilter(AppUser user,
java.lang.String role) |
BaseFilter<L> |
getTargetRoleFilter(B target,
java.lang.String role) |
BaseFilter<A> |
getUserFilter(BaseFilter<B> fil,
java.lang.String role) |
BaseFilter<A> |
getUserFilter(B target,
java.lang.String role) |
BaseFilter<L> |
getUserRoleFilter(A user,
java.lang.String role) |
BaseFilter<B> |
hasRelationFilter(java.lang.String role,
A user)
Get a
BaseFilter corresponding to target objects where the given user has
the specified relation. |
BaseFilter<A> |
personInRelationFilter(SessionService<A> sess,
java.lang.String role,
B target)
Get a
BaseFilter for AppUser s that are in the specified relationship with
the target object. |
boolean |
providesRelationship(java.lang.String role)
Does this class provide the named relationship.
|
find, find, getDefaultTableSpecification, getFilter, getFilterResult, getInput, getLeftFactory, getLeftFilter, getLeftFilter, getLeftInput, getLeftJoinFilter, getLeftRemoteFilter, getLinkCount, getLinkIterator, getRightFactory, getRightFilter, getRightFilter, getRightInput, getRightJoinFilter, getRightRemoteFilter, getSelectors, getTarget, isLeft, isRight
addLeftSet, addRightSet, getDefaultTableSpecification, getFinalTableSpecification, getFormUpdate, getHistoryHandler, getLeftField, getLeftFilter, getLeftProducer, getLeftSet, getLink, getRightField, getRightFilter, getRightProducer, getRightSet, getTableSpecification, makeHistoryHandler, makeLink, modifyHistoryTable, selectLink, setContext, setHistoryHandler, updateHistory, useAutoHistory
all, allowPreSelect, canCreate, canUpdate, checkComposite, convertToDestinationFilter, customiseForm, equals, exists, find, find, find, find, find, getAllIterator, getComposite, getComposites, getComposites, getConfigTag, getContext, getCount, getDefaultRelationshipFilter, getDefaults, getDestFilter, getExcludeFilter, getFieldConstraints, getFieldHelp, getFilter, getFilter, getFilter, getFinalSelectFilter, getFinalTableSpecification, getFindFilter, getFormCreator, getID, getIndex, getInput, getInput, getLogger, getMaxIdentifierLength, getNullable, getOptional, getOrder, getProperty, getReferenced, getReferenceFieldType, getReferenceFieldType, getRemoteFilter, getRemoteSQLFilter, getResult, getResult, getSelectFilter, getSelector, getSelector, getSupress, getTableStructureContributers, getTag, getTranslations, getUniqueIdName, hasComposite, hashCode, isMine, isMine, isMyReference, isValid, makeBDO, makeBDO, makeObject, makeRecord, makeReference, makeReference, matches, narrowSelector, narrowSelector, observeComposite, OrderBy, postCreateTableSetup, postSetContext, release, restrictDefaultInput, setComposites, setContext, setContext, setContextWithMake, setProperty, toString, updateTable
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getRelationships
getContext
protected RelationshipLinkManager(AppContext c, java.lang.String tag, java.lang.String person_field, DataObjectFactory<B> b_fac, java.lang.String field)
public final BaseFilter<L> getUserRoleFilter(A user, java.lang.String role) throws UnknownRelationshipException
UnknownRelationshipException
protected abstract BaseFilter<L> getFilterFromRole(java.lang.String role) throws UnknownRelationshipException
role
- UnknownRelationshipException
public final BaseFilter<L> getTargetRoleFilter(B target, java.lang.String role) throws UnknownRelationshipException
UnknownRelationshipException
public final BaseFilter<B> getTargetFilter(AppUser user, java.lang.String role) throws UnknownRelationshipException
UnknownRelationshipException
public final BaseFilter<A> getUserFilter(B target, java.lang.String role) throws UnknownRelationshipException
UnknownRelationshipException
public final BaseFilter<A> getUserFilter(BaseFilter<B> fil, java.lang.String role) throws UnknownRelationshipException
UnknownRelationshipException
public final DataObjectFactory<B> getTargetFactory()
RelationshipProvider
getTargetFactory
in interface RelationshipProvider<A extends AppUser,B extends DataObject>
DataObjectFactory
public final BaseFilter<B> hasRelationFilter(java.lang.String role, A user)
AccessRoleProvider
BaseFilter
corresponding to target objects where the given user has
the specified relation.
If the method returns null then the role is not recognised by the provider.
A non-null result means the role is recognised but does not imply
that any target will match. The relation with a specific target object can be tested using
DataObjectFactory.matches(BaseFilter, DataObject)
This method should not be called directly only via a call to SessionService.getRelationshipRoleFilter(DataObjectFactory, String)
to allow the SessionService
to combine and customise access rules.hasRelationFilter
in interface AccessRoleProvider<A extends AppUser,B extends DataObject>
BaseFilter
or nullpublic final BaseFilter<A> personInRelationFilter(SessionService<A> sess, java.lang.String role, B target)
AccessRoleProvider
BaseFilter
for AppUser
s that are in the specified relationship with
the target object.
This is the inverse of #hasRelationFilter(SessionService, String)
used to generate a list
of AppUser
with the relation. It can always be implemented (inefficiently) by creating an AcceptFilter
that uses AccessRoleProvider.hasRelationFilter(String, AppUser)
to check each person in turn but though it is usually possible to find some SQLFilter
to narrow the selection first even if a full SQL implementation is not possible.
If the target is null it should generate a filter for any user in relation with targets
selected by DataObjectFactory.getDefaultRelationshipFilter()
. If this is not possible
it should return null;personInRelationFilter
in interface AccessRoleProvider<A extends AppUser,B extends DataObject>
BaseFilter
or nullpublic final boolean providesRelationship(java.lang.String role)
AccessRoleProvider
providesRelationship
in interface AccessRoleProvider<A extends AppUser,B extends DataObject>
public final void addRelationships(java.util.Set<java.lang.String> roles)
AccessRoleProvider
addRelationships
in interface AccessRoleProvider<A extends AppUser,B extends DataObject>