ucUploadProcessForm

Purpose

This is used to process a file upload form as part of a trnsaction to interface with an external, cloud-based file repository.

Applies To

File attachments

Signature

public String ucUploadProcessForm ( HashMap formParameters, 
                              SesameSession session, 
                              Connection dbconn, 
                              String uploadObjectType,
                              Object uploadObject ) throws Exception ;

Notes

While it is possible for the repository DIV to generate a form submission that bypasses all existing base ExtraView code, there would be substantial work involved in the new user custom service that simply replicated existing code. Therefore, it is strongly recommended that the upload HTML designer use the existing action/option and HTML FORM for submission to the server. A user custom exit is made available to process the form parameters and request object received from the upload page. This user custom exit is responsible for:

  • Parameter validation
  • Upload object creation (attachment, image_item_udf, or document_item_udf) – this includes thumbnail generation
  • Upload object insertion to the database

This custom exit is not responsible for:

  • Providing the service action/option method
  • Collecting the parameters from the multipart form
  • Closing the upload popup

Once the user has entered the necessary information to the upload screen, the form is submitted as a multipart form, and the ExtraView base code parses the request. The result consists of form parameters in a HashMap, representing the values entered, or pre-seeded on the upload page. If the page is submitted in the Repository mode, the form parameters and the request are passed to the user custom exit ucUploadProcessForm defined here.

A new, partially constructed uploadObject is passed as a parameter. This will be either an Attachment, a DocumentItemUDF, or an ImageItemUDF object that can be used in creating the upload object in the database. In this object the required fields that are populated are: ITEM_ID, UDF_ID (if any), CREATED_BY_USER and UPDATED_BY_USER. Other system-generated fields such as LAST_DATE_UPDATED are populated during transactions on the upload object. Aside from the pre-populated fields and the system-generated fields, the user custom exit is responsible for setting the object values using its setter methods. The form parameters here do not support multi-valued parameters. This is a legacy-based restriction due to the way the parameters are handled internally in ExtraView. If multiple values are needed for a specific parameter, it is recommended that the parameter name be uniquefied with numbers, e.g., file1, file2, file3, …. in order to work around this restriction.

The string returned by this method is an error message that will alert the user in the upload screen; null for successful upload. For more information, please see here.