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