コード例 #1
0
  public String getCategoryDescription() {
    String description = "";

    ArrayList<String> nameList = new ArrayList<String>();
    if (getChildCategoryIdList().size() > 0) {
      for (Long id : getChildCategoryIdList()) {
        CPDecksContentCategory subcategory = CPDecksContentManager.getContentCategory(id);
        if (subcategory != null) {
          nameList.add(subcategory.getTitle());
        }
      }
    } else {
      for (Long id : getContentIdList()) {
        CPDecksContent content = CPDecksContentManager.getContent(id);
        if (content != null & content.getTarget() != null && !content.getTarget().isEmpty()) {
          nameList.add(content.getTarget());
        }
      }
    }
    if (nameList.size() > 0) {
      String delim = "";
      for (String name : nameList) {
        description += delim + name;
        delim = "; ";
      }
    } else {
      description = "<EMPTY>";
    }

    return description;
  }
コード例 #2
0
  public String getImageUrl() {
    if (mImageUrl == null || mImageUrl.isEmpty()) {
      for (Long id : getContentIdList()) {
        CPDecksContent content = CPDecksContentManager.getContent(id);
        if (content != null && content.getImageUrl() != null && !content.getImageUrl().isEmpty()) {
          return content.getImageUrl();
        }
      }
      for (Long id : getChildCategoryIdList()) {
        CPDecksContentCategory subcategory = CPDecksContentManager.getContentCategory(id);
        if (subcategory != null
            && subcategory.getImageUrl() != null
            && !subcategory.getImageUrl().isEmpty()) {
          return subcategory.getImageUrl();
        }
      }
    }

    return mImageUrl;
  }