|
|
|
|
|
||||||||||
| 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.Content
org.torweg.pulse.site.content.AbstractBasicContent
org.torweg.pulse.site.content.AbstractSummaryDescriptionContent
org.torweg.pulse.component.store.model.StoreContent
org.torweg.pulse.component.shop.model.ShopContent
@Entity public class ShopContent
Represents an article in the shop.
| Field Summary |
|---|
| Fields inherited from class org.torweg.pulse.site.content.AbstractBasicContent |
|---|
DEFAULT_SUFFIX |
| Constructor Summary | |
|---|---|
ShopContent()
Deprecated. |
|
ShopContent(java.util.Locale pLocale, Bundle pBundle)
The constructor that sets the Locale and the Bundle of
the ShopContent. |
|
| Method Summary | |
|---|---|
ShopContent |
createCopy(java.util.Locale l, User u)
Creates a non-persistent (therefore id = null) copy of the current ShopContent with the given Locale. |
void |
decreaseStockBy(int amnt)
Decreases the stock by the given amount. |
org.jdom.Element |
deserializeToJDOM()
Returns the state of the ShopContent as a JDOM Element. |
org.jdom.Element |
deserializeToJDOM(ServiceRequest pServiceRequest)
Returns the state of the ShopContent 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 ShopContent. |
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
c for Contents followed by the primary key. |
Status |
getStatus()
Returns the Status of the ShopContent. |
java.lang.Integer |
getStock()
Returns the stock of the ShopContent, or null, if the
stock is not maintained for the ShopContent. |
java.util.Set<? extends Variant<?>> |
getVariants()
Returns the ShopVariants of the ShopContent. |
void |
increaseStockBy(int amnt)
Increases the stock by the given amount. |
boolean |
isStockMaintainable()
Determines whether the stock is maintainable for the ShopContent. |
boolean |
isStockMaintained()
Determines whether the stock is maintained for the ShopContent. |
void |
setPrices(java.util.Set<Price> pPrices)
Sets the Prices of the ShopContent. |
void |
setStatus(Status pStatus)
Sets the Status of the ShopContent. |
void |
setStock(java.lang.Integer pStock)
Sets the stock of the ShopContent. |
void |
setVariants(java.util.Set<? extends Variant<?>> pShopVariants)
Sets the ShopVariants of the ShopContent. |
| Methods inherited from class org.torweg.pulse.component.store.model.StoreContent |
|---|
getAlternativeImages, getFullTextValue, getLinkCorrectables, getMainImage, getOrderCode, isGroup, onVirtualFileSystemChange, setAlternativeImages, setMainImage, setOrderCode, updateAssociatedVirtualFiles |
| Methods inherited from class org.torweg.pulse.site.content.AbstractSummaryDescriptionContent |
|---|
getDescription, getDescriptionElement, setDescription |
| Methods inherited from class org.torweg.pulse.site.content.AbstractBasicContent |
|---|
getKeywords, getMetaDescription, getMetaKeywords, getSuffix, getSummary, getSummaryElement, getTitle, setKeywords, setMetaDescription, setMetaKeywords, setSuffix, setSummary, setTitle |
| 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, finalize, getClass, hashCode, notify, notifyAll, 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 |
| Constructor Detail |
|---|
@Deprecated public ShopContent()
public ShopContent(java.util.Locale pLocale, Bundle pBundle)
Locale and the Bundle of
the ShopContent.
pLocale - the Locale to be set.pBundle - the Bundle to be set.| Method Detail |
|---|
public final java.lang.String getShopItemId()
ShopItem, starting with
c for Contents followed by the primary key.
getShopItemId in interface ShopItemShopItem.getShopItemId()public java.util.Set<? extends Variant<?>> getVariants()
ShopVariants of the ShopContent.
getVariants in interface IHasVariantsgetVariants in class StoreContentShopVariants of the ShopContent. (shallow
copy)public void setVariants(java.util.Set<? extends Variant<?>> pShopVariants)
ShopVariants of the ShopContent.
setVariants in class StoreContentpShopVariants - the ShopVariants to be set. (final)
java.lang.IllegalStateException - if the order code and/or the stock is not nullpublic final Status getStatus()
Status of the ShopContent.
getStatus in interface ShopItemStatus of the ShopContent.public final void setStatus(Status pStatus)
Status of the ShopContent.
setStatus in interface ShopItempStatus - the Status to be set.public final java.util.Set<Price> getPrices()
Prices of the ShopContent.
getPrices in interface ShopItemPrices of the ShopContent. (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 ShopContent.
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()
ShopContent, or null, if the
stock is not maintained for the ShopContent.
getStock in interface ShopItemShopContent, or nullShopItem.getStock()public final void setStock(java.lang.Integer pStock)
ShopContent. If the given stock is
null, it means that the stock is not maintained for the
ShopContent.
setStock in interface ShopItempStock - the stock to set, or null
java.lang.IllegalStateException - if there are ShopVariants associated with the
ShopContent and the given stock is not nullShopItem.setStock(Integer)public final boolean isStockMaintainable()
ShopContent.
isStockMaintainable in interface ShopItemtrue if the stock is maintainable for the
ShopContent. Returns false, otherwise.public final boolean isStockMaintained()
ShopContent.
isStockMaintained in interface ShopItemtrue if the stock is maintained for the
ShopContent. 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 ShopContentShopItem.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 ShopContentShopItem.decreaseStockBy(int)public org.jdom.Element deserializeToJDOM()
ShopContent as a JDOM Element.
deserializeToJDOM in interface JDOMabledeserializeToJDOM in class StoreContentShopContent as a JDOM Element.public org.jdom.Element deserializeToJDOM(ServiceRequest pServiceRequest)
ShopContent as a JDOM Element.
deserializeToJDOM in interface ExtendedJDOMabledeserializeToJDOM in class StoreContentpServiceRequest - the current ServiceRequest or null.
ShopContent as a JDOM Element.public ShopContent createCopy(java.util.Locale l, User u)
ShopContent with the given Locale.
createCopy in class StoreContentl - the Locale to be used.u - the User to be used as the creator/last modifier of
the copied Content
ShopContent.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||