1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.http;
21  
22  import com.liferay.portal.kernel.log.Log;
23  import com.liferay.portal.kernel.log.LogFactoryUtil;
24  import com.liferay.portal.service.OrganizationServiceUtil;
25  
26  import java.rmi.RemoteException;
27  
28  /**
29   * <a href="OrganizationServiceSoap.java.html"><b><i>View Source</i></b></a>
30   *
31   * <p>
32   * ServiceBuilder generated this class. Modifications in this class will be
33   * overwritten the next time is generated.
34   * </p>
35   *
36   * <p>
37   * This class provides a SOAP utility for the
38   * <code>com.liferay.portal.service.OrganizationServiceUtil</code> service
39   * utility. The static methods of this class calls the same methods of the
40   * service utility. However, the signatures are different because it is
41   * difficult for SOAP to support certain types.
42   * </p>
43   *
44   * <p>
45   * ServiceBuilder follows certain rules in translating the methods. For example,
46   * if the method in the service utility returns a <code>java.util.List</code>,
47   * that is translated to an array of
48   * <code>com.liferay.portal.model.OrganizationSoap</code>. If the method in the
49   * service utility returns a <code>com.liferay.portal.model.Organization</code>,
50   * that is translated to a <code>com.liferay.portal.model.OrganizationSoap</code>.
51   * Methods that SOAP cannot safely wire are skipped.
52   * </p>
53   *
54   * <p>
55   * The benefits of using the SOAP utility is that it is cross platform
56   * compatible. SOAP allows different languages like Java, .NET, C++, PHP, and
57   * even Perl, to call the generated services. One drawback of SOAP is that it is
58   * slow because it needs to serialize all calls into a text format (XML).
59   * </p>
60   *
61   * <p>
62   * You can see a list of services at
63   * http://localhost:8080/tunnel-web/secure/axis. Set the property
64   * <code>tunnel.servlet.hosts.allowed</code> in portal.properties to configure
65   * security.
66   * </p>
67   *
68   * <p>
69   * The SOAP utility is only generated for remote services.
70   * </p>
71   *
72   * @author Brian Wing Shun Chan
73   *
74   * @see com.liferay.portal.model.OrganizationSoap
75   * @see com.liferay.portal.service.OrganizationServiceUtil
76   * @see com.liferay.portal.service.http.OrganizationServiceHttp
77   *
78   */
79  public class OrganizationServiceSoap {
80      public static void addGroupOrganizations(long groupId,
81          long[] organizationIds) throws RemoteException {
82          try {
83              OrganizationServiceUtil.addGroupOrganizations(groupId,
84                  organizationIds);
85          }
86          catch (Exception e) {
87              _log.error(e, e);
88  
89              throw new RemoteException(e.getMessage());
90          }
91      }
92  
93      public static void addPasswordPolicyOrganizations(long passwordPolicyId,
94          long[] organizationIds) throws RemoteException {
95          try {
96              OrganizationServiceUtil.addPasswordPolicyOrganizations(passwordPolicyId,
97                  organizationIds);
98          }
99          catch (Exception e) {
100             _log.error(e, e);
101 
102             throw new RemoteException(e.getMessage());
103         }
104     }
105 
106     public static com.liferay.portal.model.OrganizationSoap addOrganization(
107         long parentOrganizationId, java.lang.String name, int type,
108         boolean recursable, long regionId, long countryId, int statusId,
109         java.lang.String comments) throws RemoteException {
110         try {
111             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.addOrganization(parentOrganizationId,
112                     name, type, recursable, regionId, countryId, statusId,
113                     comments);
114 
115             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
116         }
117         catch (Exception e) {
118             _log.error(e, e);
119 
120             throw new RemoteException(e.getMessage());
121         }
122     }
123 
124     public static void deleteOrganization(long organizationId)
125         throws RemoteException {
126         try {
127             OrganizationServiceUtil.deleteOrganization(organizationId);
128         }
129         catch (Exception e) {
130             _log.error(e, e);
131 
132             throw new RemoteException(e.getMessage());
133         }
134     }
135 
136     public static com.liferay.portal.model.OrganizationSoap getOrganization(
137         long organizationId) throws RemoteException {
138         try {
139             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.getOrganization(organizationId);
140 
141             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
142         }
143         catch (Exception e) {
144             _log.error(e, e);
145 
146             throw new RemoteException(e.getMessage());
147         }
148     }
149 
150     public static long getOrganizationId(long companyId, java.lang.String name)
151         throws RemoteException {
152         try {
153             long returnValue = OrganizationServiceUtil.getOrganizationId(companyId,
154                     name);
155 
156             return returnValue;
157         }
158         catch (Exception e) {
159             _log.error(e, e);
160 
161             throw new RemoteException(e.getMessage());
162         }
163     }
164 
165     public static com.liferay.portal.model.OrganizationSoap[] getUserOrganizations(
166         long userId) throws RemoteException {
167         try {
168             java.util.List<com.liferay.portal.model.Organization> returnValue = OrganizationServiceUtil.getUserOrganizations(userId);
169 
170             return com.liferay.portal.model.OrganizationSoap.toSoapModels(returnValue);
171         }
172         catch (Exception e) {
173             _log.error(e, e);
174 
175             throw new RemoteException(e.getMessage());
176         }
177     }
178 
179     public static void setGroupOrganizations(long groupId,
180         long[] organizationIds) throws RemoteException {
181         try {
182             OrganizationServiceUtil.setGroupOrganizations(groupId,
183                 organizationIds);
184         }
185         catch (Exception e) {
186             _log.error(e, e);
187 
188             throw new RemoteException(e.getMessage());
189         }
190     }
191 
192     public static void unsetGroupOrganizations(long groupId,
193         long[] organizationIds) throws RemoteException {
194         try {
195             OrganizationServiceUtil.unsetGroupOrganizations(groupId,
196                 organizationIds);
197         }
198         catch (Exception e) {
199             _log.error(e, e);
200 
201             throw new RemoteException(e.getMessage());
202         }
203     }
204 
205     public static void unsetPasswordPolicyOrganizations(long passwordPolicyId,
206         long[] organizationIds) throws RemoteException {
207         try {
208             OrganizationServiceUtil.unsetPasswordPolicyOrganizations(passwordPolicyId,
209                 organizationIds);
210         }
211         catch (Exception e) {
212             _log.error(e, e);
213 
214             throw new RemoteException(e.getMessage());
215         }
216     }
217 
218     public static com.liferay.portal.model.OrganizationSoap updateOrganization(
219         long organizationId, long parentOrganizationId, java.lang.String name,
220         int type, boolean recursable, long regionId, long countryId,
221         int statusId, java.lang.String comments) throws RemoteException {
222         try {
223             com.liferay.portal.model.Organization returnValue = OrganizationServiceUtil.updateOrganization(organizationId,
224                     parentOrganizationId, name, type, recursable, regionId,
225                     countryId, statusId, comments);
226 
227             return com.liferay.portal.model.OrganizationSoap.toSoapModel(returnValue);
228         }
229         catch (Exception e) {
230             _log.error(e, e);
231 
232             throw new RemoteException(e.getMessage());
233         }
234     }
235 
236     private static Log _log = LogFactoryUtil.getLog(OrganizationServiceSoap.class);
237 }