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