Sun GlassFish Enterprise Server v3 Prelude Add-On Component Development Guide

Adding a Page to the Administration Console

Your add-on component may require new configuration tasks. In addition to implementing commands that accomplish these tasks (see Chapter 4, Extending the asadmin Utility), you can provide property sheets that enable users to configure your component or to perform tasks such as creating and editing resources for it.


Example 3–13 Example JavaServer Faces Page for a Property Sheet

Most of the user interface features used in the example reference the file testPage.jsf or (for tabs) the file tabPage.jsf. Both files are in the src/main/resources/page/ directory. The testPage.jsf file looks like this:

<!composition template="/templates/propertySheetTemplate.tpl" 
              pageTitle="TEST Sample Page Title" 
              helpText="Shows you what my page looks like"
              >
 
    <!define name="properties">
       <sun:property id="prop1" labelAlign="left" noWrap="#{true}" 
                     overlapLabel="#{false}" label="page Name:" >
            <sun:staticText text="$pageSession{pageName}" > 
                <!beforeCreate
                    getRequestValue(key="name" value=>$page{pageName});
                />
            </sun:staticText>
        </sun:property> 
    </define>
</composition>

The page uses the composition directive to specify that the page uses the propertySheetTemplate.tpl template and to specify a page title and inline help text. (See Property Sheet Template for more information about this template and more examples.) The page uses additional directives, events, and tags to specify its content.