Catalog Modeler

Using Catalog Browser 

 Using  CATICatalogBrowserFactory, CATICatalogBrowser

Use Case

Abstract

This use case shows how to create and use a Catalog Browser.


What You Will Learn With This Use case

The ComponentsCatalogsInterfaces framework provides a Dialog box to browse catalogs and instantiate components. This Dialog box is the Catalog Browser and it implements the CATICatalogBrowser interface.

The aim of this article is to understand each methods of the CATICatalogBrowser interface. A demonstrator allows you

Before getting to the use case itself, it is important to already be familiar with the basic notions of Catalog. See the referenced article [1] for a detailed overview.

[Top]

The CAAMmrCatalogBrowser Use Case

CAAMmrCatalogBrowser is a use case of the CAAMechanicalModeler.edu framework that illustrates ComponentsCatalogsInterfaces framework capabilities.

[Top]

What Does CAAMmrCatalogBrowser Do

This use case is a Catalog Browser demonstrator. In an add-in of the Product Structure Workbench, the  "Catalog Browser Demonstrator ..." command is defined. This command is included in the Catalog toolbar as you can see in the next picture:

Fig.1 The Catalog Toolbar

When you launch the command, the following dialog box appears:

Fig.2 The Catalog Browser Demonstrator Dialog Box

This dialog box is made up of two frames at the first level:

The Catalog Browser Dialog box:

Fig.3 The Catalog Browser Dialog Box

Advice: Once the Catalog Browser is opened, the end user can change some options about the display or the filter, and because these modifications are without notifications the Catalog Browser Demonstrator is not updated.  

[Top]

How to Launch CAAMmrCatalogBrowser

To launch CAAMmrCatalogBrowser , you will need to

[Top]

Where to Find the CAAMmrCatalogBrowser Code

The CAAMmrCatalogBrowser use case explains the CAAMmrBrowserCmdDlg class which defines the Catalog Browser Demonstrator dialog box [Fig.2]. This class is located in the CAAMmrCatalogUI.m module of the CAAMechanicalModeler.edu framework.

 

Windows InstallRootDirectory\CAAMechanicalModeler.edu\CAAMmrCatalogUI.m\
Unix InstallRootDirectory/CAAMechanicalModeler.edu/CAAMmrCatalogUI.m/

where InstallRootDirectory is the directory where the CAA CD-ROM is installed.

[Top]

Step-by-Step

