return getDao().getTagDao().getById(id);
}
@Override
public ServiceResponse save(Map<String, String> vo) {
TagEntity tag = null;
if (!StringUtils.isEmpty(vo.get("id"))) {
tag = getDao().getTagDao().getById(Long.valueOf(vo.get("id")));
}
if (tag == null) {
tag = new TagEntity();
}
if (StringUtils.isEmpty(vo.get("parent"))) {
tag.setParent(null);
}
else {
tag.setParent(Long.valueOf(vo.get("parent")));
}
tag.setName(vo.get("name"));
tag.setTitle(vo.get("title"));
String error = getBusiness().getTagBusiness().validateBeforeSave(tag);
if (error == null) {
getDao().getTagDao().save(tag);
return ServiceResponse.createSuccessResponse(
Messages.get("tag.success_save"));