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 workflow definition link local service. This utility wraps {@link com.liferay.portal.service.impl.WorkflowDefinitionLinkLocalServiceImpl} 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 WorkflowDefinitionLinkLocalService
030     * @see com.liferay.portal.service.base.WorkflowDefinitionLinkLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.WorkflowDefinitionLinkLocalServiceImpl
032     * @generated
033     */
034    public class WorkflowDefinitionLinkLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.WorkflowDefinitionLinkLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the workflow definition link to the database. Also notifies the appropriate model listeners.
043            *
044            * @param workflowDefinitionLink the workflow definition link
045            * @return the workflow definition link that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.WorkflowDefinitionLink addWorkflowDefinitionLink(
049                    com.liferay.portal.model.WorkflowDefinitionLink workflowDefinitionLink)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addWorkflowDefinitionLink(workflowDefinitionLink);
052            }
053    
054            /**
055            * Creates a new workflow definition link with the primary key. Does not add the workflow definition link to the database.
056            *
057            * @param workflowDefinitionLinkId the primary key for the new workflow definition link
058            * @return the new workflow definition link
059            */
060            public static com.liferay.portal.model.WorkflowDefinitionLink createWorkflowDefinitionLink(
061                    long workflowDefinitionLinkId) {
062                    return getService()
063                                       .createWorkflowDefinitionLink(workflowDefinitionLinkId);
064            }
065    
066            /**
067            * Deletes the workflow definition link with the primary key from the database. Also notifies the appropriate model listeners.
068            *
069            * @param workflowDefinitionLinkId the primary key of the workflow definition link
070            * @throws PortalException if a workflow definition link with the primary key could not be found
071            * @throws SystemException if a system exception occurred
072            */
073            public static void deleteWorkflowDefinitionLink(
074                    long workflowDefinitionLinkId)
075                    throws com.liferay.portal.kernel.exception.PortalException,
076                            com.liferay.portal.kernel.exception.SystemException {
077                    getService().deleteWorkflowDefinitionLink(workflowDefinitionLinkId);
078            }
079    
080            /**
081            * Deletes the workflow definition link from the database. Also notifies the appropriate model listeners.
082            *
083            * @param workflowDefinitionLink the workflow definition link
084            * @throws SystemException if a system exception occurred
085            */
086            public static void deleteWorkflowDefinitionLink(
087                    com.liferay.portal.model.WorkflowDefinitionLink workflowDefinitionLink)
088                    throws com.liferay.portal.kernel.exception.SystemException {
089                    getService().deleteWorkflowDefinitionLink(workflowDefinitionLink);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * 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.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * 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.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            /**
164            * Returns the workflow definition link with the primary key.
165            *
166            * @param workflowDefinitionLinkId the primary key of the workflow definition link
167            * @return the workflow definition link
168            * @throws PortalException if a workflow definition link with the primary key could not be found
169            * @throws SystemException if a system exception occurred
170            */
171            public static com.liferay.portal.model.WorkflowDefinitionLink getWorkflowDefinitionLink(
172                    long workflowDefinitionLinkId)
173                    throws com.liferay.portal.kernel.exception.PortalException,
174                            com.liferay.portal.kernel.exception.SystemException {
175                    return getService().getWorkflowDefinitionLink(workflowDefinitionLinkId);
176            }
177    
178            public static com.liferay.portal.model.PersistedModel getPersistedModel(
179                    java.io.Serializable primaryKeyObj)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getService().getPersistedModel(primaryKeyObj);
183            }
184    
185            /**
186            * Returns a range of all the workflow definition links.
187            *
188            * <p>
189            * 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.
190            * </p>
191            *
192            * @param start the lower bound of the range of workflow definition links
193            * @param end the upper bound of the range of workflow definition links (not inclusive)
194            * @return the range of workflow definition links
195            * @throws SystemException if a system exception occurred
196            */
197            public static java.util.List<com.liferay.portal.model.WorkflowDefinitionLink> getWorkflowDefinitionLinks(
198                    int start, int end)
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getService().getWorkflowDefinitionLinks(start, end);
201            }
202    
203            /**
204            * Returns the number of workflow definition links.
205            *
206            * @return the number of workflow definition links
207            * @throws SystemException if a system exception occurred
208            */
209            public static int getWorkflowDefinitionLinksCount()
210                    throws com.liferay.portal.kernel.exception.SystemException {
211                    return getService().getWorkflowDefinitionLinksCount();
212            }
213    
214            /**
215            * Updates the workflow definition link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
216            *
217            * @param workflowDefinitionLink the workflow definition link
218            * @return the workflow definition link that was updated
219            * @throws SystemException if a system exception occurred
220            */
221            public static com.liferay.portal.model.WorkflowDefinitionLink updateWorkflowDefinitionLink(
222                    com.liferay.portal.model.WorkflowDefinitionLink workflowDefinitionLink)
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return getService().updateWorkflowDefinitionLink(workflowDefinitionLink);
225            }
226    
227            /**
228            * Updates the workflow definition link in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
229            *
230            * @param workflowDefinitionLink the workflow definition link
231            * @param merge whether to merge the workflow definition link 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.
232            * @return the workflow definition link that was updated
233            * @throws SystemException if a system exception occurred
234            */
235            public static com.liferay.portal.model.WorkflowDefinitionLink updateWorkflowDefinitionLink(
236                    com.liferay.portal.model.WorkflowDefinitionLink workflowDefinitionLink,
237                    boolean merge)
238                    throws com.liferay.portal.kernel.exception.SystemException {
239                    return getService()
240                                       .updateWorkflowDefinitionLink(workflowDefinitionLink, merge);
241            }
242    
243            /**
244            * Returns the Spring bean ID for this bean.
245            *
246            * @return the Spring bean ID for this bean
247            */
248            public static java.lang.String getBeanIdentifier() {
249                    return getService().getBeanIdentifier();
250            }
251    
252            /**
253            * Sets the Spring bean ID for this bean.
254            *
255            * @param beanIdentifier the Spring bean ID for this bean
256            */
257            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
258                    getService().setBeanIdentifier(beanIdentifier);
259            }
260    
261            public static com.liferay.portal.model.WorkflowDefinitionLink addWorkflowDefinitionLink(
262                    long userId, long companyId, long groupId, java.lang.String className,
263                    java.lang.String workflowDefinitionName, int workflowDefinitionVersion)
264                    throws com.liferay.portal.kernel.exception.PortalException,
265                            com.liferay.portal.kernel.exception.SystemException {
266                    return getService()
267                                       .addWorkflowDefinitionLink(userId, companyId, groupId,
268                            className, workflowDefinitionName, workflowDefinitionVersion);
269            }
270    
271            public static void deleteWorkflowDefinitionLink(long companyId,
272                    long groupId, java.lang.String className)
273                    throws com.liferay.portal.kernel.exception.PortalException,
274                            com.liferay.portal.kernel.exception.SystemException {
275                    getService().deleteWorkflowDefinitionLink(companyId, groupId, className);
276            }
277    
278            public static com.liferay.portal.model.WorkflowDefinitionLink getDefaultWorkflowDefinitionLink(
279                    long companyId, java.lang.String className)
280                    throws com.liferay.portal.kernel.exception.PortalException,
281                            com.liferay.portal.kernel.exception.SystemException {
282                    return getService()
283                                       .getDefaultWorkflowDefinitionLink(companyId, className);
284            }
285    
286            public static com.liferay.portal.model.WorkflowDefinitionLink getWorkflowDefinitionLink(
287                    long companyId, long groupId, java.lang.String className)
288                    throws com.liferay.portal.kernel.exception.PortalException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    return getService()
291                                       .getWorkflowDefinitionLink(companyId, groupId, className);
292            }
293    
294            public static com.liferay.portal.model.WorkflowDefinitionLink getWorkflowDefinitionLink(
295                    long companyId, long groupId, java.lang.String className, boolean strict)
296                    throws com.liferay.portal.kernel.exception.PortalException,
297                            com.liferay.portal.kernel.exception.SystemException {
298                    return getService()
299                                       .getWorkflowDefinitionLink(companyId, groupId, className,
300                            strict);
301            }
302    
303            public static int getWorkflowDefinitionLinksCount(long companyId,
304                    java.lang.String workflowDefinitionName, int workflowDefinitionVersion)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    return getService()
307                                       .getWorkflowDefinitionLinksCount(companyId,
308                            workflowDefinitionName, workflowDefinitionVersion);
309            }
310    
311            public static boolean hasWorkflowDefinitionLink(long companyId,
312                    long groupId, java.lang.String className)
313                    throws com.liferay.portal.kernel.exception.PortalException,
314                            com.liferay.portal.kernel.exception.SystemException {
315                    return getService()
316                                       .hasWorkflowDefinitionLink(companyId, groupId, className);
317            }
318    
319            public static com.liferay.portal.model.WorkflowDefinitionLink updateWorkflowDefinitionLink(
320                    long userId, long companyId, long groupId, java.lang.String className,
321                    java.lang.String workflowDefinitionName, int workflowDefinitionVersion)
322                    throws com.liferay.portal.kernel.exception.PortalException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    return getService()
325                                       .updateWorkflowDefinitionLink(userId, companyId, groupId,
326                            className, workflowDefinitionName, workflowDefinitionVersion);
327            }
328    
329            public static WorkflowDefinitionLinkLocalService getService() {
330                    if (_service == null) {
331                            _service = (WorkflowDefinitionLinkLocalService)PortalBeanLocatorUtil.locate(WorkflowDefinitionLinkLocalService.class.getName());
332    
333                            ReferenceRegistry.registerReference(WorkflowDefinitionLinkLocalServiceUtil.class,
334                                    "_service");
335                            MethodCache.remove(WorkflowDefinitionLinkLocalService.class);
336                    }
337    
338                    return _service;
339            }
340    
341            public void setService(WorkflowDefinitionLinkLocalService service) {
342                    MethodCache.remove(WorkflowDefinitionLinkLocalService.class);
343    
344                    _service = service;
345    
346                    ReferenceRegistry.registerReference(WorkflowDefinitionLinkLocalServiceUtil.class,
347                            "_service");
348                    MethodCache.remove(WorkflowDefinitionLinkLocalService.class);
349            }
350    
351            private static WorkflowDefinitionLinkLocalService _service;
352    }