Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.Text


      throws MalformedURLException, IOException, ServiceException {
    // core.
    this.tubeId = (videoEntry.getMediaGroup().getVideoId());
    if (videoEntry.getMediaGroup().getThumbnails() != null
        && videoEntry.getMediaGroup().getThumbnails().size() > 1) {
      this.thumbImageUrl = (new Text(videoEntry.getMediaGroup()
          .getThumbnails().get(1).getUrl()));
    }
    this.title = (new Text(videoEntry.getMediaGroup().getTitle()
        .getPlainTextContent()));
    if (videoEntry.getMediaGroup().getDescription() != null) {
      this.description = (new Text(videoEntry.getMediaGroup()
          .getDescription().getPlainTextContent()));
    }
    this.alias = (new Text(StringHelper.getAliasByLanguage(this.getTitle()
        .getValue())));

    this.authorUrl = (videoEntry.getAuthors().get(0).getUri());
    if (videoEntry.getStatistics() != null) {
      this.viewCount = (new Text(String.valueOf(videoEntry
          .getStatistics().getViewCount())));
    }
    if (videoEntry.getMediaGroup().getDuration() != null) {
      Long duration = videoEntry.getMediaGroup().getDuration();
      int hours = (int) (duration / 3600);
      int remainder = (int) (duration - hours * 3600);
      int minutes = remainder / 60;
      remainder = remainder - minutes * 60;
      int second = remainder;
      this.duration = (duration);
      this.totalTime = (new Text(((hours > 0) ? (hours + ":") : "")
          + ((minutes > 9) ? minutes : ("0" + minutes)) + ":"
          + ((second > 9) ? second : ("0" + second))));
    }

    // advanced.

    this.published = (new Date(videoEntry.getPublished().getValue()));
    JavaCacheHandle.initCache();
    if (videoEntry.getMediaGroup().getKeywords() != null) {
      List<Text> listKey = new ArrayList<Text>();
      for (String keyword : videoEntry.getMediaGroup().getKeywords()
          .getKeywords()) {
        Tag tmpTag = null;
        listKey.add(new Text(keyword));
        String tagAlias = keyword;
        tmpTag = TagModel.getByAlias(tagAlias);
        List<Text> listTubeId = new ArrayList<Text>();
        if (tmpTag != null) {
          tmpTag.setCount(tmpTag.getCount() + 1);
          listTubeId.addAll(tmpTag.getListTubeId());
          listTubeId.add(new Text(this.tubeId));
          tmpTag.setListTubeId(listTubeId);
          TagModel.update(tmpTag);
          TagModel.closePM();
        } else {
          tmpTag = new Tag();
          listTubeId.add(new Text(this.tubeId));
          tmpTag.setListTubeId(listTubeId);
          tmpTag.setAlias(tagAlias);
          tmpTag.setCount(1);
          tmpTag.setTitle(new Text(tagAlias));
          TagModel.add(tmpTag);
        }
      }
      this.keywords = listKey;
      JavaCacheHandle.addKeywords(listKey);
    }

    // get other tag.
    this.otherKeywords = JavaCacheHandle.getRandomKeywords();

    if (videoEntry.getStatistics() != null) {
      this.viewCount = (new Text(String.valueOf(videoEntry
          .getStatistics().getViewCount())));
    }

    this.categoryAlias = (StringHelper.replace(videoEntry.getMediaGroup()
        .getCategories().get(0).getLabel()));
    Category cate = CategoryModel.getByCateAlias(this.categoryAlias);
    if (cate != null) {
      cate.setCount(cate.getCount() + 1);
      CategoryModel.update(cate);
      CategoryModel.closePM();
    } else {
      cate = new Category();
      cate.setAlias(this.categoryAlias);
      cate.setTitle(new Text(videoEntry.getMediaGroup().getCategories()
          .get(0).getLabel()));
      cate.setCount(1);
      cate.setStatus(1);
      CategoryModel.add(cate);
    }
View Full Code Here


    if (tmp != null) {
      this.alias = (tmp.text());
    }
    tmp = doc.select("thumbImageUrl");
    if (tmp != null) {
      this.thumbImageUrl = (new Text(tmp.text()));
    }
    tmp = doc.select("title");
    if (tmp != null) {
      this.title = (new Text(tmp.text()));
    }
  }
View Full Code Here

      return null;
    return otherNeeds.getValue();
  }

  public void setOtherNeeds(String otherNeeds) {
    this.otherNeeds = new Text(otherNeeds);
  }
View Full Code Here

        sw.append('=');
        sw.append(header.getValue());
        sw.append('\r');
      }

      unprocessedEMail.setHeaders(new Text(sw.toString()));
      unprocessedEMail.setSubject(new Text(message.getSubject()));
      unprocessedEMail.setContent(new Text(IOUtils.toString(message
          .getInputStream())));

      EntityTransaction transaction = entityManager.getTransaction();
      try {
        transaction.begin();
View Full Code Here

  public void setNotes(Text notes) {
    this.notes = notes;
  }

  public void setNotesString(String notes) {
    this.notes = new Text(notes);
  }
View Full Code Here

    if (equipmentOther == null) return null;
    return equipmentOther.getValue();
  }

  public void setEquipmentOther(String equipmentOther) {
    this.equipmentOther = new Text(equipmentOther);
  }
View Full Code Here

    if (canvasOther == null) return null;
    return canvasOther.getValue();
  }

  public void setCanvasOther(String canvasOther) {
    this.canvasOther = new Text(canvasOther);
  }
View Full Code Here

    if (largeCanvasOther == null) return null;
    return largeCanvasOther.getValue();
  }

  public void setLargeCanvasOther(String largeCanvasOther) {
    this.largeCanvasOther = new Text(largeCanvasOther);
  }
View Full Code Here

  public String getSharedCanvas() {
    return sharedCanvas.getValue();
  }

  public void setSharedCanvas(String sharedCanvas) {
    this.sharedCanvas = new Text(sharedCanvas);
  }
View Full Code Here

  public String getSharedEquipment() {
    return sharedEquipment.getValue();
  }

  public void setSharedEquipment(String sharedEquipment) {
    this.sharedEquipment = new Text(sharedEquipment);
  }
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.Text

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.