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.TagsAssetServiceUtil;
29
30
76 public class TagsAssetServiceJSON {
77 public static void deleteAsset(long assetId)
78 throws com.liferay.portal.PortalException,
79 com.liferay.portal.SystemException {
80 TagsAssetServiceUtil.deleteAsset(assetId);
81 }
82
83 public static JSONObject getAsset(long assetId)
84 throws com.liferay.portal.PortalException,
85 com.liferay.portal.SystemException {
86 com.liferay.portlet.tags.model.TagsAsset returnValue = TagsAssetServiceUtil.getAsset(assetId);
87
88 return TagsAssetJSONSerializer.toJSONObject(returnValue);
89 }
90
91 public static JSONArray getAssets(long groupId, long[] classNameIds,
92 long[] entryIds, long[] notEntryIds, boolean andOperator,
93 java.lang.String orderByCol1, java.lang.String orderByCol2,
94 java.lang.String orderByType1, java.lang.String orderByType2,
95 boolean excludeZeroViewCount, java.util.Date publishDate,
96 java.util.Date expirationDate, int start, int end)
97 throws com.liferay.portal.PortalException,
98 com.liferay.portal.SystemException {
99 java.util.List<com.liferay.portlet.tags.model.TagsAsset> returnValue = TagsAssetServiceUtil.getAssets(groupId,
100 classNameIds, entryIds, notEntryIds, andOperator, orderByCol1,
101 orderByCol2, orderByType1, orderByType2, excludeZeroViewCount,
102 publishDate, expirationDate, start, end);
103
104 return TagsAssetJSONSerializer.toJSONArray(returnValue);
105 }
106
107 public static int getAssetsCount(long groupId, long[] classNameIds,
108 long[] entryIds, long[] notEntryIds, boolean andOperator,
109 boolean excludeZeroViewCount, java.util.Date publishDate,
110 java.util.Date expirationDate)
111 throws com.liferay.portal.PortalException,
112 com.liferay.portal.SystemException {
113 int returnValue = TagsAssetServiceUtil.getAssetsCount(groupId,
114 classNameIds, entryIds, notEntryIds, andOperator,
115 excludeZeroViewCount, publishDate, expirationDate);
116
117 return returnValue;
118 }
119
120 public static java.lang.String getAssetsRSS(long groupId,
121 long[] classNameIds, long[] entryIds, long[] notEntryIds,
122 boolean andOperator, java.lang.String orderByCol1,
123 java.lang.String orderByCol2, java.lang.String orderByType1,
124 java.lang.String orderByType2, boolean excludeZeroViewCount,
125 java.util.Date publishDate, java.util.Date expirationDate, int max,
126 java.lang.String type, double version, java.lang.String displayStyle,
127 java.lang.String feedURL, java.lang.String entryURL)
128 throws com.liferay.portal.PortalException,
129 com.liferay.portal.SystemException {
130 java.lang.String returnValue = TagsAssetServiceUtil.getAssetsRSS(groupId,
131 classNameIds, entryIds, notEntryIds, andOperator, orderByCol1,
132 orderByCol2, orderByType1, orderByType2, excludeZeroViewCount,
133 publishDate, expirationDate, max, type, version, displayStyle,
134 feedURL, entryURL);
135
136 return returnValue;
137 }
138
139 public static com.liferay.portlet.tags.model.TagsAssetType[] getAssetTypes(
140 java.lang.String languageId) {
141 com.liferay.portlet.tags.model.TagsAssetType[] returnValue = TagsAssetServiceUtil.getAssetTypes(languageId);
142
143 return returnValue;
144 }
145
146 public static com.liferay.portlet.tags.model.TagsAssetDisplay[] getCompanyAssetDisplays(
147 long companyId, int start, int end, java.lang.String languageId)
148 throws com.liferay.portal.SystemException {
149 com.liferay.portlet.tags.model.TagsAssetDisplay[] returnValue = TagsAssetServiceUtil.getCompanyAssetDisplays(companyId,
150 start, end, languageId);
151
152 return returnValue;
153 }
154
155 public static JSONArray getCompanyAssets(long companyId, int start, int end)
156 throws com.liferay.portal.SystemException {
157 java.util.List<com.liferay.portlet.tags.model.TagsAsset> returnValue = TagsAssetServiceUtil.getCompanyAssets(companyId,
158 start, end);
159
160 return TagsAssetJSONSerializer.toJSONArray(returnValue);
161 }
162
163 public static int getCompanyAssetsCount(long companyId)
164 throws com.liferay.portal.SystemException {
165 int returnValue = TagsAssetServiceUtil.getCompanyAssetsCount(companyId);
166
167 return returnValue;
168 }
169
170 public static java.lang.String getCompanyAssetsRSS(long companyId, int max,
171 java.lang.String type, double version, java.lang.String displayStyle,
172 java.lang.String feedURL, java.lang.String entryURL)
173 throws com.liferay.portal.PortalException,
174 com.liferay.portal.SystemException {
175 java.lang.String returnValue = TagsAssetServiceUtil.getCompanyAssetsRSS(companyId,
176 max, type, version, displayStyle, feedURL, entryURL);
177
178 return returnValue;
179 }
180
181 public static JSONObject incrementViewCounter(java.lang.String className,
182 long classPK) throws com.liferay.portal.SystemException {
183 com.liferay.portlet.tags.model.TagsAsset returnValue = TagsAssetServiceUtil.incrementViewCounter(className,
184 classPK);
185
186 return TagsAssetJSONSerializer.toJSONObject(returnValue);
187 }
188
189 public static com.liferay.portlet.tags.model.TagsAssetDisplay[] searchAssetDisplays(
190 long companyId, java.lang.String portletId, java.lang.String keywords,
191 java.lang.String languageId, int start, int end)
192 throws com.liferay.portal.SystemException {
193 com.liferay.portlet.tags.model.TagsAssetDisplay[] returnValue = TagsAssetServiceUtil.searchAssetDisplays(companyId,
194 portletId, keywords, languageId, start, end);
195
196 return returnValue;
197 }
198
199 public static int searchAssetDisplaysCount(long companyId,
200 java.lang.String portletId, java.lang.String keywords,
201 java.lang.String languageId) throws com.liferay.portal.SystemException {
202 int returnValue = TagsAssetServiceUtil.searchAssetDisplaysCount(companyId,
203 portletId, keywords, languageId);
204
205 return returnValue;
206 }
207
208 public static JSONObject updateAsset(long groupId,
209 java.lang.String className, long classPK,
210 java.lang.String[] categoryNames, java.lang.String[] entryNames,
211 boolean visible, java.util.Date startDate, java.util.Date endDate,
212 java.util.Date publishDate, java.util.Date expirationDate,
213 java.lang.String mimeType, java.lang.String title,
214 java.lang.String description, java.lang.String summary,
215 java.lang.String url, int height, int width, java.lang.Integer priority)
216 throws com.liferay.portal.PortalException,
217 com.liferay.portal.SystemException {
218 com.liferay.portlet.tags.model.TagsAsset returnValue = TagsAssetServiceUtil.updateAsset(groupId,
219 className, classPK, categoryNames, entryNames, visible,
220 startDate, endDate, publishDate, expirationDate, mimeType,
221 title, description, summary, url, height, width, priority);
222
223 return TagsAssetJSONSerializer.toJSONObject(returnValue);
224 }
225 }