/** * Binds to an existing item, whatever its actual type is, and loads the * specified set of property. Calling this method results in a call to * EWS. * * @param service The service to use to bind to the item. * @param id The Id of the item to bind to. * @return An Item instance representing the item corresponding to the * specified Id. * @throws Exception the exception */ public static Item bind(ExchangeService service, ItemId id) throws Exception { return Item.bind(service, id, PropertySet.getFirstClassProperties()); }
<Item name={item} closeFn={closeFn.bind(null, i)} key={i} />
/** * Binds to an existing item, whatever its actual type is, and loads the * specified set of property. Calling this method results in a call to * EWS. * * @param service The service to use to bind to the item. * @param id The Id of the item to bind to. * @return An Item instance representing the item corresponding to the * specified Id. * @throws Exception the exception */ public static Item bind(ExchangeService service, ItemId id) throws Exception { return Item.bind(service, id, PropertySet.getFirstClassProperties()); }
@Override public void updateDueDate(final TaskDto task) { try { final ItemId itemId = new ItemId(task.getExchangeId()); final Item email = Item.bind(service, itemId, createEmailPropertySet()); if (task.getDueDate() == null) { email.removeExtendedProperty(PR_TASK_DUE_DATE); } else { email.setExtendedProperty(PR_TASK_DUE_DATE, task.getDueDate()); } email.update(ConflictResolutionMode.AlwaysOverwrite); } catch (final Exception e) { LOG.error("Unable to update email due date in Exchange", e); } }
@Override public void updateCompletedFlag(final TaskDto task) { try { final ItemId itemId = new ItemId(task.getExchangeId()); final Item email = Item.bind(service, itemId, createEmailPropertySet()); email.setExtendedProperty(PR_TODO_TITLE, task.getName()); email.setExtendedProperty(PR_TASK_MODE, 0); // Task is not assigned if (task.isCompleted()) { email.removeExtendedProperty(PR_FLAG_REQUEST); email.setExtendedProperty(PR_TASK_COMPLETE, true); email.setExtendedProperty(PR_PERCENT_COMPLETE, 1d); email.setExtendedProperty(PR_TASK_DATE_COMPLETED, new Date()); email.setExtendedProperty(PR_TASK_STATUS, 2); // User's work on this task is complete email.setExtendedProperty(PR_FLAG_STATUS, PR_FLAG_STATUS_FOLLOWUP_COMPLETE); } else { email.setExtendedProperty(PR_TASK_START_DATE, new Date()); email.setExtendedProperty(PR_FLAG_REQUEST, "Follow up"); email.setExtendedProperty(PR_TODO_ORDINAL_DATE, new Date()); email.setExtendedProperty(PR_TODO_SUB_ORDINAL, "5555555"); email.setExtendedProperty(PR_TASK_COMPLETE, false); email.setExtendedProperty(PR_PERCENT_COMPLETE, 0d); email.removeExtendedProperty(PR_TASK_DATE_COMPLETED); email.setExtendedProperty(PR_TASK_STATUS, 0); email.setExtendedProperty(PR_FLAG_STATUS, PR_FLAG_STATUS_FOLLOWUP_FLAGGED); } email.update(ConflictResolutionMode.AlwaysOverwrite); } catch (final Exception e) { LOG.error("Unable to update email completed flag in Exchange", e); } }