Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.portal.jsonwebservice.action;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.json.data.FileData;
import com.liferay.portal.json.transformer.BeanAnalyzerTransformer;
import com.liferay.portal.kernel.javadoc.JavadocManagerUtil;
import com.liferay.portal.kernel.javadoc.JavadocMethod;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONSerializable;
import com.liferay.portal.kernel.json.JSONSerializer;
import com.liferay.portal.kernel.jsonwebservice.JSONWebServiceAction;
import com.liferay.portal.kernel.jsonwebservice.JSONWebServiceActionMapping;
import com.liferay.portal.kernel.jsonwebservice.JSONWebServiceActionsManagerUtil;
import com.liferay.portal.kernel.jsonwebservice.JSONWebServiceNaming;
import com.liferay.portal.kernel.util.GetterUtil;
import com.liferay.portal.kernel.util.MethodParameter;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.portal.kernel.util.ReleaseInfo;
import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Validator;
import java.io.File;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import jodd.util.ReflectUtil;
/**
* @author Igor Spasic
* @author Raymond Augé
*/
public class JSONWebServiceDiscoverAction implements JSONWebServiceAction {
public JSONWebServiceDiscoverAction(HttpServletRequest request) {
_basePath = request.getServletPath();
_baseURL = String.valueOf(request.getRequestURL());
ServletContext servletContext = request.getServletContext();
_contextName = GetterUtil.getString(
ParamUtil.getString(
request, "contextName",
servletContext.getServletContextName()));
_jsonWebServiceNaming =
JSONWebServiceActionsManagerUtil.getJSONWebServiceNaming();
}
@Override
public JSONWebServiceActionMapping getJSONWebServiceActionMapping() {
return null;
}
@Override
public Object invoke() throws Exception {
Map resultsMap = new LinkedHashMap<>();
resultsMap.put("contextName", _contextName);
resultsMap.put("basePath", _basePath);
resultsMap.put("baseURL", _baseURL);
resultsMap.put("services", _buildJsonWebServiceActionMappingMaps());
resultsMap.put("types", _buildTypes());
resultsMap.put("version", ReleaseInfo.getVersion());
return new DiscoveryContent(resultsMap);
}
public static class DiscoveryContent implements JSONSerializable {
public DiscoveryContent(Map resultsMap) {
_resultsMap = resultsMap;
}
@Override
public String toJSONString() {
JSONSerializer jsonSerializer =
JSONFactoryUtil.createJSONSerializer();
jsonSerializer.include("types");
return jsonSerializer.serializeDeep(_resultsMap);
}
private final Map _resultsMap;
}
private List