There are three logical steps in the CAAMmrCatalogBrowser use case:

  1. The CAAMmrBrowserCmdDlg header file
  2. The CAAMmrBrowserCmdDlg source file
  3. The CAAMmrBrowserCmdDlg resource file
  1. The header file
  2. #include "CATDlgDialog.h" 
    class CATDlgEditor; 
    class CATDlgPushButton;
    class CATDlgRadioButton;
    class CATDlgCheckButton;
    class CATDlgFrame;
    class CATDlgPushButton;
    class CATFrmEditor ;
    class CATICatalogBrowser ;
    
    class CAAMmrBrowserCmdDlg : public CATDlgDialog
    {
      DeclareResource(CAAMmrBrowserCmdDlg,CATDlgDialog) ;
    
    public:
    
      CAAMmrBrowserCmdDlg(CATDialog * iParent);
      ~CAAMmrBrowserCmdDlg();
    
      void Build();
    
    private:
    
      void CloseCatalog();
    
      void OKCatalog        (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void CancelCatalog    (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void ChangeChapter    (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void SelectDescription(CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      
      void ChangeCatalogAuthorization (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void InstantiationAuthorization (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void ChangeQuery                (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void LaunchInstantiation        (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
      void CreateBrowser              (CATCommand* iFrom, CATNotification* iNotif, CATCommandClientData iData);
    
    private:
    
      CATDlgEditor           * _pDescEditor;
      CATDlgEditor           * _pCatalogEditor;
      CATDlgEditor           * _pQueryEditor ;
      CATDlgEditor           * _pQueryResultEditor  ;
      CATDlgCheckButton      * _pModalButton ;
      CATDlgCheckButton      * _pWithTreeButton;
      CATDlgCheckButton      * _pInstantiateStateButton   ;
      CATDlgCheckButton      * _pChgtCatalogStateButton  ;
      CATDlgCheckButton      * _pQueryStateButton  ;
      CATDlgRadioButton      * _pWithOkButton;
      CATDlgRadioButton      * _pWithCloseButton;
      CATDlgRadioButton      * _pWithSmallIconsButton;
      CATDlgRadioButton      * _pWithLargeIconsButton;
      CATDlgRadioButton      * _pWithDetailsButton;
      CATDlgPushButton       * _pInstButton  ;
      CATDlgPushButton       * _pOpenBrowserButton ;
      CATDlgFrame            * _pBrowserOptionsFrame ;
      CATDlgFrame            * _pBrowserQueryFrame ;
      CATDlgFrame            * _pInstFrame ;
    
      CATFrmEditor           * _pDocumentEditor ;
    
      CATBoolean               _FirstOpen ;
    
      CATICatalogBrowser     * _pICatalogBrowser;
    
      CATNotification        * _pOKNotif ;
      CATNotification        * _pCancelNotif;
      CATNotification        * _pCloseNotif;
      CATNotification        * _pSelectNotif;
      CATNotification        * _pChangeNotif;
      
    };

    The CAAMcaUdfLoftDlg class derives from the CATDlgDialog class and contains 

    The DeclareResource macro declares that there is a CAAMmrBrowserCmdDlg.CATNls file - see at the end of the article;

  3. The source file
  4. The resource file
// Title of the dialog box
Title ="Catalog Browser Demonstrator" ;

// Help message displayed in the status bar when you pass over the dialog box
Help = "Dialog box to understand the Catalog Browser options and to make instantiation";

// Frames 
FrameBrowser.Title= "Catalog Browser Properties" ;

FrameBrowser.FrameBrowserOptions.Title="Window Options & Display";
FrameBrowser.FrameBrowserOptions.BehaviorLabel.Title ="Behavior";
FrameBrowser.FrameBrowserOptions.ModalCheckButton.Title ="Modal";
FrameBrowser.FrameBrowserOptions.ButtonLabel.Title="Window Button";
FrameBrowser.FrameBrowserOptions.ButtonFrame.WithOK.Title="OK";
FrameBrowser.FrameBrowserOptions.ButtonFrame.WithClose.Title="Close";
FrameBrowser.FrameBrowserOptions.DisplayOptionsLabel.Title="Display";
FrameBrowser.FrameBrowserOptions.DispOpFrame.Tree.Title="Tree";
FrameBrowser.FrameBrowserOptions.DispOpFrame.Small.Title="Small";
FrameBrowser.FrameBrowserOptions.DispOpFrame.Large.Title="Large";
FrameBrowser.FrameBrowserOptions.DispOpFrame.Detail.Title="Detail";

FrameBrowser.FrameBrowserInstMngt.Title="Instantiation Options";
FrameBrowser.FrameBrowserInstMngt.InstantiateState.Title= "Authorize Instantiation" ;

FrameBrowser.ButtonOpenBrowser.Title="Open";

FrameBrowser.ChgtCatalogState.Title = "Authorize Other Catalog Selection" ;

FrameBrowser.FrameBrowserQuery.Title="Filtering";
FrameBrowser.FrameBrowserQuery.QueryLabel.Title="Query";
FrameBrowser.FrameBrowserQuery.QueryState.Title="User";
FrameBrowser.FrameBrowserQuery.QueryResultLabel.Title="The filter on the chapter";

FrameInst.Title="Current Selection";
FrameInst.CatalogLabel.Title="Catalog";
FrameInst.DescLabel.Title="Description";
FrameInst.InstButton.Title="Launch";

This Nls file is not complete. For each Dialog object you can add

[Top]


In Short

A Catalog Browser instance is created thanks to the CATICatalogBrowserFactory interface. Once the instance is created, you can customize it or retrieve data, enter by the end user, thanks to the CATICatalogBrowser interface. 

[Top]


References

[1] Catalog Overview
[2] Instantiating a Component
[3] The CAA Command Model
[Top]

History

Version: 1 [Jul 2002] Document created
Version: 2 [May 2004] Drag and Drop impossible
Version: 3 [Feb 2005] SetCurrentCatalogPath and GetCurrentCatalogPath deprecation
[Top]

Copyright © 2002, Dassault Systèmes. All rights reserved.