001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.service;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for Company. This utility wraps
024     * {@link com.liferay.portal.service.impl.CompanyLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see CompanyLocalService
032     * @see com.liferay.portal.service.base.CompanyLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.CompanyLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class CompanyLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.CompanyLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
052                    return getService().getIndexableActionableDynamicQuery();
053            }
054    
055            /**
056            * Adds the company to the database. Also notifies the appropriate model listeners.
057            *
058            * @param company the company
059            * @return the company that was added
060            */
061            public static com.liferay.portal.kernel.model.Company addCompany(
062                    com.liferay.portal.kernel.model.Company company) {
063                    return getService().addCompany(company);
064            }
065    
066            /**
067            * Adds a company.
068            *
069            * @param webId the the company's web domain
070            * @param virtualHostname the company's virtual host name
071            * @param mx the company's mail domain
072            * @param system whether the company is the very first company (i.e., the
073            super company)
074            * @param maxUsers the max number of company users (optionally
075            <code>0</code>)
076            * @param active whether the company is active
077            * @return the company
078            */
079            public static com.liferay.portal.kernel.model.Company addCompany(
080                    java.lang.String webId, java.lang.String virtualHostname,
081                    java.lang.String mx, boolean system, int maxUsers, boolean active)
082                    throws com.liferay.portal.kernel.exception.PortalException {
083                    return getService()
084                                       .addCompany(webId, virtualHostname, mx, system, maxUsers,
085                            active);
086            }
087    
088            /**
089            * Returns the company with the web domain.
090            *
091            * The method sets mail domain to the web domain to the default name set in
092            * portal.properties
093            *
094            * @param webId the company's web domain
095            * @return the company with the web domain
096            */
097            public static com.liferay.portal.kernel.model.Company checkCompany(
098                    java.lang.String webId)
099                    throws com.liferay.portal.kernel.exception.PortalException {
100                    return getService().checkCompany(webId);
101            }
102    
103            /**
104            * Returns the company with the web domain and mail domain. If no such
105            * company exits, the method will create a new company.
106            *
107            * The method goes through a series of checks to ensure that the company
108            * contains default users, groups, etc.
109            *
110            * @param webId the company's web domain
111            * @param mx the company's mail domain
112            * @return the company with the web domain and mail domain
113            */
114            public static com.liferay.portal.kernel.model.Company checkCompany(
115                    java.lang.String webId, java.lang.String mx)
116                    throws com.liferay.portal.kernel.exception.PortalException {
117                    return getService().checkCompany(webId, mx);
118            }
119    
120            /**
121            * Creates a new company with the primary key. Does not add the company to the database.
122            *
123            * @param companyId the primary key for the new company
124            * @return the new company
125            */
126            public static com.liferay.portal.kernel.model.Company createCompany(
127                    long companyId) {
128                    return getService().createCompany(companyId);
129            }
130    
131            /**
132            * Deletes the company from the database. Also notifies the appropriate model listeners.
133            *
134            * @param company the company
135            * @return the company that was removed
136            * @throws PortalException
137            */
138            public static com.liferay.portal.kernel.model.Company deleteCompany(
139                    com.liferay.portal.kernel.model.Company company)
140                    throws com.liferay.portal.kernel.exception.PortalException {
141                    return getService().deleteCompany(company);
142            }
143    
144            /**
145            * Deletes the company with the primary key from the database. Also notifies the appropriate model listeners.
146            *
147            * @param companyId the primary key of the company
148            * @return the company that was removed
149            * @throws PortalException if a company with the primary key could not be found
150            */
151            public static com.liferay.portal.kernel.model.Company deleteCompany(
152                    long companyId)
153                    throws com.liferay.portal.kernel.exception.PortalException {
154                    return getService().deleteCompany(companyId);
155            }
156    
157            /**
158            * Deletes the company's logo.
159            *
160            * @param companyId the primary key of the company
161            * @return the deleted logo's company
162            */
163            public static com.liferay.portal.kernel.model.Company deleteLogo(
164                    long companyId)
165                    throws com.liferay.portal.kernel.exception.PortalException {
166                    return getService().deleteLogo(companyId);
167            }
168    
169            public static com.liferay.portal.kernel.model.Company fetchCompany(
170                    long companyId) {
171                    return getService().fetchCompany(companyId);
172            }
173    
174            /**
175            * Returns the company with the primary key.
176            *
177            * @param companyId the primary key of the company
178            * @return the company with the primary key, <code>null</code> if a company
179            with the primary key could not be found
180            */
181            public static com.liferay.portal.kernel.model.Company fetchCompanyById(
182                    long companyId) {
183                    return getService().fetchCompanyById(companyId);
184            }
185    
186            /**
187            * Returns the company with the virtual host name.
188            *
189            * @param virtualHostname the virtual host name
190            * @return the company with the virtual host name, <code>null</code> if a
191            company with the virtual host could not be found
192            */
193            public static com.liferay.portal.kernel.model.Company fetchCompanyByVirtualHost(
194                    java.lang.String virtualHostname) {
195                    return getService().fetchCompanyByVirtualHost(virtualHostname);
196            }
197    
198            /**
199            * Returns the company with the primary key.
200            *
201            * @param companyId the primary key of the company
202            * @return the company
203            * @throws PortalException if a company with the primary key could not be found
204            */
205            public static com.liferay.portal.kernel.model.Company getCompany(
206                    long companyId)
207                    throws com.liferay.portal.kernel.exception.PortalException {
208                    return getService().getCompany(companyId);
209            }
210    
211            /**
212            * Returns the company with the primary key.
213            *
214            * @param companyId the primary key of the company
215            * @return the company with the primary key
216            */
217            public static com.liferay.portal.kernel.model.Company getCompanyById(
218                    long companyId)
219                    throws com.liferay.portal.kernel.exception.PortalException {
220                    return getService().getCompanyById(companyId);
221            }
222    
223            /**
224            * Returns the company with the logo.
225            *
226            * @param logoId the ID of the company's logo
227            * @return the company with the logo
228            */
229            public static com.liferay.portal.kernel.model.Company getCompanyByLogoId(
230                    long logoId) throws com.liferay.portal.kernel.exception.PortalException {
231                    return getService().getCompanyByLogoId(logoId);
232            }
233    
234            /**
235            * Returns the company with the mail domain.
236            *
237            * @param mx the company's mail domain
238            * @return the company with the mail domain
239            */
240            public static com.liferay.portal.kernel.model.Company getCompanyByMx(
241                    java.lang.String mx)
242                    throws com.liferay.portal.kernel.exception.PortalException {
243                    return getService().getCompanyByMx(mx);
244            }
245    
246            /**
247            * Returns the company with the virtual host name.
248            *
249            * @param virtualHostname the company's virtual host name
250            * @return the company with the virtual host name
251            */
252            public static com.liferay.portal.kernel.model.Company getCompanyByVirtualHost(
253                    java.lang.String virtualHostname)
254                    throws com.liferay.portal.kernel.exception.PortalException {
255                    return getService().getCompanyByVirtualHost(virtualHostname);
256            }
257    
258            /**
259            * Returns the company with the web domain.
260            *
261            * @param webId the company's web domain
262            * @return the company with the web domain
263            */
264            public static com.liferay.portal.kernel.model.Company getCompanyByWebId(
265                    java.lang.String webId)
266                    throws com.liferay.portal.kernel.exception.PortalException {
267                    return getService().getCompanyByWebId(webId);
268            }
269    
270            /**
271            * Updates the company in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
272            *
273            * @param company the company
274            * @return the company that was updated
275            */
276            public static com.liferay.portal.kernel.model.Company updateCompany(
277                    com.liferay.portal.kernel.model.Company company) {
278                    return getService().updateCompany(company);
279            }
280    
281            /**
282            * Updates the company.
283            *
284            * @param companyId the primary key of the company
285            * @param virtualHostname the company's virtual host name
286            * @param mx the company's mail domain
287            * @param maxUsers the max number of company users (optionally
288            <code>0</code>)
289            * @param active whether the company is active
290            * @return the company with the primary key
291            */
292            public static com.liferay.portal.kernel.model.Company updateCompany(
293                    long companyId, java.lang.String virtualHostname, java.lang.String mx,
294                    int maxUsers, boolean active)
295                    throws com.liferay.portal.kernel.exception.PortalException {
296                    return getService()
297                                       .updateCompany(companyId, virtualHostname, mx, maxUsers,
298                            active);
299            }
300    
301            /**
302            * Update the company with additional account information.
303            *
304            * @param companyId the primary key of the company
305            * @param virtualHostname the company's virtual host name
306            * @param mx the company's mail domain
307            * @param homeURL the company's home URL (optionally <code>null</code>)
308            * @param logo whether to update the company's logo
309            * @param logoBytes the new logo image data
310            * @param name the company's account name(optionally <code>null</code>)
311            * @param legalName the company's account legal name (optionally
312            <code>null</code>)
313            * @param legalId the company's account legal ID (optionally
314            <code>null</code>)
315            * @param legalType the company's account legal type (optionally
316            <code>null</code>)
317            * @param sicCode the company's account SIC code (optionally
318            <code>null</code>)
319            * @param tickerSymbol the company's account ticker symbol (optionally
320            <code>null</code>)
321            * @param industry the company's account industry (optionally
322            <code>null</code>)
323            * @param type the company's account type (optionally <code>null</code>)
324            * @param size the company's account size (optionally <code>null</code>)
325            * @return the company with the primary key
326            */
327            public static com.liferay.portal.kernel.model.Company updateCompany(
328                    long companyId, java.lang.String virtualHostname, java.lang.String mx,
329                    java.lang.String homeURL, boolean logo, byte[] logoBytes,
330                    java.lang.String name, java.lang.String legalName,
331                    java.lang.String legalId, java.lang.String legalType,
332                    java.lang.String sicCode, java.lang.String tickerSymbol,
333                    java.lang.String industry, java.lang.String type, java.lang.String size)
334                    throws com.liferay.portal.kernel.exception.PortalException {
335                    return getService()
336                                       .updateCompany(companyId, virtualHostname, mx, homeURL,
337                            logo, logoBytes, name, legalName, legalId, legalType, sicCode,
338                            tickerSymbol, industry, type, size);
339            }
340    
341            /**
342            * Update the company with additional account information.
343            *
344            * @param companyId the primary key of the company
345            * @param virtualHostname the company's virtual host name
346            * @param mx the company's mail domain
347            * @param homeURL the company's home URL (optionally <code>null</code>)
348            * @param name the company's account name(optionally <code>null</code>)
349            * @param legalName the company's account legal name (optionally
350            <code>null</code>)
351            * @param legalId the company's account legal ID (optionally
352            <code>null</code>)
353            * @param legalType the company's account legal type (optionally
354            <code>null</code>)
355            * @param sicCode the company's account SIC code (optionally
356            <code>null</code>)
357            * @param tickerSymbol the company's account ticker symbol (optionally
358            <code>null</code>)
359            * @param industry the company's account industry (optionally
360            <code>null</code>)
361            * @param type the company's account type (optionally
362            <code>null</code>)
363            * @param size the company's account size (optionally
364            <code>null</code>)
365            * @return the company with the primary key
366            * @deprecated As of 7.0.0, replaced by {@link #updateCompany(long, String,
367            String, String, boolean, byte[], String, String, String,
368            String, String, String, String, String, String)}
369            */
370            @Deprecated
371            public static com.liferay.portal.kernel.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                    return getService()
380                                       .updateCompany(companyId, virtualHostname, mx, homeURL,
381                            name, legalName, legalId, legalType, sicCode, tickerSymbol,
382                            industry, type, size);
383            }
384    
385            /**
386            * Updates the company's logo.
387            *
388            * @param companyId the primary key of the company
389            * @param bytes the bytes of the company's logo image
390            * @return the company with the primary key
391            */
392            public static com.liferay.portal.kernel.model.Company updateLogo(
393                    long companyId, byte[] bytes)
394                    throws com.liferay.portal.kernel.exception.PortalException {
395                    return getService().updateLogo(companyId, bytes);
396            }
397    
398            /**
399            * Updates the company's logo.
400            *
401            * @param companyId the primary key of the company
402            * @param file the file of the company's logo image
403            * @return the company with the primary key
404            */
405            public static com.liferay.portal.kernel.model.Company updateLogo(
406                    long companyId, java.io.File file)
407                    throws com.liferay.portal.kernel.exception.PortalException {
408                    return getService().updateLogo(companyId, file);
409            }
410    
411            /**
412            * Update the company's logo.
413            *
414            * @param companyId the primary key of the company
415            * @param is the input stream of the company's logo image
416            * @return the company with the primary key
417            */
418            public static com.liferay.portal.kernel.model.Company updateLogo(
419                    long companyId, java.io.InputStream is)
420                    throws com.liferay.portal.kernel.exception.PortalException {
421                    return getService().updateLogo(companyId, is);
422            }
423    
424            /**
425            * @throws PortalException
426            */
427            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
428                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
429                    throws com.liferay.portal.kernel.exception.PortalException {
430                    return getService().deletePersistedModel(persistedModel);
431            }
432    
433            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
434                    java.io.Serializable primaryKeyObj)
435                    throws com.liferay.portal.kernel.exception.PortalException {
436                    return getService().getPersistedModel(primaryKeyObj);
437            }
438    
439            /**
440            * Returns an ordered range of all assets that match the keywords in the
441            * company.
442            *
443            * The method is called in {@link
444            * com.liferay.portal.search.PortalOpenSearchImpl} which is not longer used
445            * by the Search portlet.
446            *
447            * @param companyId the primary key of the company
448            * @param userId the primary key of the user
449            * @param keywords the keywords (space separated),which may occur in assets
450            in the company (optionally <code>null</code>)
451            * @param start the lower bound of the range of assets to return
452            * @param end the upper bound of the range of assets to return (not
453            inclusive)
454            * @return the matching assets in the company
455            */
456            public static com.liferay.portal.kernel.search.Hits search(long companyId,
457                    long userId, java.lang.String keywords, int start, int end) {
458                    return getService().search(companyId, userId, keywords, start, end);
459            }
460    
461            /**
462            * Returns an ordered range of all assets that match the keywords in the
463            * portlet within the company.
464            *
465            * @param companyId the primary key of the company
466            * @param userId the primary key of the user
467            * @param portletId the primary key of the portlet (optionally
468            <code>null</code>)
469            * @param groupId the primary key of the group (optionally <code>0</code>)
470            * @param type the mime type of assets to return(optionally
471            <code>null</code>)
472            * @param keywords the keywords (space separated), which may occur in any
473            assets in the portlet (optionally <code>null</code>)
474            * @param start the lower bound of the range of assets to return
475            * @param end the upper bound of the range of assets to return (not
476            inclusive)
477            * @return the matching assets in the portlet within the company
478            */
479            public static com.liferay.portal.kernel.search.Hits search(long companyId,
480                    long userId, java.lang.String portletId, long groupId,
481                    java.lang.String type, java.lang.String keywords, int start, int end) {
482                    return getService()
483                                       .search(companyId, userId, portletId, groupId, type,
484                            keywords, start, end);
485            }
486    
487            /**
488            * Returns the number of companies.
489            *
490            * @return the number of companies
491            */
492            public static int getCompaniesCount() {
493                    return getService().getCompaniesCount();
494            }
495    
496            /**
497            * Returns the number of companies used by WSRP.
498            *
499            * @param system whether the company is the very first company (i.e., the
500            super company)
501            * @return the number of companies used by WSRP
502            */
503            public static int getCompaniesCount(boolean system) {
504                    return getService().getCompaniesCount(system);
505            }
506    
507            /**
508            * Returns the OSGi service identifier.
509            *
510            * @return the OSGi service identifier
511            */
512            public static java.lang.String getOSGiServiceIdentifier() {
513                    return getService().getOSGiServiceIdentifier();
514            }
515    
516            /**
517            * Performs a dynamic query on the database and returns the matching rows.
518            *
519            * @param dynamicQuery the dynamic query
520            * @return the matching rows
521            */
522            public static <T> java.util.List<T> dynamicQuery(
523                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
524                    return getService().dynamicQuery(dynamicQuery);
525            }
526    
527            /**
528            * Performs a dynamic query on the database and returns a range of the matching rows.
529            *
530            * <p>
531            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
532            * </p>
533            *
534            * @param dynamicQuery the dynamic query
535            * @param start the lower bound of the range of model instances
536            * @param end the upper bound of the range of model instances (not inclusive)
537            * @return the range of matching rows
538            */
539            public static <T> java.util.List<T> dynamicQuery(
540                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
541                    int end) {
542                    return getService().dynamicQuery(dynamicQuery, start, end);
543            }
544    
545            /**
546            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
547            *
548            * <p>
549            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
550            * </p>
551            *
552            * @param dynamicQuery the dynamic query
553            * @param start the lower bound of the range of model instances
554            * @param end the upper bound of the range of model instances (not inclusive)
555            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
556            * @return the ordered range of matching rows
557            */
558            public static <T> java.util.List<T> dynamicQuery(
559                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
560                    int end,
561                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
562                    return getService()
563                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
564            }
565    
566            /**
567            * Returns all the companies.
568            *
569            * @return the companies
570            */
571            public static java.util.List<com.liferay.portal.kernel.model.Company> getCompanies() {
572                    return getService().getCompanies();
573            }
574    
575            /**
576            * Returns all the companies used by WSRP.
577            *
578            * @param system whether the company is the very first company (i.e., the
579            super company)
580            * @return the companies used by WSRP
581            */
582            public static java.util.List<com.liferay.portal.kernel.model.Company> getCompanies(
583                    boolean system) {
584                    return getService().getCompanies(system);
585            }
586    
587            public static java.util.List<com.liferay.portal.kernel.model.Company> getCompanies(
588                    boolean system, int start, int end) {
589                    return getService().getCompanies(system, start, end);
590            }
591    
592            /**
593            * Returns a range of all the companies.
594            *
595            * <p>
596            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CompanyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
597            * </p>
598            *
599            * @param start the lower bound of the range of companies
600            * @param end the upper bound of the range of companies (not inclusive)
601            * @return the range of companies
602            */
603            public static java.util.List<com.liferay.portal.kernel.model.Company> getCompanies(
604                    int start, int end) {
605                    return getService().getCompanies(start, end);
606            }
607    
608            /**
609            * Returns the number of rows matching the dynamic query.
610            *
611            * @param dynamicQuery the dynamic query
612            * @return the number of rows matching the dynamic query
613            */
614            public static long dynamicQueryCount(
615                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
616                    return getService().dynamicQueryCount(dynamicQuery);
617            }
618    
619            /**
620            * Returns the number of rows matching the dynamic query.
621            *
622            * @param dynamicQuery the dynamic query
623            * @param projection the projection to apply to the query
624            * @return the number of rows matching the dynamic query
625            */
626            public static long dynamicQueryCount(
627                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
628                    com.liferay.portal.kernel.dao.orm.Projection projection) {
629                    return getService().dynamicQueryCount(dynamicQuery, projection);
630            }
631    
632            /**
633            * Returns the user's company.
634            *
635            * @param userId the primary key of the user
636            * @return Returns the first company if there is only one company or the
637            user's company if there are more than one company; <code>0</code>
638            otherwise
639            * @throws Exception if a user with the primary key could not be found
640            */
641            public static long getCompanyIdByUserId(long userId)
642                    throws java.lang.Exception {
643                    return getService().getCompanyIdByUserId(userId);
644            }
645    
646            /**
647            * Checks if the company has an encryption key. It will create a key if one
648            * does not exist.
649            *
650            * @param companyId the primary key of the company
651            */
652            public static void checkCompanyKey(long companyId)
653                    throws com.liferay.portal.kernel.exception.PortalException {
654                    getService().checkCompanyKey(companyId);
655            }
656    
657            /**
658            * Removes the values that match the keys of the company's preferences.
659            *
660            * This method is called by {@link
661            * com.liferay.portlet.portalsettings.action.EditLDAPServerAction} remotely
662            * through {@link CompanyService}.
663            *
664            * @param companyId the primary key of the company
665            * @param keys the company's preferences keys to be remove
666            */
667            public static void removePreferences(long companyId, java.lang.String[] keys) {
668                    getService().removePreferences(companyId, keys);
669            }
670    
671            /**
672            * Update the company's display.
673            *
674            * @param companyId the primary key of the company
675            * @param languageId the ID of the company's default user's language
676            * @param timeZoneId the ID of the company's default user's time zone
677            */
678            public static void updateDisplay(long companyId,
679                    java.lang.String languageId, java.lang.String timeZoneId)
680                    throws com.liferay.portal.kernel.exception.PortalException {
681                    getService().updateDisplay(companyId, languageId, timeZoneId);
682            }
683    
684            /**
685            * Updates the company's preferences. The company's default properties are
686            * found in portal.properties.
687            *
688            * @param companyId the primary key of the company
689            * @param properties the company's properties. See {@link UnicodeProperties}
690            */
691            public static void updatePreferences(long companyId,
692                    com.liferay.portal.kernel.util.UnicodeProperties properties)
693                    throws com.liferay.portal.kernel.exception.PortalException {
694                    getService().updatePreferences(companyId, properties);
695            }
696    
697            /**
698            * Updates the company's security properties.
699            *
700            * @param companyId the primary key of the company
701            * @param authType the company's method of authenticating users
702            * @param autoLogin whether to allow users to select the "remember me"
703            feature
704            * @param sendPassword whether to allow users to ask the company to send
705            their password
706            * @param strangers whether to allow strangers to create accounts register
707            themselves in the company
708            * @param strangersWithMx whether to allow strangers to create accounts with
709            email addresses that match the company mail suffix
710            * @param strangersVerify whether to require strangers who create accounts
711            to be verified via email
712            * @param siteLogo whether to allow site administrators to use their own
713            logo instead of the enterprise logo
714            */
715            public static void updateSecurity(long companyId,
716                    java.lang.String authType, boolean autoLogin, boolean sendPassword,
717                    boolean strangers, boolean strangersWithMx, boolean strangersVerify,
718                    boolean siteLogo) {
719                    getService()
720                            .updateSecurity(companyId, authType, autoLogin, sendPassword,
721                            strangers, strangersWithMx, strangersVerify, siteLogo);
722            }
723    
724            public static CompanyLocalService getService() {
725                    if (_service == null) {
726                            _service = (CompanyLocalService)PortalBeanLocatorUtil.locate(CompanyLocalService.class.getName());
727    
728                            ReferenceRegistry.registerReference(CompanyLocalServiceUtil.class,
729                                    "_service");
730                    }
731    
732                    return _service;
733            }
734    
735            private static CompanyLocalService _service;
736    }