= ContextInternals.getMarinerPageContext(context);
VolantisProtocol protocol = pageContext.getProtocol();
if (protocol.getProtocolConfiguration().isFileUploadSupported()) {
XFUploadAttributes attributes = (XFUploadAttributes) papiAttributes;
// Create a new protocol attributes object every time, as this element
// could be reused before the attributes have actually been finished with
// by the protocol.
com.volantis.mcs.protocols.XFUploadAttributes pattributes
= new com.volantis.mcs.protocols.XFUploadAttributes();
// Initialise the attributes specific to this field.
TextAssetReference object;
String value;
PolicyReferenceResolver resolver =
pageContext.getPolicyReferenceResolver();
// Set the initial value attribute.
object = resolver.resolveQuotedTextExpression(
attributes.getInitial());
pattributes.setInitial(object);
// Set the max length attribute.
value = attributes.getMaxLength();
if (value != null) {
pattributes.setMaxLength(Integer.parseInt(value));
}
// Initialise form field event attributes.