Class AttachmentAH
- java.lang.Object
-
- org.openbravo.client.kernel.BaseActionHandler
-
- org.openbravo.client.application.attachment.AttachmentAH
-
- All Implemented Interfaces:
ActionHandler
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 Summary
Constructors Constructor Description AttachmentAH()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.codehaus.jettison.json.JSONObject
execute(Map<String,Object> parameters, String content)
Needs to be implemented by a subclass.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.-
Methods inherited from class org.openbravo.client.kernel.BaseActionHandler
execute, extractParametersFromRequest, extractRequestContent, fixRequestMap, writeResponse
-
-
-
-
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 classBaseActionHandler
- Parameters:
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 constantsKernelConstants.HTTP_REQUEST
andKernelConstants.HTTP_SESSION
.content
- the request content (if any)- Returns:
- 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.- Parameters:
tab
- The tab the attachments belong to.recordIds
- A string of ids concatenated by comma identifying the records whose attachments has to be loaded.- Returns:
- a JSONObject with an "attachment" key that includes a JSONArray with all the attachments.
-
-