Package com.google.gdata.data

Examples of com.google.gdata.data.PlainTextConstruct


        // add event to calendar
        if (createEvent) {
          EventEntry myEntry = new EventEntry();

          myEntry.setTitle(new PlainTextConstruct(title));

          String desc = parser.analyse(formatting.getContentValue(), program);
          myEntry.setContent(new PlainTextConstruct(desc));

          Calendar c = CalendarToolbox.getStartAsCalendar(program);

          DateTime startTime = new DateTime(c.getTime(), c.getTimeZone());
View Full Code Here


  CalendarEventEntry oEvnt;

  if (oMeet.isNull(DB.id_icalendar)) {
    oEvnt = new CalendarEventEntry();
    oEvnt.setIcalUID(oMeet.getString(DB.gu_meeting)+"@hipergate.org");
    oEvnt.setTitle(new PlainTextConstruct(oMeet.getStringNull(DB.tx_meeting,"")));
      oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
   
    When oTimes = new When();
    String sTimeZone = DBCommand.queryStr(oConn, "SELECT "+DB.tx_timezone+" FROM "+DB.k_fellows+" WHERE "+DB.gu_fellow+"='"+oMeet.getString(DB.gu_fellow)+"'");
      if (null==sTimeZone) {
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end)));
      } else {
        int lSign = sTimeZone.charAt(0)=='+' ? 1 : -1;
        String[] aTimeZone = Gadgets.split2(sTimeZone.substring(1),':');
        SimpleTimeZone oTmz = new SimpleTimeZone(lSign*(Integer.parseInt(aTimeZone[0])*3600000+Integer.parseInt(aTimeZone[1])*60000), sTimeZone);
        oTimes.setStartTime(new DateTime(oMeet.getDate(DB.dt_start),oTmz));
      oTimes.setEndTime(new DateTime(oMeet.getDate(DB.dt_end),oTmz));
      }
    oEvnt.addTime(oTimes);
    DBSubset oFlws = oMeet.getFellows(oConn);
    for (int f=0; f<oFlws.getRowCount(); f++) {
      if (!oFlws.isNull(4,f)) {
        EventWho oEwho = new EventWho();
        oEwho.setEmail(oFlws.getString(4,f));
        oEvnt.addParticipant(oEwho);
      } // fi
    } // next
    oEvnt = oCalSrv.insert(postUrl, oEvnt);

    if (!oMeet.isNull(DB.bo_private))
      oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
   
    DBCommand.executeUpdate(oConn, "UPDATE "+DB.k_meetings+" SET "+DB.id_icalendar+"='"+oMeet.getString(DB.gu_meeting)+"@hipergate.org"+"' WHERE "+DB.gu_meeting+"='"+oMeet.getString(DB.gu_meeting)+"'");
  } else {
      URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/private/full");
      CalendarQuery myQuery = new CalendarQuery(feedUrl);
      myQuery.setMinimumStartTime(new DateTime(oMeet.getDate(DB.dt_start)));
      myQuery.setMaximumStartTime(new DateTime(oMeet.getDate(DB.dt_end)));

    CalendarEventFeed oFeed = oCalSrv.query(myQuery, CalendarEventFeed.class);   
    for (int i = 0; i < oFeed.getEntries().size(); i++) {
        oEvnt = oFeed.getEntries().get(i);
      if (oEvnt.getIcalUID().equals(oMeet.getString(DB.id_icalendar))) {
        oEvnt.setTitle(new PlainTextConstruct(oMeet.getStringNull(DB.tx_meeting,"")));
          oEvnt.setContent(new PlainTextConstruct(oMeet.getStringNull(DB.de_meeting,"")));
        if (oMeet.isNull(DB.bo_private))
          oEvnt.getVisibility().setValue(Visibility.DEFAULT_VALUE);
        else
          oEvnt.getVisibility().setValue(oMeet.getShort(DB.bo_private)==0 ? Visibility.PUBLIC_VALUE : Visibility.PRIVATE_VALUE);     
        When oTimes = new When();
View Full Code Here

 
  @Override
  public ServiceResponse addAlbum(String title) {
    try {
      AlbumEntry myAlbum = new AlbumEntry();
      myAlbum.setTitle(new PlainTextConstruct(title));
      myAlbum.setDescription(new PlainTextConstruct(title));
      getBusiness().getPicasaBusiness().addAlbum(myAlbum);
      return ServiceResponse.createSuccessResponse(
          Messages.get("success"));
    }
    catch (Exception e) {
View Full Code Here

    if (album == null) {
      throw new IllegalArgumentException(Messages.get("album_not_found",
          albumId));
    }
    PhotoEntry photo = new PhotoEntry();
    photo.setTitle(new PlainTextConstruct(name));
    MediaSource mediaSource = new MediaByteArraySource(data,
        MimeType.getContentTypeByExt(FolderUtil.getFileExt(name)));
    photo.setMediaSource(mediaSource);
    return getPicasawebService().insert(new URL(getPicasaURL(albumId)),
        photo);
View Full Code Here

      newEntry = new SpreadsheetEntry();
    } else if (type.equals("folder")) {
      newEntry = new FolderEntry();
    }

    newEntry.setTitle(new PlainTextConstruct(title));
    return service.insert(buildUrl(URL_DEFAULT + URL_DOCLIST_FEED), newEntry);
  }
View Full Code Here

    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

   */
  @Override
  public DocumentServiceEntry createDocument(String title, String contents) throws DocumentServiceException {
    DocsService svc = getDocsService();
    DocumentEntry newDocument = new DocumentEntry();
    newDocument.setTitle(new PlainTextConstruct(title));
    DocumentEntry entry;
    try {
      MediaByteArraySource source = new MediaByteArraySource(contents.getBytes("UTF8"), "text/plain");
      newDocument.setMediaSource(source);
      entry = svc.insert(new URL(DOCS_SCOPE + "default/private/full"), newDocument);
View Full Code Here

   */
  @Override
  public DocumentServiceEntry renameDocument(String documentId, String newTitle) throws DocumentServiceException {
    DocumentListEntry entry = getDocumentEntry(documentId);
    try {
      entry.setTitle(new PlainTextConstruct(newTitle));
      entry.update();
      return getDocument(documentId);
    } catch (Exception e) {
      e.printStackTrace();
      throw new DocumentServiceException(e.getMessage());
View Full Code Here

        private UploadUpdateStatus uploadFile(final String path, final String documentTitle, final String mimeType, final boolean convert) throws IOException, MalformedURLException, ServiceException {
            if (convert) {
              DocumentEntry newDocument = new DocumentEntry();
              File documentFile = getFileForPath(path);
              newDocument.setFile(documentFile,mimeType);
              newDocument.setTitle(new PlainTextConstruct(documentTitle));
              URL documentListFeedUrl = new URL(DOCS_FEED);
              DocumentListEntry uploaded = service.insert(documentListFeedUrl,
                  newDocument);
              return new UploadUpdateStatus(true, uploaded.getDocumentLink().getHref());
            } else {
View Full Code Here

  public static Entry getEntryWithId(String id) {
    Entry entry = new Entry();
    entry.setId(id);
    entry.setUpdated(DateTime.now());
    entry.addHtmlLink("http://0.0.0.0/" + id, "en", id);
    PlainTextConstruct construct = new PlainTextConstruct();
    construct.setText(id);
    TextContent content = new TextContent();
    content.setContent(construct);
    entry.setContent(content);
    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.