Example usage for com.google.api.client.googleapis.xml.atom AtomPatchRelativeToOriginalContent AtomPatchRelativeToOriginalContent

List of usage examples for com.google.api.client.googleapis.xml.atom AtomPatchRelativeToOriginalContent AtomPatchRelativeToOriginalContent

Introduction

In this page you can find the example usage for com.google.api.client.googleapis.xml.atom AtomPatchRelativeToOriginalContent AtomPatchRelativeToOriginalContent.

Prototype

AtomPatchRelativeToOriginalContent

Source Link

Usage

From source file:com.phonegap.calendar.android.core.CalendarClient.java

License:Apache License

/**
 * Performs the Update operation into user calendar
 * @param updated Updated Entry object//from  w w  w .j  av  a 2  s  .c o  m
 * @param original Original Entry object
 * @return Updated entry Object
 * @throws IOException
 */
Entry executePatchRelativeToOriginal(Entry updated, Entry original) throws IOException {
    AtomPatchRelativeToOriginalContent content = new AtomPatchRelativeToOriginalContent();
    content.namespaceDictionary = DICTIONARY;
    content.originalEntry = original;
    content.patchedEntry = updated;
    HttpRequest request = requestFactory.buildPutRequest(new GenericUrl(original.getEditLink()), content);
    return request.execute().parseAs(updated.getClass());
}

From source file:net.rhinox.api.client.cliniccal.calendar.android.model.CalendarClient.java

License:Apache License

Entry executePatchRelativeToOriginal(Entry updated, Entry original) throws IOException {
    AtomPatchRelativeToOriginalContent content = new AtomPatchRelativeToOriginalContent();
    content.namespaceDictionary = DICTIONARY;
    content.originalEntry = original;// w  w  w.ja  va  2s.  c om
    content.patchedEntry = updated;
    HttpRequest request = requestFactory.buildPatchRequest(new GenericUrl(updated.getEditLink()), content);
    return request.execute().parseAs(updated.getClass());
}

From source file:org.nilriri.LunaCalendar.gcal.Entry.java

License:Apache License

public Entry executePatchRelativeToOriginal(HttpTransport transport, Entry original) throws IOException {
    HttpRequest request = transport.buildPatchRequest();
    request.setUrl(getEditLink());/*from  ww w. j  av  a  2  s.c  om*/
    AtomPatchRelativeToOriginalContent content = new AtomPatchRelativeToOriginalContent();
    content.namespaceDictionary = Util.DICTIONARY;
    content.originalEntry = original;
    content.patchedEntry = this;
    request.content = content;
    return RedirectHandler.execute(request).parseAs(getClass());
}

From source file:org.pirules.gcontactsync.android.model.Entry.java

License:Apache License

/**
 * Performs a patch between this Entry and an original Entry and executes the
 * request, then returns the response from parsed as the current class.
 * @param transport The HttpTransport to use.
 * @param original The original Entry.//from  w ww .  j  a va 2  s.c o m
 * @return The response parsed as the current Entry class.
 * @throws IOException from HttpRequest.execute.
 */
protected Entry executePatchRelativeToOriginal(HttpTransport transport, Entry original) throws IOException {
    AtomPatchRelativeToOriginalContent content = new AtomPatchRelativeToOriginalContent();
    content.namespaceDictionary = Util.DICTIONARY;
    content.originalEntry = original;
    content.patchedEntry = this;
    GoogleUrl url = new GoogleUrl(getEditLink());
    HttpRequest request = HttpRequestWrapper.getFactory(transport).buildPostRequest(url, content);
    return request.execute().parseAs(getClass());
}

From source file:se.slide.pickr.picasa.model.Entry.java

License:Apache License

Entry executePatchRelativeToOriginal(HttpTransport transport, Entry original) throws IOException {
    HttpRequest request = transport.buildPatchRequest();
    request.setUrl(getEditLink());// w  w  w .ja  v a 2 s  .c o  m
    request.headers.ifMatch = this.etag;
    AtomPatchRelativeToOriginalContent serializer = new AtomPatchRelativeToOriginalContent();
    serializer.namespaceDictionary = Util.NAMESPACE_DICTIONARY;
    serializer.originalEntry = original;
    serializer.patchedEntry = this;
    request.content = serializer;
    return request.execute().parseAs(getClass());
}