Package com.google.gdata.data

Examples of com.google.gdata.data.PlainTextConstruct


    String mimeType = DocumentListEntry.MediaType.fromFileName(file.getName())
        .getMimeType();

    DocumentEntry newDocument = new DocumentEntry();
    newDocument.setFile(file, mimeType);
    newDocument.setTitle(new PlainTextConstruct(title));

    return service
        .insert(buildUrl(URL_DEFAULT + URL_DOCLIST_FEED), newDocument);
  }
View Full Code Here


      throws IOException, ServiceException {
    System.out.println("Creating a secondary calendar");

    // Create the calendar
    CalendarEntry calendar = new CalendarEntry();
    calendar.setTitle(new PlainTextConstruct("Little League Schedule"));
    calendar.setSummary(new PlainTextConstruct(
        "This calendar contains the practice schedule and game times."));
    calendar.setTimeZone(new TimeZoneProperty("America/Los_Angeles"));
    calendar.setHidden(HiddenProperty.FALSE);
    calendar.setColor(new ColorProperty(BLUE));
    calendar.addLocation(new Where("", "", "Oakland"));
View Full Code Here

   */
  private static CalendarEntry updateCalendar(CalendarEntry calendar)
      throws IOException, ServiceException {
    System.out.println("Updating the secondary calendar");

    calendar.setTitle(new PlainTextConstruct("New title"));
    calendar.setColor(new ColorProperty(GREEN));
    calendar.setSelected(SelectedProperty.TRUE);
    return calendar.update();
  }
View Full Code Here

    String input = readLine();

    String commentUrl = videoEntry.getComments().getFeedLink().getHref();

    CommentEntry newComment = new CommentEntry();
    newComment.setContent(new PlainTextConstruct(input));

    try {
      service.insert(new URL(commentUrl), newComment);
    } catch (ServiceException se) {
      System.out.println("There was an error adding your comment.\n");
View Full Code Here

      String title = readLine();
      System.out.println("Enter a description: ");
      String description = readLine();

      PlaylistLinkEntry newEntry = new PlaylistLinkEntry();
      newEntry.setTitle(new PlainTextConstruct(title));
      newEntry.setSummary(
          TextConstruct.create(TextConstruct.Type.TEXT, description, null));

      service.insert(new URL(feedUrl), newEntry);
View Full Code Here

  public static Entry createPost(BloggerService myService, String title,
      String content, String authorName, String userName, Boolean isDraft)
      throws ServiceException, IOException {
    // Create the entry to insert
    Entry myEntry = new Entry();
    myEntry.setTitle(new PlainTextConstruct(title));
    myEntry.setContent(new PlainTextConstruct(content));
    Person author = new Person(authorName, null, userName);
    myEntry.getAuthors().add(author);
    myEntry.setDraft(isDraft);

    // Ask the service to insert the new entry
View Full Code Here

   * @throws IOException If the URL is malformed.
   */
  public static Entry updatePostTitle(BloggerService myService,
      Entry entryToUpdate, String newTitle) throws ServiceException,
      IOException {
    entryToUpdate.setTitle(new PlainTextConstruct(newTitle));
    URL editUrl = new URL(entryToUpdate.getEditLink().getHref());
    return myService.update(editUrl, entryToUpdate);
  }
View Full Code Here

    String commentsFeedUri = feedUri + "/" + postId + COMMENTS_FEED_URI_SUFFIX;
    URL feedUrl = new URL(commentsFeedUri);

    // Create a new entry for the comment and submit it to the GoogleService
    Entry myEntry = new Entry();
    myEntry.setContent(new PlainTextConstruct(commentText));
    return myService.insert(feedUrl, myEntry);
  }
View Full Code Here

    printAllPosts(myService);
    printDateRangeQueryResults(myService, DateTime.parseDate("2007-04-04"),
        DateTime.parseDate("2007-04-06"));

    // Demonstrate two ways of updating posts.
    draftPost.setTitle(new PlainTextConstruct("Swimming with the fish"));
    draftPost.update();
    System.out.println("Post's new title is \""
        + draftPost.getTitle().getPlainText() + "\".\n");
    publicPost = updatePostTitle(myService, publicPost, "The party's over");
    System.out.println("Post's new title is \""
View Full Code Here

    }

    public E buildEntry(String title, String content, String summary)
        throws Exception {
      E entry = entryClass.newInstance();
      entry.setTitle(new PlainTextConstruct(title));
      if (!StringUtil.isEmpty(content)) {
        entry.setContent(new PlainTextConstruct(content));
      }
      if (!StringUtil.isEmpty(summary)) {
        entry.setSummary(new PlainTextConstruct(summary));
      }
      if (draft) {
        entry.setDraft(true);
      }
      return entry;
View Full Code Here

TOP

Related Classes of com.google.gdata.data.PlainTextConstruct

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.