Package de.hybris.platform.jalo.type
Class SearchRestriction
java.lang.Object
de.hybris.platform.util.BridgeAbstraction
de.hybris.platform.jalo.Item
de.hybris.platform.jalo.ExtensibleItem
de.hybris.platform.jalo.c2l.LocalizableItem
de.hybris.platform.jalo.type.TypeManagerManaged
de.hybris.platform.jalo.type.SearchRestriction
- All Implemented Interfaces:
Serializable,Comparable
A SearchRestriction represents a restricted search for a principal, which will be used for realizing
personalization- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceinterface to persistence layerNested classes/interfaces inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
TypeManagerManaged.TypeManagerManagedImplNested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImplNested classes/interfaces inherited from class de.hybris.platform.jalo.Item
Item.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
AUTOCREATE, DEPRECATED, EXTENSION_NAME, GENERATEFields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLEDFields inherited from class de.hybris.platform.jalo.Item
_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, HJMPTS, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEFields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckRestrictionQuery(ComposedType restrictedType, String query) static voidcheckUniqueCodeTypePrincipal(Principal principal, ComposedType type, String code) Check that the code-type-principal combination is unique.protected SearchRestrictioncreateEntity(Principal principal, ComposedType restrictedType, String query, String code, Boolean active) protected ItemcreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap atts) Has to be implemented for each concrete subtype of item.exportXMLDefinition(org.znerd.xmlenc.XMLOutputter xout) getAllName(SessionContext ctx) getCode()getCode(SessionContext ctx) Deprecated.since ages - not needed any longergetName()getName(SessionContext ctx) protected Item.ItemAttributeMapgetNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) Defines all attributes which should be set after item creation.getQuery()getQuery(SessionContext ctx) protected SearchRestriction.SearchRestrictionImplimpl()booleanisActive()voidsetActive(boolean active) voidsetAllName(SessionContext ctx, Map names) voidsetAllName(Map names) voidsetCode(SessionContext ctx, String code) voidvoidsetName(SessionContext ctx, String name) Changes the name of this type system item for the specified language.voidChanges the name of this type system item for the current session language.voidvoidsetPrincipal(SessionContext ctx, Principal p) voidsetQuery(SessionContext ctx, String query) voidvoidsetRestrictionType(SessionContext ctx, ComposedType type) voidtoString()Returns theStringrepresentation of this item.Methods inherited from class de.hybris.platform.jalo.type.TypeManagerManaged
getAllNames, getAllNames, getExtensionName, getImpl, isAutocreate, isDeprecated, isGenerate, setAllNames, setAllNames, setAutocreate, setExtensionName, setGenerateMethods inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertyMethods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyMethods inherited from class de.hybris.platform.jalo.Item
addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, checkRemovable, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPartOfRemovedSessionMarker, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRelatedItems, getRelatedItems, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isMarkModifiedDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setRelatedItems, setTransientObject, setUseTA, suppressRelation, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Field Details
-
NAME
- See Also:
-
CODE
- See Also:
-
ACTIVE
- Since:
- 2.10
- See Also:
-
QUERY
- See Also:
-
PRINCIPAL
- See Also:
-
RESTRICTEDTYPE
- See Also:
-
RESTRICTION_TYPE_ALIAS
- See Also:
-
-
Constructor Details
-
SearchRestriction
public SearchRestriction()
-
-
Method Details
-
impl
-
createEntity
protected SearchRestriction createEntity(Principal principal, ComposedType restrictedType, String query, String code, Boolean active) throws ConsistencyCheckException - Throws:
ConsistencyCheckException
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap atts) throws JaloBusinessException, JaloInvalidParameterException Description copied from class:ItemHas to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) duringComposedType.newInstance(Map).In case this method uses any of the attribute values during creation it is required to override
Item.getNonInitialAttributes(SessionContext, ItemAttributeMap)too.
Sn example:public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) ); // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes( SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret = super.getNonInitialAttributes( ctx, allAttributes ); // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }- Specified by:
createItemin classItem- Parameters:
ctx- the current session context which this item is created withintype- the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )- Returns:
- the new item instance
- Throws:
JaloBusinessException- indicates an error during creation - any changes will be rollbackedJaloInvalidParameterException
-
getNonInitialAttributes
protected Item.ItemAttributeMap getNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) Description copied from class:ItemDefines all attributes which should be set after item creation. this is done be removing all attributes which are already set byItem.createItem(SessionContext, ComposedType, ItemAttributeMap).use it like this:
protected ItemAttributeMap getNonInitialAttributes( SessionContext ctx, ItemAttributeMap allAttributes ) { // let all superclasses remove their intial attributes too final ItemAttributeMap attributes = super.getNonInitialAttributes( ctx, allAttributes ); // remove own initial attributes here attributes.remove( MyItem.MY_INITIAL_ATTR ); return ret; }it is vital to optain the map via super.getNonInitialAttributes and pass it on as such since this ensures that attribute qualifiers are treated case insensitive!- Overrides:
getNonInitialAttributesin classItem- Parameters:
ctx- session context with language = NULLallAttributes- aItemAttributeMapcontaning attribute values.- Returns:
- a
ItemAttributeMapcontaining all attribute values, which belong to non-initial attributes.
-
getCode
-
getCode
-
setCode
-
setCode
-
isActive
public boolean isActive()- Since:
- 2.10
-
setActive
public void setActive(boolean active) - Since:
- 2.10
-
getName
- Overrides:
getNamein classTypeManagerManaged- Parameters:
ctx- the session context specifying the language to get the name for- Returns:
- the name of this type system item localized for the specified session context
-
getName
- Overrides:
getNamein classTypeManagerManaged- Returns:
- the name of this type system item localized for the current session language
-
getAllName
-
getAllName
-
setName
Description copied from class:TypeManagerManagedChanges the name of this type system item for the specified language.- Overrides:
setNamein classTypeManagerManaged- Parameters:
ctx- the session context defining the language to change the name forname- the new name
-
setName
Description copied from class:TypeManagerManagedChanges the name of this type system item for the current session language.- Overrides:
setNamein classTypeManagerManaged- Parameters:
name- the new name
-
setAllName
-
setAllName
- Throws:
JaloInvalidParameterException
-
getQuery
-
getQuery
-
setQuery
- Throws:
JaloInvalidParameterException
-
setQuery
- Throws:
JaloInvalidParameterException
-
getRestrictionType
-
getRestrictionType
-
setRestrictionType
-
setRestrictionType
-
getPrincipal
-
getPrincipal
-
setPrincipal
-
setPrincipal
-
getExcludedSubtypes
Deprecated.since ages - not needed any longerReturns all subtypes of this restrictions type for which a specialized form of this restriction exists.These restrictions must have the exactly the same code but are assigned to subtypes of the original restriction.
Within FlexibleSearch queries all these subtypes are excluded from the original restriction considering that their own restrictions are inserted too.
- Since:
- 2.10
-
toString
Description copied from class:ItemReturns theStringrepresentation of this item. This is by default the representation of the primary key of this item. -
exportXMLDefinition
- Specified by:
exportXMLDefinitionin classTypeManagerManaged
-
checkRestrictionQuery
protected void checkRestrictionQuery(ComposedType restrictedType, String query) throws JaloInvalidParameterException - Throws:
JaloInvalidParameterException
-
checkUniqueCodeTypePrincipal
public static void checkUniqueCodeTypePrincipal(Principal principal, ComposedType type, String code) Check that the code-type-principal combination is unique.- Parameters:
principal- the principaltype- the typecode- the code
-