|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.torweg.pulse.util.entity.AbstractBasicEntity
org.torweg.pulse.util.entity.AbstractNamedEntity
org.torweg.pulse.util.entity.AbstractNamableEntity
org.torweg.pulse.site.content.Variant<T>
org.torweg.pulse.site.content.AbstractBasicVariant<T>
org.torweg.pulse.site.content.AbstractSummaryDescriptionVariant<StoreVariant>
org.torweg.pulse.component.store.model.StoreVariant
org.torweg.pulse.component.shop.model.ShopVariant
@Entity public class ShopVariant
Represents an article variant in the shop.
| Field Summary |
|---|
| Fields inherited from class org.torweg.pulse.site.content.Variant |
|---|
LOGGER |
| Constructor Summary | |
|---|---|
ShopVariant()
Deprecated. |
|
ShopVariant(java.lang.String pOrderCode)
The constructor that sets the order code of the ShopVariant. |
|
| Method Summary | |
|---|---|
ShopVariant |
createCopy(Content content)
Creates a non-persistent (therefore id = null) copy of the current ShopVariant. |
void |
decreaseStockBy(int amnt)
Decreases the stock by the given amount. |
org.jdom.Element |
deserializeToJDOM()
Returns the state of the ShopVariant as a JDOM Element. |
org.jdom.Element |
deserializeToJDOM(ServiceRequest pServiceRequest)
Returns the state of the ShopVariant as a JDOM Element. |
java.lang.Integer |
getAbsoluteMaxOrderSize(User user)
returns the absolute minimum order size of all Prices available
to the given User. |
java.lang.Integer |
getAbsoluteMinOrderSize(User user)
returns the absolute minimum order size of all Prices available
to the given User. |
java.util.List<Price> |
getAvailablePrices(User user)
returns a list of Prices which are available to the given
User, ordered by Price.getAmount(), Price.getMinOrderSize(). |
Price |
getBestPrice(User pUser,
int pAmount)
Returns the best Price for the given User and the given
amount. |
java.util.Set<Price> |
getPrices()
Returns the Prices of the ShopVariant. |
java.util.Set<Price> |
getPrices(Status s)
returns all Prices with the given status. |
java.util.Set<Price> |
getPrices(Status s,
int a)
returns all Prices with the given status available for the given
amount. |
java.lang.String |
getShopItemId()
returns a string identifying the ShopItem, starting with
v for Variants followed by the primary key. |
Status |
getStatus()
Returns the Status of the ShopVariant. |
java.lang.Integer |
getStock()
Returns the stock of the ShopVariant, or null, if the
stock is not maintained for the ShopVariant. |
void |
increaseStockBy(int amnt)
Increases the stock by the given amount. |
boolean |
isStockMaintainable()
Determines whether the stock is maintainable for the ShopVariant. |
boolean |
isStockMaintained()
Determines whether the stock is maintained for the ShopVariant. |
void |
setContent(Content pShopContent)
Sets the ShopContent of the ShopVariant. |
void |
setPrices(java.util.Set<Price> pPrices)
Sets the Prices of the ShopVariant. |
void |
setStatus(Status pStatus)
Sets the Status of the ShopVariant. |
void |
setStock(java.lang.Integer pStock)
Sets the stock of the ShopVariant. |
| Methods inherited from class org.torweg.pulse.component.store.model.StoreVariant |
|---|
getAlternativeImages, getFullTextValue, getMainImage, getOrderCode, onVirtualFileSystemChange, setAlternativeImages, setMainImage, setOrderCode, updateAssociatedFiles |
| Methods inherited from class org.torweg.pulse.site.content.AbstractSummaryDescriptionVariant |
|---|
getDescription, getDescriptionElement, getLinkCorrectables, setDescription |
| Methods inherited from class org.torweg.pulse.site.content.AbstractBasicVariant |
|---|
getContent, getSummary, getSummaryElement, setSummary |
| Methods inherited from class org.torweg.pulse.site.content.Variant |
|---|
addVariant, compareTo, equals, getAssociatedVirtualFiles, getAttachments, getParentVariant, getVariants, hashCode, processHTML, removeVariant, setAssociatedVirtualFiles, setAttachments, setVariants, updateHTML |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity |
|---|
setName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity |
|---|
getName |
| Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity |
|---|
compareTo, getFullQualifiedClassNameJAXB, getId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.torweg.pulse.component.store.model.StoreItem |
|---|
equals, getAlternativeImages, getAssociatedVirtualFiles, getAttachments, getDescription, getDescriptionElement, getFullTextValue, getId, getMainImage, getOrderCode, getSummary, getSummaryElement, hashCode, onVirtualFileSystemChange, setAlternativeImages, setAssociatedVirtualFiles, setAttachments, setDescription, setMainImage, setOrderCode, setSummary |
| Methods inherited from interface org.torweg.pulse.util.INameable |
|---|
setName |
| Methods inherited from interface org.torweg.pulse.util.INamed |
|---|
getName |
| Methods inherited from interface org.torweg.pulse.site.content.IHasVariants |
|---|
getVariants |
| Constructor Detail |
|---|
@Deprecated public ShopVariant()
public ShopVariant(java.lang.String pOrderCode)
ShopVariant.
pOrderCode - the order code to be set.| Method Detail |
|---|
public final java.lang.String getShopItemId()
ShopItem, starting with
v for Variants followed by the primary key.
getShopItemId in interface ShopItemShopItem.getShopItemId()public void setContent(Content pShopContent)
ShopContent of the ShopVariant.
setContent in class StoreVariantpShopContent - the ShopContent to be set.public final Status getStatus()
Status of the ShopVariant.
getStatus in interface ShopItemStatus of the ShopVariant.public final void setStatus(Status pStatus)
Status of the ShopVariant.
setStatus in interface ShopItempStatus - the Status to be set.public final java.util.Set<Price> getPrices()
Prices of the ShopVariant.
getPrices in interface ShopItemPrices of the ShopVariant. (reference)public final java.util.Set<Price> getPrices(Status s)
Prices with the given status.
getPrices in interface ShopItems - the status
Prices
public final java.util.Set<Price> getPrices(Status s,
int a)
Prices with the given status available for the given
amount.
getPrices in interface ShopItems - the statusa - the amount
Pricespublic final void setPrices(java.util.Set<Price> pPrices)
Prices of the ShopVariant.
setPrices in interface ShopItempPrices - the Prices to be set. (overwrite matching)
public final Price getBestPrice(User pUser,
int pAmount)
Price for the given User and the given
amount.
getBestPrice in interface ShopItempUser - the User to get the best Price for.pAmount - the amount of items the best Price has to be valid
for.
Price for the given User and the given
amount.public final java.lang.Integer getAbsoluteMinOrderSize(User user)
Prices available
to the given User.
getAbsoluteMinOrderSize in interface ShopItemuser - the user
ShopItem.getAbsoluteMinOrderSize(org.torweg.pulse.accesscontrol.User)public final java.lang.Integer getAbsoluteMaxOrderSize(User user)
Prices available
to the given User.
getAbsoluteMaxOrderSize in interface ShopItemuser - the user
ShopItem.getAbsoluteMinOrderSize(org.torweg.pulse.accesscontrol.User)public final java.util.List<Price> getAvailablePrices(User user)
Prices which are available to the given
User, ordered by Price.getAmount(), Price.getMinOrderSize().
getAvailablePrices in interface ShopItemuser - the user
PricesShopItem.getAvailablePrices(User)public final java.lang.Integer getStock()
ShopVariant, or null, if the
stock is not maintained for the ShopVariant.
getStock in interface ShopItemShopVariant, or nullpublic final void setStock(java.lang.Integer pStock)
ShopVariant. If the given stock is
null, it means that the stock is not maintained for the
ShopVariant.
setStock in interface ShopItempStock - the stock to set, or null
java.lang.IllegalStateException - if there are ShopVariants associated with the
ShopVariant and the given stock is not nullpublic final boolean isStockMaintainable()
ShopVariant.
isStockMaintainable in interface ShopItemtrue if the stock is maintainable for the
ShopVariant. Returns false, otherwise.public final boolean isStockMaintained()
ShopVariant.
isStockMaintained in interface ShopItemtrue if the stock is maintained for the
ShopVariant. Returns false, otherwise.ShopItem.isStockMaintained()public final void increaseStockBy(int amnt)
increaseStockBy in interface ShopItemamnt - the amount
java.lang.IllegalStateException - if the stock is not maintained for the ShopVariantShopItem.increaseStockBy(int)public final void decreaseStockBy(int amnt)
decreaseStockBy in interface ShopItemamnt - the amount
java.lang.IllegalStateException - if the stock is not maintained for the ShopVariantShopItem.decreaseStockBy(int)public org.jdom.Element deserializeToJDOM()
ShopVariant as a JDOM Element.
deserializeToJDOM in interface JDOMabledeserializeToJDOM in class StoreVariantShopVariant as a JDOM Element.public org.jdom.Element deserializeToJDOM(ServiceRequest pServiceRequest)
ShopVariant as a JDOM Element.
deserializeToJDOM in interface ExtendedJDOMabledeserializeToJDOM in class StoreVariantpServiceRequest - the current ServiceRequest or null.
ShopVariant as a JDOM Element.public ShopVariant createCopy(Content content)
ShopVariant.
createCopy in class StoreVariantcontent - the parent Content
ShopVariant.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||