Catalog Modeler |
Catalog OverviewEssential characteristics and mechanisms of catalog documents |
|
Technical Article |
AbstractThis article details the essential characteristics and mechanisms of catalog document. |
Users often need a way of storing and classifying the many objects they have at their disposal, whether they be screws, ball bearings or computer parts. These objects may number tens of thousands, each with its own specific characteristics such as shape, color, size, diameter, length, etc. To facilitate fast and easy retrieval of such objects and avoid time-wasting redesign, Version 5 offers the possibility of creating catalogs.
A catalog is a V5 document and is in the form of a tree structure made up of:
This external catalog view is internally described by three object types:
The "Catalog Basis" section presents all the aspects of these objects: creation, valuation and explains the filtering mechanism.
A way to create automatically descriptions is done through:
The CAA Application Programming Interface (API) enables you to integrate you own component in a catalog document. It is the topic of the "Integrating a New Type of Component" section.
In addition to this API, you can use a Catalog Browser which enables to visualize the contents of catalogs and to instantiate components. The layout and the usage of this browser is explained in the "Catalog Browser" section.
The last section "Instantiating a Component" explains how to instantiate a catalog component outside the Catalog Browser scope.
Notice that, the Catalog document can be edited using the Catalog Editor workbench. This article makes sometimes references to this workbench. You can also you refer to the "Catalog Architecture" article [1] to have a global view and internal view of the Catalog architecture.
[Top]
The catalog is a V5 document such as Part, Product and so on. It means that to create one, you use the ObjectModelerBase framework API. You can you refer to the "Creating a Catalog" use case [2] for an example.
This document is based on three main features: the chapter, the description and the keyword and on a main mechanism the chapter's filtering thanks the keywords and their values.
The "Browsing a Catalog" use case [3] scans a catalog contents.
All the chapters are created thanks to the CATICatalogChapterFactory interface:
... CATICatalogChapter * pICatalogChapterOnNewChapter = NULL ; CATUnicodeString ChapterName = "ChapterName" ; CATBoolean IsEndChapter = FALSE ; rc = pICatalogChapterFactory->CreateChapter(ChapterName, IsEndChapter, pICatalogChapterOnNewChapter); ... |
Where pICatalogChapterFactory
is the CATICatalogChapterFactory
interface pointer on the root container of the catalog document. As usual, to
retrieve the root container of a document, use the CATInit interface and
its GetRootContainer
method.
The CreateChapter
method creates a new chapter in the root
container:
ChapterName |
The name of the new chapter. Then you retrieve it with the GetChapterName method on CATICatalogChapter
|
IsEndChapter |
It is a boolean which defines the kind of chapter:
|
pICatalogChapterOnNewChapter |
It is the CATICatalogChapter interface pointer on the new chapter. This pointer must be released as soon as it becomes useless. |
The first created chapter is the root chapter. It is necessary inside
the catalog and you retrieve it thanks the GetRootChapter
method of the CATICatalogChapterFactory
interface.
The chapter contains a set of descriptions. Each description references an object which can be a chapter, a feature, a file, or a description.
Whatever is the contents of the description, its creation is based on the same principle:
... pICatalogChapter->AddDescription(pICatalogDescription, pILinkableObject); ... |
Where pICatalogChapter
is the CATICatalogChapter interface pointer on the parent
chapter, and pILinkableObject
the CATILinkableObject interface pointer
to the
object to link.
When the description references chapters that make a chapters tree
structure. So once a chapter is created, except of course the root chapter,
use the AddDescription
method to insert it in the chapter tree
structure of the catalog.
It is also possible to link a description with an external chapter. An external chapter is a chapter from an another catalog. It is recommended to insert "virtual" descriptions on a chapter through a link to an external chapter that create new descriptions in the current catalog. The update modifications are easier. A best way is to create catalogs for each specific topic, and create "super" catalogs pointing these unitary catalogs. The link between catalogs is done by creating in the "super" catalog" a description which references a chapter of the smaller catalog.
The "Creating a Catalog" use case [2] gives an example of different kinds of chapters (family or not, external or not).
If the description does not reference a chapter, the chapter which has this description is a family. There are three ways to have a such description. In the first two the descriptions are automatically created:
AddDescription
method. Notice however that if the referenced
object is a document, there is a best way (the document is not opened) to make the
reference:
... CATICatalogDescription * pICatalogDescription = NULL ; CATUnicodeString Filename ="/../../../MyDoc.CATPart"; pICatalogChapterOnFamily->AddDescription(pICatalogDescription); pIDescription->SetDocumentName(FileName); ... |
Where Filename
is the complete path of the document.
The "Creating a Catalog With Part Component" use case [4] is an example where the description is created using the API.
Retrieval the Referenced Object
In all cases,
except the chapter case, the object of the description is retrieved thanks to
the GetObject
method of CATICatalogDescription. For a chapter, there are two ways, the
first being easier:
GetSubChapter
method of the CATICatalogDescription interface.
... CATICatalogChapter * pICatalogChapterOnChildChapter = NULL ; pICatalogChapterOnChildChapter = pICatalogDescription->GetSubChapter(); ... |
GetObject
method of CATICatalogDescription and the GetChapter
method of CATICatalogQueryResult The GetObject
method retrieves a temporary object a QueryResult object which
implements the CATICatalogQueryResult interface. Use the GetChapter
method on this interface to retrieve the referenced object as follow:
... CATBaseUnknown * pReferencedObject = NULL ; pICatalogDescription->GetObject(pReferencedObject); CATICatalogQueryResult * pICatalogQueryResultOnReferencedObject = NULL HRESULT rc = pReferencedObject->QueryInterface(IID_CATICatalogQueryResult, (void**) & pICatalogQueryResultOnReferencedObject ); if ( SUCCEEDED(rc) ) { CATICatalogChapter * pICatalogChapter = NULL ; rc = pICatalogQueryResultOnReferencedObject->GetChapter(pICatalogChapter); ... } ... |
Where pICatalogDescription
is a CATICatalogDescription
interface pointer on a description of a chapter and pICatalogChapter
a pointer on its child chapter.
On each description there is a preview image. This image is displayed in the "Preview" Tab page of the Catalog Editor [Fig.1] or in the Catalog Browser [Fig.2].
For each type of description there is a default image:
The preview image of the document
The preview image of the feature
You can change the default image in two ways:
...
CATPixelImage Image = .... ;
pICatalogDescription->
|
...
CATUnicodeString FileName ="...";
pICatalogDescription->
|
Where pICatalogDescription
is a CATICatalogDescription
interface pointer on a description, and FileName
is the complete
path of the image. If an embedded image exists, this image is not taken
account.
The large image is displayed with 130x110 pixels, so if your image is smaller or larger, it is increased or decreased to this size.
The keywords are associated with the chapters so it is with the CATICatalogChapter interface that you can create them and set their default values. Each description of a chapter can have a own value for each keyword of the chapter. While a keyword is not valuated on a description, its value is the default value kept on the chapter.
... CATICatalogKeyword * pICatalogKeywordOnNewKW = NULL ; CATUnicodeString KeywordName = "xxxx"; CATUnicodeString KeywordType ="yyy"; pICatalogChapterOnChapter->AddKeyword(KeywordName,KeywordType,pICatalogKeywordOnNewKW ); ... |
or
... CATICatalogKeyword * pICatalogKeywordOnNewKW = NULL ; CATUnicodeString KeywordName = "xxxx"; CATICkeType * pCATICkeTypeOnNewKeyword = ... ; pICatalogChapterOnChapter->AddKeyword(KeywordName,pCATICkeTypeOnNewKeyword ,pICatalogKeywordOnNewKW ); ... |
KeywordName | The name of the keyword. Then you retrieve it with the GetKeywordName method on the CATICatalogkeyword
interface. |
pCATICkeTypeOnNewKeyword | The type of the keyword:
|
pICatalogKeywordOnNewKW | The CATICatalogKeyword interface pointer on the new keyword. This pointer must be released as soon as it becomes useless. |
All the keywords for a chapter appear in the "Keywords" tab page in the Catalog Editor - but some can be hidden in the Catalog Browser. Those are suffixed by the star in the Catalog Editor.
To hide a keyword:
... pICatalogKeywordOnNewKW->SetHidden(); ... |
where pICatalogKeywordOnNewKW
is a CATICatalogKeyword interface
pointer.
Once the keyword is created, you can -eventually- set it a default value.
... CATICatalogChapter * pICatalogChapterOnChapter = ... ; CATUnicodeString KeywordName=".." ; pICatalogChapterOnChapter->SetDefaultValue(KeywordName,DefaultValue); ... |
The type of the DefaultValue
variable depends on the keyword
type.
Keyword Value
To valuate a keyword
of a description use the SetValue
method as follow:
... CATICatalogDescription * pICatalogDescriptionOnCurrentDescription = ... ; CATUnicodeString KeywordName=".." ; pICatalogDescriptionOnCurrentDescription->SetValue(KeywordName,Value); ... |
The type of the Value
variable depends on the keyword
type.
Specific Keyword
The "Name" keyword is a specific keyword. Its value is also the name of the
description. In other words, the value returned by the GetName
method of the CATICatalogDescription interface is also the value
returned by the GetValue
method.
In the Catalog Editor, for each chapter the "Name" keyword is created
automatically but not in the CAA API case. But even the keyword
doesn't exist, the GetValue
method of the CATICatalogDescription
interface returns the name of the
description.
As a data base, a query mechanism enables to research a specific object into a catalog. This mechanism is based on the keywords and their values. As a data base request, you build a query expression with keywords and you apply this request to a chapter. The "Using Query" use case [5] gives you a concrete example.
Query Expression
The query is an expression which has a knowledgeware syntax and the available operators are
For example: (x.DIAMETER<=4)AND(x.TYPE=="FHC")
Query Request
The chapter implements the CATICatalogQuery interface. Use the Query
method to do a request as follow:
... CATUnicodeString Expression = "(x.SideNumber==6)"; CATICatalogQueryResult * pIQueryResult = NULL; rc = piCatalogQueryOnChapter->Query(pIQueryResult,Expression); ... |
Where piCatalogQueryOnChapter
is a CATICatalogQuery
interface on the chapter to filter. The arguments of this method are:
pIQueryResult | The output object. It is a temporary object which contains the descriptions matching to the expression. |
Expression | The query |
The Query
method is not recursive. So if the chapter contains sub-chapters, the research
stops at the first level.
This paragraph explains what is a Part Family. Refer you to the "Creating a Part family" use case [6] for a concrete case.
A Part family is a whole family with Part components created from a single Part which has several configurations referenced in a design table.
On this picture, notice that :
PartNumber
header. It is
mandatory,It is always possible to add keywords to the family after or before having created a Part family. But if the keywords providing from the design table are automatically created and valuated, it is on your charge to valuate the added keywords.
The PartNumber
keyword value is a specific keyword. It
has the same role as the "Name" keyword for an another type of
chapter. It is also the
name of the description.
Once the family is created, use the AddFamilyDescriptionsFromDesignTable
method on the CATICatalogChapter interface.
... pICatalogChapterOnFamily->AddFamilyDescriptionsFromDesignTable(piDesignTable); ... |
where pICatalogChapterOnFamily
is a CATICatalogChapter interface
pointer, and piDesignTable
a CATIDesignTable interface
pointer. The "Creating a Catalog" use case [2]
gives the code to retrieve a design table in a Part document.
Each description could have a link to a Part generated from a configuration defined in the design table. It is the case when the description is "resolved". The advantage is that when a resolved Part is stored in a catalog, it can be automatically generated during the instantiation. So for the end user, there is no time-wasting for configuration computation during the instantiation.
It means that for the previous example [Fig.4], if you instantiate:
When a Part family is created, in the Reference tab page of the Catalog Editor, you can notice that the type of each descriptions is "Part family configuration". If you resolve a description, the type of the description becomes "Resolved part family configuration" [Fig.6].
On the above picture, you notice that:
To resolve a description by using CAA API, use the ResolvedDocumentFromDesignTable
method on a CATICatalogDescription interface pointer.
...
pICatalogDescription->
|
where pICatalogDescription
is a CATICatalogDescription
interface pointer.
In the Tools/Options command, if you select Infrastructure and Catalog Editor, the following tab page appears:
This tab page defines the instantiation mode for components coming from Part family.
The Folder editor defines the path of the resolved Part. The three others options are exclusive:
Through this tab page, an administrator can impose the instantiation mode and/or set the location of the resolved Part.
A persistent query is associated with a family. It enables you to have a filtered view of an external catalog into a catalog. You can you refer you to the "Creating Persistent Query" use case [7] for a concrete example.
You can create a sub-set of keywords on the family with the keywords
defining the expression. But caution, except the Name
keyword,
there is no automatic valuation of the family's keyword.
Once the family is created, there are four or five steps to create a persistent query:
AddPersistentQuery
method of the CATICatalogChapter interface.
... CATUnicodeString PersistentQueryName ="" ; CATICatalogPersistentQuery * pICatalogPersistentQuery = NULL ; pICatalogChapterOnFamily->AddPersistentQuery(PersistentQueryName, pICatalogPersistentQuery); ... |
where pICatalogChapterOnFamily is a CATICatalogChapter interface
pointer, and pICatalogPersistentQuery
a CATICatalogPersistentQuery interface
pointer on the new persistent query.
... CATICatalogChapter * piChapterToFilter =... ; pICatalogPersistentQuery->SetResolutionChapter(piChapterToFilter); ... |
where piChapterToFilter
is a CATICatalogChapter interface
pointer on the root chapter of the catalog to filter.
... CATUnicodeString Expression = " xxx" ; pICatalogPersistentQuery->SetExpression(Expression); ... |
The expression has a knowledgeware syntax. See the "Query Mechanism" paragraph.
This step is not mandatory. For each persistent query of a family it is possible to associate new default value for the keyword's family.
... CATUnicodeString KeywordName= "xxx" ; pICatalogPersistentQuery->SetDefaultValue(KeywordName,DefaultValue); ... |
where KeywordName
is a keyword of the family.
The resolution generates the descriptions on the family.
... int ResolveMode = 0 ; CATListValCATICatalogDescription_var * pListExternalDescription = NULL ; pICatalogPersistentQuery->ResolveQuery(ResolveMode,pListExternalDescription); ... |
ResolveMode
argument can have two values pListExternalDescription
contains the list of the simulated or
resolved description. Natively, the catalog document integrates some components like:
To integrate a new type of component in a catalog document, you have to implement the three following interfaces:
This interface contains the method which launches an interactive command to create a new instance of the component.
It is not mandatory to implement this interface. It enables you to provide information for the description which has a link to an instance of the component:
GetAlias
)GetEmbeddedPreview
)GetKeywordValue
)This interface authorizes the integration of the feature in a catalog document. This interface is without method.
The use case "Integrating a Component" details on a feature the implementation of these three interfaces.
Although the Part and the Product are documents natively integrated in a catalog document, they don't directly implement CATICatalogInstantiation.
The Catalog Browser is an interactive command to browse catalogs and instantiate components in context. It provides:
The Catalog Browser is a Dialog box with the following layout:
The CAA API enables you to create an instance of this command and customize its layout. The "Using the Catalog Browser" use case is a demonstrator which allows you to understand interactively all the possible options.
The Catalog Browser is created thanks to the CATICatalogBrowserFactory interface. This interface is implemented by the CATFrmEditor class (ApplicationFrame framework).
The CATFrmEditor class is the "C" in the MVC paradigm, where M (Model) is the document and V (View) the Visualization world. To be visualized, a document must implement the CATIEditor (ObjectModelerBase framework) interface which provides a CATFrmEditor class instance.
... CATFrmEditor * pDocumentEditor = CATFrmEditor::GetCurrentEditor(); CATICatalogBrowserFactory * pICatalogBrowserFactory = NULL; HRESULT rc = pDocumentEditor->QueryInterface (IID_CATICatalogBrowserFactory, (void**) &pICatalogBrowserFactory); ... |
Once you have the CATICatalogBrowserFactory interface pointer, use its single method to create a Catalog Browser instance:
... CATICatalogBrowser * pICatalogBrowser = NULL ; CATCciCatalogBrowserDisplayOptions DisplayOptions = CATCatalogDisplayCombo | CATCatalogDisplayWndBtnOKCancel | CATCatalogDisplayWithLargeIcons ; int DragAndDropAuthorized = 1 ; int InstantiationAuthorized =1 ; pICatalogBrowserFactory->OpenCatalogBrowser (pICatalogBrowser, DisplayOptions , DragAndDropAuthorized, InstantiationAuthorized); ... |
Where
pICatalogBrowser
is the new CATICatalogBrowser
interface pointerIt is an output argument. With this pointer you can change some layout options and retrieve the end user interactions: its selection, filter value, ...
DisplayOptions
, is a sum of CATCciCatalogBrowserDisplayOptions
values It is a sum of single option to customize the layout of the dialog box. In the just above example, the value for this argument means that the Catalog browser has:
CATCatalogDisplayWndBtnOKCancel
: The Ok and Cancel buttons (and not
the Close button as [Fig.8] )CATCatalogDisplayCombo:
The Display options combo (Large and Small icons and Details
options)CATCatalogDisplayWithLargeIcons
:
At the beginning the large icons are displayedIt is recommended to always have the CATCatalogDisplayCombo
value.
DragAndDropAuthorized
, authorize or not the instantiation by drag
and dropInstantiationAuthorized
, authorize or not the component's
instantiation by contextual menu or by double click on the descriptionThe instantiation can be done through the Catalog Browser:
but you can also launch yourself an instantiation. There are two steps
... CATICatalogDescription * piCatalogDesc = NULL ; rc = _pICatalogBrowser->GetSelectedDescription (piCatalogDesc); ... |
Where _pICatalogBrowser
is a CATICatalogBrowser
interface pointer on the opened Catalog Browser.
RunInstantiationCmd
method on the CATICatalogDescription interface pointer
...
rc = piCatalogDesc->
|
Where the arguments of this method are the following:
pICatalogBrowser, a
CATICatalogBrowser interface
pointerIt is a pointer on the current Catalog Browser (can be NULL). It will possibly be used to temporaryly hide the Catalog Browser during the instantiation or to close it.
InstantiateMode
(int)This argument is only useful for the document's instantiation into a Product. In this case there are two ways to do an instantiation, the first being recommended:
1
: The destination Product will have a link to the
reference document. 0
: It is a "New From" instantiation. It means that
a new document is created from the reference documentThe second solution is recommended.
RepeatMode
(int)The instantiation will be done through an interactive command which can have the repeat mode. This mode means that when the command is finished, it is automatically re-launched. So this parameter is often without interest because in most cases the repeat mode is not available (and not recommended) .
To instantiate a component you must not use the RunInstantiationCmd
method of the CATICatalogInstantiation interface and that for two reasons:
The RunInstantiationCmd
method of the CATICatalogDescription interface calls the RunInstantiationCmd
method of the CATICatalogInstantiation interface.
Advice
[Top]
The catalog is a document which enables you to classify a lot of objects (file, feature, etc.) to retrieve them quickly. It is made up of three main features:
The description's creation on a chapter can be done explicitly or automatically through the
The ComponentsCatalogsInterfaces framework provides a component, the Catalog Browser, which allows you to browse a catalog and instantiate components having the same look and feel that the other DS applications.
A component instantiation can be done through the Catalog Browser but also through the CAA API.
At last, it is possible to integrate a new type of component into the catalog's document.
[Top]
Version: 1 [Jul 2002] | Document created |
[Top] |
Copyright © 2002, Dassault Systèmes. All rights reserved.