Package com.google.gdata.data

Examples of com.google.gdata.data.Link$Type


      BatchUtils.setBatchOperationType(batchEntry, BatchOperationType.QUERY);
      batchRequest.getEntries().add(batchEntry);
    }

    CellFeed cellFeed = spreadsheetService.getFeed(cellFeedUrl, CellFeed.class);
    Link batchLink = cellFeed.getLink(Link.Rel.FEED_BATCH, Link.Type.ATOM);
    URL batchURL = new URL(batchLink.getHref());
    CellFeed queryBatchResponse = spreadsheetService.batch(batchURL, batchRequest);

    Map cellEntryMap = new HashMap(cellAddrs.size());
    for (CellEntry entry : queryBatchResponse.getEntries()) {
      cellEntryMap.put(BatchUtils.getBatchId(entry), entry);
View Full Code Here


      // Get the batch link URL and send the batch request there.
      if ( batchRequest.getEntries().isEmpty() ) {
        System.out.println("No Batch Request");
      }else {
            System.out.println("Send Calendar Batch Request");
        Link batchLink = eventFeed.getLink(Link.Rel.FEED_BATCH, Link.Type.ATOM);
        //CalendarEventFeed batchResponse =
          calService.batch(new URL(batchLink.getHref()), batchRequest);
      }
     
/* //DEBUG:     
      // Print all events 
      // Get Number of calendar entries 
View Full Code Here

        }

    }

    private Link buildLink(String rel, String type, String href) {
        Link retVal = new Link();
        retVal.setHref(href);
        retVal.setRel(rel);
        retVal.setType(type);
        return retVal;
    }
View Full Code Here

     * The selfLink is build from a prefix and the entry id. The prefix is the
     * context path of the requested feed. This will be used to request the
     * entry directly
     */@SuppressWarnings("unchecked")
    private BaseEntry setSelfLink(final BaseEntry entry, String id) {
        Link self = buildLink(Link.Rel.SELF, XMLMIME, id);
        StringBuilder builder = new StringBuilder(id);
        builder.append(entry.getVersionId());
        Link edit = buildLink(Link.Rel.ENTRY_EDIT,XMLMIME,builder.toString());
        List<Link> list = entry.getLinks();
        list.add(edit);
        list.add(self);
        return entry;
    }
View Full Code Here

    protected DateTime getCurrentDateTime(){
        return new DateTime(System.currentTimeMillis(),0);
    }
   
    private void removeDynamicElements(BaseEntry entry){
        Link selfLink = entry.getSelfLink();
        if(selfLink != null)
            entry.getLinks().remove(selfLink);
        Link editLink = entry.getEditLink();
        if(editLink != null)
            entry.getLinks().remove(editLink);
    }
View Full Code Here

                }
            }
           
            private void sendBatch() {
                try {
                    Link batchLink = cellFeed.getLink(Link.Rel.FEED_BATCH, Link.Type.ATOM);
                    CellFeed batchResponse = service.batch(new URL(batchLink.getHref()), batchRequest);
                   
                    for (CellEntry entry : batchResponse.getEntries()) {
                      String batchId = BatchUtils.getBatchId(entry);
                      if (!BatchUtils.isSuccess(entry)) {
                        BatchStatus status = BatchUtils.getBatchStatus(entry);
View Full Code Here

            entry.setTitle(new PlainTextConstruct("EntryTitle_" + i));
            entry.setContent(new PlainTextConstruct("content_" + i));
            entry.setUpdated(DateTime.now());
            // FIXME: The following three lines of code need to be fixed to add
            // HTML links.           
            Link link = new Link();
            link.setType(Link.Type.ATOM);
            link.setRel(Link.Rel.ENTRY_EDIT);
            link.setHref("http://localhost:8084/customer"  + "/" +  id);       
            entry.getLinks().add(link);
           
            // entry.addHtmlLink(""+id, "", "edit");
            // entry.addHtmlLink(""+id, "", "alternate");
            entries.put(id, entry);
View Full Code Here

        System.out.println(">>> ResourceCollectionImpl.post entry=" + entry.getTitle());

        String id = "urn:uuid:customer-" + UUID.randomUUID().toString();
        entry.setId(id);

        Link link = new Link();
        link.setType(Link.Type.ATOM);
        link.setRel(Link.Rel.ENTRY_EDIT);
        link.setHref("http://localhost:8084/customer"  + "/" +  id);       
        entry.getLinks().add(link);
       
        //entry.addLink("" + id, "edit"); entry.addLink("" + id, "alternate");
        entry.setUpdated(DateTime.now());
       
View Full Code Here

        .getFeed(metafeedUrl, CalendarFeed.class);

    // After accessing the meta-feed, get the ACL link for each calendar.
    System.out.println("Access control lists for your calendars:");
    for (CalendarEntry calEntry : calendarFeed.getEntries()) {
      Link link = calEntry.getLink(AclNamespace.LINK_REL_ACCESS_CONTROL_LIST,
          Link.Type.ATOM);

      // For each calendar that exposes an access control list, retrieve its ACL
      // feed. If link is null, then we are not the owner of that calendar
      // (e.g., it is a public calendar) and its ACL feed cannot be accessed.
      if (link != null) {
        AclFeed aclFeed = service.getFeed(new URL(link.getHref()),
            AclFeed.class);
        System.out.println("\tCalendar \"" + calEntry.getTitle().getPlainText()
            + "\":");
        for (AclEntry aclEntry : aclFeed.getEntries()) {
          System.out.println("\t\tScope: Type=" + aclEntry.getScope().getType()
View Full Code Here

    }

    // Get the URL to make batch requests to
    CalendarEventFeed feed = service.getFeed(eventFeedUrl,
        CalendarEventFeed.class);
    Link batchLink = feed.getLink(Link.Rel.FEED_BATCH, Link.Type.ATOM);
    URL batchUrl = new URL(batchLink.getHref());

    // Submit the batch request
    CalendarEventFeed batchResponse = service.batch(batchUrl, batchRequest);

    // Ensure that all the operations were successful.
View Full Code Here

TOP

Related Classes of com.google.gdata.data.Link$Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.