001
014
015 package com.liferay.portal.service.http;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.log.Log;
020 import com.liferay.portal.kernel.log.LogFactoryUtil;
021 import com.liferay.portal.kernel.util.MethodHandler;
022 import com.liferay.portal.kernel.util.MethodKey;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.PortletServiceUtil;
025
026
054 @ProviderType
055 public class PortletServiceHttp {
056 public static com.liferay.portal.kernel.json.JSONArray getWARPortlets(
057 HttpPrincipal httpPrincipal) {
058 try {
059 MethodKey methodKey = new MethodKey(PortletServiceUtil.class,
060 "getWARPortlets", _getWARPortletsParameterTypes0);
061
062 MethodHandler methodHandler = new MethodHandler(methodKey);
063
064 Object returnObj = null;
065
066 try {
067 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
068 }
069 catch (Exception e) {
070 throw new com.liferay.portal.kernel.exception.SystemException(e);
071 }
072
073 return (com.liferay.portal.kernel.json.JSONArray)returnObj;
074 }
075 catch (com.liferay.portal.kernel.exception.SystemException se) {
076 _log.error(se, se);
077
078 throw se;
079 }
080 }
081
082 public static com.liferay.portal.model.Portlet updatePortlet(
083 HttpPrincipal httpPrincipal, long companyId,
084 java.lang.String portletId, java.lang.String roles, boolean active)
085 throws com.liferay.portal.kernel.exception.PortalException {
086 try {
087 MethodKey methodKey = new MethodKey(PortletServiceUtil.class,
088 "updatePortlet", _updatePortletParameterTypes1);
089
090 MethodHandler methodHandler = new MethodHandler(methodKey,
091 companyId, portletId, roles, active);
092
093 Object returnObj = null;
094
095 try {
096 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
097 }
098 catch (Exception e) {
099 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
100 throw (com.liferay.portal.kernel.exception.PortalException)e;
101 }
102
103 throw new com.liferay.portal.kernel.exception.SystemException(e);
104 }
105
106 return (com.liferay.portal.model.Portlet)returnObj;
107 }
108 catch (com.liferay.portal.kernel.exception.SystemException se) {
109 _log.error(se, se);
110
111 throw se;
112 }
113 }
114
115 private static Log _log = LogFactoryUtil.getLog(PortletServiceHttp.class);
116 private static final Class<?>[] _getWARPortletsParameterTypes0 = new Class[] {
117
118 };
119 private static final Class<?>[] _updatePortletParameterTypes1 = new Class[] {
120 long.class, java.lang.String.class, java.lang.String.class,
121 boolean.class
122 };
123 }