1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.annotation.BeanReference;
31  import com.liferay.portal.kernel.dao.db.DB;
32  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
33  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
34  import com.liferay.portal.service.ResourceLocalService;
35  import com.liferay.portal.service.ResourceService;
36  import com.liferay.portal.service.UserLocalService;
37  import com.liferay.portal.service.UserService;
38  import com.liferay.portal.service.persistence.ResourceFinder;
39  import com.liferay.portal.service.persistence.ResourcePersistence;
40  import com.liferay.portal.service.persistence.UserFinder;
41  import com.liferay.portal.service.persistence.UserPersistence;
42  
43  import com.liferay.portlet.tags.model.TagsProperty;
44  import com.liferay.portlet.tags.service.TagsAssetLocalService;
45  import com.liferay.portlet.tags.service.TagsAssetService;
46  import com.liferay.portlet.tags.service.TagsEntryLocalService;
47  import com.liferay.portlet.tags.service.TagsEntryService;
48  import com.liferay.portlet.tags.service.TagsPropertyLocalService;
49  import com.liferay.portlet.tags.service.TagsPropertyService;
50  import com.liferay.portlet.tags.service.TagsSourceLocalService;
51  import com.liferay.portlet.tags.service.TagsSourceService;
52  import com.liferay.portlet.tags.service.TagsVocabularyLocalService;
53  import com.liferay.portlet.tags.service.TagsVocabularyService;
54  import com.liferay.portlet.tags.service.persistence.TagsAssetFinder;
55  import com.liferay.portlet.tags.service.persistence.TagsAssetPersistence;
56  import com.liferay.portlet.tags.service.persistence.TagsEntryFinder;
57  import com.liferay.portlet.tags.service.persistence.TagsEntryPersistence;
58  import com.liferay.portlet.tags.service.persistence.TagsPropertyFinder;
59  import com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder;
60  import com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence;
61  import com.liferay.portlet.tags.service.persistence.TagsSourcePersistence;
62  import com.liferay.portlet.tags.service.persistence.TagsVocabularyPersistence;
63  
64  import java.util.List;
65  
66  /**
67   * <a href="TagsPropertyLocalServiceBaseImpl.java.html"><b><i>View Source</i>
68   * </b></a>
69   *
70   * @author Brian Wing Shun Chan
71   */
72  public abstract class TagsPropertyLocalServiceBaseImpl
73      implements TagsPropertyLocalService {
74      public TagsProperty addTagsProperty(TagsProperty tagsProperty)
75          throws SystemException {
76          tagsProperty.setNew(true);
77  
78          return tagsPropertyPersistence.update(tagsProperty, false);
79      }
80  
81      public TagsProperty createTagsProperty(long propertyId) {
82          return tagsPropertyPersistence.create(propertyId);
83      }
84  
85      public void deleteTagsProperty(long propertyId)
86          throws PortalException, SystemException {
87          tagsPropertyPersistence.remove(propertyId);
88      }
89  
90      public void deleteTagsProperty(TagsProperty tagsProperty)
91          throws SystemException {
92          tagsPropertyPersistence.remove(tagsProperty);
93      }
94  
95      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
96          throws SystemException {
97          return tagsPropertyPersistence.findWithDynamicQuery(dynamicQuery);
98      }
99  
100     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
101         int end) throws SystemException {
102         return tagsPropertyPersistence.findWithDynamicQuery(dynamicQuery,
103             start, end);
104     }
105 
106     public TagsProperty getTagsProperty(long propertyId)
107         throws PortalException, SystemException {
108         return tagsPropertyPersistence.findByPrimaryKey(propertyId);
109     }
110 
111     public List<TagsProperty> getTagsProperties(int start, int end)
112         throws SystemException {
113         return tagsPropertyPersistence.findAll(start, end);
114     }
115 
116     public int getTagsPropertiesCount() throws SystemException {
117         return tagsPropertyPersistence.countAll();
118     }
119 
120     public TagsProperty updateTagsProperty(TagsProperty tagsProperty)
121         throws SystemException {
122         tagsProperty.setNew(false);
123 
124         return tagsPropertyPersistence.update(tagsProperty, true);
125     }
126 
127     public TagsProperty updateTagsProperty(TagsProperty tagsProperty,
128         boolean merge) throws SystemException {
129         tagsProperty.setNew(false);
130 
131         return tagsPropertyPersistence.update(tagsProperty, merge);
132     }
133 
134     public TagsAssetLocalService getTagsAssetLocalService() {
135         return tagsAssetLocalService;
136     }
137 
138     public void setTagsAssetLocalService(
139         TagsAssetLocalService tagsAssetLocalService) {
140         this.tagsAssetLocalService = tagsAssetLocalService;
141     }
142 
143     public TagsAssetService getTagsAssetService() {
144         return tagsAssetService;
145     }
146 
147     public void setTagsAssetService(TagsAssetService tagsAssetService) {
148         this.tagsAssetService = tagsAssetService;
149     }
150 
151     public TagsAssetPersistence getTagsAssetPersistence() {
152         return tagsAssetPersistence;
153     }
154 
155     public void setTagsAssetPersistence(
156         TagsAssetPersistence tagsAssetPersistence) {
157         this.tagsAssetPersistence = tagsAssetPersistence;
158     }
159 
160     public TagsAssetFinder getTagsAssetFinder() {
161         return tagsAssetFinder;
162     }
163 
164     public void setTagsAssetFinder(TagsAssetFinder tagsAssetFinder) {
165         this.tagsAssetFinder = tagsAssetFinder;
166     }
167 
168     public TagsEntryLocalService getTagsEntryLocalService() {
169         return tagsEntryLocalService;
170     }
171 
172     public void setTagsEntryLocalService(
173         TagsEntryLocalService tagsEntryLocalService) {
174         this.tagsEntryLocalService = tagsEntryLocalService;
175     }
176 
177     public TagsEntryService getTagsEntryService() {
178         return tagsEntryService;
179     }
180 
181     public void setTagsEntryService(TagsEntryService tagsEntryService) {
182         this.tagsEntryService = tagsEntryService;
183     }
184 
185     public TagsEntryPersistence getTagsEntryPersistence() {
186         return tagsEntryPersistence;
187     }
188 
189     public void setTagsEntryPersistence(
190         TagsEntryPersistence tagsEntryPersistence) {
191         this.tagsEntryPersistence = tagsEntryPersistence;
192     }
193 
194     public TagsEntryFinder getTagsEntryFinder() {
195         return tagsEntryFinder;
196     }
197 
198     public void setTagsEntryFinder(TagsEntryFinder tagsEntryFinder) {
199         this.tagsEntryFinder = tagsEntryFinder;
200     }
201 
202     public TagsPropertyLocalService getTagsPropertyLocalService() {
203         return tagsPropertyLocalService;
204     }
205 
206     public void setTagsPropertyLocalService(
207         TagsPropertyLocalService tagsPropertyLocalService) {
208         this.tagsPropertyLocalService = tagsPropertyLocalService;
209     }
210 
211     public TagsPropertyService getTagsPropertyService() {
212         return tagsPropertyService;
213     }
214 
215     public void setTagsPropertyService(TagsPropertyService tagsPropertyService) {
216         this.tagsPropertyService = tagsPropertyService;
217     }
218 
219     public TagsPropertyPersistence getTagsPropertyPersistence() {
220         return tagsPropertyPersistence;
221     }
222 
223     public void setTagsPropertyPersistence(
224         TagsPropertyPersistence tagsPropertyPersistence) {
225         this.tagsPropertyPersistence = tagsPropertyPersistence;
226     }
227 
228     public TagsPropertyFinder getTagsPropertyFinder() {
229         return tagsPropertyFinder;
230     }
231 
232     public void setTagsPropertyFinder(TagsPropertyFinder tagsPropertyFinder) {
233         this.tagsPropertyFinder = tagsPropertyFinder;
234     }
235 
236     public TagsPropertyKeyFinder getTagsPropertyKeyFinder() {
237         return tagsPropertyKeyFinder;
238     }
239 
240     public void setTagsPropertyKeyFinder(
241         TagsPropertyKeyFinder tagsPropertyKeyFinder) {
242         this.tagsPropertyKeyFinder = tagsPropertyKeyFinder;
243     }
244 
245     public TagsSourceLocalService getTagsSourceLocalService() {
246         return tagsSourceLocalService;
247     }
248 
249     public void setTagsSourceLocalService(
250         TagsSourceLocalService tagsSourceLocalService) {
251         this.tagsSourceLocalService = tagsSourceLocalService;
252     }
253 
254     public TagsSourceService getTagsSourceService() {
255         return tagsSourceService;
256     }
257 
258     public void setTagsSourceService(TagsSourceService tagsSourceService) {
259         this.tagsSourceService = tagsSourceService;
260     }
261 
262     public TagsSourcePersistence getTagsSourcePersistence() {
263         return tagsSourcePersistence;
264     }
265 
266     public void setTagsSourcePersistence(
267         TagsSourcePersistence tagsSourcePersistence) {
268         this.tagsSourcePersistence = tagsSourcePersistence;
269     }
270 
271     public TagsVocabularyLocalService getTagsVocabularyLocalService() {
272         return tagsVocabularyLocalService;
273     }
274 
275     public void setTagsVocabularyLocalService(
276         TagsVocabularyLocalService tagsVocabularyLocalService) {
277         this.tagsVocabularyLocalService = tagsVocabularyLocalService;
278     }
279 
280     public TagsVocabularyService getTagsVocabularyService() {
281         return tagsVocabularyService;
282     }
283 
284     public void setTagsVocabularyService(
285         TagsVocabularyService tagsVocabularyService) {
286         this.tagsVocabularyService = tagsVocabularyService;
287     }
288 
289     public TagsVocabularyPersistence getTagsVocabularyPersistence() {
290         return tagsVocabularyPersistence;
291     }
292 
293     public void setTagsVocabularyPersistence(
294         TagsVocabularyPersistence tagsVocabularyPersistence) {
295         this.tagsVocabularyPersistence = tagsVocabularyPersistence;
296     }
297 
298     public CounterLocalService getCounterLocalService() {
299         return counterLocalService;
300     }
301 
302     public void setCounterLocalService(CounterLocalService counterLocalService) {
303         this.counterLocalService = counterLocalService;
304     }
305 
306     public CounterService getCounterService() {
307         return counterService;
308     }
309 
310     public void setCounterService(CounterService counterService) {
311         this.counterService = counterService;
312     }
313 
314     public ResourceLocalService getResourceLocalService() {
315         return resourceLocalService;
316     }
317 
318     public void setResourceLocalService(
319         ResourceLocalService resourceLocalService) {
320         this.resourceLocalService = resourceLocalService;
321     }
322 
323     public ResourceService getResourceService() {
324         return resourceService;
325     }
326 
327     public void setResourceService(ResourceService resourceService) {
328         this.resourceService = resourceService;
329     }
330 
331     public ResourcePersistence getResourcePersistence() {
332         return resourcePersistence;
333     }
334 
335     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
336         this.resourcePersistence = resourcePersistence;
337     }
338 
339     public ResourceFinder getResourceFinder() {
340         return resourceFinder;
341     }
342 
343     public void setResourceFinder(ResourceFinder resourceFinder) {
344         this.resourceFinder = resourceFinder;
345     }
346 
347     public UserLocalService getUserLocalService() {
348         return userLocalService;
349     }
350 
351     public void setUserLocalService(UserLocalService userLocalService) {
352         this.userLocalService = userLocalService;
353     }
354 
355     public UserService getUserService() {
356         return userService;
357     }
358 
359     public void setUserService(UserService userService) {
360         this.userService = userService;
361     }
362 
363     public UserPersistence getUserPersistence() {
364         return userPersistence;
365     }
366 
367     public void setUserPersistence(UserPersistence userPersistence) {
368         this.userPersistence = userPersistence;
369     }
370 
371     public UserFinder getUserFinder() {
372         return userFinder;
373     }
374 
375     public void setUserFinder(UserFinder userFinder) {
376         this.userFinder = userFinder;
377     }
378 
379     protected void runSQL(String sql) throws SystemException {
380         try {
381             DB db = DBFactoryUtil.getDB();
382 
383             db.runSQL(sql);
384         }
385         catch (Exception e) {
386             throw new SystemException(e);
387         }
388     }
389 
390     @BeanReference(name = "com.liferay.portlet.tags.service.TagsAssetLocalService")
391     protected TagsAssetLocalService tagsAssetLocalService;
392     @BeanReference(name = "com.liferay.portlet.tags.service.TagsAssetService")
393     protected TagsAssetService tagsAssetService;
394     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsAssetPersistence")
395     protected TagsAssetPersistence tagsAssetPersistence;
396     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsAssetFinder")
397     protected TagsAssetFinder tagsAssetFinder;
398     @BeanReference(name = "com.liferay.portlet.tags.service.TagsEntryLocalService")
399     protected TagsEntryLocalService tagsEntryLocalService;
400     @BeanReference(name = "com.liferay.portlet.tags.service.TagsEntryService")
401     protected TagsEntryService tagsEntryService;
402     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsEntryPersistence")
403     protected TagsEntryPersistence tagsEntryPersistence;
404     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsEntryFinder")
405     protected TagsEntryFinder tagsEntryFinder;
406     @BeanReference(name = "com.liferay.portlet.tags.service.TagsPropertyLocalService")
407     protected TagsPropertyLocalService tagsPropertyLocalService;
408     @BeanReference(name = "com.liferay.portlet.tags.service.TagsPropertyService")
409     protected TagsPropertyService tagsPropertyService;
410     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsPropertyPersistence")
411     protected TagsPropertyPersistence tagsPropertyPersistence;
412     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsPropertyFinder")
413     protected TagsPropertyFinder tagsPropertyFinder;
414     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsPropertyKeyFinder")
415     protected TagsPropertyKeyFinder tagsPropertyKeyFinder;
416     @BeanReference(name = "com.liferay.portlet.tags.service.TagsSourceLocalService")
417     protected TagsSourceLocalService tagsSourceLocalService;
418     @BeanReference(name = "com.liferay.portlet.tags.service.TagsSourceService")
419     protected TagsSourceService tagsSourceService;
420     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsSourcePersistence")
421     protected TagsSourcePersistence tagsSourcePersistence;
422     @BeanReference(name = "com.liferay.portlet.tags.service.TagsVocabularyLocalService")
423     protected TagsVocabularyLocalService tagsVocabularyLocalService;
424     @BeanReference(name = "com.liferay.portlet.tags.service.TagsVocabularyService")
425     protected TagsVocabularyService tagsVocabularyService;
426     @BeanReference(name = "com.liferay.portlet.tags.service.persistence.TagsVocabularyPersistence")
427     protected TagsVocabularyPersistence tagsVocabularyPersistence;
428     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
429     protected CounterLocalService counterLocalService;
430     @BeanReference(name = "com.liferay.counter.service.CounterService")
431     protected CounterService counterService;
432     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
433     protected ResourceLocalService resourceLocalService;
434     @BeanReference(name = "com.liferay.portal.service.ResourceService")
435     protected ResourceService resourceService;
436     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
437     protected ResourcePersistence resourcePersistence;
438     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
439     protected ResourceFinder resourceFinder;
440     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
441     protected UserLocalService userLocalService;
442     @BeanReference(name = "com.liferay.portal.service.UserService")
443     protected UserService userService;
444     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
445     protected UserPersistence userPersistence;
446     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
447     protected UserFinder userFinder;
448 }