[Inso Home Page] [Home] [Collection] [Book] [Expand] [Collapse] [Search Forms] [Previous Section with Hits] [Next Section with Hits] [Clear Search] [Preferences] [Print] [Help]

 inside  Expand Search


   Frames   [Table of Contents]    Modifying the Print Interface

DynaWeb Publishers Guide

[-] 5. Modifying The DynaWeb Interface
[-] Buttons

Buttons

Changing a Button's Icon

You can change a button's icon by substituting another source graphic for the icon and naming the new graphic the same as the old graphic. Below is the portion of the configuration file that determines the icon graphics used for each icon.

Note: When replacing an icon with one of your own, check in the "icons" directory to see whether there is a dimmed version of the graphic. Dimmed graphics are used to denote unavailable options.

Figure 5-2: Collection Button Bar

raster

The following section lists the filenames for each button in the order that they appear in the button bar (and their dimmed/undimmed counterparts, if any are available).

   inso_home_page            b_insohm.gif
   home                      b_home.gif
   collection                b_colect.gif
   collection_dim            d_colect.gif
   book                      b_book.gif
   book_dim                  d_book.gif
   collapse                  b_colpse.gif
   collapse_dim              d_colpse.gif
   expand                    b_expand.gif
   expand_dim                d_expand.gif
   search                    b_search.gif
   search_dim                d_search.gif
   search_forms              b_forms.gif
   search_forms_dim          d_forms.gif
   prev_hit                  b_prvhit.gif
   prev_hit_dim              d_prvhit.gif
   next_hit                  b_nxthit.gif
   next_hit_dim              d_nxthit.gif
   clear_search              b_clear.gif
   clear_search_dim          d_clear.gif
   hide_frames               b_nofram.gif
   show_frames               b_frames.gif
   help                      b_help.gif
   print                     b_print.gif
   prefs                     b_prefs.gif

Place your graphics into the icons directory used by DynaWeb: {server-directory}/icons where {server-directory} is the main directory of the server you are running.

Adding a Button to the Button Bar

The publisher can add his or her own button(s) to the button bar. This section will illustrate the addition of a publisher-defined button linking the browser to the main home page for your site. There are a few steps involved in adding a button to the button bar.

Dimmed Buttons

The dimmed versions of DynaWeb's buttons indicate unavailable options. When adding your own button, think about whether you need a dimmed version as well. If you decide that a dimmed version is necessary, repeat the instructions in each section for the dimmed button.

How DynaWeb Handles Buttons

DynaWeb handles button characteristics through a set of variables. Each button then references those variables when the button bar is called, ensuring that all of the buttons share the same characteristics. When the source variable is changed, all of the buttons inherit the change.

Setting the Location of the Source Graphic

DynaWeb tracks its graphics by storing them in a single directory and referring to that directory with a variable (IconDir).

Search for the phrase "dwSetParam button_path_map" in the configuration file "bbarutil.dwc". You should see a section of the configuration file that looks like this:

dwSetParam button_path_map {
        inso_home_page        \"[dwGetParam IconDir]b_insohm.gif\"
        home                  \"[dwGetParam IconDir]b_home.gif\"
        home_dim              \"[dwGetParam IconDir]d_home.gif\"
        collection            \"[dwGetParam IconDir]b_colect.gif\"
[...]
        show_frames           \"[dwGetParam IconDir]b_frames.gif\"
        help                  \"[dwGetParam IconDir]b_help.gif\"
        print                 \"[dwGetParam IconDir]b_print.gif\"
        prefs                 \"[dwGetParam IconDir]b_prefs.gif\"
}

Copy the "prefs" button's line and paste it underneath the existing "prefs" line. Replace the button's name with the name of your button, and change the icon's name to the icon you have prepared as the new button.

Note: The exisiting buttons for DynaWeb use a simple naming convention for their sources. The source graphics for buttons begin with "b_" and if they have a dimmed version, that graphic starts with "d_". We suggest you follow these conventions for ease of integration.

For this example, we want the button to be called "mainpage" and the file name is "b_mainpg.gif". After we make the changes, the configuration file should look like this:

dwSetParam button_path_map {
        inso_home_page         \"[dwGetParam IconDir]b_insohmpg.gif\"
[...]
        print                  \"[dwGetParam IconDir]b_print.gif\"
        prefs                 \"[dwGetParam IconDir]b_prefs.gif\"
        mainpage               \"[dwGetParam IconDir]b_mainpg.gif\"
}

Setting a Button Label

