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.MethodHandler;
20 import com.liferay.portal.kernel.util.MethodKey;
21 import com.liferay.portal.security.auth.HttpPrincipal;
22 import com.liferay.portal.service.PortletPreferencesServiceUtil;
23
24
61 public class PortletPreferencesServiceHttp {
62 public static void deleteArchivedPreferences(HttpPrincipal httpPrincipal,
63 long portletItemId)
64 throws com.liferay.portal.PortalException,
65 com.liferay.portal.SystemException {
66 try {
67 MethodKey methodKey = new MethodKey(PortletPreferencesServiceUtil.class.getName(),
68 "deleteArchivedPreferences",
69 _deleteArchivedPreferencesParameterTypes0);
70
71 MethodHandler methodHandler = new MethodHandler(methodKey,
72 portletItemId);
73
74 try {
75 TunnelUtil.invoke(httpPrincipal, methodHandler);
76 }
77 catch (Exception e) {
78 if (e instanceof com.liferay.portal.PortalException) {
79 throw (com.liferay.portal.PortalException)e;
80 }
81
82 if (e instanceof com.liferay.portal.SystemException) {
83 throw (com.liferay.portal.SystemException)e;
84 }
85
86 throw new com.liferay.portal.SystemException(e);
87 }
88 }
89 catch (com.liferay.portal.SystemException se) {
90 _log.error(se, se);
91
92 throw se;
93 }
94 }
95
96 public static void restoreArchivedPreferences(HttpPrincipal httpPrincipal,
97 long groupId, java.lang.String name, java.lang.String portletId,
98 javax.portlet.PortletPreferences preferences)
99 throws com.liferay.portal.PortalException,
100 com.liferay.portal.SystemException {
101 try {
102 MethodKey methodKey = new MethodKey(PortletPreferencesServiceUtil.class.getName(),
103 "restoreArchivedPreferences",
104 _restoreArchivedPreferencesParameterTypes1);
105
106 MethodHandler methodHandler = new MethodHandler(methodKey, groupId,
107 name, portletId, preferences);
108
109 try {
110 TunnelUtil.invoke(httpPrincipal, methodHandler);
111 }
112 catch (Exception e) {
113 if (e instanceof com.liferay.portal.PortalException) {
114 throw (com.liferay.portal.PortalException)e;
115 }
116
117 if (e instanceof com.liferay.portal.SystemException) {
118 throw (com.liferay.portal.SystemException)e;
119 }
120
121 throw new com.liferay.portal.SystemException(e);
122 }
123 }
124 catch (com.liferay.portal.SystemException se) {
125 _log.error(se, se);
126
127 throw se;
128 }
129 }
130
131 public static void updateArchivePreferences(HttpPrincipal httpPrincipal,
132 long userId, long groupId, java.lang.String name,
133 java.lang.String portletId, javax.portlet.PortletPreferences preferences)
134 throws com.liferay.portal.PortalException,
135 com.liferay.portal.SystemException {
136 try {
137 MethodKey methodKey = new MethodKey(PortletPreferencesServiceUtil.class.getName(),
138 "updateArchivePreferences",
139 _updateArchivePreferencesParameterTypes2);
140
141 MethodHandler methodHandler = new MethodHandler(methodKey, userId,
142 groupId, name, portletId, preferences);
143
144 try {
145 TunnelUtil.invoke(httpPrincipal, methodHandler);
146 }
147 catch (Exception e) {
148 if (e instanceof com.liferay.portal.PortalException) {
149 throw (com.liferay.portal.PortalException)e;
150 }
151
152 if (e instanceof com.liferay.portal.SystemException) {
153 throw (com.liferay.portal.SystemException)e;
154 }
155
156 throw new com.liferay.portal.SystemException(e);
157 }
158 }
159 catch (com.liferay.portal.SystemException se) {
160 _log.error(se, se);
161
162 throw se;
163 }
164 }
165
166 private static Log _log = LogFactoryUtil.getLog(PortletPreferencesServiceHttp.class);
167 private static final Class<?>[] _deleteArchivedPreferencesParameterTypes0 = new Class[] {
168 long.class
169 };
170 private static final Class<?>[] _restoreArchivedPreferencesParameterTypes1 = new Class[] {
171 long.class, java.lang.String.class, java.lang.String.class,
172 javax.portlet.PortletPreferences.class
173 };
174 private static final Class<?>[] _updateArchivePreferencesParameterTypes2 = new Class[] {
175 long.class, long.class, java.lang.String.class,
176 java.lang.String.class, javax.portlet.PortletPreferences.class
177 };
178 }