Definition at line 204 of file product.h.
typedef Id<Product> OSB_LIB::Product::Oid |
OSB_LIB::Product::Product | ( | const Oid & | oid, | |
const std::string & | name = "" , |
|||
const std::string & | des = "" | |||
) |
Constructor with object id.
ProductNode& OSB_LIB::Product::addNode | ( | const ProductNode::Oid & | parentId, | |
std::auto_ptr< ProductItem > | item | |||
) |
Insert a product node into the parts list of the proper parent.
The node is not added to the database. A new node is created with edit status `esCreated'. It will be added to the database when the product's saveNodes() method is called.
parentId | Id of parent node. | |
item | The product item owned by the node. |
OsbException |
|
int OSB_LIB::Product::buildNodeTree | ( | const ProductNode::Oid & | parentId, | |
ProductNodeParts & | parts, | |||
ProductNodeParts & | tmpList, | |||
std::vector< OsbError > & | errors, | |||
int | numErrors | |||
) | [private] |
Builds the product's node tree.
int OSB_LIB::Product::buildNodeTree | ( | const ProductNodeParts & | nodes, | |
std::vector< OsbError > & | errors | |||
) | [private] |
Builds the product's node tree.
The method iterates iterates the nodes list and populates the appropriate parts list. Checks thast the product item and parent of a node exist.
nodes | Nodes list to iterates iterates. | |
errors | Container of errors during build. |
void OSB_LIB::Product::creProductNode | ( | const OSB_DB::Session & | session, | |
ProductNode & | node | |||
) | [private] |
Create a new product node in the database.
void OSB_LIB::Product::delNode | ( | const ProductNode::Oid & | nodeId | ) |
Remove a product node.
The node is not removed from the database. Its edit status is set to `esDeleted'. It will be removed from the database when the product's saveNodes() method is called.
void OSB_LIB::Product::delNode | ( | ProductNode & | node | ) | [private] |
Mark a product node to be removed.
It is called by delNode(nodeId).
void OSB_LIB::Product::delNodeChildren | ( | const OSB_DB::Session & | session, | |
ProductNode & | parent | |||
) | [private] |
Deletes all the children of a product node from the database.
void OSB_LIB::Product::delProductNode | ( | const OSB_DB::Session & | session, | |
ProductNode & | node | |||
) | [private] |
Deletes a product node from the database.
All its children and product items will be deleted also.
session | Database session to use. | |
node | Product node to delete. |
OsbException | in case of a database error. |
const std::string& OSB_LIB::Product::desc | ( | ) | const |
Product description.
const ProductNode* OSB_LIB::Product::findProductNode | ( | const ProductNode::Oid & | nodeId | ) | const |
Get a const product node pointer by its id.
Id of pricelist.
Restrictions: The product will return only the first pricelist that it find if more than 1 pricelist items exist in the product items of the product.
const ProductNode& OSB_LIB::Product::getProductNode | ( | const ProductNode::Oid & | nodeId | ) | const |
Get a const product node reference by its id.
const std::string& OSB_LIB::Product::name | ( | ) | const |
Product name.
long OSB_LIB::Product::nextTempNodeId | ( | ) | [private] |
Decrement and return the next temporary product node id.
void OSB_LIB::Product::objVsPlus | ( | ) | [private] |
Increase object version.
const Oid& OSB_LIB::Product::oid | ( | ) | const |
Object id, database link.
ProductNodeParts& OSB_LIB::Product::parts | ( | ) |
None const 1st generation parts list.
const ProductNodeParts& OSB_LIB::Product::parts | ( | ) | const |
1st generation product nodes.
ProductNode* OSB_LIB::Product::productNode | ( | const ProductNode::Oid & | nodeId | ) |
Get a non-const product node pointer by its id.
ProductNode* OSB_LIB::Product::productNode | ( | const ProductNode::Oid & | nodeId, | |
ProductNodeParts & | parts | |||
) | [private] |
Get a non-const product node pointer by its id.
It is called by delNode(nodeId).
bool OSB_LIB::Product::read | ( | const OSB_DB::Session & | session | ) | [private] |
Read a product from the database.
void OSB_LIB::Product::saveItem | ( | const OSB_DB::Session & | session, | |
ProductItem * | item | |||
) | [private] |
Save changes made to a product item.
bool OSB_LIB::Product::saveNode | ( | const OSB_DB::Session & | session, | |
ProductNode & | node | |||
) | [private] |
Save changes made to a product node.
session | Database session to use. | |
node | Product node to save. |
OsbException | in case of a database error. |
void OSB_LIB::Product::saveNodes | ( | const OSB_DB::Session & | session, | |
ProductNodeParts & | parts | |||
) | [private] |
Save changes recursively made to all product nodes.
void OSB_LIB::Product::saveNodes | ( | const OSB_DB::Session & | session | ) | [private] |
Save changes made to all product nodes.
void OSB_LIB::Product::setDesc | ( | std::string & | desc | ) |
Set description.
void OSB_LIB::Product::setName | ( | std::string & | name | ) |
Set name.
void OSB_LIB::Product::sortNodeByName | ( | ProductNodeParts & | parts, | |
bool | desc = false | |||
) |
Sort product nodes by name.
parts | Product node parts. | |
desc | Flag to sort in descending (true) or ascending (false) order. |
void OSB_LIB::Product::sortNodeByName | ( | bool | desc = false |
) |
Sort product nodes by name.
desc | Flag to sort in descending (true) or ascending (false) order. |
std::ostream& operator<< | ( | std::ostream & | , | |
const Product & | ||||
) | [friend] |
friend class OSB_DB::ProductGw [friend] |
friend class ProductCatalogue [friend] |
std::string OSB_LIB::Product::des_ [private] |
std::string OSB_LIB::Product::name_ [private] |
long OSB_LIB::Product::objVs_ [private] |
Oid OSB_LIB::Product::oid_ [private] |
ProductNodeParts OSB_LIB::Product::parts_ [private] |
long OSB_LIB::Product::tempNodeId_ [private] |