1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.service.OrganizationServiceUtil;
26
27 import org.json.JSONArray;
28 import org.json.JSONObject;
29
30
74 public class OrganizationServiceJSON {
75 public static void addGroupOrganizations(long groupId,
76 long[] organizationIds)
77 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
78 com.liferay.portal.PortalException {
79 OrganizationServiceUtil.addGroupOrganizations(groupId, organizationIds);
80 }
81
82 public static void addPasswordPolicyOrganizations(long passwordPolicyId,
83 long[] organizationIds)
84 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
85 com.liferay.portal.PortalException {
86 OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId,
87 organizationIds);
88 }
89
90 public static JSONObject addOrganization(long parentOrganizationId,
91 java.lang.String name, int type, boolean recursable, long regionId,
92 long countryId, int statusId, java.lang.String comments)
93 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
94 com.liferay.portal.PortalException {
95 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
96 name, type, recursable, regionId, countryId, statusId, comments);
97
98 return OrganizationJSONSerializer.toJSONObject(returnValue);
99 }
100
101 public static void deleteOrganization(long organizationId)
102 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
103 com.liferay.portal.PortalException {
104 OrganizationServiceUtil.deleteOrganization(organizationId);
105 }
106
107 public static JSONObject getOrganization(long organizationId)
108 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
109 com.liferay.portal.PortalException {
110 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId);
111
112 return OrganizationJSONSerializer.toJSONObject(returnValue);
113 }
114
115 public static long getOrganizationId(long companyId, java.lang.String name)
116 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
117 com.liferay.portal.PortalException {
118 long returnValue = OrganizationServiceUtil.getOrganizationId(companyId,
119 name);
120
121 return returnValue;
122 }
123
124 public static JSONArray getUserOrganizations(long userId)
125 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
126 com.liferay.portal.PortalException {
127 java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId);
128
129 return OrganizationJSONSerializer.toJSONArray(returnValue);
130 }
131
132 public static void setGroupOrganizations(long groupId,
133 long[] organizationIds)
134 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
135 com.liferay.portal.PortalException {
136 OrganizationServiceUtil.setGroupOrganizations(groupId, organizationIds);
137 }
138
139 public static void unsetGroupOrganizations(long groupId,
140 long[] organizationIds)
141 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
142 com.liferay.portal.PortalException {
143 OrganizationServiceUtil.unsetGroupOrganizations(groupId, organizationIds);
144 }
145
146 public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
147 long[] organizationIds)
148 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
149 com.liferay.portal.PortalException {
150 OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId,
151 organizationIds);
152 }
153
154 public static JSONObject updateOrganization(long organizationId,
155 long parentOrganizationId, java.lang.String name, int type,
156 boolean recursable, long regionId, long countryId, int statusId,
157 java.lang.String comments)
158 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
159 com.liferay.portal.PortalException {
160 com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
161 parentOrganizationId, name, type, recursable, regionId,
162 countryId, statusId, comments);
163
164 return OrganizationJSONSerializer.toJSONObject(returnValue);
165 }
166 }