Extending the Administration Console

 Previous Next Contents View as PDF  

Using the Console Extension Tag Library

The following sections describe the attributes of the console extension tags and provide a sample usage for each:

 


Overview of the Console Extension JSP Tag Library

A JSP tag library is supplied with the WebLogic Server distribution for use in creating console extensions. The tag library allows you to:

 


Tag Library Attribute Reference

The following sections describe the usage of each tag in the Console Extension Tag Library.

<wl:node> Tag

Use the <wl:node> tag to create new nodes in the Administration Console navigation tree.

The following example demonstrates the usage of the <wl:node> tag:

Listing 2-1 Sample Usage of the <wl:node> Tag

<wl:node 
   label='<%="My Console Extension"%>'
   icon='/images/smiley.gif'
   expanded='true'>

   <wl:node
      label='My 1st nested node'
      icon='/images/bullet.gif'
      url='/dialog_domain_example.jsp'>
   </wl:node>

   <wl:node label='My 2nd nested node'
      icon='/images/bullet.gif'>
   </wl:node>

</wl:node>

Table 2-1 Attributes of the <wl:node> Tag

Attribute

Description

icon

The URL of an image file (.gif or .jpg) that is displayed in the navigation tree for this node.

The URL may be an absolute URL, (for example, http://somesite.com/images/myIcon.gif) or a URL relative to the Web Application containing the console extension (for example, /images/myIcon.gif.).

label

The text label displayed for this node. Do not use this attribute if you define the labelId attribute

labelId

The Catalog ID of the localized text label for this node. Do not use this attribute if you define the label attribute.

url

The URL of the page that should be displayed in the Administration Console when the user clicks this node.

The URL may be an absolute URL, (for example, http://somesite.com/myPage.jsp) or a URL relative to the Web Application containing the console extension.

target

The name of a browser frame where the URL specified in the url attribute should be displayed. If this attribute is not specified, the URL is displayed in the right pane of the Administration Console. You may use any name you choose or one of the following keywords:

  • _top   - Displays the URL in the same browser window that displays the console, replacing the console.

  • _blank - Displays the page specified by the url attribute in a new browser window.

expanded

Set to true or false. If set to true, the node appears expanded (all child nodes are visible) when the console first loads.

Default is false.

font

Font used to display the node's text label. Support for fonts is browser-dependent.

<wl:menu> and <wl:menu-separator> Tags

Use the <wl:menu> to create menus and actions that users access by right-clicking on nodes in the navigation tree defined with the <wl:node> tag. The <wl:menu-separator> tab inserts a separator line in the right-click menu.

Listing 2-2 Usage of the <wl:menu> and <wl:menu-separator> Tags

...

   <wl:node
      label='My 2nd nested node'
      icon='/images/bullet.gif'>
      <wl:menu
         label='BEA Product Documentation'
         url='http://www.oracle.com/technology/documentation/index.html'
         target='_blank'/>
      <wl:menu-separator/>

       <wl:menu
           label='BEA home page'
           url='http://www.bea.com'
            target='_blank'/>

   </wl:node>

...

The above code creates a right-click menu under the "My 2nd Nested Node" entry in the navigation tree.

Table 2-2 Attributes of the <wl:menu> Tag

Attribute

Description

label

Text label that appears for this menu item. Do not use this attribute if you define the labelId attribute.

labelId

The Catalog ID of the localized text label for this menu item. Do not use this attribute if you define the label attribute.

url

Absolute URL or a URL relative to the Web Application root for a page to be displayed in the console

target

The name of a browser frame where the URL specified in the url attribute should be displayed. If this attribute is not specified, the URL is displayed in the right pane of the Administration Console. You may use any name you choose or one of the following keywords:

_top   - Displays the URL in the same browser window that displays the console, replacing the console.

_blank - Displays the page specified by the url attribute in a new browser window.

The <wl:menu-separator> tag has no attributes.

<wl:tab> Tag

Use the <wl:tab> tag to create a tabbed interface in your console extension. You can create nested tabbed screens by nesting a <wl:tab> tag within another <wl:tab> tag. Only one level of nesting is supported.

The following example demonstrates the usage of the <wl:tab> tag:

Listing 2-3 Sample Usage for the <wl:tab> Tag

<wl:tab name='TopLevelTabA' label='Top Level Tab A'>

   <wl:tab name='NestedTabA1' label='Nested Tab A-1'>
       (Insert your JSP and/or HTML code
       for displaying your console extension here.)
   </wl:tab>

   <wl:tab name='NestedTabA2' label='Nested Tab A-2'>
      (Insert your JSP and/or HTML code
       for displaying your console extension here.)
   </wl:tab>

</wl:tab>
<wl:tab name='TopLevelTabB' label='Top Level Tab B'>

   <wl:tab name='NestedTabB1' label='Nested Tab B-1'>
       (Insert your JSP and/or HTML code
       for displaying your console extension here.)
   </wl:tab>

   <wl:tab name='NestedTabB2' label='Nested Tab B-2'>
      (Insert your JSP and/or HTML code
       for displaying your console extension here.)
   </wl:tab>

</wl:tab>

Table 2-3 Attributes of the <wl:tab> Tag

Attribute

Description

name

The name of the tab. Do not use the period (.) character in the name. If you do not specify the labelId attribute, the console looks for an entry in the localization catalog with the form

tab + name

For example, if you set name to config, the console labels the tab by looking up localized text located in the catalog using the ID tab.config.

label

The exact text that appears as the title of the tab. Do not define this attribute if you define the labelId attribute. Use this attribute only if you are not using a localization catalog.

labelId

The catalog ID for a localized label for the tab, if different from the name attribute. This text is looked up in the localization catalog. Do not define this attribute if you define the label attribute.

<wl:dialog> Tag

The <wl:dialog> Tag demarcates a section of the JSP that defines tabbed console screens. <wl:tab> tags must appear with in a <wl:dialog> block.

Listing 2-4 Sample Usage of the <wl:dialog> Tab

...
<wl:dialog>
  <wl:tab>
     ....(Insert code for tabbed dialog screen here.)
  </wl:tab>
</wl:dialog>
...

The <wl:dialog> tag has no attributes.

<wl:stylesheet> Tag

Insert the <wl:stylesheet> tag with the HTML <head> block to specify that your console screens use the same display styles (fonts, colors, etc.) as the standard Administration Console.

Listing 2-5 Sample Usage of the <wl:stylesheet> Tab

<html>
 <head>
   <wl:stylesheet/>
 </head>
...

The <wl:dialog> tag has no attributes.

<wl:extensibility-key> Tag

The <wl:extensibility-key> tag creates a scripting variable that represents a Java object. You can use this tag in the JSP that defines the Navigation tree.

Note: The <wl:extensibility-key> tag cannot be used in a JSP that defines a console dialog screen.

Listing 2-6 Sample Usage of the <wl:extensibility-key> Tag

<wl:extensibility-key 
  id='domainKey'   class='weblogic.management.configuration.DomainMBean' />
<%="Configuration Version is" + domainKey.getConfigurationVersion()%> 

Attribute

Description

id

Name of the scripting variable.

class

Java class of the scripting variable.

<wl:text> Tag

Use the <wl:text> tag to display text from the localization catalog.

Listing 2-7 Sample Usage of the <wl:text> Tag

<wl:text textId='Text.3' textParamId='Param.1' />
<p>
<wl:text textId='Text.2' textParam="Blue"/>

Table 2-4 Attributes of the <wl:text> Tag

Attribute

Description

style

(Optional) HTML Style class used to display the text.

text

The actual text you want to display. Do not define this attribute if you define the textID attribute.

textId

The catalog ID for the localized text you want to display. This text is looked up in the localization catalog. Do not define this attribute if you define the text attribute.

textParamId

The localization catalog ID of text that is substituted for any occurrence of the string {0} in text retrieved from the catalog. Do not define this attribute if you define the textParam attribute.

textParam

A literal string that is substituted for any occurrence of the string {0} in text retrieved from the catalog. Do not define this attribute if you define the textParamID attribute.

 


Using the Tag Library in a Console Extension

To use the console extensibility tag library:

  1. Add the following section to the web.xml deployment descriptor of the Web Application containing your console extension:
    <taglib>
      <taglib-uri>console_extension_taglib.jar</taglib-uri>
      <taglib-location>
         WEB-INF/console_extension_taglib.tld
      </taglib-location>
    </taglib>

  2. Copy the console_extension_taglib.tld file to the WEB-INF directory of the Web Application containing your console extension.

  3. Insert this taglib statement at the top of each JSP that uses the console extensibility tag library:
    <%@ taglib uri='console_extension_taglib.jar' prefix='wl' %>

 

Back to Top Previous Next