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.IntegerWrapper;
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.ResourceServiceUtil;
25
26
63 public class ResourceServiceHttp {
64 public static com.liferay.portal.model.Resource getResource(
65 HttpPrincipal httpPrincipal, long companyId, java.lang.String name,
66 int scope, java.lang.String primKey)
67 throws com.liferay.portal.kernel.exception.PortalException,
68 com.liferay.portal.kernel.exception.SystemException {
69 try {
70 Object paramObj0 = new LongWrapper(companyId);
71
72 Object paramObj1 = name;
73
74 if (name == null) {
75 paramObj1 = new NullWrapper("java.lang.String");
76 }
77
78 Object paramObj2 = new IntegerWrapper(scope);
79
80 Object paramObj3 = primKey;
81
82 if (primKey == null) {
83 paramObj3 = new NullWrapper("java.lang.String");
84 }
85
86 MethodWrapper methodWrapper = new MethodWrapper(ResourceServiceUtil.class.getName(),
87 "getResource",
88 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
89
90 Object returnObj = null;
91
92 try {
93 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
94 }
95 catch (Exception e) {
96 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
97 throw (com.liferay.portal.kernel.exception.PortalException)e;
98 }
99
100 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
101 throw (com.liferay.portal.kernel.exception.SystemException)e;
102 }
103
104 throw new com.liferay.portal.kernel.exception.SystemException(e);
105 }
106
107 return (com.liferay.portal.model.Resource)returnObj;
108 }
109 catch (com.liferay.portal.kernel.exception.SystemException se) {
110 _log.error(se, se);
111
112 throw se;
113 }
114 }
115
116 private static Log _log = LogFactoryUtil.getLog(ResourceServiceHttp.class);
117 }