1
19
20 package com.liferay.portal.service.http;
21
22 import com.liferay.portal.kernel.log.Log;
23 import com.liferay.portal.kernel.log.LogFactoryUtil;
24 import com.liferay.portal.kernel.util.BooleanWrapper;
25 import com.liferay.portal.kernel.util.LongWrapper;
26 import com.liferay.portal.kernel.util.MethodWrapper;
27 import com.liferay.portal.kernel.util.NullWrapper;
28 import com.liferay.portal.security.auth.HttpPrincipal;
29 import com.liferay.portal.service.PortletServiceUtil;
30
31
70 public class PortletServiceHttp {
71 public static com.liferay.portal.kernel.json.JSONArray getWARPortlets(
72 HttpPrincipal httpPrincipal) throws com.liferay.portal.SystemException {
73 try {
74 MethodWrapper methodWrapper = new MethodWrapper(PortletServiceUtil.class.getName(),
75 "getWARPortlets", new Object[0]);
76
77 Object returnObj = null;
78
79 try {
80 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
81 }
82 catch (Exception e) {
83 throw new com.liferay.portal.SystemException(e);
84 }
85
86 return (com.liferay.portal.kernel.json.JSONArray)returnObj;
87 }
88 catch (com.liferay.portal.SystemException se) {
89 _log.error(se, se);
90
91 throw se;
92 }
93 }
94
95 public static com.liferay.portal.model.Portlet updatePortlet(
96 HttpPrincipal httpPrincipal, long companyId,
97 java.lang.String portletId, java.lang.String roles, boolean active)
98 throws com.liferay.portal.PortalException,
99 com.liferay.portal.SystemException {
100 try {
101 Object paramObj0 = new LongWrapper(companyId);
102
103 Object paramObj1 = portletId;
104
105 if (portletId == null) {
106 paramObj1 = new NullWrapper("java.lang.String");
107 }
108
109 Object paramObj2 = roles;
110
111 if (roles == null) {
112 paramObj2 = new NullWrapper("java.lang.String");
113 }
114
115 Object paramObj3 = new BooleanWrapper(active);
116
117 MethodWrapper methodWrapper = new MethodWrapper(PortletServiceUtil.class.getName(),
118 "updatePortlet",
119 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
120
121 Object returnObj = null;
122
123 try {
124 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
125 }
126 catch (Exception e) {
127 if (e instanceof com.liferay.portal.PortalException) {
128 throw (com.liferay.portal.PortalException)e;
129 }
130
131 if (e instanceof com.liferay.portal.SystemException) {
132 throw (com.liferay.portal.SystemException)e;
133 }
134
135 throw new com.liferay.portal.SystemException(e);
136 }
137
138 return (com.liferay.portal.model.Portlet)returnObj;
139 }
140 catch (com.liferay.portal.SystemException se) {
141 _log.error(se, se);
142
143 throw se;
144 }
145 }
146
147 private static Log _log = LogFactoryUtil.getLog(PortletServiceHttp.class);
148 }