pCon.planner Plugin SDK  Version 8.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Properties | Events | List of all members
X3g::Plugin::IArticleManager Class Reference

Article Manager. More...

Public Member Functions

void PrepareArticleEntities ()
 Prepares all article entities in the document. More...
 
bool IsArticle (String^ pEntityId)
 Checks if the given id belongs to an article. More...
 
IArticleEntityGetArticleEntity (String^ pEntityId)
 Retrieves the article behind id 'pEntityId' (see DbEntity::Id). More...
 
IArticleEntityInsertArticle (String^ pManufacturerId, String^ pSeriesId, String^ pBaseArticleNumber, String^ pVariantCode, bool pKeepInstanced)
 Inserts a new article. More...
 
IArticleEntityInsertArticle (String^ pManufacturerId, String^ pSeriesId, String^ pBaseArticleNumber, String^ pVariantCode, bool pKeepInstanced, ArticleGeometryMode pGeoMode)
 Inserts a new article. More...
 
Articles::ArticleEntityInsertArticleByPackage (String^ pCatalogPkgName, String^ pArticlePkgName, String^ pArticleNumber, String^ pVariantCode, bool pKeepInstanced, ArticleGeometryMode pGeoMode)
 Inserts an article from given package. More...
 
IArticleEntityCreateUserArticle (String^ pEntityId)
 Creates an user article from the given entity/geometry. More...
 
IArticleEntityCreateUserArticle (DbBlockReference^ pEntity)
 Creates an user article from a given block reference. More...
 
bool ConvertToUserArticle (IArticleEntity^ pArticle)
 Converts the given article to a user article. More...
 
ReadOnlyCollection< String^ >^ SplitUpArticle (IArticleEntity^ pArticle)
 Splits-up a configuration or an article with childs into separate articles. More...
 
bool UpdateArticleToCurrentPD (IArticleEntity^ pArticle)
 Updates the given article and all its sub-articles to the currently installed product data (OFML). More...
 
bool UpdateArticleToCurrentPD (IArticleEntity^ pArticle, DateTime pPriceDate)
 Updates the given article and all its sub-articles to the currently installed product data (OFML). More...
 
IArticleInstanceInstantiateArticle (IArticleEntity^ pArticle, ReadOnlyCollection< String^ >^pAdditionalLang)
 Intantiates the given article and selects it to give access to its properties. More...
 
IFolderManagerGetFolderManager ()
 Returns the folder manager. More...
 
IProjectSettingsGetProjectSettings ()
 Returns the project settings. More...
 
IList< String^ >^ GetEffectiveArticleLanguages ()
 Returns effective product data languages as two-letter country codes. More...
 
IList< String^ >^ GetEffectiveCatalogLanguages ()
 Returns effective catalog languages as two-letter country codes. More...
 
IBasketGenerateBasket (BasketGenerationFlags pFlags, ReadOnlyCollection< String^ >^pAdditionalLang)
 Generates the basket view. More...
 
virtual bool ExportBasketToObx (BasketGenerationFlags pFlags, System::String^ pFilename)
 Generates the basket view and exports it to an obx file. More...
 
bool ExportBasketToObk (BasketGenerationFlags pFlags, System::String^ pFilename)
 Generates the basket view and exports it to an obk file. More...
 
bool ExportBasketToCsv (BasketGenerationFlags pFlags, System::String^ pFilename)
 Generates the basket view and exports it to an csv file. More...
 

Properties

IArticleInstance^  CurrentInstance [get]
 Current instanced article. More...
 

Events

Articles::ArticleInsertedEventHandler^  ArticleInserted [add, remove, raise]
 Occurs when article was inserted from catalog. More...
 
Articles::AssignDefaultPropValuesHandler^  AssignDefaultPropValues [add, remove, raise]
 Allows to initialize ofml articles with default property values before insertion. More...
 

Detailed Description

Article Manager.

Member Function Documentation

bool X3g::Plugin::IArticleManager::ConvertToUserArticle ( IArticleEntity pArticle)

Converts the given article to a user article.

Returns true if the conversion was successful.

The article must not be a configuration or has child articles. IArticleManager::SplitUpArticle() can be used to split-up those articles.

IArticleEntity ^ X3g::Plugin::IArticleManager::CreateUserArticle ( String pEntityId)

Creates an user article from the given entity/geometry.

The entity must not be part of an article or include articles. The entity will be cloned to a block and a new block reference is created for the user article. The original entity is removed.

IArticleEntity X3g::Plugin::IArticleManager::CreateUserArticle ( DbBlockReference pEntity)

Creates an user article from a given block reference.

The block reference must not be part of an article or include articles. The returned article entity will attach it's data directly to the given block reference. No additional block or block reference is created. The given block reference stays valid.

bool X3g::Plugin::IArticleManager::ExportBasketToCsv ( BasketGenerationFlags  pFlags,
System::String^  pFilename 
)

Generates the basket view and exports it to an csv file.

Returns true if the export was successful.

The flags PrepareCatalogImages and PrepareGeneratedImages will be ignored.

bool X3g::Plugin::IArticleManager::ExportBasketToObk ( BasketGenerationFlags  pFlags,
System::String^  pFilename 
)

Generates the basket view and exports it to an obk file.

Returns true if the export was successful.

The flags PrepareCatalogImages and PrepareGeneratedImages will be ignored.

bool X3g::Plugin::IArticleManager::ExportBasketToObx ( BasketGenerationFlags  pFlags,
System::String^  pFilename 
)
virtual

Generates the basket view and exports it to an obx file.

Returns true if the export was successful.