Next you need to set the text you want to appear if the icon doesn't load for some reason (either the server can't find it, or the client's browser is set to not load images). Since DynaWeb keeps all of its localization strings in one file (localize.dwc) the value for each parameter is a pointer to the string ID of each button.

Note: You do not need this step for dimmed buttons.

Search for the phrase "dwSetParam button_title_map" in the configuration file bbarutil.dwc. It should be located directly below the section you just edited in the step above ("Setting the Location of the Source Graphic"). This section looks like:

dwSetParam ${language} button_title_map {
        inso_home_page                 \"\[[dwGetLocalizedString 201 ${language}]\]\"
        home                           \"\[[dwGetLocalizedString 202 ${language}]\]\"
[...]
        next_hit                       \"\[[dwGetLocalizedString 211 ${language}]\]\"
        help                           \"\[[dwGetLocalizedString 212 ${language}]\]\"
        print                          \"\[[dwGetLocalizedString 213 ${language}]\]\"
        prefs                          \"\[[dwGetLocalizedString 401 ${language}]\]\"
}

Copy the last line "prefs..." and paste it underneath the original line. Modify the new line to reflect the new button and the string ID you want to assign to it. Check the localize.dwc file to check for a number that is not assigned already. Make sure you use the same designation for the button that you used in the previous section (for this example, "mainpage").

When you are finished, the parameter should look approximately like this:

dwSetParam button_title_map {
        inso_home_page                 \"\[[dwGetLocalizedString 201 ${language}]\]\"
        home                           \"\[[dwGetLocalizedString 202 ${language}]\]\"
.
.
.
        next_hit                       \"\[[dwGetLocalizedString 211 ${language}]\]\"
        help                           \"\[[dwGetLocalizedString 212 ${language}]\]\"
        print                          \"\[[dwGetLocalizedString 213 ${language}]\]\"
        prefs                          \"\[[dwGetLocalizedString 401 ${language}]\]\"
        mainpage                       \"\[[dwGetLocalizedString 225 ${language}]\]\"
}

Now, modify the parameter map located in the localize.dwc file for the default language of your browser and add in the new button mapping. When you are finished, it should look approximately like this:

dwSetParam en {
  1    "DynaWeb 4.1"
  2    "List of Collections on"
.
.
.
  220  "Next Section"
  221  "Collection"
  222  "All Collections"
  223  "Previous Hit"
  224  "Next Hit"
  225  "Main Page"
.
.
.

Setting the Button Parameters

The next step for inserting a button into the button bar is to set up a "source mapping" for the button. The source mapping points to the image tag for the new button.

In the bbarutil.dwc configuration file, search for "dwSetParam button_image_srcmap". This procedure should be located slightly beneath the procedure you modified in the last section. The section of the configuration file you are interested in looks like:

dwSetParam ${language}_button_image_srcmap {
        inso_home_page   "<IMG\ SRC=[dwGetParam button_path_map inso_home_page]\
                           ALT=[dwGetParam ${language}_button_title_map inso_home_page]\
                           ALIGN=[dwGetParam button_alignment]\
                           BORDER=[dwGetParam button_border]\
                           WIDTH=[dwGetParam button_width]\
                           HEIGHT=[dwGetParam button_height]>"
        home             "<IMG\ SRC=[dwGetParam button_path_map home]\
                           ALT=[dwGetParam button_title_map home]\
[...]
        prefs            "<IMG\ SRC=[dwGetParam button_path_map prefs]\
                                ALT=[dwGetParam ${language}_button_title_map prefs]\
                                ALIGN=[dwGetParam button_alignment]\
                                BORDER=[dwGetParam button_border]\
                                WIDTH=[dwGetParam button_width]\
                                HEIGHT=[dwGetParam button_height]>"
}

When the text has been replaced, the last statement in the procedure should look approximately like this:

        mainpage     "<IMG\ SRC=[dwGetParam button_path_map mainpage]\
                                     ALT=[dwGetParam ${language}_button_title_map mainpage]\
                                     ALIGN=[dwGetParam button_alignment]\
                                     BORDER=[dwGetParam button_border]\
                                     WIDTH=[dwGetParam button_width]\
                                     HEIGHT=[dwGetParam button_height]>"
}

Note: Be careful not to overwrite the last brace following the help statement. The brace is required to close the procedure, and will generate an error message if it is missing.

Setting Up the Anchor Tag

Note: You do not need this step for dimmed buttons.

