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.dao.DynamicQueryInitializer;
28  
29  import com.liferay.portlet.tags.model.TagsSource;
30  import com.liferay.portlet.tags.service.TagsAssetLocalService;
31  import com.liferay.portlet.tags.service.TagsAssetLocalServiceFactory;
32  import com.liferay.portlet.tags.service.TagsAssetService;
33  import com.liferay.portlet.tags.service.TagsAssetServiceFactory;
34  import com.liferay.portlet.tags.service.TagsEntryLocalService;
35  import com.liferay.portlet.tags.service.TagsEntryLocalServiceFactory;
36  import com.liferay.portlet.tags.service.TagsEntryService;
37  import com.liferay.portlet.tags.service.TagsEntryServiceFactory;
38  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
39  import com.liferay.portlet.tags.service.TagsPropertyLocalServiceFactory;
40  import com.liferay.portlet.tags.service.TagsPropertyService;
41  import com.liferay.portlet.tags.service.TagsPropertyServiceFactory;
42  import com.liferay.portlet.tags.service.TagsSourceLocalService;
43  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
44  import com.liferay.portlet.tags.service.persistence.TagsAssetFinderUtil;
45  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
46  import com.liferay.portlet.tags.service.persistence.TagsAssetUtil;
47  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
48  import com.liferay.portlet.tags.service.persistence.TagsEntryFinderUtil;
49  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
50  import com.liferay.portlet.tags.service.persistence.TagsEntryUtil;
51  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
52  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinderUtil;
53  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
54  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinderUtil;
55  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
56  import com.liferay.portlet.tags.service.persistence.TagsPropertyUtil;
57  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
58  import com.liferay.portlet.tags.service.persistence.TagsSourceUtil;
59  
60  import org.springframework.beans.factory.InitializingBean;
61  
62  import java.util.List;
63  
64  /**
65   * <a href="TagsSourceLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
66   *
67   * @author Brian Wing Shun Chan
68   *
69   */
70  public abstract class TagsSourceLocalServiceBaseImpl
71      implements TagsSourceLocalService, InitializingBean {
72      public TagsSource addTagsSource(TagsSource tagsSource)
73          throws SystemException {
74          tagsSource.setNew(true);
75  
76          return tagsSourcePersistence.update(tagsSource, false);
77      }
78  
79      public void deleteTagsSource(long sourceId)
80          throws PortalException, SystemException {
81          tagsSourcePersistence.remove(sourceId);
82      }
83  
84      public void deleteTagsSource(TagsSource tagsSource)
85          throws PortalException, SystemException {
86          tagsSourcePersistence.remove(tagsSource);
87      }
88  
89      public List<TagsSource> dynamicQuery(
90          DynamicQueryInitializer queryInitializer) throws SystemException {
91          return tagsSourcePersistence.findWithDynamicQuery(queryInitializer);
92      }
93  
94      public List<TagsSource> dynamicQuery(
95          DynamicQueryInitializer queryInitializer, int begin, int end)
96          throws SystemException {
97          return tagsSourcePersistence.findWithDynamicQuery(queryInitializer,
98              begin, end);
99      }
100 
101     public TagsSource updateTagsSource(TagsSource tagsSource)
102         throws SystemException {
103         tagsSource.setNew(false);
104 
105         return tagsSourcePersistence.update(tagsSource, true);
106     }
107 
108     public TagsAssetLocalService getTagsAssetLocalService() {
109         return tagsAssetLocalService;
110     }
111 
112     public void setTagsAssetLocalService(
113         TagsAssetLocalService tagsAssetLocalService) {
114         this.tagsAssetLocalService = tagsAssetLocalService;
115     }
116 
117     public TagsAssetService getTagsAssetService() {
118         return tagsAssetService;
119     }
120 
121     public void setTagsAssetService(TagsAssetService tagsAssetService) {
122         this.tagsAssetService = tagsAssetService;
123     }
124 
125     public TagsAssetPersistence getTagsAssetPersistence() {
126         return tagsAssetPersistence;
127     }
128 
129     public void setTagsAssetPersistence(
130         TagsAssetPersistence tagsAssetPersistence) {
131         this.tagsAssetPersistence = tagsAssetPersistence;
132     }
133 
134     public TagsAssetFinder getTagsAssetFinder() {
135         return tagsAssetFinder;
136     }
137 
138     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
139         this.tagsAssetFinder = tagsAssetFinder;
140     }
141 
142     public TagsEntryLocalService getTagsEntryLocalService() {
143         return tagsEntryLocalService;
144     }
145 
146     public void setTagsEntryLocalService(
147         TagsEntryLocalService tagsEntryLocalService) {
148         this.tagsEntryLocalService = tagsEntryLocalService;
149     }
150 
151     public TagsEntryService getTagsEntryService() {
152         return tagsEntryService;
153     }
154 
155     public void setTagsEntryService(TagsEntryService tagsEntryService) {
156         this.tagsEntryService = tagsEntryService;
157     }
158 
159     public TagsEntryPersistence getTagsEntryPersistence() {
160         return tagsEntryPersistence;
161     }
162 
163     public void setTagsEntryPersistence(
164         TagsEntryPersistence tagsEntryPersistence) {
165         this.tagsEntryPersistence = tagsEntryPersistence;
166     }
167 
168     public TagsEntryFinder getTagsEntryFinder() {
169         return tagsEntryFinder;
170     }
171 
172     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
173         this.tagsEntryFinder = tagsEntryFinder;
174     }
175 
176     public TagsPropertyLocalService getTagsPropertyLocalService() {
177         return tagsPropertyLocalService;
178     }
179 
180     public void setTagsPropertyLocalService(
181         TagsPropertyLocalService tagsPropertyLocalService) {
182         this.tagsPropertyLocalService = tagsPropertyLocalService;
183     }
184 
185     public TagsPropertyService getTagsPropertyService() {
186         return tagsPropertyService;
187     }
188 
189     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
190         this.tagsPropertyService = tagsPropertyService;
191     }
192 
193     public TagsPropertyPersistence getTagsPropertyPersistence() {
194         return tagsPropertyPersistence;
195     }
196 
197     public void setTagsPropertyPersistence(
198         TagsPropertyPersistence tagsPropertyPersistence) {
199         this.tagsPropertyPersistence = tagsPropertyPersistence;
200     }
201 
202     public TagsPropertyFinder getTagsPropertyFinder() {
203         return tagsPropertyFinder;
204     }
205 
206     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
207         this.tagsPropertyFinder = tagsPropertyFinder;
208     }
209 
210     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
211         return tagsPropertyKeyFinder;
212     }
213 
214     public void setTagsPropertyKeyFinder(
215         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
216         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
217     }
218 
219     public TagsSourcePersistence getTagsSourcePersistence() {
220         return tagsSourcePersistence;
221     }
222 
223     public void setTagsSourcePersistence(
224         TagsSourcePersistence tagsSourcePersistence) {
225         this.tagsSourcePersistence = tagsSourcePersistence;
226     }
227 
228     public void afterPropertiesSet() {
229         if (tagsAssetLocalService == null) {
230             tagsAssetLocalService = TagsAssetLocalServiceFactory.getImpl();
231         }
232 
233         if (tagsAssetService == null) {
234             tagsAssetService = TagsAssetServiceFactory.getImpl();
235         }
236 
237         if (tagsAssetPersistence == null) {
238             tagsAssetPersistence = TagsAssetUtil.getPersistence();
239         }
240 
241         if (tagsAssetFinder == null) {
242             tagsAssetFinder = TagsAssetFinderUtil.getFinder();
243         }
244 
245         if (tagsEntryLocalService == null) {
246             tagsEntryLocalService = TagsEntryLocalServiceFactory.getImpl();
247         }
248 
249         if (tagsEntryService == null) {
250             tagsEntryService = TagsEntryServiceFactory.getImpl();
251         }
252 
253         if (tagsEntryPersistence == null) {
254             tagsEntryPersistence = TagsEntryUtil.getPersistence();
255         }
256 
257         if (tagsEntryFinder == null) {
258             tagsEntryFinder = TagsEntryFinderUtil.getFinder();
259         }
260 
261         if (tagsPropertyLocalService == null) {
262             tagsPropertyLocalService = TagsPropertyLocalServiceFactory.getImpl();
263         }
264 
265         if (tagsPropertyService == null) {
266             tagsPropertyService = TagsPropertyServiceFactory.getImpl();
267         }
268 
269         if (tagsPropertyPersistence == null) {
270             tagsPropertyPersistence = TagsPropertyUtil.getPersistence();
271         }
272 
273         if (tagsPropertyFinder == null) {
274             tagsPropertyFinder = TagsPropertyFinderUtil.getFinder();
275         }
276 
277         if (tagsPropertyKeyFinder == null) {
278             tagsPropertyKeyFinder = TagsPropertyKeyFinderUtil.getFinder();
279         }
280 
281         if (tagsSourcePersistence == null) {
282             tagsSourcePersistence = TagsSourceUtil.getPersistence();
283         }
284     }
285 
286     protected TagsAssetLocalService tagsAssetLocalService;
287     protected TagsAssetService tagsAssetService;
288     protected TagsAssetPersistence tagsAssetPersistence;
289     protected TagsAssetFinder tagsAssetFinder;
290     protected TagsEntryLocalService tagsEntryLocalService;
291     protected TagsEntryService tagsEntryService;
292     protected TagsEntryPersistence tagsEntryPersistence;
293     protected TagsEntryFinder tagsEntryFinder;
294     protected TagsPropertyLocalService tagsPropertyLocalService;
295     protected TagsPropertyService tagsPropertyService;
296     protected TagsPropertyPersistence tagsPropertyPersistence;
297     protected TagsPropertyFinder tagsPropertyFinder;
298     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
299     protected TagsSourcePersistence tagsSourcePersistence;
300 }