1
14
15 package com.liferay.portal.service.http;
16
17 import com.liferay.portal.kernel.log.Log;
18 import com.liferay.portal.kernel.log.LogFactoryUtil;
19 import com.liferay.portal.kernel.util.LongWrapper;
20 import com.liferay.portal.kernel.util.MethodWrapper;
21 import com.liferay.portal.kernel.util.NullWrapper;
22 import com.liferay.portal.security.auth.HttpPrincipal;
23 import com.liferay.portal.service.PortletPreferencesServiceUtil;
24
25
62 public class PortletPreferencesServiceHttp {
63 public static void deleteArchivedPreferences(HttpPrincipal httpPrincipal,
64 long portletItemId)
65 throws com.liferay.portal.kernel.exception.PortalException,
66 com.liferay.portal.kernel.exception.SystemException {
67 try {
68 Object paramObj0 = new LongWrapper(portletItemId);
69
70 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
71 "deleteArchivedPreferences", new Object[] { paramObj0 });
72
73 try {
74 TunnelUtil.invoke(httpPrincipal, methodWrapper);
75 }
76 catch (Exception e) {
77 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
78 throw (com.liferay.portal.kernel.exception.PortalException)e;
79 }
80
81 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
82 throw (com.liferay.portal.kernel.exception.SystemException)e;
83 }
84
85 throw new com.liferay.portal.kernel.exception.SystemException(e);
86 }
87 }
88 catch (com.liferay.portal.kernel.exception.SystemException se) {
89 _log.error(se, se);
90
91 throw se;
92 }
93 }
94
95 public static void restoreArchivedPreferences(HttpPrincipal httpPrincipal,
96 long groupId, java.lang.String name, java.lang.String portletId,
97 javax.portlet.PortletPreferences preferences)
98 throws com.liferay.portal.kernel.exception.PortalException,
99 com.liferay.portal.kernel.exception.SystemException {
100 try {
101 Object paramObj0 = new LongWrapper(groupId);
102
103 Object paramObj1 = name;
104
105 if (name == null) {
106 paramObj1 = new NullWrapper("java.lang.String");
107 }
108
109 Object paramObj2 = portletId;
110
111 if (portletId == null) {
112 paramObj2 = new NullWrapper("java.lang.String");
113 }
114
115 Object paramObj3 = preferences;
116
117 if (preferences == null) {
118 paramObj3 = new NullWrapper("javax.portlet.PortletPreferences");
119 }
120
121 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
122 "restoreArchivedPreferences",
123 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
124
125 try {
126 TunnelUtil.invoke(httpPrincipal, methodWrapper);
127 }
128 catch (Exception e) {
129 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
130 throw (com.liferay.portal.kernel.exception.PortalException)e;
131 }
132
133 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
134 throw (com.liferay.portal.kernel.exception.SystemException)e;
135 }
136
137 throw new com.liferay.portal.kernel.exception.SystemException(e);
138 }
139 }
140 catch (com.liferay.portal.kernel.exception.SystemException se) {
141 _log.error(se, se);
142
143 throw se;
144 }
145 }
146
147 public static void updateArchivePreferences(HttpPrincipal httpPrincipal,
148 long userId, long groupId, java.lang.String name,
149 java.lang.String portletId, javax.portlet.PortletPreferences preferences)
150 throws com.liferay.portal.kernel.exception.PortalException,
151 com.liferay.portal.kernel.exception.SystemException {
152 try {
153 Object paramObj0 = new LongWrapper(userId);
154
155 Object paramObj1 = new LongWrapper(groupId);
156
157 Object paramObj2 = name;
158
159 if (name == null) {
160 paramObj2 = new NullWrapper("java.lang.String");
161 }
162
163 Object paramObj3 = portletId;
164
165 if (portletId == null) {
166 paramObj3 = new NullWrapper("java.lang.String");
167 }
168
169 Object paramObj4 = preferences;
170
171 if (preferences == null) {
172 paramObj4 = new NullWrapper("javax.portlet.PortletPreferences");
173 }
174
175 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
176 "updateArchivePreferences",
177 new Object[] {
178 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
179 });
180
181 try {
182 TunnelUtil.invoke(httpPrincipal, methodWrapper);
183 }
184 catch (Exception e) {
185 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
186 throw (com.liferay.portal.kernel.exception.PortalException)e;
187 }
188
189 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
190 throw (com.liferay.portal.kernel.exception.SystemException)e;
191 }
192
193 throw new com.liferay.portal.kernel.exception.SystemException(e);
194 }
195 }
196 catch (com.liferay.portal.kernel.exception.SystemException se) {
197 _log.error(se, se);
198
199 throw se;
200 }
201 }
202
203 private static Log _log = LogFactoryUtil.getLog(PortletPreferencesServiceHttp.class);
204 }