InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (949 KB)
Appendix B Template ReferenceThe 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: Base TemplateThe base template, baseTemplate.tpl, is included by the other templates.
Property Sheet TemplateUse the property sheet template, propertySheetTemplate.tpl, to specify a property sheet.
Example B–1 Example Page That Uses a Single Property SheetThe 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>
Example B–2 Example Page That Uses Multiple Property SheetsThe 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>
Property Table TemplateUse the property table template, propertyTableTemplate.tpl, to specify a property table.
Sheet Table TemplateUse 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.
Administration Console Property Sheet TemplateUse 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.
Example B–3 Example That Uses an Administration Console Property SheetThe 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>
Administration Console Property Table TemplateThis template, adminConsolePropertyTable.tpl, extends the property table template, adding support for AMXConfig objects.
Administration Console Sheet Table TemplateUse 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.
|
|