1
22
23 package com.liferay.portlet.tags.service.http;
24
25 import com.liferay.portal.kernel.json.JSONArray;
26 import com.liferay.portal.kernel.json.JSONObject;
27
28 import com.liferay.portlet.tags.service.TagsEntryServiceUtil;
29
30
76 public class TagsEntryServiceJSON {
77 public static JSONObject addEntry(java.lang.String parentEntryName,
78 java.lang.String name, java.lang.String vocabularyName,
79 java.lang.String[] properties,
80 com.liferay.portal.service.ServiceContext serviceContext)
81 throws com.liferay.portal.PortalException,
82 com.liferay.portal.SystemException {
83 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.addEntry(parentEntryName,
84 name, vocabularyName, properties, serviceContext);
85
86 return TagsEntryJSONSerializer.toJSONObject(returnValue);
87 }
88
89 public static void deleteEntry(long entryId)
90 throws com.liferay.portal.PortalException,
91 com.liferay.portal.SystemException {
92 TagsEntryServiceUtil.deleteEntry(entryId);
93 }
94
95 public static JSONArray getEntries(java.lang.String className, long classPK)
96 throws com.liferay.portal.PortalException,
97 com.liferay.portal.SystemException {
98 java.util.List<com.liferay.portlet.tags.model.TagsEntry> returnValue = TagsEntryServiceUtil.getEntries(className,
99 classPK);
100
101 return TagsEntryJSONSerializer.toJSONArray(returnValue);
102 }
103
104 public static JSONArray getEntries(long groupId, long classNameId,
105 java.lang.String name)
106 throws com.liferay.portal.PortalException,
107 com.liferay.portal.SystemException {
108 java.util.List<com.liferay.portlet.tags.model.TagsEntry> returnValue = TagsEntryServiceUtil.getEntries(groupId,
109 classNameId, name);
110
111 return TagsEntryJSONSerializer.toJSONArray(returnValue);
112 }
113
114 public static JSONObject getEntry(long entryId)
115 throws com.liferay.portal.PortalException,
116 com.liferay.portal.SystemException {
117 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.getEntry(entryId);
118
119 return TagsEntryJSONSerializer.toJSONObject(returnValue);
120 }
121
122 public static JSONArray getGroupVocabularyEntries(long groupId,
123 java.lang.String vocabularyName)
124 throws com.liferay.portal.PortalException,
125 com.liferay.portal.SystemException {
126 java.util.List<com.liferay.portlet.tags.model.TagsEntry> returnValue = TagsEntryServiceUtil.getGroupVocabularyEntries(groupId,
127 vocabularyName);
128
129 return TagsEntryJSONSerializer.toJSONArray(returnValue);
130 }
131
132 public static JSONArray getGroupVocabularyEntries(long groupId,
133 java.lang.String parentEntryName, java.lang.String vocabularyName)
134 throws com.liferay.portal.PortalException,
135 com.liferay.portal.SystemException {
136 java.util.List<com.liferay.portlet.tags.model.TagsEntry> returnValue = TagsEntryServiceUtil.getGroupVocabularyEntries(groupId,
137 parentEntryName, vocabularyName);
138
139 return TagsEntryJSONSerializer.toJSONArray(returnValue);
140 }
141
142 public static JSONArray getGroupVocabularyRootEntries(long groupId,
143 java.lang.String vocabularyName)
144 throws com.liferay.portal.PortalException,
145 com.liferay.portal.SystemException {
146 java.util.List<com.liferay.portlet.tags.model.TagsEntry> returnValue = TagsEntryServiceUtil.getGroupVocabularyRootEntries(groupId,
147 vocabularyName);
148
149 return TagsEntryJSONSerializer.toJSONArray(returnValue);
150 }
151
152 public static void mergeEntries(long fromEntryId, long toEntryId)
153 throws com.liferay.portal.PortalException,
154 com.liferay.portal.SystemException {
155 TagsEntryServiceUtil.mergeEntries(fromEntryId, toEntryId);
156 }
157
158 public static com.liferay.portal.kernel.json.JSONArray search(
159 long groupId, java.lang.String name, java.lang.String[] properties,
160 int start, int end) throws com.liferay.portal.SystemException {
161 com.liferay.portal.kernel.json.JSONArray returnValue = TagsEntryServiceUtil.search(groupId,
162 name, properties, start, end);
163
164 return returnValue;
165 }
166
167 public static JSONObject updateEntry(long entryId,
168 java.lang.String parentEntryName, java.lang.String name,
169 java.lang.String vocabularyName, java.lang.String[] properties)
170 throws com.liferay.portal.PortalException,
171 com.liferay.portal.SystemException {
172 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.updateEntry(entryId,
173 parentEntryName, name, vocabularyName, properties);
174
175 return TagsEntryJSONSerializer.toJSONObject(returnValue);
176 }
177 }