1
22
23 package com.liferay.portlet.tags.model.impl;
24
25 import com.liferay.portal.PortalException;
26 import com.liferay.portal.SystemException;
27 import com.liferay.portal.kernel.util.StringPool;
28 import com.liferay.portlet.tags.NoSuchEntryException;
29 import com.liferay.portlet.tags.model.TagsEntry;
30 import com.liferay.portlet.tags.model.TagsEntryConstants;
31 import com.liferay.portlet.tags.model.TagsVocabulary;
32 import com.liferay.portlet.tags.service.TagsEntryLocalServiceUtil;
33 import com.liferay.portlet.tags.service.TagsVocabularyLocalServiceUtil;
34
35
42 public class TagsEntryImpl extends TagsEntryModelImpl implements TagsEntry {
43
44 public TagsEntryImpl() {
45 }
46
47 public String getParentName() throws PortalException, SystemException {
48 String name = StringPool.BLANK;
49
50 if (getParentEntryId() == TagsEntryConstants.DEFAULT_PARENT_ENTRY_ID) {
51 return name;
52 }
53
54 try {
55 name = TagsEntryLocalServiceUtil.getEntry(
56 getParentEntryId()).getName();
57 }
58 catch (NoSuchEntryException nsee) {
59 }
60
61 return name;
62 }
63
64 public TagsVocabulary getVocabulary()
65 throws PortalException, SystemException {
66
67 return TagsVocabularyLocalServiceUtil.getVocabulary(getVocabularyId());
68 }
69
70 public boolean isCategory() throws PortalException, SystemException {
71 TagsVocabulary vocabulary = getVocabulary();
72
73 if (vocabulary.isFolksonomy()) {
74 return false;
75 }
76 else {
77 return true;
78 }
79 }
80
81 }