pageContext.getEnvironmentContext().getCachingDirectives();
if (cachingDirectives != null) {
cachingDirectives.disable();
}
XFFormAttributes attributes = (XFFormAttributes) papiAttributes;
// Try and find the form with the specified name, if it could not be
// found then return and skip the element body.
String formName = attributes.getName();
Form form = pageContext.getForm(formName);
if (form == null) {
skipped = true;
return SKIP_ELEMENT_BODY;
}
TextAssetReference textReference;
LinkAssetReference linkReference;
String value;
// Copy the base attributes.
pattributes.setId(attributes.getId());
PolicyReferenceResolver resolver =
pageContext.getPolicyReferenceResolver();
// Process the action as a mariner expression.
linkReference = resolver.resolveQuotedLinkExpression(
attributes.getAction(), PageURLType.FORM);
pattributes.setAction(linkReference);
// Set the form attribute.
FormInstance formInstance =
(FormInstance) pageContext.getFormatInstance(
form, NDimensionalIndex.ZERO_DIMENSIONS);
pattributes.setFormData(formInstance);
// Process the help as a mariner expression.
textReference =
resolver.resolveQuotedTextExpression(attributes.getHelp());
pattributes.setHelp(textReference);
// Set the method attribute, the default is "get".
value = attributes.getMethod();
if (value == null) {
value = "get";
}
pattributes.setMethod(value);
// Set the name attribute.
String name = attributes.getName();
pattributes.setName(name);
// Process the prompt as a mariner expression.
textReference = resolver.resolveQuotedTextExpression(
attributes.getPrompt());
pattributes.setPrompt(textReference);
// Set the segment attribute.
pattributes.setSegment(attributes.getSegment());
// Setup the fragmentation state for the form
try {
pageContext.updateFormFragmentationState(form);
}