The flags PrepareCatalogImages and PrepareGeneratedImages will be ignored.

X3g::Plugin::IBasket X3g::Plugin::IArticleManager::GenerateBasket ( BasketGenerationFlags  pFlags,
ReadOnlyCollection< String^ >^  pAdditionalLang 
)

Generates the basket view.

The generated basket represents a static article list. If changes are made to the document, the basket needs to be generated again. IBasket provides the article information for different languages. The availalbe languages depend on the current application settings. The pAdditionalLang parameter can be used to request additional languages. Any open ModelSpace block will be closed and set to be the current selection.

Parameters
pAdditionalLangList of additional two letter ISO language keys.
X3g::Plugin::IArticleEntity X3g::Plugin::IArticleManager::GetArticleEntity ( String pEntityId)

Retrieves the article behind id 'pEntityId' (see DbEntity::Id).

PrepareArticleEntities() needs to be called once before using this function. Otherwise, the funcion may return null or an article with an invalid BasketId.

IList< String^ > X3g::Plugin::IArticleManager::GetEffectiveArticleLanguages ( )

Returns effective product data languages as two-letter country codes.

Primary language at index 0.

IList< String^ > X3g::Plugin::IArticleManager::GetEffectiveCatalogLanguages ( )

Returns effective catalog languages as two-letter country codes.

Primary language at index 0.

X3g::Plugin::IFolderManager X3g::Plugin::IArticleManager::GetFolderManager ( )

Returns the folder manager.

X3g::Plugin::IProjectSettings X3g::Plugin::IArticleManager::GetProjectSettings ( )

Returns the project settings.

IArticleEntity ^ X3g::Plugin::IArticleManager::InsertArticle ( String pManufacturerId,
String pSeriesId,
String pBaseArticleNumber,
String pVariantCode,
bool  pKeepInstanced 
)

Inserts a new article.

If pKeepInstanced is true the article will stay instantiated. This will speed-up a subsequent call to IArticleManager::InstantiateArticle() for the inserted article. Geometry mode depends on user setting in pCon.planner.

IArticleEntity X3g::Plugin::IArticleManager::InsertArticle ( String pManufacturerId,
String pSeriesId,
String pBaseArticleNumber,
String pVariantCode,
bool  pKeepInstanced,
ArticleGeometryMode  pGeoMode 
)

Inserts a new article.

If pKeepInstanced is true the article will stay instantiated. This will speed-up a subsequent call to IArticleManager::InstantiateArticle() for the inserted article. Allows to specify the geometry mode.

Articles::ArticleEntity X3g::Plugin::IArticleManager::InsertArticleByPackage ( String pCatalogPkgName,
String pArticlePkgName,
String pArticleNumber,
String pVariantCode,
bool  pKeepInstanced,
ArticleGeometryMode  pGeoMode 
)

Inserts an article from given package.

Parameters
pCatalogPkgNameName of catalog package which references the article.
pArticlePkgNameName of package which contains the article data.
pArticleNumberThe article number.
pVariantCodeThe variant code.
pKeepInstancedArticle stays instanced for configuration.
pGeoModeSet ArticleGeometryMode::Undefined to apply user setting.
X3g::Plugin::IArticleInstance X3g::Plugin::IArticleManager::InstantiateArticle ( IArticleEntity pArticle,
ReadOnlyCollection< String^ >^  pAdditionalLang 
)

Intantiates the given article and selects it to give access to its properties.

IArticleInstance provides the article information for different languages. The availalbe languages depend on the current application settings. The pAdditionalLang parameter can be used to request additional languages.

Parameters
pAdditionalLangList of additional two letter ISO language keys.
Exceptions
System::ExceptionAn exception will be thrown if the instantiation failed.
bool X3g::Plugin::IArticleManager::IsArticle ( String pEntityId)

Checks if the given id belongs to an article.

void X3g::Plugin::IArticleManager::PrepareArticleEntities ( )

Prepares all article entities in the document.

This function ensures that each article resides in an unique block hirarchie and has a unique BasketId. (IArticleEntity::ArticleInformation::BasketId)

This function needs to be called everytime before using GetArticleEntity() if the block structure of the document may have changed. (e.g. an article was grouped or grouped articles were copied)

The block structure may have changed after calling this function. Therefore, it should be called before iterating the hirarchie (DbBlock) of the document.

ReadOnlyCollection< System::String^ > X3g::Plugin::IArticleManager::SplitUpArticle ( IArticleEntity pArticle)

Splits-up a configuration or an article with childs into separate articles.

Returns the ids of the separated articles.

bool X3g::Plugin::IArticleManager::UpdateArticleToCurrentPD ( IArticleEntity pArticle)

Updates the given article and all its sub-articles to the currently installed product data (OFML).

Keeps the saved price date. Returns true if the update was successful.

bool X3g::Plugin::IArticleManager::UpdateArticleToCurrentPD ( IArticleEntity pArticle,
DateTime  pPriceDate 
)

Updates the given article and all its sub-articles to the currently installed product data (OFML).

Updates prices to given price date. Returns true if the update was successful.

Property Documentation

IArticleInstance^ X3g::Plugin::IArticleManager::CurrentInstance
get

Current instanced article.

Event Documentation

Articles:: ArticleInsertedEventHandler^ X3g::Plugin::IArticleManager::ArticleInserted
addremoveraise

Occurs when article was inserted from catalog.

Articles:: AssignDefaultPropValuesHandler^ X3g::Plugin::IArticleManager::AssignDefaultPropValues
addremoveraise

Allows to initialize ofml articles with default property values before insertion.

Handlers should return true if they assigned any property values.