public class DefaultSearchRestrictionService extends java.lang.Object implements SearchRestrictionService
SearchRestrictionService interface.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CTX_SEARCH_RESTRICTIONS |
static java.lang.String |
DISABLE_RESTRICTIONS |
| Constructor and Description |
|---|
DefaultSearchRestrictionService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addSessionSearchRestrictions(java.util.Collection<SessionSearchRestriction> restrictions)
Adds session search restrictions to current session context.
|
void |
addSessionSearchRestrictions(SessionSearchRestriction... restrictions)
Adds session search restrictions to current session context.
|
void |
clearSessionSearchRestrictions()
Clear session search restrictions in current session context.
|
void |
disableSearchRestrictions()
Disable search restrictions in current session context.
|
void |
enableSearchRestrictions()
Enable search restrictions in current session context.
|
java.util.Collection<SearchRestrictionModel> |
getActiveSearchRestrictions(PrincipalModel principal,
boolean includePrincipalGroups,
java.util.Collection<ComposedTypeModel> types)
Gets only active search restrictions for given
ComposedTypeModel. |
java.util.Collection<SearchRestrictionModel> |
getInactiveSearchRestrictions(PrincipalModel principal,
boolean includePrincipalGroups,
java.util.Collection<ComposedTypeModel> types)
Gets only inactive search restrictions for given
ComposedTypeModel. |
java.util.Collection<SearchRestrictionModel> |
getSearchRestrictions(PrincipalModel principal,
boolean includePrincipalGroups,
java.util.Collection<ComposedTypeModel> types)
Gets all (active and inactive) search restrictions for given
ComposedTypeModel. |
java.util.Collection<SearchRestrictionModel> |
getSearchRestrictionsForType(ComposedTypeModel type)
Gets all search restrictions for type.
|
java.util.Collection<SessionSearchRestriction> |
getSessionSearchRestrictions()
Gets the session search restrictions from current session context.
|
java.util.Collection<SessionSearchRestriction> |
getSessionSearchRestrictions(ComposedTypeModel type)
Gets the session search restrictions from current session context for particular
ComposedTypeModel
object. |
boolean |
hasRestrictions(PrincipalModel principal,
boolean includePrincipalGroups,
ComposedTypeModel type)
Checks whether type has search restrictions (session and persisted).
|
boolean |
isSearchRestrictionsEnabled()
Checks if search restrictions feature in current session context is enabled.
|
void |
removalAllSessionSearchRestrictions()
Removes all session-scoped search restrictions from the current session.
|
void |
removeSessionSearchRestrictions(java.util.Collection<SessionSearchRestriction> restrictions)
Remove session search restrictions from current session context.
|
void |
setConverter(SessionSearchRestrictionConverter converter) |
void |
setSearchRestrictionDao(SearchRestrictionDao searchRestrictionDao) |
void |
setSessionService(SessionService sessionService) |
public static final java.lang.String CTX_SEARCH_RESTRICTIONS
public static final java.lang.String DISABLE_RESTRICTIONS
public void addSessionSearchRestrictions(java.util.Collection<SessionSearchRestriction> restrictions)
final ComposedTypeModel restrictedType = typeService.getComposedTypeForClass(LanguageModel.class);
final SessionSearchRestriction restriction = new SessionSearchRestriction("someUniqueCode", "{active} IS TRUE", restrictedType);
final Collection<SessionSearchRestriction> restrictions = new ArrayList<SessionSearchRestriction>();
restrictions.add(restriction);
searchRestrictionService.addSessionSearchRestrictions(restrictions);
addSessionSearchRestrictions in interface SearchRestrictionServicerestrictions - the restrictions collection to add to session.public void addSessionSearchRestrictions(SessionSearchRestriction... restrictions)
final ComposedTypeModel restrictedType = typeService.getComposedTypeForClass(LanguageModel.class);
final SessionSearchRestriction restriction1 = new SessionSearchRestriction("someUniqueCode1", "{active} IS TRUE", restrictedType);
final SessionSearchRestriction restriction2 = new SessionSearchRestriction("someUniqueCode2", "{foo}={bar}", restrictedType);
searchRestrictionService.addSessionSearchRestrictions(restriction1, restriction2);
addSessionSearchRestrictions in interface SearchRestrictionServicerestrictions - the restrictions to addpublic void clearSessionSearchRestrictions()
clearSessionSearchRestrictions in interface SearchRestrictionServicepublic void disableSearchRestrictions()
disableSearchRestrictions in interface SearchRestrictionServicepublic void enableSearchRestrictions()
enableSearchRestrictions in interface SearchRestrictionServicepublic java.util.Collection<SearchRestrictionModel> getActiveSearchRestrictions(PrincipalModel principal, boolean includePrincipalGroups, java.util.Collection<ComposedTypeModel> types)
ComposedTypeModel.getActiveSearchRestrictions in interface SearchRestrictionServiceprincipal - the principal for which restrictions will be searchedincludePrincipalGroups - determines whether include principal groups in searchtypes - Collection of ComposedTypeModel objects for which restriction will be obtained.public java.util.Collection<SearchRestrictionModel> getInactiveSearchRestrictions(PrincipalModel principal, boolean includePrincipalGroups, java.util.Collection<ComposedTypeModel> types)
ComposedTypeModel.getInactiveSearchRestrictions in interface SearchRestrictionServiceprincipal - the principal for which restrictions will be searchedincludePrincipalGroups - determines whether include principal groups in searchtypes - Collection of ComposedTypeModel objects for which restriction will be obtained.public java.util.Collection<SearchRestrictionModel> getSearchRestrictions(PrincipalModel principal, boolean includePrincipalGroups, java.util.Collection<ComposedTypeModel> types)
ComposedTypeModel.getSearchRestrictions in interface SearchRestrictionServiceprincipal - the principal for which restrictions will be searchedincludePrincipalGroups - determines whether include principal groups in searchtypes - Collection of ComposedTypeModel objects for which restriction will be obtained.public java.util.Collection<SearchRestrictionModel> getSearchRestrictionsForType(ComposedTypeModel type)
SearchRestrictionServicegetSearchRestrictionsForType in interface SearchRestrictionServicetype - the typepublic java.util.Collection<SessionSearchRestriction> getSessionSearchRestrictions()
getSessionSearchRestrictions in interface SearchRestrictionServicepublic java.util.Collection<SessionSearchRestriction> getSessionSearchRestrictions(ComposedTypeModel type)
ComposedTypeModel
object.getSessionSearchRestrictions in interface SearchRestrictionServicetype - the type for which which restriction will be obtained.public boolean hasRestrictions(PrincipalModel principal, boolean includePrincipalGroups, ComposedTypeModel type)
hasRestrictions in interface SearchRestrictionServiceprincipal - the principal for which restrictions will be searchedincludePrincipalGroups - determines whether include principal groups in searchtype - the type for which check will be triggered.public boolean isSearchRestrictionsEnabled()
isSearchRestrictionsEnabled in interface SearchRestrictionServicepublic void removeSessionSearchRestrictions(java.util.Collection<SessionSearchRestriction> restrictions)
removeSessionSearchRestrictions in interface SearchRestrictionServicerestrictions - the restrictions collection to remove from session.public void removalAllSessionSearchRestrictions()
removalAllSessionSearchRestrictions in interface SearchRestrictionServicepublic void setConverter(SessionSearchRestrictionConverter converter)
public void setSearchRestrictionDao(SearchRestrictionDao searchRestrictionDao)
public void setSessionService(SessionService sessionService)
Copyright © 2018 SAP SE. All Rights Reserved.