001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the company local service. This utility wraps {@link com.liferay.portal.service.impl.CompanyLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see CompanyLocalService
030     * @see com.liferay.portal.service.base.CompanyLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.CompanyLocalServiceImpl
032     * @generated
033     */
034    public class CompanyLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.CompanyLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the company to the database. Also notifies the appropriate model listeners.
043            *
044            * @param company the company
045            * @return the company that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.Company addCompany(
049                    com.liferay.portal.model.Company company)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addCompany(company);
052            }
053    
054            /**
055            * Creates a new company with the primary key. Does not add the company to the database.
056            *
057            * @param companyId the primary key for the new company
058            * @return the new company
059            */
060            public static com.liferay.portal.model.Company createCompany(long companyId) {
061                    return getService().createCompany(companyId);
062            }
063    
064            /**
065            * Deletes the company with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param companyId the primary key of the company
068            * @throws PortalException if a company with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public static void deleteCompany(long companyId)
072                    throws com.liferay.portal.kernel.exception.PortalException,
073                            com.liferay.portal.kernel.exception.SystemException {
074                    getService().deleteCompany(companyId);
075            }
076    
077            /**
078            * Deletes the company from the database. Also notifies the appropriate model listeners.
079            *
080            * @param company the company
081            * @throws SystemException if a system exception occurred
082            */
083            public static void deleteCompany(com.liferay.portal.model.Company company)
084                    throws com.liferay.portal.kernel.exception.SystemException {
085                    getService().deleteCompany(company);
086            }
087    
088            /**
089            * Performs a dynamic query on the database and returns the matching rows.
090            *
091            * @param dynamicQuery the dynamic query
092            * @return the matching rows
093            * @throws SystemException if a system exception occurred
094            */
095            @SuppressWarnings("rawtypes")
096            public static java.util.List dynamicQuery(
097                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
098                    throws com.liferay.portal.kernel.exception.SystemException {
099                    return getService().dynamicQuery(dynamicQuery);
100            }
101    
102            /**
103            * Performs a dynamic query on the database and returns a range of the matching rows.
104            *
105            * <p>
106            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
107            * </p>
108            *
109            * @param dynamicQuery the dynamic query
110            * @param start the lower bound of the range of model instances
111            * @param end the upper bound of the range of model instances (not inclusive)
112            * @return the range of matching rows
113            * @throws SystemException if a system exception occurred
114            */
115            @SuppressWarnings("rawtypes")
116            public static java.util.List dynamicQuery(
117                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
118                    int end) throws com.liferay.portal.kernel.exception.SystemException {
119                    return getService().dynamicQuery(dynamicQuery, start, end);
120            }
121    
122            /**
123            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
124            *
125            * <p>
126            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
127            * </p>
128            *
129            * @param dynamicQuery the dynamic query
130            * @param start the lower bound of the range of model instances
131            * @param end the upper bound of the range of model instances (not inclusive)
132            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
133            * @return the ordered range of matching rows
134            * @throws SystemException if a system exception occurred
135            */
136            @SuppressWarnings("rawtypes")
137            public static java.util.List dynamicQuery(
138                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
139                    int end,
140                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getService()
143                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
144            }
145    
146            /**
147            * Returns the number of rows that match the dynamic query.
148            *
149            * @param dynamicQuery the dynamic query
150            * @return the number of rows that match the dynamic query
151            * @throws SystemException if a system exception occurred
152            */
153            public static long dynamicQueryCount(
154                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
155                    throws com.liferay.portal.kernel.exception.SystemException {
156                    return getService().dynamicQueryCount(dynamicQuery);
157            }
158    
159            /**
160            * Returns the company with the primary key.
161            *
162            * @param companyId the primary key of the company
163            * @return the company
164            * @throws PortalException if a company with the primary key could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            public static com.liferay.portal.model.Company getCompany(long companyId)
168                    throws com.liferay.portal.kernel.exception.PortalException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getService().getCompany(companyId);
171            }
172    
173            public static com.liferay.portal.model.PersistedModel getPersistedModel(
174                    java.io.Serializable primaryKeyObj)
175                    throws com.liferay.portal.kernel.exception.PortalException,
176                            com.liferay.portal.kernel.exception.SystemException {
177                    return getService().getPersistedModel(primaryKeyObj);
178            }
179    
180            /**
181            * Returns a range of all the companies.
182            *
183            * <p>
184            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
185            * </p>
186            *
187            * @param start the lower bound of the range of companies
188            * @param end the upper bound of the range of companies (not inclusive)
189            * @return the range of companies
190            * @throws SystemException if a system exception occurred
191            */
192            public static java.util.List<com.liferay.portal.model.Company> getCompanies(
193                    int start, int end)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getService().getCompanies(start, end);
196            }
197    
198            /**
199            * Returns the number of companies.
200            *
201            * @return the number of companies
202            * @throws SystemException if a system exception occurred
203            */
204            public static int getCompaniesCount()
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getCompaniesCount();
207            }
208    
209            /**
210            * Updates the company in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
211            *
212            * @param company the company
213            * @return the company that was updated
214            * @throws SystemException if a system exception occurred
215            */
216            public static com.liferay.portal.model.Company updateCompany(
217                    com.liferay.portal.model.Company company)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getService().updateCompany(company);
220            }
221    
222            /**
223            * Updates the company in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
224            *
225            * @param company the company
226            * @param merge whether to merge the company with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
227            * @return the company that was updated
228            * @throws SystemException if a system exception occurred
229            */
230            public static com.liferay.portal.model.Company updateCompany(
231                    com.liferay.portal.model.Company company, boolean merge)
232                    throws com.liferay.portal.kernel.exception.SystemException {
233                    return getService().updateCompany(company, merge);
234            }
235    
236            /**
237            * Returns the Spring bean ID for this bean.
238            *
239            * @return the Spring bean ID for this bean
240            */
241            public static java.lang.String getBeanIdentifier() {
242                    return getService().getBeanIdentifier();
243            }
244    
245            /**
246            * Sets the Spring bean ID for this bean.
247            *
248            * @param beanIdentifier the Spring bean ID for this bean
249            */
250            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
251                    getService().setBeanIdentifier(beanIdentifier);
252            }
253    
254            public static com.liferay.portal.model.Company addCompany(
255                    java.lang.String webId, java.lang.String virtualHostname,
256                    java.lang.String mx, java.lang.String shardName, boolean system,
257                    int maxUsers)
258                    throws com.liferay.portal.kernel.exception.PortalException,
259                            com.liferay.portal.kernel.exception.SystemException {
260                    return getService()
261                                       .addCompany(webId, virtualHostname, mx, shardName, system,
262                            maxUsers);
263            }
264    
265            public static com.liferay.portal.model.Company checkCompany(
266                    java.lang.String webId)
267                    throws com.liferay.portal.kernel.exception.PortalException,
268                            com.liferay.portal.kernel.exception.SystemException {
269                    return getService().checkCompany(webId);
270            }
271    
272            public static com.liferay.portal.model.Company checkCompany(
273                    java.lang.String webId, java.lang.String mx, java.lang.String shardName)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException {
276                    return getService().checkCompany(webId, mx, shardName);
277            }
278    
279            public static void checkCompanyKey(long companyId)
280                    throws com.liferay.portal.kernel.exception.PortalException,
281                            com.liferay.portal.kernel.exception.SystemException {
282                    getService().checkCompanyKey(companyId);
283            }
284    
285            public static void deleteLogo(long companyId)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    getService().deleteLogo(companyId);
289            }
290    
291            public static java.util.List<com.liferay.portal.model.Company> getCompanies()
292                    throws com.liferay.portal.kernel.exception.SystemException {
293                    return getService().getCompanies();
294            }
295    
296            public static java.util.List<com.liferay.portal.model.Company> getCompanies(
297                    boolean system)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getService().getCompanies(system);
300            }
301    
302            public static int getCompaniesCount(boolean system)
303                    throws com.liferay.portal.kernel.exception.SystemException {
304                    return getService().getCompaniesCount(system);
305            }
306    
307            public static com.liferay.portal.model.Company getCompanyById(
308                    long companyId)
309                    throws com.liferay.portal.kernel.exception.PortalException,
310                            com.liferay.portal.kernel.exception.SystemException {
311                    return getService().getCompanyById(companyId);
312            }
313    
314            public static com.liferay.portal.model.Company getCompanyByLogoId(
315                    long logoId)
316                    throws com.liferay.portal.kernel.exception.PortalException,
317                            com.liferay.portal.kernel.exception.SystemException {
318                    return getService().getCompanyByLogoId(logoId);
319            }
320    
321            public static com.liferay.portal.model.Company getCompanyByMx(
322                    java.lang.String mx)
323                    throws com.liferay.portal.kernel.exception.PortalException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    return getService().getCompanyByMx(mx);
326            }
327    
328            public static com.liferay.portal.model.Company getCompanyByVirtualHost(
329                    java.lang.String virtualHostname)
330                    throws com.liferay.portal.kernel.exception.PortalException,
331                            com.liferay.portal.kernel.exception.SystemException {
332                    return getService().getCompanyByVirtualHost(virtualHostname);
333            }
334    
335            public static com.liferay.portal.model.Company getCompanyByWebId(
336                    java.lang.String webId)
337                    throws com.liferay.portal.kernel.exception.PortalException,
338                            com.liferay.portal.kernel.exception.SystemException {
339                    return getService().getCompanyByWebId(webId);
340            }
341    
342            public static void removePreferences(long companyId, java.lang.String[] keys)
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    getService().removePreferences(companyId, keys);
345            }
346    
347            public static com.liferay.portal.kernel.search.Hits search(long companyId,
348                    long userId, java.lang.String keywords, int start, int end)
349                    throws com.liferay.portal.kernel.exception.SystemException {
350                    return getService().search(companyId, userId, keywords, start, end);
351            }
352    
353            public static com.liferay.portal.kernel.search.Hits search(long companyId,
354                    long userId, java.lang.String portletId, long groupId,
355                    java.lang.String type, java.lang.String keywords, int start, int end)
356                    throws com.liferay.portal.kernel.exception.SystemException {
357                    return getService()
358                                       .search(companyId, userId, portletId, groupId, type,
359                            keywords, start, end);
360            }
361    
362            public static com.liferay.portal.model.Company updateCompany(
363                    long companyId, java.lang.String virtualHostname, java.lang.String mx,
364                    int maxUsers)
365                    throws com.liferay.portal.kernel.exception.PortalException,
366                            com.liferay.portal.kernel.exception.SystemException {
367                    return getService()
368                                       .updateCompany(companyId, virtualHostname, mx, maxUsers);
369            }
370    
371            public static com.liferay.portal.model.Company updateCompany(
372                    long companyId, java.lang.String virtualHostname, java.lang.String mx,
373                    java.lang.String homeURL, java.lang.String name,
374                    java.lang.String legalName, java.lang.String legalId,
375                    java.lang.String legalType, java.lang.String sicCode,
376                    java.lang.String tickerSymbol, java.lang.String industry,
377                    java.lang.String type, java.lang.String size)
378                    throws com.liferay.portal.kernel.exception.PortalException,
379                            com.liferay.portal.kernel.exception.SystemException {
380                    return getService()
381                                       .updateCompany(companyId, virtualHostname, mx, homeURL,
382                            name, legalName, legalId, legalType, sicCode, tickerSymbol,
383                            industry, type, size);
384            }
385    
386            public static void updateDisplay(long companyId,
387                    java.lang.String languageId, java.lang.String timeZoneId)
388                    throws com.liferay.portal.kernel.exception.PortalException,
389                            com.liferay.portal.kernel.exception.SystemException {
390                    getService().updateDisplay(companyId, languageId, timeZoneId);
391            }
392    
393            public static void updateLogo(long companyId, byte[] bytes)
394                    throws com.liferay.portal.kernel.exception.PortalException,
395                            com.liferay.portal.kernel.exception.SystemException {
396                    getService().updateLogo(companyId, bytes);
397            }
398    
399            public static void updateLogo(long companyId, java.io.File file)
400                    throws com.liferay.portal.kernel.exception.PortalException,
401                            com.liferay.portal.kernel.exception.SystemException {
402                    getService().updateLogo(companyId, file);
403            }
404    
405            public static void updateLogo(long companyId, java.io.InputStream is)
406                    throws com.liferay.portal.kernel.exception.PortalException,
407                            com.liferay.portal.kernel.exception.SystemException {
408                    getService().updateLogo(companyId, is);
409            }
410    
411            public static void updatePreferences(long companyId,
412                    com.liferay.portal.kernel.util.UnicodeProperties properties)
413                    throws com.liferay.portal.kernel.exception.SystemException {
414                    getService().updatePreferences(companyId, properties);
415            }
416    
417            public static void updateSecurity(long companyId,
418                    java.lang.String authType, boolean autoLogin, boolean sendPassword,
419                    boolean strangers, boolean strangersWithMx, boolean strangersVerify,
420                    boolean communityLogo)
421                    throws com.liferay.portal.kernel.exception.SystemException {
422                    getService()
423                            .updateSecurity(companyId, authType, autoLogin, sendPassword,
424                            strangers, strangersWithMx, strangersVerify, communityLogo);
425            }
426    
427            public static CompanyLocalService getService() {
428                    if (_service == null) {
429                            _service = (CompanyLocalService)PortalBeanLocatorUtil.locate(CompanyLocalService.class.getName());
430    
431                            ReferenceRegistry.registerReference(CompanyLocalServiceUtil.class,
432                                    "_service");
433                            MethodCache.remove(CompanyLocalService.class);
434                    }
435    
436                    return _service;
437            }
438    
439            public void setService(CompanyLocalService service) {
440                    MethodCache.remove(CompanyLocalService.class);
441    
442                    _service = service;
443    
444                    ReferenceRegistry.registerReference(CompanyLocalServiceUtil.class,
445                            "_service");
446                    MethodCache.remove(CompanyLocalService.class);
447            }
448    
449            private static CompanyLocalService _service;
450    }