1
14
15 package com.liferay.portlet.announcements.service.impl;
16
17 import com.liferay.portal.PortalException;
18 import com.liferay.portal.SystemException;
19 import com.liferay.portal.security.auth.PrincipalException;
20 import com.liferay.portlet.announcements.model.AnnouncementsFlag;
21 import com.liferay.portlet.announcements.service.base.AnnouncementsFlagServiceBaseImpl;
22
23
30 public class AnnouncementsFlagServiceImpl
31 extends AnnouncementsFlagServiceBaseImpl {
32
33 public void addFlag(long entryId, int value)
34 throws PortalException, SystemException {
35
36 announcementsFlagLocalService.addFlag(getUserId(), entryId, value);
37 }
38
39 public void deleteFlag(long flagId)
40 throws PortalException, SystemException {
41
42 AnnouncementsFlag flag = announcementsFlagPersistence.findByPrimaryKey(
43 flagId);
44
45 if (flag.getUserId() != getUserId()) {
46 throw new PrincipalException();
47 }
48
49 announcementsFlagLocalService.deleteFlag(flagId);
50 }
51
52 public AnnouncementsFlag getFlag(long entryId, int value)
53 throws PortalException, SystemException {
54
55 return announcementsFlagLocalService.getFlag(
56 getUserId(), entryId, value);
57 }
58
59 }