001
014
015 package com.liferay.portlet.exportimport.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.http.TunnelUtil;
025
026 import com.liferay.portlet.exportimport.service.ExportImportConfigurationServiceUtil;
027
028
056 @ProviderType
057 public class ExportImportConfigurationServiceHttp {
058 public static void deleteExportImportConfiguration(
059 HttpPrincipal httpPrincipal, long exportImportConfigurationId)
060 throws com.liferay.portal.kernel.exception.PortalException {
061 try {
062 MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
063 "deleteExportImportConfiguration",
064 _deleteExportImportConfigurationParameterTypes0);
065
066 MethodHandler methodHandler = new MethodHandler(methodKey,
067 exportImportConfigurationId);
068
069 try {
070 TunnelUtil.invoke(httpPrincipal, methodHandler);
071 }
072 catch (Exception e) {
073 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074 throw (com.liferay.portal.kernel.exception.PortalException)e;
075 }
076
077 throw new com.liferay.portal.kernel.exception.SystemException(e);
078 }
079 }
080 catch (com.liferay.portal.kernel.exception.SystemException se) {
081 _log.error(se, se);
082
083 throw se;
084 }
085 }
086
087 public static com.liferay.portlet.exportimport.model.ExportImportConfiguration moveExportImportConfigurationToTrash(
088 HttpPrincipal httpPrincipal, long exportImportConfigurationId)
089 throws com.liferay.portal.kernel.exception.PortalException {
090 try {
091 MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
092 "moveExportImportConfigurationToTrash",
093 _moveExportImportConfigurationToTrashParameterTypes1);
094
095 MethodHandler methodHandler = new MethodHandler(methodKey,
096 exportImportConfigurationId);
097
098 Object returnObj = null;
099
100 try {
101 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
102 }
103 catch (Exception e) {
104 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
105 throw (com.liferay.portal.kernel.exception.PortalException)e;
106 }
107
108 throw new com.liferay.portal.kernel.exception.SystemException(e);
109 }
110
111 return (com.liferay.portlet.exportimport.model.ExportImportConfiguration)returnObj;
112 }
113 catch (com.liferay.portal.kernel.exception.SystemException se) {
114 _log.error(se, se);
115
116 throw se;
117 }
118 }
119
120 public static com.liferay.portlet.exportimport.model.ExportImportConfiguration restoreExportImportConfigurationFromTrash(
121 HttpPrincipal httpPrincipal, long exportImportConfigurationId)
122 throws com.liferay.portal.kernel.exception.PortalException {
123 try {
124 MethodKey methodKey = new MethodKey(ExportImportConfigurationServiceUtil.class,
125 "restoreExportImportConfigurationFromTrash",
126 _restoreExportImportConfigurationFromTrashParameterTypes2);
127
128 MethodHandler methodHandler = new MethodHandler(methodKey,
129 exportImportConfigurationId);
130
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
138 throw (com.liferay.portal.kernel.exception.PortalException)e;
139 }
140
141 throw new com.liferay.portal.kernel.exception.SystemException(e);
142 }
143
144 return (com.liferay.portlet.exportimport.model.ExportImportConfiguration)returnObj;
145 }
146 catch (com.liferay.portal.kernel.exception.SystemException se) {
147 _log.error(se, se);
148
149 throw se;
150 }
151 }
152
153 private static Log _log = LogFactoryUtil.getLog(ExportImportConfigurationServiceHttp.class);
154 private static final Class<?>[] _deleteExportImportConfigurationParameterTypes0 =
155 new Class[] { long.class };
156 private static final Class<?>[] _moveExportImportConfigurationToTrashParameterTypes1 =
157 new Class[] { long.class };
158 private static final Class<?>[] _restoreExportImportConfigurationFromTrashParameterTypes2 =
159 new Class[] { long.class };
160 }