Package com.google.appengine.api.datastore

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


  }

  @Override
  public void addTag(String tag) {
    this.initTags();
    this.tags.add(new Category(tag));
  }
View Full Code Here


  }

  @Override
  public void removeTag(String tag) {
    this.initTags();
    this.tags.remove(new Category(tag));
  }
View Full Code Here

  }

  @Override
  public void addTags(Collection<String> tags) {
    this.initTags();
    Category cTag;
    for(String tag : tags) {
      cTag = new Category(tag);
      if(!this.tags.contains(cTag)){
        this.tags.add(cTag);
      }
    }
  }
View Full Code Here

  }

  @Override
  public void removeTags(Collection<String> tags) {
    this.initTags();
    Category cTag;
    for(String tag : tags) {
      cTag = new Category(tag);
      this.tags.remove(cTag);
    }
   
  }
View Full Code Here

    while (it.hasNext()) {
      Set set = (Set) it.next();
      Object[] array = set.toArray();
      for (Object o : array) {
        if (o instanceof Category) {
          Category c = (Category) o;
          mapa.put(c.getCategory(), c);
        }
      }
    }
    return new ArrayList<Category>(mapa.values());
  }
View Full Code Here

        // アクティビティタイプ(post or share)
        if(!activity.getVerb().equals(Constants.GOOGLE_ACTIVITY_VERB_TYPE_POST)
                && !activity.getVerb().equals(Constants.GOOGLE_ACTIVITY_VERB_TYPE_SHARE)) {
            throw new DataInvalidException();
        }else {
            model.setVerb(new Category(activity.getVerb()));
        }

        // タイトル
        if(activity.getTitle() != null && !activity.getTitle().trim().isEmpty()) {
            String title = activity.getTitle();
            model.setTitle(new Text(title));
        }

        // 公開日
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(activity.getPublished().getValue());
        calendar.add(Calendar.HOUR, 9);
        model.setPublished(calendar.getTime());

        // 更新日
        model.setUpdated(new Date(activity.getUpdated().getValue()));

        // URL
        model.setUrl(new Text(activity.getUrl()));

        // コンテントの設定
        if(activity.getObject().getContent() != null
                && !activity.getObject().getContent().trim().isEmpty()) {
            String content = activity.getObject().getContent();
            model.setContent(new Text(content));
        }


        // -------------------------------------------------------
        // 添付情報の設定
        // -------------------------------------------------------
        List<Attachments> attachmentsList = activity.getObject().getAttachments();
        if(attachmentsList != null && attachmentsList.size() > 0) {
            // 添付情報の一つ目のみを対象とする
            Attachments attachment = attachmentsList.get(0);

            if(attachment.getObjectType() == null) {
                throw new DataInvalidException();
            }

            // 添付フラグをTrueに設定
            model.setAttachmentsFlg(true);

            // 添付情報のタイプ
            if(attachment.getObjectType() != null) {
                if(attachment.getObjectType().equals(Constants.GOOGLE_ACTIVITY_ATTACHMENTS_TYPE_PHOTO)
                        || attachment.getObjectType().equals(Constants.GOOGLE_ACTIVITY_ATTACHMENTS_TYPE_VIDEO)
                        || attachment.getObjectType().equals(Constants.GOOGLE_ACTIVITY_ATTACHMENTS_TYPE_ARTICLE)
                        || attachment.getObjectType().equals(Constants.GOOGLE_ACTIVITY_ATTACHMENTS_TYPE_ALBUM)) {
                    model.setAttachmentsType(new Category(attachment.getObjectType()));

                }else {
                    throw new DataInvalidException();
                }
            }else {
View Full Code Here

      List<Category> categories = new ArrayList<Category>();
      categories.addAll(this.serviceLocator.getExtendedCourseService().getCoursesTags(locale));
      categories.addAll(this.serviceLocator.getCourseService().getCoursesTags(locale));
      Iterator<Category> it = categories.iterator();
      while(it.hasNext()) {
        Category category = it.next();
        mapa.put(category.getCategory(), category);
      }
      return new ArrayList<Category>(mapa.values());
    } catch (Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return new ArrayList<Category>();
View Full Code Here

      List<Category> categories = new ArrayList<Category>();
      categories.addAll(this.serviceLocator.getExtendedCourseService().getCoursesTags(locale));
      categories.addAll(this.serviceLocator.getCourseService().getCoursesTags(locale));
      Iterator<Category> it = categories.iterator();
      while(it.hasNext()) {
        Category category = it.next();
        mapa.put(category.getCategory(), category);
      }
      return new ArrayList<Category>(mapa.values());
    } catch (Exception e) {
      LOGGER.severe(StackTraceUtil.getStackTrace(e));
      return new ArrayList<Category>();
View Full Code Here

      throw new RuntimeException("ShortBlob is not supported.");
    } else if (valueType.equals(GEO_PT)) {
      String[] split = ((String) value).split(VALUE_SEPARATER);
      val = new GeoPt(Float.parseFloat(split[0]), Float.parseFloat(split[1]));
    } else if (valueType.equals(CATEGORY)) {
      val = new Category((String) value);
    } else if (valueType.equals(RATING)) {
      val = new Rating(Integer.parseInt((String) value));
    } else if (valueType.equals(PHONE_NUMBER)) {
      val = new PhoneNumber((String) value);
    } else if (valueType.equals(POSTAL_ADDRESS)) {
View Full Code Here

   
    public void  setAsText(String text) {
      Set<Category> tags = new HashSet<Category>();
      String[] inputTags = text.split("[,]");
      for(String tag : inputTags) {
        tags.add(new Category(tag.trim().toLowerCase()));
      }
      setValue(tags);
      /*if(getValue() == null) {
        setValue(tags);
      } else {
View Full Code Here

TOP

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

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.