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.BooleanWrapper;
20 import com.liferay.portal.kernel.util.LongWrapper;
21 import com.liferay.portal.kernel.util.MethodWrapper;
22 import com.liferay.portal.kernel.util.NullWrapper;
23 import com.liferay.portal.security.auth.HttpPrincipal;
24 import com.liferay.portal.service.LayoutSetServiceUtil;
25
26
63 public class LayoutSetServiceHttp {
64 public static void updateLogo(HttpPrincipal httpPrincipal, long groupId,
65 boolean privateLayout, boolean logo, java.io.File file)
66 throws com.liferay.portal.kernel.exception.PortalException,
67 com.liferay.portal.kernel.exception.SystemException {
68 try {
69 Object paramObj0 = new LongWrapper(groupId);
70
71 Object paramObj1 = new BooleanWrapper(privateLayout);
72
73 Object paramObj2 = new BooleanWrapper(logo);
74
75 Object paramObj3 = file;
76
77 if (file == null) {
78 paramObj3 = new NullWrapper("java.io.File");
79 }
80
81 MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
82 "updateLogo",
83 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
84
85 try {
86 TunnelUtil.invoke(httpPrincipal, methodWrapper);
87 }
88 catch (Exception e) {
89 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
90 throw (com.liferay.portal.kernel.exception.PortalException)e;
91 }
92
93 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
94 throw (com.liferay.portal.kernel.exception.SystemException)e;
95 }
96
97 throw new com.liferay.portal.kernel.exception.SystemException(e);
98 }
99 }
100 catch (com.liferay.portal.kernel.exception.SystemException se) {
101 _log.error(se, se);
102
103 throw se;
104 }
105 }
106
107 public static com.liferay.portal.model.LayoutSet updateLookAndFeel(
108 HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
109 java.lang.String themeId, java.lang.String colorSchemeId,
110 java.lang.String css, boolean wapTheme)
111 throws com.liferay.portal.kernel.exception.PortalException,
112 com.liferay.portal.kernel.exception.SystemException {
113 try {
114 Object paramObj0 = new LongWrapper(groupId);
115
116 Object paramObj1 = new BooleanWrapper(privateLayout);
117
118 Object paramObj2 = themeId;
119
120 if (themeId == null) {
121 paramObj2 = new NullWrapper("java.lang.String");
122 }
123
124 Object paramObj3 = colorSchemeId;
125
126 if (colorSchemeId == null) {
127 paramObj3 = new NullWrapper("java.lang.String");
128 }
129
130 Object paramObj4 = css;
131
132 if (css == null) {
133 paramObj4 = new NullWrapper("java.lang.String");
134 }
135
136 Object paramObj5 = new BooleanWrapper(wapTheme);
137
138 MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
139 "updateLookAndFeel",
140 new Object[] {
141 paramObj0, paramObj1, paramObj2, paramObj3, paramObj4,
142 paramObj5
143 });
144
145 Object returnObj = null;
146
147 try {
148 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
149 }
150 catch (Exception e) {
151 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
152 throw (com.liferay.portal.kernel.exception.PortalException)e;
153 }
154
155 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
156 throw (com.liferay.portal.kernel.exception.SystemException)e;
157 }
158
159 throw new com.liferay.portal.kernel.exception.SystemException(e);
160 }
161
162 return (com.liferay.portal.model.LayoutSet)returnObj;
163 }
164 catch (com.liferay.portal.kernel.exception.SystemException se) {
165 _log.error(se, se);
166
167 throw se;
168 }
169 }
170
171 public static com.liferay.portal.model.LayoutSet updateVirtualHost(
172 HttpPrincipal httpPrincipal, long groupId, boolean privateLayout,
173 java.lang.String virtualHost)
174 throws com.liferay.portal.kernel.exception.PortalException,
175 com.liferay.portal.kernel.exception.SystemException {
176 try {
177 Object paramObj0 = new LongWrapper(groupId);
178
179 Object paramObj1 = new BooleanWrapper(privateLayout);
180
181 Object paramObj2 = virtualHost;
182
183 if (virtualHost == null) {
184 paramObj2 = new NullWrapper("java.lang.String");
185 }
186
187 MethodWrapper methodWrapper = new MethodWrapper(LayoutSetServiceUtil.class.getName(),
188 "updateVirtualHost",
189 new Object[] { paramObj0, paramObj1, paramObj2 });
190
191 Object returnObj = null;
192
193 try {
194 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
195 }
196 catch (Exception e) {
197 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
198 throw (com.liferay.portal.kernel.exception.PortalException)e;
199 }
200
201 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
202 throw (com.liferay.portal.kernel.exception.SystemException)e;
203 }
204
205 throw new com.liferay.portal.kernel.exception.SystemException(e);
206 }
207
208 return (com.liferay.portal.model.LayoutSet)returnObj;
209 }
210 catch (com.liferay.portal.kernel.exception.SystemException se) {
211 _log.error(se, se);
212
213 throw se;
214 }
215 }
216
217 private static Log _log = LogFactoryUtil.getLog(LayoutSetServiceHttp.class);
218 }