Next, construct the anchor tag DynaWeb will use to activate the link to the new page.

Note: If the new button does not take the user to a specific address, you may not need this procedure.

Search for the phrase "a_href" in the bbarutil.dwc configuration file. The following section should appear:

dwSetParam a_href_map {
         inso_home_page             <A\ HREF=\"http://www.inso.com/\"
                                        TARGET=dynaweb_popup>dwGetParam button_image_srcmap inso_home_page]</A>
         help   "<A HREF=\"[dwGetParam IconDir]iconhelp.htm\" \
                TARGET=_top\">[dwGetParam button_image_srcmap help]</A>" }

Copy the existing "inso_home_page..." statement and paste it directly beneath the "help" statement. Make sure the ending brace is below the copied statement.

Modify the line, replacing "inso_home_page" with the name of the new button and the HREF address with the address of the destination page. When you are finished, the line should look like:

dwSetParam ${language}_a_href_map {
         inso_home_page    <A\ HREF=\"http://www.inso.com/\"\
                               TARGET=dynaweb_popup>dwGetParam ${language}_button_image_srcmap inso_home_page]</A>
         help              <A\ HREF=\"[dwGetParam IconDir]iconhelp.htm\" \
                               TARGET=_top\">[dwGetParam ${language}_button_image_srcmap help]</A>
         mainpage          <A\ HREF=\"http://www.inso.com/mainpage.htm\"\
                               TARGET=dynaweb_popup>dwGetParam ${language}_button_image_srcmap mainpage]</A>
 }

Adding the Button to the Button Bar Templates

Finally, add the HTML that calls the button. There are six templates that you must modify in order to add the button to all of the button bars that DynaWeb displays. Each level of browsing (root, collection, and book level) has a button bar for frame viewing and a button bar for non-frame viewing. The six templates are located in the bookbbar.dwc, collbbar.dwc, and rootbbar.dwc configuration files and are named:

rootbbar.dwc

dwTemplate FramesRootButtonBarView
dwTemplate NoFrames__RootButtonBarView

collbbar.dwc

dwTemplate Frames__CollectionButtonBarView
dwTemplate NoFrames__CollectionButtonBarView

bookbbar.dwc

dwTemplate Frames__BookButtonBarTemplate
dwTemplate NoFrames__BookButtonBarTemplate

Decide where in the button bar you want to place your button. In this example, we will place our new button next to the inso_home_page button. No matter where you place the button, follow the directions below, substituting the location you chose for the location used below.

If the button you are adding has a dimmed version, it is best to decide beforehand which templates will have the new button dimmed and which templates will have the active button. Do not place both the dimmed version and the active version into the same template. For dimmed buttons, copy the line which reads "$[dwGetParam graphic_image_srcmap spacer]" and paste it into the location where the active version of the button would be. Replace "spacer" with the designation of the dimmed button.

Find the template that you want to modify from the list above. For this example, we will use the Frames__RootButtonBarView template.

Copy the line that contains "a_href_map inso_home_page" and paste it into the position in the button bar that you want it to occupy. After you copy and paste the line according to the directions above, make the necessary modifications.

After paste:

dwTemplate Frames__RootButtonBarView {
<HTML>
  <HEAD>
    <BASE HREF="$[dwGet BaseUrl]@Generic__RootButtonBarView">
  </HEAD>
  <BODY BGCOLOR=#C0C0C0>
   <TABLE WIDTH="100%" HEIGHT=42 CELLPADDING=0 CELLSPACING=0>
    <TR ALIGN=left VALIGN=center>
     <TD>
      <TABLE NOWRAP CELLPADDING=0 CELLSPACING=2>
       <TR ALIGN=center VALIGN=center>
        <NOBR>
         $[dwGetLocParam [dwGet State__Language]_a_href_map inso_home_page]
         $[dwGetLocParam [dwGet State__Language]_a_href_map inso_home_page]
        $[dwGetLocParam [dwGet State__Language]_graphic_image_srcmap spacer]
         $[dwGetLocParam [dwGet State__Language]_graphic_image_srcmap spacer]
         <A HREF="@Generic__RootView$[dwCall RemoveHfUrlParam]$[dwGet UrlParamString];hf=0$[dwGet UrlQueryString]"\
            TARGET=_top>$[dwGetLocParam [dwGet State__Language]_button_image_srcmap hide_frames]</A>
        </NOBR>
      </TABLE>
   </TABLE>
  </BODY>
</HTML>
}

After changes made.

