Overview  Index    SDX 7.6 Enterprise JSP Tags
Juniper Networks, Inc.
SUMMARY: DATA | ACTION | ITERATOR | PRESENTATION

Enterprise Tag Library

The enterprise tag library provides JavaServer Pages (JSP) developers with a custom JSP tag library so they can create and modify enterprise portals — that is, Web portals served by ISPs and used by enterprise IT managers.

See:
          Description

Data Tag Summary
<jnpr:acc> This tag represents an access.
<jnpr:attr> This tag represents an LDAP attribute for a specific subscriber, subscription, manager, or service.
<jnpr:ent> This tag represents an enterprise.
<jnpr:folder> This tag represents a subscriber folder.
<jnpr:globalVar> This tag represents a global variable.
<jnpr:mgr> This tag represents a manager.
<jnpr:mgrSess> This tag provides information about the current manager's login session.
<jnpr:ret> This tag represents a retailer.
<jnpr:sched> This tag represents a schedule.
<jnpr:serv> This tag represents a service.
<jnpr:servParam> This tag represents a service parameter.
<jnpr:sess> This tag specifies a session for a leaf subscriber.
<jnpr:site> This tag represents a site.
<jnpr:sub> This tag represents a subscription.
<jnpr:subr> This tag represents an enterprise, site, or access, depending on its initialization attribute's values.
<jnpr:subst> This tag represents a substitution.
<jnpr:substVals> This tag is responsible for getting the potential values for a given substitution.
<jnpr:var> This tag represents the named variable's value, type, and status (fixed, defaulted, or free) in the context of a specific subscriber or subscription.
<jnpr:vpn> This tag represents a virtual private network (VPN) in the Enterprise information model.

Action Tag Summary
<jnpr:loginMgrSess> This tag logs in the specified manager for the current HTTP session.
<jnpr:logoutMgrSess> This tag logs out the manager who is logged in to the current HTTP session.
<jnpr:reloadMgrSess> This tag forces the tag library to clear its cache of enterprise data, which was obtained from an LDAP directory, and its caches of session data, which were obtained from various SAEs.
<jnpr:reloadSess> This tag forces the tag library to clear its cache of data about the specified session, which was obtained from the SAE managing that session.
<jnpr:writeAttr> This tag modifies a specific LDAP attribute for a specific subscriber, subscription, manager, or service.
<jnpr:writeMgr> This tag creates, modifies, or deletes a manager.
<jnpr:writeSched> This tag creates, modifies, or deletes a schedule.
<jnpr:writeSess> This tag modifies a specific session and specifies whether it should be active.
<jnpr:writeSub> This tag creates, modifies, or deletes a manager.
<jnpr:writeSubst> This tag creates, modifies, or deletes a substitution.
<jnpr:writeVpn> This tag modifies, exports, or cancels the export of a VPN.

Iterator Tag Summary
<jnpr:eachAcc> This tag iterates over the set of accesses for a specific site or enterprise.
<jnpr:eachChild> This tag iterates over the set of subscribers that are children of a specific subscriber.
<jnpr:eachEnt> This tag iterates over the set of enterprises under a specific retailer.
<jnpr:eachFolder> This tag iterates over the set of all subscriber folders.
<jnpr:eachGlobalVar> This tag iterates over the set of all global variables.
<jnpr:eachLeafSess> This tag iterates over the set of sessions associated with a specific leaf subscriber.
<jnpr:eachMgr> This tag iterates over the set of managers for a specific subscriber.
<jnpr:eachPolicyVar> This tag is intended for debugging and advanced portals only.
<jnpr:eachRet> This tag iterates over the set of all retailers.
<jnpr:eachRuntimeVar> This tag is intended for debugging and advanced portals only.
<jnpr:eachSched> This tag iterates over the set of schedules for a specific subscriber.
<jnpr:eachServ> This tag iterates over the set of all services.
<jnpr:eachServParam> This tag iterates over the set of service parameters associated with a specific service.
<jnpr:eachSite> This tag iterates over the set of sites under a specific enterprise.
<jnpr:eachSub> This tag iterates over the set of subscriptions for a specific subscriber.
<jnpr:eachSubSess> This tag iterates over the set of sessions associated with a specific subscription.
<jnpr:eachSubst> This tag iterates over the set of all substitutions in a specific subscriber or subscription.
<jnpr:eachVar> This tag iterates over the set of all variables in a specified context.
<jnpr:eachVpn> This tag iterates over the set of VPNs for a specific subscriber.

Presentation Tag Summary
<jnpr:pane> The pane tag generates a titled border around arbitrary HTML.
<jnpr:selectedNodePane> This tag is intended for use with the tree tag.
<jnpr:substValsSelectList> The substValsSelectList tag lists current parameters and their corresponding values for substitutions from which customers can select items.
<jnpr:tabbedPane> This tag generates a pane with tabs on top.
<jnpr:tree> The tree tag is a special session tag.

Enterprise Tag Library Description

The enterprise tag library provides JavaServer Pages (JSP) developers with a custom JSP tag library so they can create and modify enterprise portals — that is, Web portals served by ISPs and used by enterprise IT managers.

