1
14
15 package com.liferay.portlet.tags.model.impl;
16
17 import com.liferay.portal.PortalException;
18 import com.liferay.portal.SystemException;
19 import com.liferay.portal.kernel.util.StringPool;
20 import com.liferay.portlet.tags.NoSuchEntryException;
21 import com.liferay.portlet.tags.model.TagsEntry;
22 import com.liferay.portlet.tags.model.TagsEntryConstants;
23 import com.liferay.portlet.tags.model.TagsVocabulary;
24 import com.liferay.portlet.tags.service.TagsEntryLocalServiceUtil;
25 import com.liferay.portlet.tags.service.TagsVocabularyLocalServiceUtil;
26
27
34 public class TagsEntryImpl extends TagsEntryModelImpl implements TagsEntry {
35
36 public TagsEntryImpl() {
37 }
38
39 public String getParentName() throws PortalException, SystemException {
40 String name = StringPool.BLANK;
41
42 if (getParentEntryId() == TagsEntryConstants.DEFAULT_PARENT_ENTRY_ID) {
43 return name;
44 }
45
46 try {
47 name = TagsEntryLocalServiceUtil.getEntry(
48 getParentEntryId()).getName();
49 }
50 catch (NoSuchEntryException nsee) {
51 }
52
53 return name;
54 }
55
56 public TagsVocabulary getVocabulary()
57 throws PortalException, SystemException {
58
59 return TagsVocabularyLocalServiceUtil.getVocabulary(getVocabularyId());
60 }
61
62 public boolean isCategory() throws PortalException, SystemException {
63 TagsVocabulary vocabulary = getVocabulary();
64
65 if (vocabulary.isFolksonomy()) {
66 return false;
67 }
68 else {
69 return true;
70 }
71 }
72
73 }