dwTemplate Frames__RootButtonBarView {
<HTML>
  <HEAD>
    <BASE HREF="$[dwGet BaseUrl]@Generic__RootButtonBarView">
  </HEAD>
  <BODY BGCOLOR=#C0C0C0>
   <TABLE WIDTH="100%" HEIGHT=42 CELLPADDING=0 CELLSPACING=0>
    <TR ALIGN=left VALIGN=center>
     <TD>
      <TABLE NOWRAP CELLPADDING=0 CELLSPACING=2>
       <TR ALIGN=center VALIGN=center>
        <NOBR>
         $[dwGetLocParam [dwGet State__Language]_a_href_map inso_home_page]
         $[dwGetLocParam [dwGet State__Language]_a_href_map mainpage]        $[dwGetLocParam [dwGet State__Language]_graphic_image_srcmap spacer]
         $[dwGetLocParam [dwGet State__Language]_graphic_image_srcmap spacer]
         <A HREF="@Generic__RootView$[dwCall RemoveHfUrlParam]$[dwGet UrlParamString];hf=0$[dwGet UrlQueryString]"\
            TARGET=_top>$[dwGetLocParam [dwGet State__Language]_button_image_srcmap hide_frames]</A>
        </NOBR>
      </TABLE>
   </TABLE>
  </BODY>
</HTML>
} 

Make the above changes in all six templates listed above. Once this is completed, the button should appear in the button bar in both the collection-level view and the book-level view.

Removing a Button from the Button Bar

To delete a button from the button bar, you need to remove the HTML that calls the button from the button bar template. There are six templates that control the button bars that appear while viewing DynaWeb collections and books. Each level of browsing (root, collection, and book level) has a button bar for frame viewing and a button bar for non-frame viewing.

The four templates are located in the bookbbar.dwc and collbbar.dwc configuration files and are named:

collbbar.dwc

dwTemplate Frames__CollectionButtonBarView
dwTemplate NoFrames__CollectionButtonBarView

bookbbar.dwc

dwTemplate Frames__BookButtonBarTemplate
dwTemplate NoFrames__BookButtonBarTemplate

The HTML for individual buttons differs, depending on the function of the particular button. Following is a list of all the buttons and the HTML that you need to remove in order to delete the button.

The HTML for each button is contained in a separate script that is called into the button bar with a dwCall statement. To remove the button completely from the button bar, remove the dwCall statement for the particular button.

Removing the Inso Home Page Button

This button provides a link to Inso's home page and a list of other places where DynaWeb collections are available for browsing. Find the following line in the above templates to remove this button.

$[dwGetLocParam [dwGet State__Language]_a_href_map inso_home_page]

Removing the Home Button

The Home button returns the viewer to the Root level of browsing (or to an alternate location if the value of the Home button destination is altered). The HTML that calls the Home button is as follows:

$[dwCall ShowHomeButton]

To put a different button in place of the Inso Home Page button, modify the dwScript "ShowHomeButton" to point to the button you desire.

Removing the Collection Button

The Collection button returns the browser to the Collection level of browsing. The HTML tags for the Collection button appear as follows:

dwSet CollectionButton \
<A HREF=\"../@[dwGet TopLevelView][dwGet UrlParamString]\"\
TARGET=_top>
[dwGetLocParam [dwGet State__Language]_button_image_srcmap collection]</A>

Removing the Book Button

The HTML tags for the Book button in the Frames__BookButtonBarTemplate and NoFrames__BookButtonBarTemplate are as follows:

<A HREF="../@Generic__CollectionView$[dwGet CollUrlParamString]"
   TARGET=_top>$[dwGetLocParam [dwGet State__Language]_button_image_srcmap book]</A>

In the Frames__CollectionButtonBarView and NoFrames__CollectionButtonBarView templates, the Book button is inactive, and the HTML is as follows:

$[dwGetLocParam [dwGet State__Language]_button_image_srcmap book_dim]

Removing the Expand Button

The Expand button displays another level of the TOC. The HTML used to call the Expand button into the bookbbar.dwc file is as follows:

$[dwGet expand_button]

Search for "dwSet expand_button" for the actual HTML.

The HTML used to show the Expand button in the collbbar.dwc file is as follows:

<A HREF="@$[dwGet TopLevelView]$[dwGet ExpandParams]$[dwGet UrlQueryString]"
   TARGET=_top>$[dwGetLocParam [dwGet State__Language]_button_image_srcmap expand]</A>

Removing the Collapse Button

