OSB_LIB::ProductCatalogue Class Reference

Collaboration diagram for OSB_LIB::ProductCatalogue:

Collaboration graph
[legend]
List of all members.

Detailed Description

Manager of product related classes.

Definition at line 65 of file productcat.h.

Public Member Functions

Product maintenace
Pricelist maintenace
SubsFuncCfgs maintenace
Read access to product item types

Private Types

Private Member Functions

Product maintenace
Product catalogue internal search functions

Private Attributes

Friends


Member Typedef Documentation

typedef TypeId<ProductItemBase> OSB_LIB::ProductCatalogue::PiType [private]

Shorthand for product item type id.

Definition at line 402 of file productcat.h.


Constructor & Destructor Documentation

OSB_LIB::ProductCatalogue::ProductCatalogue (  )  [private]

Default Constructor.

OSB_LIB::ProductCatalogue::~ProductCatalogue (  )  [private]

Destructor.

OSB_LIB::ProductCatalogue::ProductCatalogue ( const ProductCatalogue rhs  )  [private]

Prevent copying: not defined.


Member Function Documentation

bool OSB_LIB::ProductCatalogue::addPricelist ( OSB_DB::Session session,
Pricelist pl 
)

Add a price list to the database and master list.

Parameters:
session Database Session to use.
pl Pricelist to be added.
Exceptions:
DbException if database error occurs.
Returns:
True if new price list was inserted successfully.

bool OSB_LIB::ProductCatalogue::addPricelistCfg ( OSB_DB::Session session,
PricelistCfg plCfg 
)

Add a price list configuration to the database and master list.

Parameters:
session Database session to use.
plCfg Price list configuration to be added.
Exceptions:
DbException if database error occurs.
Returns:
True if new price list configuration was inserted successfully.

void OSB_LIB::ProductCatalogue::addProduct ( OSB_DB::Session session,
Product pd 
) [private]

Creates a new product in the database.

Parameters:
session The database session.
pd The new product (oid not set).
Exceptions:
OsbException 
  • in case name or description too long.
  • unique database constraint violated.
  • any other database error.

void OSB_LIB::ProductCatalogue::buildNodeTree ( const OSB_DB::Session session  )  [private]

Constructs the product node trees.

bool OSB_LIB::ProductCatalogue::checkPricelistCfg ( OSB_DB::Session session,
PricelistCfg::Oid plCfg 
)

Change the status of a price list configuration from editable to standby.

Parameters:
session Database session to use.
plCfg Unique id of price list configuration to be modified.
Exceptions:
DbException if database error occurs.
Returns:
True if status of price list configuration was changed successfully.

bool OSB_LIB::ProductCatalogue::delPricelist ( OSB_DB::Session session,
Pricelist::Oid pl 
)

Delete a price list fom the database and master list.

Parameters:
session Database Session to use.
pl Unique id of Pricelist to be deleted.
Exceptions:
DbException if database error occurs.
Returns:
True if price list was deleted successfully.

bool OSB_LIB::ProductCatalogue::delPricelistCfg ( OSB_DB::Session session,
PricelistCfg::Oid plCfg 
)

Delete a price list configuration from the database and master list.

Parameters:
session Database session to use.
plCfg Unique id of Price list configuration to be deleted.
Exceptions:
DbException if database error occurs.
Returns:
True if price list configuration was deleted successfully.

void OSB_LIB::ProductCatalogue::delProduct ( OSB_DB::Session session,
const Product::Oid pdId 
)

Deletes a product from the database.

Parameters:
session The database session.
pdId Id of the product to delete.
Exceptions:
OsbException 
  • in case cannot delete product from database.

const Pricelist* OSB_LIB::ProductCatalogue::findPricelist ( const Pricelist::Oid  )  const

Find a pricelist and give readonly access.

const PricelistCfg* OSB_LIB::ProductCatalogue::findPricelistCfg ( const PricelistCfg::Oid  )  const

