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 boolean addCommunityPermissions, boolean addGuestPermissions)
78 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
79 com.liferay.portal.PortalException {
80 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(plid,
81 parentCategoryId, name, description, addCommunityPermissions,
82 addGuestPermissions);
83
84 return MBCategoryJSONSerializer.toJSONObject(returnValue);
85 }
86
87 public static JSONObject addCategory(long plid, long parentCategoryId,
88 java.lang.String name, java.lang.String description,
89 java.lang.String[] communityPermissions,
90 java.lang.String[] guestPermissions)
91 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
92 com.liferay.portal.PortalException {
93 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.addCategory(plid,
94 parentCategoryId, name, description, communityPermissions,
95 guestPermissions);
96
97 return MBCategoryJSONSerializer.toJSONObject(returnValue);
98 }
99
100 public static void deleteCategory(long categoryId)
101 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
102 com.liferay.portal.PortalException {
103 MBCategoryServiceUtil.deleteCategory(categoryId);
104 }
105
106 public static JSONObject getCategory(long categoryId)
107 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
108 com.liferay.portal.PortalException {
109 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.getCategory(categoryId);
110
111 return MBCategoryJSONSerializer.toJSONObject(returnValue);
112 }
113
114 public static JSONArray getCategories(long groupId, long parentCategoryId,
115 int begin, int end)
116 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
117 com.liferay.portal.PortalException {
118 java.util.List<com.liferay.portlet.messageboards.model.MBCategory> returnValue =
119 MBCategoryServiceUtil.getCategories(groupId, parentCategoryId,
120 begin, end);
121
122 return MBCategoryJSONSerializer.toJSONArray(returnValue);
123 }
124
125 public static int getCategoriesCount(long groupId, long parentCategoryId)
126 throws java.rmi.RemoteException, com.liferay.portal.SystemException {
127 int returnValue = MBCategoryServiceUtil.getCategoriesCount(groupId,
128 parentCategoryId);
129
130 return returnValue;
131 }
132
133 public static void subscribeCategory(long categoryId)
134 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
135 com.liferay.portal.PortalException {
136 MBCategoryServiceUtil.subscribeCategory(categoryId);
137 }
138
139 public static void unsubscribeCategory(long categoryId)
140 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
141 com.liferay.portal.PortalException {
142 MBCategoryServiceUtil.unsubscribeCategory(categoryId);
143 }
144
145 public static JSONObject updateCategory(long categoryId,
146 long parentCategoryId, java.lang.String name,
147 java.lang.String description, boolean mergeWithParentCategory)
148 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
149 com.liferay.portal.PortalException {
150 com.liferay.portlet.messageboards.model.MBCategory returnValue = MBCategoryServiceUtil.updateCategory(categoryId,
151 parentCategoryId, name, description, mergeWithParentCategory);
152
153 return MBCategoryJSONSerializer.toJSONObject(returnValue);
154 }
155 }