Class AttachmentAH

  • All Implemented Interfaces:

    public class AttachmentAH
    extends BaseActionHandler
    Action handler to manage attachments.
    It implements 3 different commands. 'LOAD' used to fill the attachment section with the record attachments. 'EDIT' used to update the metadata of an attachment. And 'DELETE' used to remove an attachment.
    • Constructor Detail

      • AttachmentAH

        public AttachmentAH()
    • Method Detail

      • execute

        protected org.codehaus.jettison.json.JSONObject execute​(Map<String,​Object> parameters,
                                                                String content)
        Description copied from class: BaseActionHandler
        Needs to be implemented by a subclass.
        Specified by:
        execute in class BaseActionHandler
        parameters - the parameters obtained from the request. Note that the request object and the session object are also present in this map, resp. as the constants KernelConstants.HTTP_REQUEST and KernelConstants.HTTP_SESSION.
        content - the request content (if any)
        the return should be a JSONObject, this is passed back to the caller on the client.
      • getAttachmentJSONObject

        public static org.codehaus.jettison.json.JSONObject getAttachmentJSONObject​(Tab tab,
                                                                                    String recordIds)
        Method to build the JSONObject that contains all the attachments related to the given tab's record ids.
        tab - The tab the attachments belong to.
        recordIds - A string of ids concatenated by comma identifying the records whose attachments has to be loaded.
        a JSONObject with an "attachment" key that includes a JSONArray with all the attachments.