コード例 #1
0
 @Override
 public void updateTagTypes() {
   LOG.info("About to update type for all tags.");
   for (Tag tag : tagDao.retrieveAll()) {
     if (!tag.getTagForComment()) { // this is an application tag
       tag.setType(TagType.APPLICATION);
     } else {
       tag.setType(TagType.COMMENT);
     }
     tagDao.saveOrUpdate(tag);
   }
 }
コード例 #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);
   }
 }