1
22
23 package com.liferay.portlet.polls.service.http;
24
25 import com.liferay.portlet.polls.service.PollsQuestionServiceUtil;
26
27 import org.json.JSONObject;
28
29
70 public class PollsQuestionServiceJSON {
71 public static JSONObject addQuestion(long plid, java.lang.String title,
72 java.lang.String description, int expirationDateMonth,
73 int expirationDateDay, int expirationDateYear, int expirationDateHour,
74 int expirationDateMinute, boolean neverExpire, java.util.List choices,
75 boolean addCommunityPermissions, boolean addGuestPermissions)
76 throws com.liferay.portal.SystemException,
77 com.liferay.portal.PortalException, java.rmi.RemoteException {
78 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.addQuestion(plid,
79 title, description, expirationDateMonth, expirationDateDay,
80 expirationDateYear, expirationDateHour, expirationDateMinute,
81 neverExpire, choices, addCommunityPermissions,
82 addGuestPermissions);
83
84 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
85 }
86
87 public static JSONObject addQuestion(long plid, java.lang.String title,
88 java.lang.String description, int expirationDateMonth,
89 int expirationDateDay, int expirationDateYear, int expirationDateHour,
90 int expirationDateMinute, boolean neverExpire, java.util.List choices,
91 java.lang.String[] communityPermissions,
92 java.lang.String[] guestPermissions)
93 throws com.liferay.portal.SystemException,
94 com.liferay.portal.PortalException, java.rmi.RemoteException {
95 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.addQuestion(plid,
96 title, description, expirationDateMonth, expirationDateDay,
97 expirationDateYear, expirationDateHour, expirationDateMinute,
98 neverExpire, choices, communityPermissions, guestPermissions);
99
100 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
101 }
102
103 public static void deleteQuestion(long questionId)
104 throws com.liferay.portal.SystemException,
105 com.liferay.portal.PortalException, java.rmi.RemoteException {
106 PollsQuestionServiceUtil.deleteQuestion(questionId);
107 }
108
109 public static JSONObject getQuestion(long questionId)
110 throws com.liferay.portal.SystemException,
111 com.liferay.portal.PortalException, java.rmi.RemoteException {
112 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.getQuestion(questionId);
113
114 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
115 }
116
117 public static JSONObject updateQuestion(long questionId,
118 java.lang.String title, java.lang.String description,
119 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
120 int expirationDateHour, int expirationDateMinute, boolean neverExpire,
121 java.util.List choices)
122 throws com.liferay.portal.SystemException,
123 com.liferay.portal.PortalException, java.rmi.RemoteException {
124 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.updateQuestion(questionId,
125 title, description, expirationDateMonth, expirationDateDay,
126 expirationDateYear, expirationDateHour, expirationDateMinute,
127 neverExpire, choices);
128
129 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
130 }
131 }