List<Text> listKey = new ArrayList<Text>();
for (String keyword : videoEntry.getMediaGroup().getKeywords()
.getKeywords()) {
Tag tmpTag = null;
listKey.add(new Text(keyword));
TagModel tagModel = new TagModel();
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));
tmpTag.setType("N");
tagModel.add(tmpTag);
}
}
this.keywords = listKey;
JavaCacheHandle.addKeywords(listKey);
}