Package de.hybris.platform.util
Class ViewResultItem
java.lang.Object
de.hybris.platform.util.BridgeAbstraction
de.hybris.platform.jalo.Item
de.hybris.platform.util.ViewResultItem
- All Implemented Interfaces:
JaloOnlyItem,JaloOnlySingletonItem,Serializable,Comparable
Represents the result of a search which was initiated by a
ViewType- See Also:
-
Nested Class Summary
Nested 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
Fields 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 TypeMethodDescriptioncreateItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) Returns an instance of this class.doGetAttribute(SessionContext ctx, String qualifier) Should get the value of the given attribute if noAttributeAccesshas been registered for it.voiddoSetAttribute(SessionContext ctx, String qualifier, Object value) Should set the value of the given attribute if noAttributeAccesshas been registered for it.protected Item.ItemAttributeMapgetNonInitialAttributes(SessionContext ctx, Item.ItemAttributeMap allAttributes) Defines all attributes which should be set after item creation.Should provide the composed type of this item.Should provide a fixed creation time for this item.Should provide a modification time for this item.Should provide a fixed PK for this item.voidno-opMethods 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, createNonClassAccessor, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getDefaultAttributeModes, getImplementation, 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, toString, useTA, writeReplaceMethods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
Constructor Details
-
ViewResultItem
public ViewResultItem() -
ViewResultItem
-
-
Method Details
-
createItem
public Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException Returns an instance of this class.- 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 rollbacked
-
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:
- empty map since
createItem(de.hybris.platform.jalo.SessionContext, de.hybris.platform.jalo.type.ComposedType, de.hybris.platform.jalo.Item.ItemAttributeMap)has already stored all attributes and we have to avoid calls to setAttribute().
-
removeJaloOnly
no-op- Specified by:
removeJaloOnlyin interfaceJaloOnlyItem- Throws:
ConsistencyCheckException- to signal that this item removal failed
-
providePK
Description copied from interface:JaloOnlyItemShould provide a fixed PK for this item.- Specified by:
providePKin interfaceJaloOnlyItem- Returns:
- PK of this item
-
provideComposedType
Description copied from interface:JaloOnlyItemShould provide the composed type of this item.- Specified by:
provideComposedTypein interfaceJaloOnlyItem- Returns:
- ComposedType of this item
-
provideCreationTime
Description copied from interface:JaloOnlyItemShould provide a fixed creation time for this item.- Specified by:
provideCreationTimein interfaceJaloOnlyItem- Returns:
- creation time date of this item
-
provideModificationTime
Description copied from interface:JaloOnlyItemShould provide a modification time for this item.- Specified by:
provideModificationTimein interfaceJaloOnlyItem- Returns:
- modification time date of this item
-
doGetAttribute
Description copied from interface:JaloOnlyItemShould get the value of the given attribute if noAttributeAccesshas been registered for it. Otherwise the value is read from the access instance.- Specified by:
doGetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextqualifier- the qualifier of the requested attribute- Returns:
- the attribute value
-
doSetAttribute
public void doSetAttribute(SessionContext ctx, String qualifier, Object value) throws JaloBusinessException Description copied from interface:JaloOnlyItemShould set the value of the given attribute if noAttributeAccesshas been registered for it. Otherwise the value is read from the access instance.- Specified by:
doSetAttributein interfaceJaloOnlyItem- Parameters:
ctx- the session contextqualifier- the qualifier of the requested attributevalue- the new attribute value- Throws:
JaloSecurityException- in case the session user is not allowed to write this attributeJaloBusinessException- in case any other error occured
-