Overview | Package | Class | Tree | Deprecated | Index | Help
| BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.compoze.collab.exchange
Interface ITaskRequest

All Superinterfaces:
  IAttachmentSupport, IExchangeItem, IExchangeMessage, IGroupwareItem, IItem, IMailMessage, IMessage, IMessagingItem, java.io.Serializable

All Known Subinterfaces:
  IMapiTaskRequest

public interface ITaskRequest
extends IExchangeMessage

The interface `IExchangeTaskRequest` represents the message that is received by a recipient when a task has been assigned to them. The class identifier is `item.taskrequest.exchange`.

Task Request creation is only supported in Exchange by the MAPI provider. WebDAV is able to read task requests and update an already existing associated task from a request. To create a task request, an `IMapiTask` is required.

This is an example of how to create a task request, set properties, and send the request

Sample code:

    /**
     * The <code>createTaskRequest</code> method demonstrates how to create a task
     * with either the MAPI or the WebDAV Exchange providers. The task has
     * several properties set and is then saved and sent to the assignee.
     *
     * @throws  CollaborationException  if the session factory could not instantiate
     *          a session with the given parameters, or if there was an error
     *          retrieving folders, setting properties, or sending the request.
     */
    public  void    createTaskRequest
    (
    )
    throws  CollaborationException
        {
        // setup the session
        // since this is the creation of a task request, the MAPI provider is
        // required
        Properties p = new Properties ();
        p.setProperty (IExchangeSession.PROP_PROVIDER, IMapiSession.INTERNAL_NAME);
        p.setProperty (IExchangeSession.PROP_EXCHANGE_SERVER, "server");
        p.setProperty (IExchangeSession.PROP_USER_DOMAIN, "domain");
        p.setProperty (IExchangeSession.PROP_USER_USERNAME, "username");
        p.setProperty (IExchangeSession.PROP_USER_PASSWORD, "password");

        // create and open the session
        IExchangeSession session = (IExchangeSession)SessionFactory.createSession(p);
        session.open();
        session.login ();

        IRootContainer root = session.getDefaultRootContainer ();

        // Get a handle to the tasks folder
        IExchangeTasksContainer tasks = null;
        tasks = (IExchangeTasksContainer)session.getDefaultContainer(
            DefaultContainerClassEnum.TASKS );

        // add a new task to the tasks folder, but do not commit it yet
        // the item will be of the type IMapiTask.CLASS
        //
        // In Exchange, only the MAPI provider is currently able to create
        // task requests. WebDAV is able to read and accept task requests
        // and also update an existing assigned tasks from a request.
        IMapiTask task = null;
        task = (IMapiTask)tasks.add( IMapiTask.CLASS, false );

        // set the subject
        task.setSubject( "Compoze Software Test Task Request" );

        // set the body
        // the HTML body could also be set with HTML instead
        task.setBody( "Body of the task." );

        // set the importance to high
        task.setImportance( ImportanceEnum.HIGH );

        // the task has the default values of 0% completed, status of NOT_STARTED,
        // no complete date and false for isComplete. Since this is a new task,
        // we'll just leave it this way.
        task.commit();

        // create a request from the saved task
        IMapiTaskRequest taskRequest = task.createRequest();

        // add an assignee to the task
        taskRequest.addRecipient( RecipientTypeEnum.TO, "none@null.net", "None N." );

        // get the sent items folder for saving the request
        IContainer sentItems = session.getDefaultContainer(
            DefaultContainerClassEnum.SENT );

        // send the request
        taskRequest.send( sentItems );
        // logout and close
        session.logout ();
        session.close();
        }

Field Summary
`static Key` | `ASSOCIATED_TASK_LINK` Represents the property that holds the link between a task request and the task it is associated.
`static ItemClass` | `CLASS` The item class of `IExchangeTaskRequest`.
`static int` | `KEYID_ASSOCIATED_TASK_LINK` The `int` ID for the `ASSOCIATED_TASK_LINK` key.
`static int` | `KEYID_READ_NO_ACTION` The `int` ID for the `READ_NO_ACTION` key.
`static Key` | `READ_NO_ACTION` Key that represents if a task request has been read by the recipient, but no action has been applied to the task yet.

Fields inherited from interface com.compoze.collab.exchange.IExchangeMessage
`DELIVERY_RECEIPT_REQUESTED, KEYID_DELIVERY_RECEIPT_REQUESTED`

