Class PDTRow
- java.lang.Object
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable
- Direct Known Subclasses:
GeneratedAbstractDiscountRow
,GeneratedPriceRow
,GeneratedTaxRow
public abstract class PDTRow extends GeneratedPDTRow
Abstract Superclass of our price , tax and discount rule classes PriceRow, TaxRow and DiscountRow. Here the basic matching fields are defined: product, product price group, user and user group.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.GenericItem
GenericItem.GenericItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LocalizableItem.LocalizableItemImpl
-
Nested classes/interfaces inherited from class de.hybris.platform.jalo.ExtensibleItem
ExtensibleItem.ExtensibleItemImpl
-
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 Modifier and Type Field Description static java.lang.String
ALL_PRODUCT_GROUPS
Field ALL_PRODUCT_GROUPSstatic Product
ALL_PRODUCTS
Field ALL_PRODUCTSstatic java.lang.String
ALL_USER_GROUPS
Field ALL_USER_GROUPSstatic User
ALL_USERS
Field ALL_USERSstatic java.lang.String
DATE_RANGE
Deprecated.since agesstatic java.lang.String
DATERANGE
Deprecated.since agesstatic java.lang.String
END_TIME
Deprecated.since agesstatic java.lang.String
START_TIME
Deprecated.since ages-
Fields inherited from class de.hybris.platform.europe1.jalo.GeneratedPDTRow
DEFAULT_INITIAL_ATTRIBUTES, ENDTIME, PG, PRODUCT, PRODUCTID, PRODUCTMATCHQUALIFIER, STARTTIME, UG, USER, USERMATCHQUALIFIER
-
Fields inherited from class de.hybris.platform.jalo.c2l.LocalizableItem
LANGUAGE_FALLBACK_ENABLED
-
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, TYPE
-
Fields inherited from class de.hybris.platform.util.BridgeAbstraction
impl, tenant
-
-
Constructor Summary
Constructors Constructor Description PDTRow()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected Item
createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes)
Has to be implemented for each concrete subtype of item.Customer
getCustomer()
Deprecated.since ages - please use getUser() instead.Customer
getCustomer(SessionContext ctx)
Deprecated.since ages - please use getUser(SessionContext) instead.EnumerationValue
getCustomerGroup()
Deprecated.since ages - please use getUserGroup instead.EnumerationValue
getCustomerGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup instead.EnumerationValue
getCustomerPriceGroup()
Deprecated.since ages - please use getCustomerGroup() insteadEnumerationValue
getCustomerPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup( SessionContext ctx) insteadStandardDateRange
getDateRange()
StandardDateRange
getDateRange(SessionContext ctx)
The range of time which this row is valid within.protected java.lang.Long
getInitialProductMatchField(Item.ItemAttributeMap allAttributes)
protected java.lang.Long
getInitialUserMatchField(Item.ItemAttributeMap allAttributes)
EnumerationValue
getProductGroup()
Specified the product price group this rule is assigned to.EnumerationValue
getProductGroup(SessionContext ctx)
EnumerationValue
getProductPriceGroup()
Deprecated.since ages - please use getProductGroup() insteadEnumerationValue
getProductPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getProductGroup( SessionContext ctx ) insteadEnumerationValue
getUserGroup()
The user group which this rule is assigned to.EnumerationValue
getUserGroup(SessionContext ctx)
SeegetUserGroup()
.protected void
markProductModified()
Marks the product which this row (might) belong to modified.void
remove(SessionContext ctx)
Removes this item.protected void
removeLinks()
Superclass method overridden to skip searching for links during removal of a PDTRow.void
setDateRange(SessionContext ctx, StandardDateRange dateRange)
Method setDateRangevoid
setDateRange(StandardDateRange dateRange)
protected void
setPg(SessionContext ctx, EnumerationValue value)
Whenever a non-null PG is set the product attribute is cleared.protected void
setProduct(SessionContext ctx, Product value)
Whenever a non-null product is set the PG attribute is cleared.void
setProductId(SessionContext ctx, java.lang.String value)
Generated method - Setter of thePDTRow.productId
attribute.void
setProductMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this classjava.lang.Object
setProperty(SessionContext ctx, java.lang.String name, java.lang.Object value)
Overwritten to mark owning product as modified each time a property of this row has been changed.void
setUg(SessionContext ctx, EnumerationValue value)
Whenever a non-null UG is set the user attribute is cleared.void
setUser(SessionContext ctx, User value)
Whenever a non-null user is set the UG attribute is cleared.void
setUserMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this classprotected void
updateProductMatchField()
protected void
updateUserMatchField()
-
Methods inherited from class de.hybris.platform.europe1.jalo.GeneratedPDTRow
getDefaultAttributeModes, getEndTime, getEndTime, getPg, getPg, getProduct, getProduct, getProductId, getProductId, getProductMatchQualifier, getProductMatchQualifier, getProductMatchQualifierAsPrimitive, getProductMatchQualifierAsPrimitive, getStartTime, getStartTime, getUg, getUg, getUser, getUser, getUserMatchQualifier, getUserMatchQualifier, getUserMatchQualifierAsPrimitive, getUserMatchQualifierAsPrimitive, setEndTime, setEndTime, setPg, setProduct, setProductId, setProductMatchQualifier, setProductMatchQualifier, setProductMatchQualifier, setStartTime, setStartTime, setUg, setUser, setUserMatchQualifier, setUserMatchQualifier, setUserMatchQualifier
-
Methods inherited from class de.hybris.platform.jalo.GenericItem
getImplementation, getInitialProperties, getNonInitialAttributes, getRelatedItems, setRelatedItems
-
Methods 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, setLocalizedProperty
-
Methods inherited from class de.hybris.platform.jalo.ExtensibleItem
createNonClassAccessor, getAllProperties, getAllProperties, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty
-
Methods 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, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, 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, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, 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, setTransientObject, setUseTA, toString, useTA, writeReplace
-
Methods inherited from class de.hybris.platform.util.BridgeAbstraction
setTenant
-
-
-
-
Field Detail
-
DATERANGE
@Deprecated public static final java.lang.String DATERANGE
Deprecated.since ages- See Also:
- Constant Field Values
-
DATE_RANGE
@Deprecated public static final java.lang.String DATE_RANGE
Deprecated.since ages- See Also:
- Constant Field Values
-
START_TIME
@Deprecated public static final java.lang.String START_TIME
Deprecated.since ages- See Also:
- Constant Field Values
-
END_TIME
@Deprecated public static final java.lang.String END_TIME
Deprecated.since ages- See Also:
- Constant Field Values
-
ALL_PRODUCTS
public static final Product ALL_PRODUCTS
Field ALL_PRODUCTS
-
ALL_PRODUCT_GROUPS
public static final java.lang.String ALL_PRODUCT_GROUPS
Field ALL_PRODUCT_GROUPS
-
ALL_USERS
public static final User ALL_USERS
Field ALL_USERS
-
ALL_USER_GROUPS
public static final java.lang.String ALL_USER_GROUPS
Field ALL_USER_GROUPS
-
-
Method Detail
-
createItem
protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
Description copied from class:Item
Has 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; }
- Overrides:
createItem
in classGenericItem
- 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
-
setProductMatchQualifier
public void setProductMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this class- Overrides:
setProductMatchQualifier
in classGeneratedPDTRow
value
- the productMatchQualifier
-
setUserMatchQualifier
public void setUserMatchQualifier(SessionContext ctx, java.lang.Long value)
Overwritten to disallow changing this calculated field from outside this class- Overrides:
setUserMatchQualifier
in classGeneratedPDTRow
value
- the userMatchQualifier
-
getInitialProductMatchField
protected java.lang.Long getInitialProductMatchField(Item.ItemAttributeMap allAttributes)
-
getInitialUserMatchField
protected java.lang.Long getInitialUserMatchField(Item.ItemAttributeMap allAttributes)
-
updateProductMatchField
protected void updateProductMatchField()
-
updateUserMatchField
protected void updateUserMatchField()
-
setProduct
protected void setProduct(SessionContext ctx, Product value)
Whenever a non-null product is set the PG attribute is cleared.- Overrides:
setProduct
in classGeneratedPDTRow
value
- the product
-
setProductId
public void setProductId(SessionContext ctx, java.lang.String value)
Description copied from class:GeneratedPDTRow
Generated method - Setter of thePDTRow.productId
attribute.- Overrides:
setProductId
in classGeneratedPDTRow
value
- the productId
-
setUser
public void setUser(SessionContext ctx, User value)
Whenever a non-null user is set the UG attribute is cleared.- Overrides:
setUser
in classGeneratedPDTRow
value
- the user
-
setPg
protected void setPg(SessionContext ctx, EnumerationValue value)
Whenever a non-null PG is set the product attribute is cleared.- Overrides:
setPg
in classGeneratedPDTRow
value
- the pg
-
setUg
public void setUg(SessionContext ctx, EnumerationValue value)
Whenever a non-null UG is set the user attribute is cleared.- Overrides:
setUg
in classGeneratedPDTRow
value
- the ug
-
removeLinks
protected void removeLinks()
Superclass method overridden to skip searching for links during removal of a PDTRow. PDTRows are not linked!- Overrides:
removeLinks
in classItem
-
getProductPriceGroup
@Deprecated public EnumerationValue getProductPriceGroup()
Deprecated.since ages - please use getProductGroup() insteadSpecified the product price group this rule is assigned to. This field is only of interest if no product was specified.Please note that by now product price groups are not managed by the hybris Platform, and therefore are only Strings.null
is a valid value and means that all groups are matched, while an empty String will result in an invisible PriceRow as it is only matching the "empty String" product price group.
-
getProductGroup
public EnumerationValue getProductGroup()
Specified the product price group this rule is assigned to. This field is only of interest if no product was specified.Please note that by now product price groups are not managed by the hybris Platform, and therefore are only Strings.null
is a valid value and means that all groups are matched, while an empty String will result in an invisible PriceRow as it is only matching the "empty String" product price group.
-
getProductPriceGroup
@Deprecated public EnumerationValue getProductPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getProductGroup( SessionContext ctx ) instead- Parameters:
ctx
-
-
getProductGroup
public EnumerationValue getProductGroup(SessionContext ctx)
- Parameters:
ctx
-
-
getCustomer
@Deprecated public Customer getCustomer()
Deprecated.since ages - please use getUser() instead.The customer this rule is assigned to. Ifnull
is set all customers are meant. If one is specified the customer price group field is not evaluated.
-
getCustomer
@Deprecated public Customer getCustomer(SessionContext ctx)
Deprecated.since ages - please use getUser(SessionContext) instead.SeegetCustomer()
.- Parameters:
ctx
-
-
getCustomerPriceGroup
@Deprecated public EnumerationValue getCustomerPriceGroup()
Deprecated.since ages - please use getCustomerGroup() insteadThe customer price group which this rule is assigned to. This applies only if no customer is specified. Please note that by now customer price groups are not managed by the hybris Platform, and therefore are only Strings.null
is a valid value and means that all groups are matched.
-
getCustomerGroup
@Deprecated public EnumerationValue getCustomerGroup()
Deprecated.since ages - please use getUserGroup instead.The customer price group which this rule is assigned to. This applies only if no customer is specified. Please note that by now customer price groups are not managed by the hybris Platform, and therefore are only Strings.null
is a valid value and means that all groups are matched.
-
getUserGroup
public EnumerationValue getUserGroup()
The user group which this rule is assigned to. This applies only if no user is specified. Please note that by now user groups are not managed by the hybris Platform, and therefore are only Strings.null
is a valid value and means that all groups are matched.
-
getCustomerPriceGroup
@Deprecated public EnumerationValue getCustomerPriceGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup( SessionContext ctx) instead- Parameters:
ctx
-
-
getCustomerGroup
@Deprecated public EnumerationValue getCustomerGroup(SessionContext ctx)
Deprecated.since ages - please use getUserGroup instead.SeegetCustomerGroup()
.- Parameters:
ctx
-
-
getUserGroup
public EnumerationValue getUserGroup(SessionContext ctx)
SeegetUserGroup()
.- Parameters:
ctx
-
-
getDateRange
public StandardDateRange getDateRange()
-
getDateRange
public StandardDateRange getDateRange(SessionContext ctx)
The range of time which this row is valid within. If null the row is always valid.
-
setDateRange
public void setDateRange(StandardDateRange dateRange)
-
setDateRange
public void setDateRange(SessionContext ctx, StandardDateRange dateRange)
Method setDateRange- Parameters:
ctx
-dateRange
-
-
remove
public void remove(SessionContext ctx) throws ConsistencyCheckException
Description copied from class:Item
Removes this item.This method is using the following attributes of the given SessionContext:
CacheUsage Language StagingMethod n/a (this is a setter method) no, language doesn't matter for removal yes if called on a StageableItem, no otherwise
- Overrides:
remove
in classItem
- Parameters:
ctx
- A SessionContext object- Throws:
ConsistencyCheckException
- if this item could not be removed for some reason
-
setProperty
public java.lang.Object setProperty(SessionContext ctx, java.lang.String name, java.lang.Object value)
Overwritten to mark owning product as modified each time a property of this row has been changed.- Overrides:
setProperty
in classExtensibleItem
- Parameters:
ctx
- A SessionContext objectname
- the name (key) of the propertyvalue
- the value- Returns:
- the property that was bound to the name or
null
if there was no property.
-
markProductModified
protected void markProductModified()
Marks the product which this row (might) belong to modified. This method is called upon all modifications done to a PDTRow to allow proper product modification status.
This functionality can be enabled / disabled using two config settings. First you can enabled / disable it using the session attribute
Europe1Constants.PDTROW_MARK_PRODUCT_MODIFIED
to true / false. If this session attribute is set to true, the product will be marked as modified independent of the other config setting. If set to false, the config property pdtrow.mark.product.modified configured in your local.properties will be evaluated, if set to true, the product will be marked modified, if set to false the mark as modified will be skipped.By default this feature is disabled (no session attribute set (-> false) and the default value in project.properties is set to false.
-
-