Get a pricelist configuration and give only read access.

const PricelistCfg* OSB_LIB::ProductCatalogue::findPricelistCfg ( const Pricelist::Oid oid,
const DateTime refDate 
) const

Get a released pricelist configuration valid for a date.

Parameters:
oid Unique id of pricelist.
refDate Date criteria.
Returns:
Pricelist configuration if found, else return 0.

const Product* OSB_LIB::ProductCatalogue::findProduct ( const Product::Oid pdId  )  const

Find a product and give readonly access.

const SubsFuncCfg* OSB_LIB::ProductCatalogue::findSubsFuncCfg ( const SubsFuncCfg::Oid  )  const

Get a subscription function configuration.

const Pricelist& OSB_LIB::ProductCatalogue::getPricelist ( const Pricelist::Oid  )  const

Find a pricelist and give readonly access.

const PricelistCfg& OSB_LIB::ProductCatalogue::getPricelistCfg ( const PricelistCfg::Oid  )  const

Get a pricelist configuration and give only read access.

PcatLockMgr& OSB_LIB::ProductCatalogue::lockMgr (  ) 

Set the lock manager of this product catalogue.

Allocates a new lock manager for this product catalogue, if there doesn't exist one, yet.

Returns:
Returns a reference to the lock manager.

ProductCatalogue& OSB_LIB::ProductCatalogue::operator= ( const ProductCatalogue rhs  )  [private]

Prevent assignment: not defined.

const ProductItemTypes::Info& OSB_LIB::ProductCatalogue::piType ( const PiType type  )  const

Get a product item type by id.

const ProductItemTypes& OSB_LIB::ProductCatalogue::piTypes (  )  const [inline]

Get the list of supported product item types.

Definition at line 409 of file productcat.h.

References piTypes_.

Pricelist* OSB_LIB::ProductCatalogue::pricelist ( const Pricelist::Oid  ) 

Find a pricelist and give write access.

PricelistCfg* OSB_LIB::ProductCatalogue::pricelistCfg ( const PricelistCfg::Oid  ) 

Get a pricelist configuration and give write access.

const PricelistCfgs& OSB_LIB::ProductCatalogue::pricelistCfgs (  )  const [inline]

Read access to pricelist configurations.

Definition at line 278 of file productcat.h.

References pricelistCfgs_.

const Pricelists& OSB_LIB::ProductCatalogue::pricelists (  )  const [inline]

Read access to the whole pricelist list.

Definition at line 204 of file productcat.h.

References pricelists_.

std::ostream& OSB_LIB::ProductCatalogue::prInfo ( std::ostream &   ) 

Prints the catalogue (for testing only).

Product* OSB_LIB::ProductCatalogue::product ( const Product::Oid productId  )  [private]

Find a product and give write access.

const Products& OSB_LIB::ProductCatalogue::products (  )  const [inline]

Read access to the whole product list.

Definition at line 177 of file productcat.h.

References products_.

void OSB_LIB::ProductCatalogue::read ( const OSB_DB::Session  ) 

Loads the ProductCatalogue from database.

bool OSB_LIB::ProductCatalogue::releasePricelistCfg ( OSB_DB::Session session,
PricelistCfg::Oid plCfg 
)

Change the status of a price list configuration from standby to released.

Parameters:
session Database session to use.
plCfg Unique id of price list configuration to be modified.
Exceptions:
DbException if database error occurs.
Returns:
True if status of price list configuration was changed successfully.

bool OSB_LIB::ProductCatalogue::revokePricelistCfg ( OSB_DB::Session session,
PricelistCfg::Oid plCfg 
)

Change the status of a price list configuration from released to standby.

Parameters:
session Database session to use.
plCfg Unique id of price list configuration to be modified.
Exceptions:
DbException if database error occurs.
Returns:
True if status of price list configuration was changed successfully.

void OSB_LIB::ProductCatalogue::saveProduct ( OSB_DB::Session session,
Product pd 
)

