コード例 #1
0
  @Override
  public List<Tag> setEnterpriseTag(List<Tag> tags) {
    for (Tag tag : listFrom(tags)) {
      Tag databaseTag = tagDao.retrieveById(tag.getId());
      if (databaseTag == null) {
        tags.remove(tag);
      } else {
        tag.setEnterpriseTag(databaseTag.getEnterpriseTag());
      }
    }

    return tags;
  }
コード例 #2
0
 @Override
 public void copyAppTagsToCommentTags() {
   List<Tag> appTags = loadAllApplicationTags();
   if (appTags == null) {
     LOG.info("There is no tags in system.");
     return;
   }
   LOG.info("About to copy " + appTags.size() + " application tags to comment tags.");
   for (Tag appTag : appTags) {
     if (loadCommentTag(appTag.getName()) == null) {
       LOG.info("Copying " + appTag.getName());
       Tag newCommentTag = new Tag();
       newCommentTag.setName(appTag.getName());
       newCommentTag.setEnterpriseTag(appTag.getEnterpriseTag());
       newCommentTag.setDefaultJsonFilter(appTag.getDefaultJsonFilter());
       newCommentTag.setType(TagType.COMMENT);
       tagDao.saveOrUpdate(newCommentTag);
     }
     appTag.setType(TagType.APPLICATION);
     tagDao.saveOrUpdate(appTag);
   }
 }