public Object createServiceObjectWithServiceParam( ExchangeService srv) throws Exception { return new PostItem(srv); } }, new ICreateServiceObjectWithAttachmentParam() {
/** * Binds to an existing post item and loads its first class property. * calling this method results in a call to EWS. * * @param service the service * @param id the id * @return An PostItem instance representing the post item corresponding to * the specified Id. * @throws Exception the exception */ public static PostItem bind(ExchangeService service, ItemId id) throws Exception { return PostItem .bind(service, id, PropertySet.getFirstClassProperties()); }
/** * Posts a reply to this post item. Calling this method results in a call to * EWS. * * @param bodyPrefix the body prefix * @throws Exception the exception */ public void postReply(MessageBody bodyPrefix) throws Exception { PostReply postReply = this.createPostReply(); postReply.setBodyPrefix(bodyPrefix); postReply.save(); }
private void parseData(JSONArray array){ Log.d(TAG, "Parsing array"); // Collect all the PostItems and add to adapter all at once List<PostItem> postItems = new ArrayList<>(); for (int i = 0; i<array.length(); i++) { JSONObject jsonObject; try { jsonObject = array.getJSONObject(i); JSONObject postTitle = jsonObject.getJSONObject("title"); String title = postTitle.getString("rendered"); JSONObject links = jsonObject.getJSONObject("_links"); JSONArray authorLink = links.getJSONArray("author"); String authorhref = authorLink.getJSONObject(0).getString("href"); PostItem postItem = new PostItem(); postItem.setPostTitle(title); postItem.setPostAuthorUrl(authorhref); postItems.add(postItem); if (mAdapter.getAuthor(authorhref) == null) { getAuthor(authorhref); } } catch (JSONException w) { w.printStackTrace(); //Toast.makeText(this, "Error in parsing Json", Toast.LENGTH_LONG).show(); } } mAdapter.setPostItems(postItems); }
/** * Sets the from. * * @param value the new from * @throws Exception the exception */ public void setFrom(EmailAddress value) throws Exception { this.getPropertyBag().setObjectFromPropertyDefinition( EmailMessageSchema.From, value); }
/** * Creates a forward response to the post item. * * @return A ResponseMessage representing the forward response that can * subsequently be modified and sent. * @throws Exception the exception */ public ResponseMessage createForward() throws Exception { this.throwIfThisIsNew(); return new ResponseMessage(this, ResponseMessageType.Forward); }
/** * Forwards the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param toRecipients the to recipients * @throws Exception the exception */ public void forward(MessageBody bodyPrefix, EmailAddress... toRecipients) throws Exception { forward(bodyPrefix, Arrays.asList(toRecipients)); }
/** * Replies to the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param replyAll the reply all * @throws Exception the exception */ public void reply(MessageBody bodyPrefix, boolean replyAll) throws Exception { ResponseMessage responseMessage = this.createReply(replyAll); responseMessage.setBodyPrefix(bodyPrefix); responseMessage.sendAndSaveCopy(); }
/** * Forwards the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param toRecipients the to recipients * @throws Exception the exception */ public void forward(MessageBody bodyPrefix, Iterable<EmailAddress> toRecipients) throws Exception { ResponseMessage responseMessage = this.createForward(); responseMessage.setBodyPrefix(bodyPrefix); responseMessage.getToRecipients() .addEmailRange(toRecipients.iterator()); responseMessage.sendAndSaveCopy(); }
/** * Gets a value indicating whether the post item is read. * * @return the checks if is read * @throws ServiceLocalException the service local exception */ public Boolean getIsRead() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( EmailMessageSchema.IsRead); }
/** * Creates a post reply to this post item. * * @return A PostReply that can be modified and saved. * @throws Exception the exception */ public PostReply createPostReply() throws Exception { this.throwIfThisIsNew(); return new PostReply(this); }
/** * Forwards the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param toRecipients the to recipients * @throws Exception the exception */ public void forward(MessageBody bodyPrefix, EmailAddress... toRecipients) throws Exception { forward(bodyPrefix, Arrays.asList(toRecipients)); }
/** * Replies to the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param replyAll the reply all * @throws Exception the exception */ public void reply(MessageBody bodyPrefix, boolean replyAll) throws Exception { ResponseMessage responseMessage = this.createReply(replyAll); responseMessage.setBodyPrefix(bodyPrefix); responseMessage.sendAndSaveCopy(); }
/** * Forwards the post item. Calling this method results in a call to EWS. * * @param bodyPrefix the body prefix * @param toRecipients the to recipients * @throws Exception the exception */ public void forward(MessageBody bodyPrefix, Iterable<EmailAddress> toRecipients) throws Exception { ResponseMessage responseMessage = this.createForward(); responseMessage.setBodyPrefix(bodyPrefix); responseMessage.getToRecipients() .addEmailRange(toRecipients.iterator()); responseMessage.sendAndSaveCopy(); }
/** * Gets the references of the post item. * * @return the references * @throws ServiceLocalException the service local exception */ public String getReferences() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( EmailMessageSchema.References); }
public Object createServiceObjectWithAttachmentParam( ItemAttachment itemAttachment, boolean isNew) throws Exception { return new PostItem(itemAttachment); } });
/** * Creates a e-mail reply response to the post item. * * @param replyAll the reply all * @return A ResponseMessage representing the e-mail reply response that can * subsequently be modified and sent. * @throws Exception the exception */ public ResponseMessage createReply(boolean replyAll) throws Exception { this.throwIfThisIsNew(); return new ResponseMessage(this, replyAll ? ResponseMessageType.ReplyAll : ResponseMessageType.Reply); }
/** * Posts a reply to this post item. Calling this method results in a call to * EWS. * * @param bodyPrefix the body prefix * @throws Exception the exception */ public void postReply(MessageBody bodyPrefix) throws Exception { PostReply postReply = this.createPostReply(); postReply.setBodyPrefix(bodyPrefix); postReply.save(); }
/** * Binds to an existing post item and loads its first class property. * calling this method results in a call to EWS. * * @param service the service * @param id the id * @return An PostItem instance representing the post item corresponding to * the specified Id. * @throws Exception the exception */ public static PostItem bind(ExchangeService service, ItemId id) throws Exception { return PostItem .bind(service, id, PropertySet.getFirstClassProperties()); }
/** * Gets the conversation index of the post item. * * @return the conversation index * @throws ServiceLocalException the service local exception */ public byte[] getConversationIndex() throws ServiceLocalException { return getPropertyBag().getObjectFromPropertyDefinition( EmailMessageSchema.ConversationIndex); }