Fields inherited from interface com.compoze.collab.groupware.IMailMessage
`DELIVERY_DATE, DISPLAY_BCC, DISPLAY_CC, DISPLAY_FROM, DISPLAY_TO, ENCRYPTED, KEYID_DELIVERY_DATE, KEYID_DISPLAY_BCC, KEYID_DISPLAY_CC, KEYID_DISPLAY_FROM, KEYID_DISPLAY_TO, KEYID_ENCRYPTED, KEYID_READ_RECEIPT_REQUESTED, KEYID_SENDER_ADDRESS, KEYID_SENDER_NAME, KEYID_SENT_DATE, KEYID_SIGNED, KEYID_UNREAD, READ_RECEIPT_REQUESTED, SENDER_ADDRESS, SENDER_NAME, SENT_DATE, SIGNED, UNREAD`

Fields inherited from interface com.compoze.collab.messaging.IMessage
`KEYID_RECIPIENTS, RECIPIENTS`

Fields inherited from interface com.compoze.collab.messaging.IMessagingItem
`BODY, BODY_HTML, KEYID_BODY, KEYID_BODY_HTML`

Fields inherited from interface com.compoze.collab.IItem
`ID, ITEM_CLASS, KEYID_ID, KEYID_ITEM_CLASS, KEYID_PARENT_ID, MINIMUM_ITEM_KEYS, PARENT_ID`

Fields inherited from interface com.compoze.collab.groupware.IGroupwareItem
`CATEGORIES, DATE_CREATED, DATE_LAST_MODIFIED, IMPORTANCE, KEYID_CATEGORIES, KEYID_DATE_CREATED, KEYID_DATE_LAST_MODIFIED, KEYID_IMPORTANCE, KEYID_SIZE, KEYID_SUBJECT, SIZE, SUBJECT`

Fields inherited from interface com.compoze.collab.exchange.IExchangeItem
`BODY_RTF, CONTACT_NAMES, CREATOR_ENTRYID, FLAG, FLAG_REMIND_BY, FLAG_TEXT, HAS_REMINDER, HIDE_ATTACHMENTS, ICON_INDEX, IS_HIDDEN, KEYID_BODY_RTF, KEYID_CONTACT_NAMES, KEYID_CREATOR_ENTRYID, KEYID_FLAG, KEYID_FLAG_REMIND_BY, KEYID_FLAG_TEXT, KEYID_HAS_REMINDER, KEYID_HIDE_ATTACHMENTS, KEYID_ICON_INDEX, KEYID_IS_HIDDEN, KEYID_MILEAGE, KEYID_NORMALIZED_SUBJECT, KEYID_PRIORITY, KEYID_SENSITIVITY, KEYID_SUBJECT_PREFIX, MILEAGE, NORMALIZED_SUBJECT, PRIORITY, SENSITIVITY, SUBJECT_PREFIX`

Fields inherited from interface com.compoze.collab.IAttachmentSupport
`ATTACHMENTS, HAS_ATTACHMENT, KEYID_ATTACHMENTS, KEYID_HAS_ATTACHMENT`

Method Summary
`ITaskNotice` | `accept(IContainer container)` Accepts this task request and creates an `ITaskNotice` to return to the originator.
`ITaskNotice` | `decline()` Declines this task request and creates an `ITaskNotice` to return to the originator.
`ITaskRequest` | `delegate(IMailRecipient assignee)` Delegates this request to another assignee without accepting or declining this task request.
`IExchangeTask` | `getAssociatedTask()` Gets the task associated with this task request.
`IExchangeTask` | `getAssociatedTask(FetchProfile profile)` Gets the task associated with this task request.

Methods inherited from interface com.compoze.collab.exchange.IExchangeMessage
`getDeliveryReceiptRequested, setDeliveryReceiptRequested`

Methods inherited from interface com.compoze.collab.groupware.IMailMessage
`addEmbeddedAttachment, addRecipient, addRecipient, forward, forward, getBccAddresses, getBccRecipients, getCcAddresses, getCcRecipients, getDateDelivered, getDateSent, getFromAddresses, getRecipientsByType, getSender, getToAddresses, getToRecipients, isEncrypted, isReadReceiptRequested, isSigned, isUnread, removeRecipient, removeRecipient, removeRecipient, reply, reply, send, send, setEncrypted, setReadReceiptRequested, setSigned, setUnread`

Methods inherited from interface com.compoze.collab.messaging.IMessage
`addRecipient, getRecipients, send, setRecipients`

Methods inherited from interface com.compoze.collab.messaging.IMessagingItem
`getBody, getBodyHtml, setBody, setBodyHtml`

