001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.LongWrapper;
020 import com.liferay.portal.kernel.util.MethodWrapper;
021 import com.liferay.portal.kernel.util.NullWrapper;
022 import com.liferay.portal.security.auth.HttpPrincipal;
023 import com.liferay.portal.service.PortletPreferencesServiceUtil;
024
025
055 public class PortletPreferencesServiceHttp {
056 public static void deleteArchivedPreferences(HttpPrincipal httpPrincipal,
057 long portletItemId)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 Object paramObj0 = new LongWrapper(portletItemId);
062
063 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
064 "deleteArchivedPreferences", new Object[] { paramObj0 });
065
066 try {
067 TunnelUtil.invoke(httpPrincipal, methodWrapper);
068 }
069 catch (Exception e) {
070 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
071 throw (com.liferay.portal.kernel.exception.PortalException)e;
072 }
073
074 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
075 throw (com.liferay.portal.kernel.exception.SystemException)e;
076 }
077
078 throw new com.liferay.portal.kernel.exception.SystemException(e);
079 }
080 }
081 catch (com.liferay.portal.kernel.exception.SystemException se) {
082 _log.error(se, se);
083
084 throw se;
085 }
086 }
087
088 public static void restoreArchivedPreferences(HttpPrincipal httpPrincipal,
089 long groupId, java.lang.String name, java.lang.String portletId,
090 javax.portlet.PortletPreferences preferences)
091 throws com.liferay.portal.kernel.exception.PortalException,
092 com.liferay.portal.kernel.exception.SystemException {
093 try {
094 Object paramObj0 = new LongWrapper(groupId);
095
096 Object paramObj1 = name;
097
098 if (name == null) {
099 paramObj1 = new NullWrapper("java.lang.String");
100 }
101
102 Object paramObj2 = portletId;
103
104 if (portletId == null) {
105 paramObj2 = new NullWrapper("java.lang.String");
106 }
107
108 Object paramObj3 = preferences;
109
110 if (preferences == null) {
111 paramObj3 = new NullWrapper("javax.portlet.PortletPreferences");
112 }
113
114 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
115 "restoreArchivedPreferences",
116 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
117
118 try {
119 TunnelUtil.invoke(httpPrincipal, methodWrapper);
120 }
121 catch (Exception e) {
122 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
123 throw (com.liferay.portal.kernel.exception.PortalException)e;
124 }
125
126 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
127 throw (com.liferay.portal.kernel.exception.SystemException)e;
128 }
129
130 throw new com.liferay.portal.kernel.exception.SystemException(e);
131 }
132 }
133 catch (com.liferay.portal.kernel.exception.SystemException se) {
134 _log.error(se, se);
135
136 throw se;
137 }
138 }
139
140 public static void updateArchivePreferences(HttpPrincipal httpPrincipal,
141 long userId, long groupId, java.lang.String name,
142 java.lang.String portletId, javax.portlet.PortletPreferences preferences)
143 throws com.liferay.portal.kernel.exception.PortalException,
144 com.liferay.portal.kernel.exception.SystemException {
145 try {
146 Object paramObj0 = new LongWrapper(userId);
147
148 Object paramObj1 = new LongWrapper(groupId);
149
150 Object paramObj2 = name;
151
152 if (name == null) {
153 paramObj2 = new NullWrapper("java.lang.String");
154 }
155
156 Object paramObj3 = portletId;
157
158 if (portletId == null) {
159 paramObj3 = new NullWrapper("java.lang.String");
160 }
161
162 Object paramObj4 = preferences;
163
164 if (preferences == null) {
165 paramObj4 = new NullWrapper("javax.portlet.PortletPreferences");
166 }
167
168 MethodWrapper methodWrapper = new MethodWrapper(PortletPreferencesServiceUtil.class.getName(),
169 "updateArchivePreferences",
170 new Object[] {
171 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4
172 });
173
174 try {
175 TunnelUtil.invoke(httpPrincipal, methodWrapper);
176 }
177 catch (Exception e) {
178 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
179 throw (com.liferay.portal.kernel.exception.PortalException)e;
180 }
181
182 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
183 throw (com.liferay.portal.kernel.exception.SystemException)e;
184 }
185
186 throw new com.liferay.portal.kernel.exception.SystemException(e);
187 }
188 }
189 catch (com.liferay.portal.kernel.exception.SystemException se) {
190 _log.error(se, se);
191
192 throw se;
193 }
194 }
195
196 private static Log _log = LogFactoryUtil.getLog(PortletPreferencesServiceHttp.class);
197 }