1
22
23 package com.liferay.portlet.messageboards.service.http;
24
25 import com.liferay.portlet.messageboards.service.MBCategoryServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
74 public class MBCategoryServiceJSON {
75 public static JSONObject addCategory(long plid, long parentCategoryId,
76 java.lang.String name, java.lang.String description,
77 java.lang.String[] communityPermissions,
78 java.lang.String[] guestPermissions)
79 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
80 com.liferay.portal.PortalException {
81 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(plid,
82 parentCategoryId, name, description, communityPermissions,
83 guestPermissions);
84
85 return MBCategoryJSONSerializer.toJSONObject(returnValue);
86 }
87
88 public static void deleteCategory(long categoryId)
89 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
90 com.liferay.portal.PortalException {
91 MBCategoryServiceUtil.deleteCategory(categoryId);
92 }
93
94 public static JSONObject getCategory(long categoryId)
95 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
96 com.liferay.portal.PortalException {
97 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
98
99 return MBCategoryJSONSerializer.toJSONObject(returnValue);
100 }
101
102 public static JSONArray getCategories(long groupId, long parentCategoryId,
103 int begin, int end)
104 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
105 com.liferay.portal.PortalException {
106 java.util.List returnValue = MBCategoryServiceUtil.getCategories(groupId,
107 parentCategoryId, begin, end);
108
109 return MBCategoryJSONSerializer.toJSONArray(returnValue);
110 }
111
112 public static int getCategoriesCount(long groupId, long parentCategoryId)
113 throws java.rmi.RemoteException, com.liferay.portal.SystemException {
114 int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
115 parentCategoryId);
116
117 return returnValue;
118 }
119
120 public static void subscribeCategory(long categoryId)
121 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
122 com.liferay.portal.PortalException {
123 MBCategoryServiceUtil.subscribeCategory(categoryId);
124 }
125
126 public static void unsubscribeCategory(long categoryId)
127 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
128 com.liferay.portal.PortalException {
129 MBCategoryServiceUtil.unsubscribeCategory(categoryId);
130 }
131
132 public static JSONObject updateCategory(long categoryId,
133 long parentCategoryId, java.lang.String name,
134 java.lang.String description, boolean mergeWithParentCategory)
135 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
136 com.liferay.portal.PortalException {
137 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
138 parentCategoryId, name, description, mergeWithParentCategory);
139
140 return MBCategoryJSONSerializer.toJSONObject(returnValue);
141 }
142 }