Methods inherited from interface com.compoze.collab.IItem
`commit, containsKey, containsKey, copyProperties, copyTo, delete, fetchProperties, getAttribute, getEnum, getID, getInputStream, getItemClass, getOutputStream, getParent, getParent, getParentID, getProperties, getProperties, getProperties, getProperty, getProperty, getProperty, getReader, getRootContainer, getSession, getWriter, isMissing, moveTo, removeAttribute, removeProperty, setAttribute, setProperties, setProperty, setProperty, setProperty`

Methods inherited from interface com.compoze.collab.groupware.IGroupwareItem
`getBodyHtml, getBodyHtml, getCategories, getDateCreated, getDateLastModified, getImportance, getNormalizedSubject, getSize, getSubject, getSubject, getSubjectPrefix, setBodyHtml, setCategories, setImportance, setSubject`

Methods inherited from interface com.compoze.collab.exchange.IExchangeItem
`getBodyRtf, getContactNames, getFlagStatus, getFlagText, getHideAttachments, getMileage, getPriority, getSensitivity, getSubjectPrefix, isHidden, setBodyRtf, setContactNames, setFlagStatus, setFlagText, setHideAttachments, setMileage, setPriority, setSensitivity, setSubjectPrefix`

Methods inherited from interface com.compoze.collab.IAttachmentSupport
`addAttachment, getAttachment, getAttachmentCount, getAttachments, hasAttachment`

Field Detail

### KEYID_READ_NO_ACTION

    public static final int KEYID_READ_NO_ACTION

  The `int` ID for the `READ_NO_ACTION` key.

### KEYID_ASSOCIATED_TASK_LINK

    public static final int KEYID_ASSOCIATED_TASK_LINK

  The `int` ID for the `ASSOCIATED_TASK_LINK` key.

### ASSOCIATED_TASK_LINK

    public static final Key ASSOCIATED_TASK_LINK

  Represents the property that holds the link between a task request and the task it is associated.

### READ_NO_ACTION

    public static final Key READ_NO_ACTION

  Key that represents if a task request has been read by the recipient, but no action has been applied to the task yet. Actions include accepting, declines and re-assigning the task request.

### CLASS

    public static final ItemClass CLASS

  The item class of `IExchangeTaskRequest`.

Method Detail

### accept

    public ITaskNotice accept(IContainer container)
                       throws CollaborationException

  Accepts this task request and creates an `ITaskNotice` to return to the originator.
  Parameters:
    `container` - the container to save the accepted task into, or `null` to use the default task container.
  Returns:
    an `ITaskNotice` object that can be sent to the task assigner. The notice informs them of the accepted status.
  Throws:
    `CollaborationException` - if there was an error creating the notice

### decline

    public ITaskNotice decline()
                        throws CollaborationException

  Declines this task request and creates an `ITaskNotice` to return to the originator.
  Returns:
    an `ITaskNotice` object that can be sent to the task assigner. The notice informs them of the declined status.
  Throws:
    `CollaborationException` - if there was an error creating the notice

### delegate

    public ITaskRequest delegate(IMailRecipient assignee)
                          throws CollaborationException

  Delegates this request to another assignee without accepting or declining this task request.
  Parameters:
    `assignee` - the recipient to which this task request is being delegated to.
  Returns:
    an `ITaskRequest` object that can be sent to the recipient specified.
  Throws:
    `CollaborationException` - if there was an error creating the request

### getAssociatedTask

    public IExchangeTask getAssociatedTask()
                                    throws CollaborationException

  Gets the task associated with this task request. This method requires that the `ASSOCIATED_TASK` key is fetched with the item.
  Returns:
    the associated task
  Throws:
    `CollaborationException` - if there was an error getting the task
  See Also:
    `ASSOCIATED_TASK_LINK`

### getAssociatedTask

    public IExchangeTask getAssociatedTask(FetchProfile profile)
                                    throws CollaborationException

  Gets the task associated with this task request. This method requires that the `ASSOCIATED_TASK` key is fetched with the item.
  Parameters:
    `profile` - the fetch profile to use when bringing back the task
  Returns:
    the associated task
  Throws:
    `CollaborationException` - if there was an error getting the task
  See Also:
    `ASSOCIATED_TASK_LINK`, `IAttachmentSupport.ATTACHMENTS`

Overview | Package | Class | Tree | Deprecated | Index | Help
| BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright ©1999-2005 BEA Systems, Inc. All rights reserved.