Before using the SDX custom JSP tag library to build Web portals, JSP developers should understand the SDX enterprise information model and the relationships and behavior within the information model (for example, the behavior of the parameter acquisition path). They must have experience working with JSP, JSP tags, and custom JSP tag libraries.

See the following sections for information about these topics as they apply to the enterprise tag library:

Custom JSP Tags

The enterprise tag library provides four types of custom JSP tags:

Enterprise Data Tags

Each enterprise data tag provides information of interest to an enterprise IT manager or to a service provider. For example, a JSP developer can use the <jnpr:ent> tag to get information about an enterprise and the <jnpr:sub> tag to get information about a subscription.

The Data Tag Summary lists the enterprise data tags.

Action Tags

Action tags allow the JSP developer to modify enterprise data and control a manager's interaction with the Web portal.

Most action tags allow the JSP developer to create, modify, or delete enterprise-related data. For example, a JSP developer can use the <jnpr:writeMgr> tag to change a manager's password. Two action tags, <jnpr:loginMgrSess> and <jnpr:logoutMgrSess>, allow the JSP developer to control an IT manager's interaction with the Web portal. Two other action tags, <jnpr:reloadMgrSess> and <jnpr:reloadSess>, allow the JSP developer to design JSP pages that reload cached data.

Most action tags inherit part of their definition from a corresponding enterprise data tag. In other words, action tag X inherits its definition from an enterprise data tag Y, and has all the same attributes as tag Y, plus a few more, and all the same scripting variables as tag Y. (The action tags do not introduce any new scripting variables.)

The Action Tag Summary lists the action tags.

Iterator Tags

The iterator tags provide the JSP developer with a method of repeating the same action or generating similar HTML code for a set of related enterprise objects. For example, by putting some HTML code inside the body of a <jnpr:eachServ></jnpr:eachServ> tag, the JSP developer can generate a Web page that lists and describes every existing service.

The Iterator Tag Summary lists the iterator tags.

Presentation Tags

The presentation tags generate HTML code. The presentation tags provide the JSP developer with the means to generate Web pages. For example, the JSP developer can use the <pres:pane> tag to generate a border around a section of a Web page.

The <jnpr:tree> tag is a special tag that does not behave like the other tags in the enterprise tag library. See The Tree Tag and Tree Tag Configuration for more information.

The Presentation Tag Summary lists the presentation tags.

The Tree Tag

The <jnpr:tree> tag draws a graphical tree showing all subscribers in a given manager's scope of control. Each node in the tree is a hypertext reference (href) to a configurable URL.

The tree tag is a special case; it does not conform to the standard behavior of the other tags in the enterprise tag library. It is special in the following ways:

Tree Tag Configuration

NOTE: This section applies to the tree tag only if the default value for the tree tag's treeClassName attribute is used. If a nondefault value is specified for the treeClassName attribute, the tree tag configuration may be entirely different.

The tree tag must be configured by means of its treeConfig attribute. This attribute is of the form property1=value1;property2=value2;property3=value3. More specifically, the treeConfig attribute is a string that contains a set of properties. The properties are separated by the delimiter ";" or by white space (any white space is treated as a delimiter between properties). Within each property is a name/value pair, separated by the delimiter "=". The required properties are described below.

One set of properties specifies the URLs of the images used to draw the tree. These required properties are:

    jsp.tree.top-bottom-icon=images/tree/t-b.gif

jsp.tree.top-right-icon=images/tree/t-r.gif
jsp.tree.top-right-bottom-icon=images/tree/t-r-b.gif
jsp.tree.left-bottom-icon=images/tree/l-b.gif
jsp.tree.expand-icon=images/tree/closed.gif
jsp.tree.collapse-icon=images/tree/open.gif
jsp.tree.blank-icon=images/tree/white-pixel.gif

Some of these images are used to draw lines connecting the nodes of the tree. These images should be of the following forms:

The other images are used as icons that show the state of nodes in the tree:

Also, for each type of node in the tree (that is, manager, retailer, enterprise, site, access), there exists a property that specifies what image to use to represent the node when you draw the tree. The names of these required properties are:

    mgr_icon=images/tree/ent.gif

rtl_icon=images/tree/rtl.gif
ent_icon=images/tree/ent.gif
site_icon=images/tree/site.gif
acc_icon=images/tree/acc.gif

In addition, a URL must be specified for each type of node. The node is associated with an href to the specified URL in the generated tree. The names of these properties are:

    mgr_url=manager.jsp

rtl_url=retailer.jsp
ent_url=enterprise.jsp
site_url=site.jsp
acc_url=access.jsp

Finally, an optional property, rootlabel, can be specified. This is the label displayed next to the root node when the tree is generated. (All other nodes are displayed with a label that is the display name of the node; for example Boston might be the display name of a site node). If no property value is explicitly specified, the default value for this property, which is the fully qualified login name of the currently logged-in manager, is used. This optional property is:

    rootlabel=You

