1
22
23 package com.liferay.portlet.tags.service.http;
24
25 import com.liferay.portlet.tags.service.TagsEntryServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
71 public class TagsEntryServiceJSON {
72 public static JSONObject addEntry(java.lang.String name)
73 throws com.liferay.portal.SystemException,
74 com.liferay.portal.PortalException, java.rmi.RemoteException {
75 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.addEntry(name);
76
77 return TagsEntryJSONSerializer.toJSONObject(returnValue);
78 }
79
80 public static JSONObject addEntry(java.lang.String name,
81 java.lang.String[] properties)
82 throws com.liferay.portal.SystemException,
83 com.liferay.portal.PortalException, java.rmi.RemoteException {
84 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.addEntry(name,
85 properties);
86
87 return TagsEntryJSONSerializer.toJSONObject(returnValue);
88 }
89
90 public static void deleteEntry(long entryId)
91 throws com.liferay.portal.SystemException,
92 com.liferay.portal.PortalException, java.rmi.RemoteException {
93 TagsEntryServiceUtil.deleteEntry(entryId);
94 }
95
96 public static JSONArray getEntries(java.lang.String className, long classPK)
97 throws com.liferay.portal.SystemException,
98 com.liferay.portal.PortalException, java.rmi.RemoteException {
99 java.util.List returnValue = TagsEntryServiceUtil.getEntries(className,
100 classPK);
101
102 return TagsEntryJSONSerializer.toJSONArray(returnValue);
103 }
104
105 public static JSONArray search(long companyId, java.lang.String name,
106 java.lang.String[] properties)
107 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
108 java.util.List returnValue = TagsEntryServiceUtil.search(companyId,
109 name, properties);
110
111 return TagsEntryJSONSerializer.toJSONArray(returnValue);
112 }
113
114 public static JSONArray search(long companyId, java.lang.String name,
115 java.lang.String[] properties, int begin, int end)
116 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
117 java.util.List returnValue = TagsEntryServiceUtil.search(companyId,
118 name, properties, begin, end);
119
120 return TagsEntryJSONSerializer.toJSONArray(returnValue);
121 }
122
123 public static JSONArray searchAutocomplete(long companyId,
124 java.lang.String name, java.lang.String[] properties, int begin, int end)
125 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
126 com.liferay.portal.kernel.json.JSONArrayWrapper returnValue = TagsEntryServiceUtil.searchAutocomplete(companyId,
127 name, properties, begin, end);
128
129 return (JSONArray)returnValue.getValue();
130 }
131
132 public static int searchCount(long companyId, java.lang.String name,
133 java.lang.String[] properties)
134 throws com.liferay.portal.SystemException, java.rmi.RemoteException {
135 int returnValue = TagsEntryServiceUtil.searchCount(companyId, name,
136 properties);
137
138 return returnValue;
139 }
140
141 public static JSONObject updateEntry(long entryId, java.lang.String name)
142 throws com.liferay.portal.SystemException,
143 com.liferay.portal.PortalException, java.rmi.RemoteException {
144 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.updateEntry(entryId,
145 name);
146
147 return TagsEntryJSONSerializer.toJSONObject(returnValue);
148 }
149
150 public static JSONObject updateEntry(long entryId, java.lang.String name,
151 java.lang.String[] properties)
152 throws com.liferay.portal.SystemException,
153 com.liferay.portal.PortalException, java.rmi.RemoteException {
154 com.liferay.portlet.tags.model.TagsEntry returnValue = TagsEntryServiceUtil.updateEntry(entryId,
155 name, properties);
156
157 return TagsEntryJSONSerializer.toJSONObject(returnValue);
158 }
159 }