The Administration Console provides a set of page extensible templates to make it easier to provide Administration Console content for your add-on component. This appendix provides information about these templates.
In an Enterprise Server distribution in which both Enterprise Server and the Administration Console are running, these templates can be found in the directory domain-dir/generated/jsp/__admingui/loader/templates.
To use a template, specify it in the template attribute of the composition directive for your page.
The following topics are addressed here:
The base template, baseTemplate.tpl, is included by the other templates.
None.
The baseTemplate.tpl file takes the following parameters. You can specify these parameters as attributes to the composition tag for any JSF page that includes baseTemplate.tpl.
The name of the resource bundle for internationalization. Specify #{i18n} to access the values.
The name of the resource bundle for help. Specify #{help} to access the values.
The name of the page. Will be used in both the head element and as the page header.
The inline help text to be displayed under the page header.
You can use define tags with the following name values.
Use this value if your page needs to add content to the head element.
Use this value if you need to add any extra child components to the sun:title custom tag.
Use this value if you need to add child components to the pageButtonsTop facet of the sun:title custom tag.
This value is required, and describes what the body of the page will be. The body content is usually defined by child templates, but if you use or extend this template directly, you must specify this value.
Use the property sheet template, propertySheetTemplate.tpl, to specify a property sheet.
baseTemplate.tpl
The propertySheetTemplate.tpl file takes the following parameter in addition to those listed in Base Template:
If this parameter is set to "true" (the String value, not a Boolean, due to conversion errors with the component), the following legend will appear at the top right of the page:
* Indicates required field |
You can use define tags with the following name values, in addition to those listed in Base Template:
Use this value to list each sun:property custom tag needed on the page.
Use this value if you need more than one property sheet. Provide a sun:propertySheetSection custom tag for each sheet you need, along with the sun:property custom tag for each section.
The following page uses the property sheet template to specify a property sheet.
<!composition template="/templates/propertySheetTemplate.tpl" i18nBundle="com.foo.resources.Messages" helpBundle="com.foo.resources.Help" pageTitle="Using the Base Templates" helpText="This file uses the property sheet template."> <!define name="properties"> <sun:property id="propOne" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property One"> <sun:dropDown id="propOneDD" selected="#{propOne}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> <sun:property id="propTwo" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property Two"> <sun:dropDown id="propTwoDD" selected="#{propTwo}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> </define> </composition>
The following page uses the property sheet template to specify a set of property sheets.
<!composition template="/templates/propertySheetTemplate.tpl" i18nBundle="com.foo.resources.Messages" helpBundle="com.foo.resources.Help" pageTitle="Using the Base Templates" helpText="This page uses two property sheets."> <!define name="propertySheets"> <sun:propertySheetSection> <sun:property id="propOne" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property One"> <sun:dropDown id="propOneDD" selected="#{propOne}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> <sun:property id="propTwo" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property Two"> <sun:dropDown id="propTwoDD" selected="#{propTwo}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> </sun:propertySheetSection> <sun:propertySheetSection> <sun:property id="propThree" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property Three"> <sun:dropDown id="propThreeDD" selected="#{propThree}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> <sun:property id="propFour" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="Property Four"> <sun:dropDown id="propFourDD" selected="#{propFour}" labels={"foo" "bar" "baz"} values={"FOO" "BAR" "BAZ"} /> </sun:property> </sun:propertySheetSection> </define> </composition>
Use the property table template, propertyTableTemplate.tpl, to specify a property table.
baseTemplate.tpl
The propertyTableTemplate.tpl file takes the following parameter in addition to those listed in Base Template.
A List<Map> that holds the table data. This List can be created by passing a Map<String,PropertyConfig> or Map<String,String> to the handler getTableList.
See defines for Base Template.
Use the sheet table template, propSheetPropTableTemplate.tpl, to specify a page that contains both a property sheet and a property table. This template is an amalgamation of propertySheetTemplate.tpl and propertyTableTemplate.tpl, so any requirements for those two templates apply here as well. This template will display the property sheet above the table.
baseTemplate.tpl
See parameters for Base Template, Property Sheet Template, and Property Table Template.
See defines for Base Template and Property Sheet Template.
Use the Administration Console property sheet template, adminConsolePropertySheet.tpl, to specify a property sheet that adds support for manipulating an AMXConfig object. (AMX refers to Appserver Management EXtensions.) The loading and saving of values, including the retrieval of default values, is automatic with this template.
propertySheetTemplate.tpl
The adminConsolePropertySheet.tpl file takes the following parameters, in addition to those specified in Base Template and Property Sheet Template.
The id of the Enterprise Server configuration.
A List detailing which attributes of the AMXConfig object are to be handled on this page.
See defines for Base Template and Property Sheet Template.
The following page uses the Administration Console property sheet template to specify a property sheet.
<!initPage setResourceBundle(key="web" bundle="org.glassfish.web.admingui.Strings") /> <!composition template="/templates/adminConsolePropertySheet.tpl" pageTitle="$resource{web.monitoring.Title}" helpText="$resource{web.monitoring.PageHelp}" helpBundle="org.glassfish.web.admingui.Helplinks" amxConfigName="monitoringServiceConfig.moduleMonitoringLevelsConfig" amxConfigAttributes={"HTTPService","webContainer", "JVM", "threadPool"}> <!define name="properties"> <sun:property id="httpProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Http}"> <sun:dropDown id="Http" selected="#{configMap['HTTPService']}" labels={"$resource{web.monitoring.Low}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"} values={"LOW" "HIGH" "OFF"} /> </sun:property> <sun:property id="webProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Web}"> <sun:dropDown id="Web" selected="#{configMap['webContainer']}" labels={"$resource{web.monitoring.Low}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"} values={"LOW" "HIGH" "OFF"} /> </sun:property> <sun:property id="jvm" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.Jvm}"> <sun:dropDown id="Http" selected="#{configMap['JVM']}" labels={"$resource{web.monitoring.Low}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"} values={"LOW" "HIGH" "OFF"} /> </sun:property> <sun:property id="threadPool" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{web.monitoring.ThreadPool}"> <sun:dropDown id="Web" selected="#{configMap['threadPool']}" labels={"$resource{web.monitoring.Low}" "$resource{web.monitoring.High}" "$resource{web.monitoring.Off}"} values={"LOW" "HIGH" "OFF"} /> </sun:property> "<br /><br /> </define> </composition>
This template, adminConsolePropertyTable.tpl, extends the property table template, adding support for AMXConfig objects.
propertyTableTemplate.tpl
See parameters for Base Template, Property Table Template, and Administration Console Property Sheet Template.
See defines for Base Template.
Use the Administration Console sheet table template, adminConsoleSheetTable.tpl, to specify a page that contains both a property sheet and a property table. This template extends the property sheet and property table templates, adding support for AMXConfig objects.
propSheetPropTableTemplate.tpl
See parameters for Base Template, Property Sheet Template, Property Table Template, and Administration Console Property Sheet Template.
See defines for Base Template, Property Sheet Template, and Administration Console Property Sheet Template.