The following procedure explains how to develop Install Configuration pages for your gears. This procedure differs from the procedure for developing Initial, Instance, or User Configuration pages. For information on developing Initial, Instance, or User Configuration pages, see the section Developing Initial, Instance, or User Configuration Pages.

  1. Surround the page content with the hasRole tag to prevent users other than a portal administrator from accessing this page. For example:

    <%@ taglib uri="/paf-taglib" prefix="paf" %>
    <paf:hasRole roles="portal-admin">

       <%!--INSTALL CONFIGURATION FORM PAGE CONTENT GOES HERE --%>

    </paf:hasRole>

  2. Import your form handler. For example, if you create a subclass of the GearConfigFormHandler that you have named MyConfigFormHandler, you would import it as follows:

    <%@ taglib uri="/dsp" prefix="dsp" %>
    <dsp:importbean bean="/atg/portal/gear/MyConfigFormHandler"/>

    If you need additional functionality in the form handler, you can extend the class.

  3. Set the gear definition request attribute to the value passed to you by the PAF.

    <%request.setAttribute(atg.portal.framework.RequestAttributes.
    GEAR_DEFINITION,(String) request.getParameter("paf_gear_def_id") );%>

  4. Set up the default values needed by your form using <dsp:setvalue> tags to set values in your form handler:

    <dsp:setvalue bean="MyConfigFormHandler.paramType" value="instance"/>
    <dsp:setvalue bean="MyConfigFormHandler.settingDefaultValues"
                  value="true"/>
    <dsp:setvalue bean="MyConfigFormHandler.paramNames"
                  value="displayColumnHeaders displayTitle displayDescription
                  displayAuthor authorPropertyName authorDisplayProp1
                  authorDisplayProp2 displayCreateDate dateStyle timeStyle
                  displayStatus resourceBundle"/>

    Note how the paramNames property takes a space-delimited list of the names of all the parameters that should be set in this form.

  5. Create your configuration form. The form should submit to the current page. You would use the following markup to begin and end the form:

    <dsp:form method="post" action="<%= request.getRequestURI() %>">

    <%!-- CONFIGURATION FORM PAGE CONTENT GOES HERE --%>

    </dsp:form>

  6. You already set your form’s default values in step 5, using <dsp:setvalue> tags. Now, protect your form handler against back button usage by reiterating the property settings you set in step 5, using hidden form fields:

    <dsp:input type="hidden" bean="MyConfigFormHandler.paramType"
               value="instance"/>
    <dsp:input type="hidden" bean="MyConfigFormHandler.settingDefaultValues"
               value="true"/>
    <dsp:input type="hidden" bean="MyConfigFormHandler.paramNames"
               value="displayColumnHeaders displayTitle displayDescription
                      displayAuthor authorPropertyName authorDisplayProp1
                      authorDisplayProp2 displayCreateDate dateStyle timeStyle
                      displayStatus resourceBundle"/>

  7. Create the hidden fields necessary for navigation and form processing.

    The form handler’s successUrl property should be set to the value passed to you in the paf_success_url request parameter by the framework.

    <dsp:input type="hidden" bean="MyConfigFormHandler.successUrl"
     value='<%= request.getParameter("paf_success_url") %>'/>

    Since you are creating an Install Configuration page, you are setting default instance variables. Use a GearConfigFormHandler to set the settingDefaultValues and paramType properties as follows:

    <dsp:input type="hidden" bean="MyConfigFormHandler.settingDefaultValues"
     value="true"/>
    <dsp:input type="hidden" bean="MyConfigFormHandler.paramType"
    value="instance"/>

    As in every gear page, you must set the following parameters. Note, though, in Install Configuration you are working with a gear definition whereas in other configuration modes you are working with a gear, so you must take care to set the paf_gear_def_id parameter instead of paf_gear_id as you will in nearly every other gear page you develop.

    <input type="hidden" name="paf_dm" value="<%=gearEnv.getDisplayMode()%>"/>
    <input type="hidden" name="paf_gm" value="<%=gearEnv.getGearMode()%>"/>
    <input type="hidden" name="paf_gear_def_id"
    value="<%=gearEnv.getGearDefinition().getId() %>"/>

  8. Create the form’s input fields.

    Use <dsp:input> tags because they need to be processed by the DSP form handler. Get the default values for the form fields from the form handler:

    <dsp:input type="text" bean="MyConfigFormHandler.values.myParam" />

  9. Create the form’s Submit button.

    Use a <dsp:input> Submit button because it will submit to a DSP form handler and it should submit to the handleConfirm as in the following example:

    <dsp:input type="submit" value="Submit"
    bean="MyConfigFormHandler.confirm"/>

    If you have a multipage form you may want to collect values on several pages and submit them all on the last page. GearConfigFormHandler provides a handleCollectValues method to help you do that. Use a button like this if you take that approach on a multipage form:

    <dsp:input type="submit" value="Continue"
               bean="GearConfigFormHandler.collectValues"/>


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices