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.PortletServiceUtil;
23
24
61 public class PortletServiceHttp {
62 public static com.liferay.portal.kernel.json.JSONArray getWARPortlets(
63 HttpPrincipal httpPrincipal) throws com.liferay.portal.SystemException {
64 try {
65 MethodKey methodKey = new MethodKey(PortletServiceUtil.class.getName(),
66 "getWARPortlets", _getWARPortletsParameterTypes0);
67
68 MethodHandler methodHandler = new MethodHandler(methodKey);
69
70 Object returnObj = null;
71
72 try {
73 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
74 }
75 catch (Exception e) {
76 throw new com.liferay.portal.SystemException(e);
77 }
78
79 return (com.liferay.portal.kernel.json.JSONArray)returnObj;
80 }
81 catch (com.liferay.portal.SystemException se) {
82 _log.error(se, se);
83
84 throw se;
85 }
86 }
87
88 public static com.liferay.portal.model.Portlet updatePortlet(
89 HttpPrincipal httpPrincipal, long companyId,
90 java.lang.String portletId, java.lang.String roles, boolean active)
91 throws com.liferay.portal.PortalException,
92 com.liferay.portal.SystemException {
93 try {
94 MethodKey methodKey = new MethodKey(PortletServiceUtil.class.getName(),
95 "updatePortlet", _updatePortletParameterTypes1);
96
97 MethodHandler methodHandler = new MethodHandler(methodKey,
98 companyId, portletId, roles, active);
99
100 Object returnObj = null;
101
102 try {
103 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
104 }
105 catch (Exception e) {
106 if (e instanceof com.liferay.portal.PortalException) {
107 throw (com.liferay.portal.PortalException)e;
108 }
109
110 if (e instanceof com.liferay.portal.SystemException) {
111 throw (com.liferay.portal.SystemException)e;
112 }
113
114 throw new com.liferay.portal.SystemException(e);
115 }
116
117 return (com.liferay.portal.model.Portlet)returnObj;
118 }
119 catch (com.liferay.portal.SystemException se) {
120 _log.error(se, se);
121
122 throw se;
123 }
124 }
125
126 private static Log _log = LogFactoryUtil.getLog(PortletServiceHttp.class);
127 private static final Class<?>[] _getWARPortletsParameterTypes0 = new Class[] {
128
129 };
130 private static final Class<?>[] _updatePortletParameterTypes1 = new Class[] {
131 long.class, java.lang.String.class, java.lang.String.class,
132 boolean.class
133 };
134 }