001    /**
002     * Copyright (c) 2000-2012 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.portlet.journal.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 journal structure local service. This utility wraps {@link com.liferay.portlet.journal.service.impl.JournalStructureLocalServiceImpl} 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 JournalStructureLocalService
030     * @see com.liferay.portlet.journal.service.base.JournalStructureLocalServiceBaseImpl
031     * @see com.liferay.portlet.journal.service.impl.JournalStructureLocalServiceImpl
032     * @generated
033     */
034    public class JournalStructureLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.journal.service.impl.JournalStructureLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the journal structure to the database. Also notifies the appropriate model listeners.
043            *
044            * @param journalStructure the journal structure
045            * @return the journal structure that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.journal.model.JournalStructure addJournalStructure(
049                    com.liferay.portlet.journal.model.JournalStructure journalStructure)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addJournalStructure(journalStructure);
052            }
053    
054            /**
055            * Creates a new journal structure with the primary key. Does not add the journal structure to the database.
056            *
057            * @param id the primary key for the new journal structure
058            * @return the new journal structure
059            */
060            public static com.liferay.portlet.journal.model.JournalStructure createJournalStructure(
061                    long id) {
062                    return getService().createJournalStructure(id);
063            }
064    
065            /**
066            * Deletes the journal structure with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param id the primary key of the journal structure
069            * @throws PortalException if a journal structure with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteJournalStructure(long id)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteJournalStructure(id);
076            }
077    
078            /**
079            * Deletes the journal structure from the database. Also notifies the appropriate model listeners.
080            *
081            * @param journalStructure the journal structure
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteJournalStructure(
085                    com.liferay.portlet.journal.model.JournalStructure journalStructure)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteJournalStructure(journalStructure);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            public static com.liferay.portlet.journal.model.JournalStructure fetchJournalStructure(
162                    long id) throws com.liferay.portal.kernel.exception.SystemException {
163                    return getService().fetchJournalStructure(id);
164            }
165    
166            /**
167            * Returns the journal structure with the primary key.
168            *
169            * @param id the primary key of the journal structure
170            * @return the journal structure
171            * @throws PortalException if a journal structure with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portlet.journal.model.JournalStructure getJournalStructure(
175                    long id)
176                    throws com.liferay.portal.kernel.exception.PortalException,
177                            com.liferay.portal.kernel.exception.SystemException {
178                    return getService().getJournalStructure(id);
179            }
180    
181            public static com.liferay.portal.model.PersistedModel getPersistedModel(
182                    java.io.Serializable primaryKeyObj)
183                    throws com.liferay.portal.kernel.exception.PortalException,
184                            com.liferay.portal.kernel.exception.SystemException {
185                    return getService().getPersistedModel(primaryKeyObj);
186            }
187    
188            /**
189            * Returns the journal structure with the UUID in the group.
190            *
191            * @param uuid the UUID of journal structure
192            * @param groupId the group id of the journal structure
193            * @return the journal structure
194            * @throws PortalException if a journal structure with the UUID in the group could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public static com.liferay.portlet.journal.model.JournalStructure getJournalStructureByUuidAndGroupId(
198                    java.lang.String uuid, long groupId)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    return getService().getJournalStructureByUuidAndGroupId(uuid, groupId);
202            }
203    
204            /**
205            * Returns a range of all the journal structures.
206            *
207            * <p>
208            * 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.
209            * </p>
210            *
211            * @param start the lower bound of the range of journal structures
212            * @param end the upper bound of the range of journal structures (not inclusive)
213            * @return the range of journal structures
214            * @throws SystemException if a system exception occurred
215            */
216            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> getJournalStructures(
217                    int start, int end)
218                    throws com.liferay.portal.kernel.exception.SystemException {
219                    return getService().getJournalStructures(start, end);
220            }
221    
222            /**
223            * Returns the number of journal structures.
224            *
225            * @return the number of journal structures
226            * @throws SystemException if a system exception occurred
227            */
228            public static int getJournalStructuresCount()
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().getJournalStructuresCount();
231            }
232    
233            /**
234            * Updates the journal structure in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param journalStructure the journal structure
237            * @return the journal structure that was updated
238            * @throws SystemException if a system exception occurred
239            */
240            public static com.liferay.portlet.journal.model.JournalStructure updateJournalStructure(
241                    com.liferay.portlet.journal.model.JournalStructure journalStructure)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService().updateJournalStructure(journalStructure);
244            }
245    
246            /**
247            * Updates the journal structure in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
248            *
249            * @param journalStructure the journal structure
250            * @param merge whether to merge the journal structure 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.
251            * @return the journal structure that was updated
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portlet.journal.model.JournalStructure updateJournalStructure(
255                    com.liferay.portlet.journal.model.JournalStructure journalStructure,
256                    boolean merge)
257                    throws com.liferay.portal.kernel.exception.SystemException {
258                    return getService().updateJournalStructure(journalStructure, merge);
259            }
260    
261            /**
262            * Returns the Spring bean ID for this bean.
263            *
264            * @return the Spring bean ID for this bean
265            */
266            public static java.lang.String getBeanIdentifier() {
267                    return getService().getBeanIdentifier();
268            }
269    
270            /**
271            * Sets the Spring bean ID for this bean.
272            *
273            * @param beanIdentifier the Spring bean ID for this bean
274            */
275            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
276                    getService().setBeanIdentifier(beanIdentifier);
277            }
278    
279            public static com.liferay.portlet.journal.model.JournalStructure addStructure(
280                    long userId, long groupId, java.lang.String structureId,
281                    boolean autoStructureId, java.lang.String parentStructureId,
282                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
283                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
284                    java.lang.String xsd,
285                    com.liferay.portal.service.ServiceContext serviceContext)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    return getService()
289                                       .addStructure(userId, groupId, structureId, autoStructureId,
290                            parentStructureId, nameMap, descriptionMap, xsd, serviceContext);
291            }
292    
293            public static void addStructureResources(
294                    com.liferay.portlet.journal.model.JournalStructure structure,
295                    boolean addGroupPermissions, boolean addGuestPermissions)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    getService()
299                            .addStructureResources(structure, addGroupPermissions,
300                            addGuestPermissions);
301            }
302    
303            public static void addStructureResources(
304                    com.liferay.portlet.journal.model.JournalStructure structure,
305                    java.lang.String[] groupPermissions, java.lang.String[] guestPermissions)
306                    throws com.liferay.portal.kernel.exception.PortalException,
307                            com.liferay.portal.kernel.exception.SystemException {
308                    getService()
309                            .addStructureResources(structure, groupPermissions, guestPermissions);
310            }
311    
312            public static void addStructureResources(long groupId,
313                    java.lang.String structureId, boolean addGroupPermissions,
314                    boolean addGuestPermissions)
315                    throws com.liferay.portal.kernel.exception.PortalException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    getService()
318                            .addStructureResources(groupId, structureId, addGroupPermissions,
319                            addGuestPermissions);
320            }
321    
322            public static void addStructureResources(long groupId,
323                    java.lang.String structureId, java.lang.String[] groupPermissions,
324                    java.lang.String[] guestPermissions)
325                    throws com.liferay.portal.kernel.exception.PortalException,
326                            com.liferay.portal.kernel.exception.SystemException {
327                    getService()
328                            .addStructureResources(groupId, structureId, groupPermissions,
329                            guestPermissions);
330            }
331    
332            public static void checkNewLine(long groupId, java.lang.String structureId)
333                    throws com.liferay.portal.kernel.exception.PortalException,
334                            com.liferay.portal.kernel.exception.SystemException {
335                    getService().checkNewLine(groupId, structureId);
336            }
337    
338            public static com.liferay.portlet.journal.model.JournalStructure copyStructure(
339                    long userId, long groupId, java.lang.String oldStructureId,
340                    java.lang.String newStructureId, boolean autoStructureId)
341                    throws com.liferay.portal.kernel.exception.PortalException,
342                            com.liferay.portal.kernel.exception.SystemException {
343                    return getService()
344                                       .copyStructure(userId, groupId, oldStructureId,
345                            newStructureId, autoStructureId);
346            }
347    
348            public static void deleteStructure(
349                    com.liferay.portlet.journal.model.JournalStructure structure)
350                    throws com.liferay.portal.kernel.exception.PortalException,
351                            com.liferay.portal.kernel.exception.SystemException {
352                    getService().deleteStructure(structure);
353            }
354    
355            public static void deleteStructure(long groupId,
356                    java.lang.String structureId)
357                    throws com.liferay.portal.kernel.exception.PortalException,
358                            com.liferay.portal.kernel.exception.SystemException {
359                    getService().deleteStructure(groupId, structureId);
360            }
361    
362            public static void deleteStructures(long groupId)
363                    throws com.liferay.portal.kernel.exception.PortalException,
364                            com.liferay.portal.kernel.exception.SystemException {
365                    getService().deleteStructures(groupId);
366            }
367    
368            public static com.liferay.portlet.journal.model.JournalStructure getStructure(
369                    long id)
370                    throws com.liferay.portal.kernel.exception.PortalException,
371                            com.liferay.portal.kernel.exception.SystemException {
372                    return getService().getStructure(id);
373            }
374    
375            public static com.liferay.portlet.journal.model.JournalStructure getStructure(
376                    long groupId, java.lang.String structureId)
377                    throws com.liferay.portal.kernel.exception.PortalException,
378                            com.liferay.portal.kernel.exception.SystemException {
379                    return getService().getStructure(groupId, structureId);
380            }
381    
382            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> getStructures()
383                    throws com.liferay.portal.kernel.exception.SystemException {
384                    return getService().getStructures();
385            }
386    
387            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> getStructures(
388                    long groupId)
389                    throws com.liferay.portal.kernel.exception.SystemException {
390                    return getService().getStructures(groupId);
391            }
392    
393            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> getStructures(
394                    long groupId, int start, int end)
395                    throws com.liferay.portal.kernel.exception.SystemException {
396                    return getService().getStructures(groupId, start, end);
397            }
398    
399            public static int getStructuresCount(long groupId)
400                    throws com.liferay.portal.kernel.exception.SystemException {
401                    return getService().getStructuresCount(groupId);
402            }
403    
404            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> search(
405                    long companyId, long[] groupIds, java.lang.String keywords, int start,
406                    int end, com.liferay.portal.kernel.util.OrderByComparator obc)
407                    throws com.liferay.portal.kernel.exception.SystemException {
408                    return getService()
409                                       .search(companyId, groupIds, keywords, start, end, obc);
410            }
411    
412            public static java.util.List<com.liferay.portlet.journal.model.JournalStructure> search(
413                    long companyId, long[] groupIds, java.lang.String structureId,
414                    java.lang.String name, java.lang.String description,
415                    boolean andOperator, int start, int end,
416                    com.liferay.portal.kernel.util.OrderByComparator obc)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getService()
419                                       .search(companyId, groupIds, structureId, name, description,
420                            andOperator, start, end, obc);
421            }
422    
423            public static int searchCount(long companyId, long[] groupIds,
424                    java.lang.String keywords)
425                    throws com.liferay.portal.kernel.exception.SystemException {
426                    return getService().searchCount(companyId, groupIds, keywords);
427            }
428    
429            public static int searchCount(long companyId, long[] groupIds,
430                    java.lang.String structureId, java.lang.String name,
431                    java.lang.String description, boolean andOperator)
432                    throws com.liferay.portal.kernel.exception.SystemException {
433                    return getService()
434                                       .searchCount(companyId, groupIds, structureId, name,
435                            description, andOperator);
436            }
437    
438            public static com.liferay.portlet.journal.model.JournalStructure updateStructure(
439                    long groupId, java.lang.String structureId,
440                    java.lang.String parentStructureId,
441                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
442                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
443                    java.lang.String xsd,
444                    com.liferay.portal.service.ServiceContext serviceContext)
445                    throws com.liferay.portal.kernel.exception.PortalException,
446                            com.liferay.portal.kernel.exception.SystemException {
447                    return getService()
448                                       .updateStructure(groupId, structureId, parentStructureId,
449                            nameMap, descriptionMap, xsd, serviceContext);
450            }
451    
452            public static JournalStructureLocalService getService() {
453                    if (_service == null) {
454                            _service = (JournalStructureLocalService)PortalBeanLocatorUtil.locate(JournalStructureLocalService.class.getName());
455    
456                            ReferenceRegistry.registerReference(JournalStructureLocalServiceUtil.class,
457                                    "_service");
458                            MethodCache.remove(JournalStructureLocalService.class);
459                    }
460    
461                    return _service;
462            }
463    
464            public void setService(JournalStructureLocalService service) {
465                    MethodCache.remove(JournalStructureLocalService.class);
466    
467                    _service = service;
468    
469                    ReferenceRegistry.registerReference(JournalStructureLocalServiceUtil.class,
470                            "_service");
471                    MethodCache.remove(JournalStructureLocalService.class);
472            }
473    
474            private static JournalStructureLocalService _service;
475    }