The Collapse button hides the lowest level currently being shown of the TOC. The HTML to call the Collapse button into the button bar in the bookbbar.dwc file is shown below.

$[dwGet collapse_button]

Search for "dwSet collapse_button" for the actual HTML.

The HTML for the Collapse button in the collbbar.dwc is shown below.

<A HREF="@$[dwGet TopLevelView]$[dwGet CollapseParams]$[dwGet UrlQueryString]"
            TARGET=_top>$[dwGetLocParam [dwGet State__Language]_button_image_srcmap collapse]</A>

Removing the Search Button

The HTML that shows the Search button is displayed below.

$[dwGetLocParam [dwGet State__Language]_button_image_srcmap search]

Removing the Search Forms Button

The Search Forms button brings up an HTML form that mimics existing DynaText search forms. The HTML is as follows:

$[dwGetParam [dwGet State__Language]_button_image_srcmap search_forms]

Removing the Previous Search Hit Button

The Previous Search Hit button moves the view to the previous section of text that contains a successful search hit. The HTML used to call the button is shown below.

$[dwCall ShowPrevHitButton]

Removing the Next Search Hit Button

The Next Search Hit button moves the view to the following section of text that contains a successful search hit. The HTML used to call the button is shown below.

$[dwCall ShowNextHitButton]

Removing the Clear Search Button

The Clear Search button removes all visible hits from a completed search.

$[dwCall ShowClearButton]

The Clear Search button does not appear in the Frames__RootButtonBarView or the NoFrames__RootButtonBarView templates.

Removing the Show Frames/Hide Frames Button(s)

Depending on the current viewing mode, one of these buttons is always present to switch into or out of frame viewing.

The Show Frames button appears in the NoFrames__RootButtonBarView, the NoFrames__CollectionButtonBarView, and the NoFrames__BookButtonBarTemplate. The HTML for the Show Frames button in the Root view is as follows:

$[dwCall NoFrames__RootShowFramesButton]
$[dwCall NoFrames__CollectionShowFramesButton]
$[dwCall NoFrames__BookShowFramesButton]

The Hide Frames button appears in the Frames__RootButtonBarView template, the Frames__CollectionButtonBarView template, and the Frames__BookButtonBarTemplate. The HTML to call the button in the Frames__RootButtonBarView is:

<A HREF="@Generic__RootView$[dwCall RemoveHfUrlParam]$[dwGet UrlParamString];hf=0$[dwGet UrlQueryString]"\
   TARGET=_top>$[dwGetParam button_image_srcmap hide_frames]</A>

For the Frames__CollectionButtonBarView template, the HTML is:

<A HREF="$[dwGet hideframesUrlprefix]@Generic__CollectionView$[dwGet UrlParamString];hf=0$[dwGet UrlQueryString]"\
   TARGET=_top>$[dwGetParam [dwGet State__Language]_button_image_srcmap hide_frames]</A>

For the Frames__BookButtonBarTemplate, the HTML looks like:

<A HREF="@Generic__BookTextView$[dwCall RemoveHfUrlParam]$[dwGet UrlParamString];hf=0$[dwGet UrlQueryString]"\
   TARGET=_top>$[dwGetParam [dwGet State__Language]_button_image_srcmap hide_frames]</A>

Removing the Print Button

The Print button allows users to select sections of the currently viewed book to download as a PostScript file for printing. The HTML for the Print button is shown below.

$[dwCall ShowPrintButton]

The Print button only appears in the Frames__BookButtonBarView and the NoFrames__BookButtonBarView templates.

Removing the Help Button

The Help button links to a quick overview of the button bar buttons. The HTML for the help button is shown below.

<A HREF=" "\
   TARGET=_top>$[dwGetParam [dwGet State__Language]_button_image_srcmap help]</A>

The Help button does not appear in the Frames__RootButtonBarView or the NoFrames__RootButtonBarView templates.

Removing the Expand Search Checkbox

The Expand Search allows users to decide whether or not to expand their searches. The HTML for the Expand Search checkbox is shown below:

$[dwCall ShowSearchExpandCheckbox]

This line appears four times in the configuration files. Two times at the collection level (once for frames and once for non-frames), and two more times at the book level. In order to fully remove the checkbox, you will have to either remove or comment out all four lines. Do not simply remove the dwScript ShowSearchExpandCheckbox, as that will cause Tcl errors.

The collection level lines are located in collbbar.dwc, while the book level ones are located in bookbbar.dwc.


   Frames   [Table of Contents]    Modifying the Print Interface