001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.BooleanWrapper;
020 import com.liferay.portal.kernel.util.LongWrapper;
021 import com.liferay.portal.kernel.util.MethodWrapper;
022 import com.liferay.portal.kernel.util.NullWrapper;
023 import com.liferay.portal.security.auth.HttpPrincipal;
024 import com.liferay.portal.service.PortletServiceUtil;
025
026
056 public class PortletServiceHttp {
057 public static com.liferay.portal.kernel.json.JSONArray getWARPortlets(
058 HttpPrincipal httpPrincipal)
059 throws com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodWrapper methodWrapper = new MethodWrapper(PortletServiceUtil.class.getName(),
062 "getWARPortlets", new Object[0]);
063
064 Object returnObj = null;
065
066 try {
067 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
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 com.liferay.portal.kernel.exception.SystemException {
087 try {
088 Object paramObj0 = new LongWrapper(companyId);
089
090 Object paramObj1 = portletId;
091
092 if (portletId == null) {
093 paramObj1 = new NullWrapper("java.lang.String");
094 }
095
096 Object paramObj2 = roles;
097
098 if (roles == null) {
099 paramObj2 = new NullWrapper("java.lang.String");
100 }
101
102 Object paramObj3 = new BooleanWrapper(active);
103
104 MethodWrapper methodWrapper = new MethodWrapper(PortletServiceUtil.class.getName(),
105 "updatePortlet",
106 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
107
108 Object returnObj = null;
109
110 try {
111 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
112 }
113 catch (Exception e) {
114 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
115 throw (com.liferay.portal.kernel.exception.PortalException)e;
116 }
117
118 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
119 throw (com.liferay.portal.kernel.exception.SystemException)e;
120 }
121
122 throw new com.liferay.portal.kernel.exception.SystemException(e);
123 }
124
125 return (com.liferay.portal.model.Portlet)returnObj;
126 }
127 catch (com.liferay.portal.kernel.exception.SystemException se) {
128 _log.error(se, se);
129
130 throw se;
131 }
132 }
133
134 private static Log _log = LogFactoryUtil.getLog(PortletServiceHttp.class);
135 }