Saves a product to the database.

This method delegates to addProduct() or updProduct().

Parameters:
session The database session.
pd The product to save.
Exceptions:
OsbException 
  • in case cannot create/update product in database.

int OSB_LIB::ProductCatalogue::setPlSubsFunc (  )  [private]

Set subscription function pointers for pricelist versions.

void OSB_LIB::ProductCatalogue::sortPricelistByName ( bool  desc = false  ) 

Sort price lists by name.

Parameters:
desc Flag to sort in descending (true) or ascending (false) order.

void OSB_LIB::ProductCatalogue::sortProdByName ( bool  desc = false  ) 

Sort products by name.

Parameters:
desc Flag to sort in descending (true) or ascending (false) order.

const SubsFuncCfgs& OSB_LIB::ProductCatalogue::subsFuncCfgs (  )  const [inline]

Read access to subscription function configurations.

Definition at line 391 of file productcat.h.

References subsFuncCfgs_.

bool OSB_LIB::ProductCatalogue::unfreezePricelistCfg ( OSB_DB::Session session,
PricelistCfg::Oid plCfg 
)

Change the status of a price list configuration from standby to editable.

Parameters:
session Database session to use.
plCfg Unique id of price list configuration to be modified.
Exceptions:
DbException if database error occurs.
Returns:
True if status of price list configuration was changed successfully.

bool OSB_LIB::ProductCatalogue::updPricelist ( OSB_DB::Session session,
Pricelist pl 
)

Update a price list to the database and master list.

Parameters:
session Database Session to use.
pl Pricelist to be updated.
Exceptions:
DbException if database error occurs.
Returns:
True if price list was updated successfully.

bool OSB_LIB::ProductCatalogue::updPricelistCfg ( OSB_DB::Session session,
PricelistCfg plCfg 
)

Update a price list configuration to the database and master list.

Parameters:
session Database session to use.
plCfg Price list configuration to be updated.
Exceptions:
DbException if database error occurs.
Returns:
True if price list configuration was updated successfully.

void OSB_LIB::ProductCatalogue::updProduct ( OSB_DB::Session session,
Product pd 
) [private]

Updates database with new information of product.

Parameters:
session The database session.
pd The product to update (oid is set).
Exceptions:
OsbException 
  • in case name or description too long.
  • unique database constraint violated.
  • any other database error.


Friends And Related Function Documentation

friend class PcatLockMgr [friend]

For the implementation of the various write guards, the lock manager needs non-const access to the pricelist.

Definition at line 71 of file productcat.h.

friend class PcatMgr [friend]

Allow construction and destruction.

Definition at line 73 of file productcat.h.


Member Data Documentation

PcatLockMgr* OSB_LIB::ProductCatalogue::pcatLm_ [private]

Productcatalogue lock manager.

Definition at line 448 of file productcat.h.

ProductItemTypes OSB_LIB::ProductCatalogue::piTypes_ [private]

List of product item types.

Definition at line 445 of file productcat.h.

Referenced by piTypes().

PricelistCfgs OSB_LIB::ProductCatalogue::pricelistCfgs_ [private]

Pricelist data.

Definition at line 440 of file productcat.h.

Referenced by pricelistCfgs().

Pricelists OSB_LIB::ProductCatalogue::pricelists_ [private]

Pricelist descriptions.

Definition at line 438 of file productcat.h.

Referenced by pricelists().

Products OSB_LIB::ProductCatalogue::products_ [private]

Master list of products.

Definition at line 436 of file productcat.h.

Referenced by products().

SubsFuncCfgs OSB_LIB::ProductCatalogue::subsFuncCfgs_ [private]

Subs. function configs.

Definition at line 442 of file productcat.h.

Referenced by subsFuncCfgs().


The documentation for this class was generated from the following file:
Generated on Sat Sep 2 14:12:44 2006 for OSB Library by  doxygen 1.4.7