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
73 public class PollsQuestionServiceJSON {
74 public static JSONObject addQuestion(long plid, java.lang.String title,
75 java.lang.String description, int expirationDateMonth,
76 int expirationDateDay, int expirationDateYear, int expirationDateHour,
77 int expirationDateMinute, boolean neverExpire, java.util.List choices,
78 boolean addCommunityPermissions, boolean addGuestPermissions)
79 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
80 com.liferay.portal.PortalException {
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, java.util.List choices,
94 java.lang.String[] communityPermissions,
95 java.lang.String[] guestPermissions)
96 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
97 com.liferay.portal.PortalException {
98 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.addQuestion(plid,
99 title, description, expirationDateMonth, expirationDateDay,
100 expirationDateYear, expirationDateHour, expirationDateMinute,
101 neverExpire, choices, communityPermissions, guestPermissions);
102
103 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
104 }
105
106 public static void deleteQuestion(long questionId)
107 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
108 com.liferay.portal.PortalException {
109 PollsQuestionServiceUtil.deleteQuestion(questionId);
110 }
111
112 public static JSONObject getQuestion(long questionId)
113 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
114 com.liferay.portal.PortalException {
115 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.getQuestion(questionId);
116
117 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
118 }
119
120 public static JSONObject updateQuestion(long questionId,
121 java.lang.String title, java.lang.String description,
122 int expirationDateMonth, int expirationDateDay, int expirationDateYear,
123 int expirationDateHour, int expirationDateMinute, boolean neverExpire,
124 java.util.List choices)
125 throws java.rmi.RemoteException, com.liferay.portal.SystemException,
126 com.liferay.portal.PortalException {
127 com.liferay.portlet.polls.model.PollsQuestion returnValue = PollsQuestionServiceUtil.updateQuestion(questionId,
128 title, description, expirationDateMonth, expirationDateDay,
129 expirationDateYear, expirationDateHour, expirationDateMinute,
130 neverExpire, choices);
131
132 return PollsQuestionJSONSerializer.toJSONObject(returnValue);
133 }
134 }