You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



CCK Wizard Machine Design


Table of  Contents

Target Audience
CCK Components
Design of CCK Wizard application
Design of CCK Wizard Machine
A sample INI file
i18n issues



 
Target Audience
All groups involved in developing and supporting Netscape's Client Customization Kit.
 
CCK Components
 The main goal of CCK (Client Customization Kit) is to allow ISPs to customize and build an installer for the latest Netscape Communicator. Building a customized communicator involves an ISP to work with 4 major components of CCK. They are,

    Shell :

     
    This component provides ISP an opportunity to customize the very first (shell) dialog that pops up when the end user inserts the Communicator CD in his/her machine. The shell dialog(s) presented to the user displays an image in the background and few buttons and text explaining the user about the installation options in the foreground. This is a great place for an ISP to customize all these elements (viz., back ground image, Dialog captions, text associated with buttons, etc.,). So, Shell interface will have text fields allowing ISPs to enter the customized information viz., customized text, caption and path to background image.
     
    Configuration Editor :
     
     
    Majority of the customizations to the Communicator can be done using Configuration Editor. Config Editor allows ISP to set default preference elements for the Communicator components (like mail, news, bookmarks, etc.,). This helps ISP to take care of all customizable preferences allowed by CCK, for all ISP customers at once.
     
    Account Setup Editor :
     
     
    ISP will also have an option to customize the Account Setup Wizard. Account Setup Wizard is used by the end users who want to create a new Internet account or modify an existing Internet account. Account Setup Editor lets ISP to provide the customized information that ISP wants to present to the end user when the end user runs the Account Setup Wizard. Typically, ISP can change the image that appears on the each screen of Account Setup Wizard and set a common Title to all the pages. 
     
    Install Builder :
     
     
    Install Builder is a critical component as it gathers all the customization information entered by an ISP and creates a media (CD/disk)  image (a directory of files). ISP can simply drop the image thus created on to a CD/disk and distribute the same to all his/her end users. Install Builder also allows ISPs to define the installation experience that end users to going to get when they run the CD.
     
Powered with all these components CCK will be an extremely handy tool for the ISPs to customize their users' experience in installing and running Netscape Communicator for all the Internet activities.


Design of CCK Wizard application
The CCK Wizard that we are building for next generation Netscape Communicator, is designed with 2 main goals. They are Easy and Stable. We want to provide ISPs a tool that is easy to use and stable to operate with. CCK design past required ISP to run the components like Config Editor, Account Setup Editor and Install Builder separately in order to customize the Communicator. Such a design can lead to redundant data collection and disconnected experience to the CCK user. So, the new CCK designed is aimed at providing a unifying experience of all the above components. User can run CCK wizard to provide the set of required customizations and build a media image (CD or Diskette) by walking through the series of screens presented by the CCK wizard. This approach allows components to transfer the data among themselves and remove the burden on the user to run the components separately entering the same information in multiple locations.

The new approach brings in a new component that needs to built into CCK Wizard, i.e., Wizard Machine. Wizard Machine will be the driving force behind the CCK application. All other CCK components depend on Wizard Machine in displaying the dialogs and in transferring the information among themselves. Wizard Machine provides APIs to the all other components to collect and disseminate the information. ISP never interacts with Wizard Machine directly. ISP performs his tasks using one of the other tools (viz., Config Editor, Account Setup Editor or  Install Builder) and in turn each of these components depend on Wizard Machine creating and displaying dialog interfaces to ISP.

The following diagram explains the design of new CCK Wizard application.

Another new approach that is built into the CCK application illustrated above is the INI file approach. From the beginning to the end, each screen in the CCK application will be driven by the corresponding INI files. Each INI file will have some control information and set of widgets (with all the required information to build them). So, Each of the top level CCK components viz., Shell, Config Editor, Account Setup Editor and Install Builder will have set of INI files under them. Each component seeks Wizard Machine's help in displaying dialogs to the ISP i.e., when a component passes an INI file to the Wizard Machine it creates notes all the control information and creates dialogs dynamically with all the widgets or fields placed appropriately and presents the same back to the component. Wizard Machine also offers access the the all global information collected until that point. So, this approach eliminates the redundancy in data collection as the information can be shared among the components via Wizard Machine.

