1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.tags.service.base;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.bean.InitializingBean;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  
30  import com.liferay.portlet.tags.model.TagsSource;
31  import com.liferay.portlet.tags.service.TagsAssetLocalService;
32  import com.liferay.portlet.tags.service.TagsAssetLocalServiceFactory;
33  import com.liferay.portlet.tags.service.TagsAssetService;
34  import com.liferay.portlet.tags.service.TagsAssetServiceFactory;
35  import com.liferay.portlet.tags.service.TagsEntryLocalService;
36  import com.liferay.portlet.tags.service.TagsEntryLocalServiceFactory;
37  import com.liferay.portlet.tags.service.TagsEntryService;
38  import com.liferay.portlet.tags.service.TagsEntryServiceFactory;
39  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
40  import com.liferay.portlet.tags.service.TagsPropertyLocalServiceFactory;
41  import com.liferay.portlet.tags.service.TagsPropertyService;
42  import com.liferay.portlet.tags.service.TagsPropertyServiceFactory;
43  import com.liferay.portlet.tags.service.TagsSourceLocalService;
44  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
45  import com.liferay.portlet.tags.service.persistence.TagsAssetFinderUtil;
46  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
47  import com.liferay.portlet.tags.service.persistence.TagsAssetUtil;
48  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
49  import com.liferay.portlet.tags.service.persistence.TagsEntryFinderUtil;
50  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
51  import com.liferay.portlet.tags.service.persistence.TagsEntryUtil;
52  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
53  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinderUtil;
54  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
55  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinderUtil;
56  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
57  import com.liferay.portlet.tags.service.persistence.TagsPropertyUtil;
58  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
59  import com.liferay.portlet.tags.service.persistence.TagsSourceUtil;
60  
61  import java.util.List;
62  
63  /**
64   * <a href="TagsSourceLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
65   *
66   * @author Brian Wing Shun Chan
67   *
68   */
69  public abstract class TagsSourceLocalServiceBaseImpl
70      implements TagsSourceLocalService, InitializingBean {
71      public TagsSource addTagsSource(TagsSource tagsSource)
72          throws SystemException {
73          tagsSource.setNew(true);
74  
75          return tagsSourcePersistence.update(tagsSource, false);
76      }
77  
78      public void deleteTagsSource(long sourceId)
79          throws PortalException, SystemException {
80          tagsSourcePersistence.remove(sourceId);
81      }
82  
83      public void deleteTagsSource(TagsSource tagsSource)
84          throws SystemException {
85          tagsSourcePersistence.remove(tagsSource);
86      }
87  
88      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
89          throws SystemException {
90          return tagsSourcePersistence.findWithDynamicQuery(dynamicQuery);
91      }
92  
93      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
94          int end) throws SystemException {
95          return tagsSourcePersistence.findWithDynamicQuery(dynamicQuery, start,
96              end);
97      }
98  
99      public TagsSource getTagsSource(long sourceId)
100         throws PortalException, SystemException {
101         return tagsSourcePersistence.findByPrimaryKey(sourceId);
102     }
103 
104     public TagsSource updateTagsSource(TagsSource tagsSource)
105         throws SystemException {
106         tagsSource.setNew(false);
107 
108         return tagsSourcePersistence.update(tagsSource, true);
109     }
110 
111     public TagsAssetLocalService getTagsAssetLocalService() {
112         return tagsAssetLocalService;
113     }
114 
115     public void setTagsAssetLocalService(
116         TagsAssetLocalService tagsAssetLocalService) {
117         this.tagsAssetLocalService = tagsAssetLocalService;
118     }
119 
120     public TagsAssetService getTagsAssetService() {
121         return tagsAssetService;
122     }
123 
124     public void setTagsAssetService(TagsAssetService tagsAssetService) {
125         this.tagsAssetService = tagsAssetService;
126     }
127 
128     public TagsAssetPersistence getTagsAssetPersistence() {
129         return tagsAssetPersistence;
130     }
131 
132     public void setTagsAssetPersistence(
133         TagsAssetPersistence tagsAssetPersistence) {
134         this.tagsAssetPersistence = tagsAssetPersistence;
135     }
136 
137     public TagsAssetFinder getTagsAssetFinder() {
138         return tagsAssetFinder;
139     }
140 
141     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
142         this.tagsAssetFinder = tagsAssetFinder;
143     }
144 
145     public TagsEntryLocalService getTagsEntryLocalService() {
146         return tagsEntryLocalService;
147     }
148 
149     public void setTagsEntryLocalService(
150         TagsEntryLocalService tagsEntryLocalService) {
151         this.tagsEntryLocalService = tagsEntryLocalService;
152     }
153 
154     public TagsEntryService getTagsEntryService() {
155         return tagsEntryService;
156     }
157 
158     public void setTagsEntryService(TagsEntryService tagsEntryService) {
159         this.tagsEntryService = tagsEntryService;
160     }
161 
162     public TagsEntryPersistence getTagsEntryPersistence() {
163         return tagsEntryPersistence;
164     }
165 
166     public void setTagsEntryPersistence(
167         TagsEntryPersistence tagsEntryPersistence) {
168         this.tagsEntryPersistence = tagsEntryPersistence;
169     }
170 
171     public TagsEntryFinder getTagsEntryFinder() {
172         return tagsEntryFinder;
173     }
174 
175     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
176         this.tagsEntryFinder = tagsEntryFinder;
177     }
178 
179     public TagsPropertyLocalService getTagsPropertyLocalService() {
180         return tagsPropertyLocalService;
181     }
182 
183     public void setTagsPropertyLocalService(
184         TagsPropertyLocalService tagsPropertyLocalService) {
185         this.tagsPropertyLocalService = tagsPropertyLocalService;
186     }
187 
188     public TagsPropertyService getTagsPropertyService() {
189         return tagsPropertyService;
190     }
191 
192     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
193         this.tagsPropertyService = tagsPropertyService;
194     }
195 
196     public TagsPropertyPersistence getTagsPropertyPersistence() {
197         return tagsPropertyPersistence;
198     }
199 
200     public void setTagsPropertyPersistence(
201         TagsPropertyPersistence tagsPropertyPersistence) {
202         this.tagsPropertyPersistence = tagsPropertyPersistence;
203     }
204 
205     public TagsPropertyFinder getTagsPropertyFinder() {
206         return tagsPropertyFinder;
207     }
208 
209     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
210         this.tagsPropertyFinder = tagsPropertyFinder;
211     }
212 
213     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
214         return tagsPropertyKeyFinder;
215     }
216 
217     public void setTagsPropertyKeyFinder(
218         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
219         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
220     }
221 
222     public TagsSourcePersistence getTagsSourcePersistence() {
223         return tagsSourcePersistence;
224     }
225 
226     public void setTagsSourcePersistence(
227         TagsSourcePersistence tagsSourcePersistence) {
228         this.tagsSourcePersistence = tagsSourcePersistence;
229     }
230 
231     public void afterPropertiesSet() {
232         if (tagsAssetLocalService == null) {
233             tagsAssetLocalService = TagsAssetLocalServiceFactory.getImpl();
234         }
235 
236         if (tagsAssetService == null) {
237             tagsAssetService = TagsAssetServiceFactory.getImpl();
238         }
239 
240         if (tagsAssetPersistence == null) {
241             tagsAssetPersistence = TagsAssetUtil.getPersistence();
242         }
243 
244         if (tagsAssetFinder == null) {
245             tagsAssetFinder = TagsAssetFinderUtil.getFinder();
246         }
247 
248         if (tagsEntryLocalService == null) {
249             tagsEntryLocalService = TagsEntryLocalServiceFactory.getImpl();
250         }
251 
252         if (tagsEntryService == null) {
253             tagsEntryService = TagsEntryServiceFactory.getImpl();
254         }
255 
256         if (tagsEntryPersistence == null) {
257             tagsEntryPersistence = TagsEntryUtil.getPersistence();
258         }
259 
260         if (tagsEntryFinder == null) {
261             tagsEntryFinder = TagsEntryFinderUtil.getFinder();
262         }
263 
264         if (tagsPropertyLocalService == null) {
265             tagsPropertyLocalService = TagsPropertyLocalServiceFactory.getImpl();
266         }
267 
268         if (tagsPropertyService == null) {
269             tagsPropertyService = TagsPropertyServiceFactory.getImpl();
270         }
271 
272         if (tagsPropertyPersistence == null) {
273             tagsPropertyPersistence = TagsPropertyUtil.getPersistence();
274         }
275 
276         if (tagsPropertyFinder == null) {
277             tagsPropertyFinder = TagsPropertyFinderUtil.getFinder();
278         }
279 
280         if (tagsPropertyKeyFinder == null) {
281             tagsPropertyKeyFinder = TagsPropertyKeyFinderUtil.getFinder();
282         }
283 
284         if (tagsSourcePersistence == null) {
285             tagsSourcePersistence = TagsSourceUtil.getPersistence();
286         }
287     }
288 
289     protected TagsAssetLocalService tagsAssetLocalService;
290     protected TagsAssetService tagsAssetService;
291     protected TagsAssetPersistence tagsAssetPersistence;
292     protected TagsAssetFinder tagsAssetFinder;
293     protected TagsEntryLocalService tagsEntryLocalService;
294     protected TagsEntryService tagsEntryService;
295     protected TagsEntryPersistence tagsEntryPersistence;
296     protected TagsEntryFinder tagsEntryFinder;
297     protected TagsPropertyLocalService tagsPropertyLocalService;
298     protected TagsPropertyService tagsPropertyService;
299     protected TagsPropertyPersistence tagsPropertyPersistence;
300     protected TagsPropertyFinder tagsPropertyFinder;
301     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
302     protected TagsSourcePersistence tagsSourcePersistence;
303 }