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