In SDX Release 4.0, an acquirable attribute path is included in the tree tag, so any enclosed tags can acquire the value of this attribute. By adding provide_path=true or provide_path=false to its treeConfig attribute, Web developers can decide whether the tree tag should provide the path value or not. The default value is false.

Attribute Value Acquisition

Many of the attributes of the custom tags are used to specify an object in the enterprise information model (for example, enterpriseName, siteName, subscriptionName, managerName). The tag attributes that play this object-naming role can acquire their values from enclosing custom tags. If one of the custom tags is nested in the body of another custom tag, some of the nested tag's attributes will automatically acquire their values from the attributes of the same name in the enclosing tag. The following example illustrates nested tags:

    <jnpr:site retailerName="isp3" enterpriseName="Juniper" siteName="Kanata"> 

<jnpr:acc accessName="primaryAccess">
// HTML describing the Access
</jnpr:acc>
</jnpr:site>

In this example, the inner tag has attributes called retailerName, enterpriseName, siteName, and accessName, but the JSP developer has to specify only the accessName attribute. The other attributes automatically acquire their values from the corresponding attribute of the same name in the outer, or enclosing, tag.

If multiple levels of tags are nested inside each other, the value for a particular attribute will be automatically acquired from the innermost tag that has an attribute of the same name.

The value null (that is, no specified value) will be acquired exactly like any other attribute value.

Exceptions to Attribute Value Acquisition

The presentation tag attributes never acquire their values from enclosing tags. Also, some non-presentation tag attributes do not acquire their value from the enclosing tags. The attributes that do not automatically get values are attributes that play some role other than specifying an object in the enterprise information model.

In the tables describing each tag in detail, we indicate for each attribute whether or not that attribute will automatically acquire its value from enclosing tags.

Overriding Attribute Value Acquisition

The JSP developer can always provide a value for any attribute. If the JSP developer provides a value, the developer-supplied value is used, and the acquired value is not used.

Referencing Subscriptions

If the name of a subscription is different from the name of the associated service, you can use the construction <serviceName>%<subscriptionName> to represent a subscription in any tag that supports the attribute subscriptionName. The variable <serviceName> is the name of the service in the directory, and the variable <subscriptionName> is the name of the subscription in the directory. For example, if a subscriber has a subscription called rock to a service called Audio-Bronze, you can set the subtag's subscriptionName attribute to the value Audio-Bronze%rock to reference the subscription called rock.

If a subscriber has a subscription that has the same name as the associated service, you can use the variable <serviceName> to reference the subscription name. For example, if a subscriber has a subscription called Audio-Bronze to the service Audio-Bronze, you can set the subtag's subscriptionName attribute to the value Audio-Bronze.

Scripting Variables

The custom tags provide scripting variables. These scripting variables are the mechanism by which the tags provide information to the JSP developer. The following example illustrates this mechanism. This example generates a bulleted list naming every service that exists:

    <h1>The following services exist:</h1> 

<ul>
<jnpr:eachServ>
<jnpr:serv serviceName="<%=eachServ_serviceName %>">
<li> <%=serv_displayName %></li>
 </jnpr:serv>
</jnpr:eachServ>
</ul>

In this example, the scripting variable <eachServ_serviceName> is provided by the iterator tag <jnpr:eachServ>, which iterates over every existing service. This scripting variable has a different value in each iteration. Each value is the name of one service.

The serv_displayName scripting variable is provided by the <jnpr:serv> tag, which represents a specific service. This scripting variable's value is the name of the service in a form suitable for displaying it to IT managers.

See the tables that describe each tag for a list of tag scripting variables and a description of each scripting variable.

Scope of Scripting Variables

With one exception, all scripting variables provided by the custom tags have NESTED scope, meaning they are available only within the body of the tag that provides them.

The exception is the presentation tag <jnpr:tree>, whose scripting variables have REQUEST scope, rather than NESTED scope.

Style Sheets for Presentation Tags

The presentation tags generate HTML code. The generated HTML code contains HTML elements that reference specific named styles. The JSP developer must provide a style sheet that defines the appearance of these named styles. See the Tree Tag Style-Sheet Classes table for the names and descriptions of each style that is referenced in the generated HTML code.

Style-Sheet Class Name Purpose of Style-Sheet Class
nodetext Controls the appearance of all unselected node labels.
nodetextsel Controls the appearance of the selected node's label.
nodetextseloutline Controls the appearance of the border around the selected node's label.

Exceptions and Error Handling

Error conditions may occur that prevent a given custom tag from operating normally. These error conditions are as follows:

In all these normal error cases, an exception will be raised by the tag. The exception will always be of the type EntTagException. This EntTagException is a subclass of JspTagException. The EntTagException's getMessage method will provide an English-language message explaining the error condition. This message is not suitable for display to subscribers.

If the error condition is caused by an exception raised by the underlying enterprise API (that is, an EntException), then that EntException will be available through the EntTagException's getRootCause method.

Overview  Index    SDX 7.6 Enterprise JSP Tags
Juniper Networks, Inc.
SUMMARY: DATA | ACTION | ITERATOR | PRESENTATION

Copyright 2000-2010 Juniper Networks, Inc. All rights reserved.