Another interesting thing to note in the new approach is that the Account Setup application can also be built as an INI file based application. That will allow Account Setup to use the APIs offered by Wizard Machine to collect and disseminate the information across the screens in creating or modifying an account.

The underlying advantage in shifting to INI file (from the standard VC++ resource file usage)  is to give the flexibility to the ISP in case to the ISP chooses to tailor the screens to the ISP's requirement. ISP can choose to move components around, remove some components or add additional fields. Also INI file allows us to modify the screens, if we need to do so in future, with no need to recompile the sources.


Design of CCK Wizard Machine
As explained above, Wizard Machine is the key component of CCK Wizard. Wizard Machine is like a service provider for all the top level CCK components that ISP uses. It starts the CCK Wizard and processes INI files, presenting back the screens that ISPs have to use to enter the customization information and allows the top level components to perform their tasks by providing them access to the required information.

Wizard Machine will use a m-way tree data structure to manage the data that it gathers from INI files that it receives as input. A set of top level global defaults will be defined for some common elements like a default image that can appear on all CCK/Account Setup Wizard pages and a title that can appear on CCK/Account Setup wizard pages, etc.,. A tree as shown below will be built so that Wizard machine can access and update the information easily. Building of tree happens dynamically as Wizard Machine reads INI files.

The node with cck.ini will be the root of the tree i.e., cck.ini will contain information about the globals and also informs Wizard machine that it has four sub pages. The four nodes that are branching out of root are the sub pages found in cck.ini. Wizard machine starts at the root of the node and visits the all nodes of the tree reading INI file corresponding to each node and storing the same in the inter data structures. Global Defaults, represented by a node, will have link with root node. If for some reason, none of the INI files contains the information about globals, Global Defaults node will supply that information. Arrows between any 2 nodes point at each other indicating that data access can ne in both directions.

Wizard Machine with above data structure recursively parses all INI files and builds a knowledge base. It handles all the common wizard functionalities like Next and Back buttons and passes the specific tasks to the individual top level components.
 


A Sample INI File
     
    #Represents variables that are specific to this page - part of control information 
    [Local Variables] 
    Name=page1 
    BackGroundImage=bg.bmp 
    Title=Sample Page 
    Visibility=show 
    WidgetCount=3 

    #Represents any sub pages under this component 
    [Sub Pages] 

    #Represents all fields that go on to the dialog pertained to this page 
    [Field1] 
     type=Text 
     title=Test Example 
     start_X=17 
     start_Y=15 
     Width=67 
     Height=23 

    [Field2] 
     type=Button 
     title=Button1 
     start_X=13 
     start_Y=31 
    Width=63 
     Height=45 
     onClick=ConvertJSCFile 

    [Field3] 
     type=RadioButton 
     title=Radio1 
     start_X=24 
     start_Y=86 
     Width=63 
     Height=96 
     value=selected 
     

    * Not every INI file is required to contain Widgets i.e., some GUI elements. An INI file can just have Control Information i.e., Information related to Local Variables and  Sub Pages. Wizard Machine will identify those INI files as container pages and processes elements nuder Sub Pages section.  Sub Pages section typically contains pages related to that container. For example cck.ini (top level INI file) will have Shell, Config Editor, Install Builder and so on as Sub Pages and Shell will have dialog1, dialog2 and so on as Sub Pages. Once the Wizard Machine traverse through until it finds an INI file with no Sub Pages section.

i18n issues
It is always important for us to develop our application in such way that it can be easily localized. Currently, we are discussing with i18n group in identifying the areas that need to be focussed in making localization an easy task with respect to the the new design proposed above.


Author : Bhuvan Rachamreddy
Date :    12/07/98