org.sakaiproject.tool.helper
Class AttachmentAction

java.lang.Object
  extended byorg.sakaiproject.tool.helper.AttachmentAction

public class AttachmentAction
extends Object

AttachmentAction is a helper Action that other tools can use to edit their attachments.

Version:
$Revision: 4742 $
Author:
University of Michigan, CHEF Software Development Team

Field Summary
static String MODE_DONE
          Modes.
static String MODE_MAIN
           
static String STATE_ATTACHMENTS
          State attribute for the Vector of References, one for each attachment.
static String STATE_FROM_TEXT
          The part of the message after "Attachments for:", set by the client tool.
static String STATE_HAS_ATTACHMENT_BEFORE
          State attribute for where there is at least one attachment before invoking attachment tool
static String STATE_MODE
          State attributes for Attachments mode - when it's MODE_DONE the tool can process the results.
 
Constructor Summary
AttachmentAction()
           
 
Method Summary
static String buildBrowseContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context for the browsing for resources display
static String buildHelperContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context.
static String buildMainContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context for the main display
static String buildPropertiesContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context for the properties editing for attachment display
static String buildUploadContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context for the upload display
static String buildUrlContext(VelocityPortlet portlet, Context context, RunData rundata, SessionState state)
          build the context for the url display
static void doAdd(RunData data)
          Handle the eventSubmit_doAdd command to add attachments.
static void doBrowse_option(RunData data)
          Handle the eventSubmit_doBrowse_option command to process inputs from the browse form: go up, go down, or be done.
static void doBrowse(RunData data)
          Handle the eventSubmit_doBrowse command to go into browse for a resource on the site mode.
static void doCancel_add(RunData data)
          Handle the eventSubmit_doCancel_add command to abort an add.
static void doCancel_browse(RunData data)
          Handle the eventSubmit_doCancel_browse command to abort the browse.
static void doCancel_properties(RunData data)
          Handle the eventSubmit_doCancel_properties command to abort the properties edit.
static void doCancel(RunData data)
          Handle the eventSubmit_doCancel command to abort the edits.
static void doDispatch_attachment_upload(RunData data)
          Dispatch function for upload attachment page
static void doProperties(RunData data)
          Handle the eventSubmit_doProperties command to edit the selected attachment's properties.
static void doRemove_all(RunData data)
          Handle the eventSubmit_doRemove_all command to remove the selected attachment(s).
static void doRemove(RunData data)
          Handle the eventSubmit_doRemove command to remove the selected attachment(s).
static void doSave(RunData data)
          Handle the eventSubmit_doSave command to save the edited attachments.
static void doUpdate_properties(RunData data)
          Handle the eventSubmit_doUpdate_properties command to keep the edited properties.
static void doUpload(RunData data)
          Handle the eventSubmit_doUpload command to go into upload resource mode.
static void doUrl(RunData data)
          Handle the eventSubmit_doUrl command to go into enter url mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_MODE

public static final String STATE_MODE
State attributes for Attachments mode - when it's MODE_DONE the tool can process the results.

See Also:
Constant Field Values

STATE_HAS_ATTACHMENT_BEFORE

public static final String STATE_HAS_ATTACHMENT_BEFORE
State attribute for where there is at least one attachment before invoking attachment tool

See Also:
Constant Field Values

STATE_ATTACHMENTS

public static final String STATE_ATTACHMENTS
State attribute for the Vector of References, one for each attachment. Using tools can pre-populate, and can read the results from here.

See Also:
Constant Field Values

STATE_FROM_TEXT

public static final String STATE_FROM_TEXT
The part of the message after "Attachments for:", set by the client tool.

See Also:
Constant Field Values

MODE_DONE

public static final String MODE_DONE
Modes.

See Also:
Constant Field Values

MODE_MAIN

public static final String MODE_MAIN
See Also:
Constant Field Values
Constructor Detail

AttachmentAction

public AttachmentAction()
Method Detail

buildHelperContext

public static String buildHelperContext(VelocityPortlet portlet,
                                        Context context,
                                        RunData rundata,
                                        SessionState state)
build the context.

Returns:
The name of the template to use.

buildMainContext

public static String buildMainContext(VelocityPortlet portlet,
                                      Context context,
                                      RunData rundata,
                                      SessionState state)
build the context for the main display

Returns:
The name of the template to use.

buildBrowseContext

public static String buildBrowseContext(VelocityPortlet portlet,
                                        Context context,
                                        RunData rundata,
                                        SessionState state)
build the context for the browsing for resources display

Returns:
The name of the template to use.

buildUploadContext

public static String buildUploadContext(VelocityPortlet portlet,
                                        Context context,
                                        RunData rundata,
                                        SessionState state)
build the context for the upload display

Returns:
The name of the template to use.

buildUrlContext

public static String buildUrlContext(VelocityPortlet portlet,
                                     Context context,
                                     RunData rundata,
                                     SessionState state)
build the context for the url display

Returns:
The name of the template to use.

buildPropertiesContext

public static String buildPropertiesContext(VelocityPortlet portlet,
                                            Context context,
                                            RunData rundata,
                                            SessionState state)
build the context for the properties editing for attachment display

Returns:
The name of the template to use.

doSave

public static void doSave(RunData data)
Handle the eventSubmit_doSave command to save the edited attachments.


doCancel

public static void doCancel(RunData data)
Handle the eventSubmit_doCancel command to abort the edits.


doBrowse

public static void doBrowse(RunData data)
Handle the eventSubmit_doBrowse command to go into browse for a resource on the site mode.


doUpload

public static void doUpload(RunData data)
Handle the eventSubmit_doUpload command to go into upload resource mode.


doUrl

public static void doUrl(RunData data)
Handle the eventSubmit_doUrl command to go into enter url mode.


doAdd

public static void doAdd(RunData data)
Handle the eventSubmit_doAdd command to add attachments.


doRemove

public static void doRemove(RunData data)
Handle the eventSubmit_doRemove command to remove the selected attachment(s).


doRemove_all

public static void doRemove_all(RunData data)
Handle the eventSubmit_doRemove_all command to remove the selected attachment(s).


doProperties

public static void doProperties(RunData data)
Handle the eventSubmit_doProperties command to edit the selected attachment's properties. Note: not yet used.


doCancel_browse

public static void doCancel_browse(RunData data)
Handle the eventSubmit_doCancel_browse command to abort the browse.


doCancel_add

public static void doCancel_add(RunData data)
Handle the eventSubmit_doCancel_add command to abort an add.


doBrowse_option

public static void doBrowse_option(RunData data)
Handle the eventSubmit_doBrowse_option command to process inputs from the browse form: go up, go down, or be done.


doCancel_properties

public static void doCancel_properties(RunData data)
Handle the eventSubmit_doCancel_properties command to abort the properties edit. Note: not yet used.


doUpdate_properties

public static void doUpdate_properties(RunData data)
Handle the eventSubmit_doUpdate_properties command to keep the edited properties. Note: not yet used.


doDispatch_attachment_upload

public static void doDispatch_attachment_upload(RunData data)
Dispatch function for upload attachment page