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