Class PluginTagGenerator
The Java Plugin-in HTML Converter supplied by Sun generates html which is complex and cumbersome to maintain. The jsp:plugin tag makes it easier to create the complex html needed for the plugin, but requires the jsp developer to enter all attributes during development of page. This class dynamically produces html tags from runtime inputs, request attributes, and wt.properties.
There are two types of inputs, parameters and attributes. Parameters are passed on to the applet as applet parameters. Attributes effect the plugin container (ie codebase, code, height, width). These inputs are prepended with param. and attr. respectively. Attributes to the JSP PluginTag are treated as attributes and inputs defined within ParamTag tags are passed into applets as paramaters.
wt.properties entries prepended with wt.taglib.util.plugin. are used as the default. Request specific defaults may override these defaults using clientmod rules described later. The inputs from the page being generated are then applied over these defaults. Finally, inputs that are prepended with override. are applied. This allows inputs defined within wt.properties to override those given by page developers.
The list of currently applied client modifications is defined by wt.property wt.taglib.util.plugin.clientmods. The modification is defined by the wt.taglib.util.plugin.clientmoddef.MOD_NAME.agentContains.N property where MOD_NAME is the name given in the clientmods list and N is an incremental number in the case multiple rules apply for this modification. If the value of this property is found in the HTTP USER-AGENT request header, the overrides found within wt.taglib.util.plugin.clientmod.MOD_NAME are then applied.
For example, to tell all Solaris users to use a 1.4 compatible JVM:
wt.taglib.util.plugin.clientmods=SOLARIS
wt.taglib.util.plugin.clientmoddef.SOLARIS.agentContains.1=Solaris
wt.taglib.util.plugin.clientmod.SOLARIS.attr.jreversion=1.4
This class handles Windchill Template Processed Scripts with the following rules:
- known plugin tag attributes are sent to plugin generator as is
- 'param.' corresponds to a ParamTag (ie param.X="Y" == <util:param name="X" value="Y" />)
- 'fallback' corresponds to a FallbackTag (ie fallback="Message" == <util:fallback>Message</util:fallback>)
- 'recurse.' standard template processing recursion attribute. Takes a Windchill script as an argument and places return value into value of attribute named after 'recurse.'
<SCRIPT LANGUAGE=Windchill>
<!--
wt.taglib.util.PluginTagGenerator createPluginTag code="pkg/foo.class" codebase=".." width="100" height="20" param.name1="value1" param.name2="value2" recurse.param.basename="wt.htmlutil.HtmlUtil createBase" fallback="This is the fallback message"
-->
</SCRIPT>
| Attribute Definitions | |
type |
The type of html code to be generated. Specify bean or
applet to generate plugin object code. Specifying
browserapplet generates html to use the browser's vm; generates
an <applet> tag |
code |
The name of the Java class file that the plugin will execute. You must
include the .class extension in the name. The filename is relative to the
directory named in the codebase attribute.
|
codebase |
The absolute or relative path to the directory that contains the applet's code. Defaults to the path of the JSP file that calls this tag. |
name |
A name for the Bean or applet instance, which makes it possible for applets or Beans called by the same JSP file to communicate with each other. |
align |
Specifies the positioning of the object relative to the html surrounding
the tag. Defaults to bottom.
|
height |
The initial height, in pixels, of the image the applet or Bean displays. |
width |
The initial width, in pixels, of the image the applet or Bean displays. |
hspace |
The amount of space, in pixels, to the left and right of the image the applet or Bean displays. |
vspace |
The amount of space, in pixels, to the top and bottom of the image the applet or Bean displays. |
jreplugin |
The version of the java plugin to be used with this applet. jreplugin allows any plugin jvm that is compatible with this version to be used. jpiplugin requires that the specific version, and only that version, may be used. |
nspluginurl |
The URL where the user can download the JRE plugin for Netscape Navigator. |
iepluginurl |
The URL where the user can download the JRE plugin for Internet Explorer. |
fallback |
A text message to display if the code can not be started. |
| Parameter Definitions | |
cache_option |
The 1.3 plugin introduces jar caching similar in functionality to the Windchill Bootstrap used in previous releases. See Applet Caching and Installation in Java Plug-in for more information on these parameters. Windchill includes an additional cache_option of "Bootstrap" which is similar to the 1.3 Plugin Jar Cache. See the wt.boot package for more information.
An alternative to specifying the cache_version parameter, is to have it read from a jar.properties file residing in the same directory as the jar file the version is describing. Setting wt.taglib.util.plugin.useCacheVersion=true causes the tag generation to generate a cache_version tag with the version number for each jar within the adjacent cache_archive tag. The default version is 0.0.0.0 if this property is not set within jar.properties. Note: The 1.3 java plugin requires the cache_version tag when using HTTPS to determine if a jar requires download. |
Supported API: true
Extendable: false
- Since:
- Windchill R6.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreatePluginTag(PrintWriter out, Properties prop, Locale locale, String userAgent)
Supported API: truestatic StringcreatePluginTag(Properties prop, Locale locale)
Supported API: truestatic voidcreatePluginTag(Properties prop, Locale locale, OutputStream os) Create plugin tag used within Windchill Template Processing.static voidcreatePluginTag(Properties prop, Locale locale, OutputStream os, String userAgent)
Supported API: truestatic StringcreatePluginTag(Properties prop, Locale locale, String userAgent)
Supported API: true
-
Method Details
-
createPluginTag
public static String createPluginTag(Properties prop, Locale locale, String userAgent) throws WTException
Supported API: true- Throws:
WTException
-
createPluginTag
Supported API: true- Throws:
WTException
-
createPluginTag
public static void createPluginTag(Properties prop, Locale locale, OutputStream os) throws WTException Create plugin tag used within Windchill Template Processing.
Supported API: true- Throws:
WTException
-
createPluginTag
public static void createPluginTag(Properties prop, Locale locale, OutputStream os, String userAgent) throws WTException
Supported API: true- Throws:
WTException
-
createPluginTag
public static void createPluginTag(PrintWriter out, Properties prop, Locale locale, String userAgent) throws WTException
Supported API: true- Throws:
WTException
-