com.liferay.fragment.web.internal.display.context.ConfigurationDisplayContext Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
package com.liferay.fragment.web.internal.display.context;
import com.liferay.fragment.contributor.FragmentCollectionContributorRegistry;
import com.liferay.fragment.helper.DefaultInputFragmentEntryConfigurationProvider;
import com.liferay.fragment.model.FragmentEntry;
import com.liferay.fragment.service.FragmentEntryLocalServiceUtil;
import com.liferay.info.field.type.BooleanInfoFieldType;
import com.liferay.info.field.type.DateInfoFieldType;
import com.liferay.info.field.type.DateTimeInfoFieldType;
import com.liferay.info.field.type.FileInfoFieldType;
import com.liferay.info.field.type.HTMLInfoFieldType;
import com.liferay.info.field.type.InfoFieldType;
import com.liferay.info.field.type.LongTextInfoFieldType;
import com.liferay.info.field.type.MultiselectInfoFieldType;
import com.liferay.info.field.type.NumberInfoFieldType;
import com.liferay.info.field.type.RelationshipInfoFieldType;
import com.liferay.info.field.type.SelectInfoFieldType;
import com.liferay.info.field.type.TextInfoFieldType;
import com.liferay.portal.kernel.json.JSONObject;
import com.liferay.portal.kernel.language.LanguageUtil;
import com.liferay.portal.kernel.model.Group;
import com.liferay.portal.kernel.portlet.LiferayPortletResponse;
import com.liferay.portal.kernel.portlet.LiferayWindowState;
import com.liferay.portal.kernel.portlet.url.builder.PortletURLBuilder;
import com.liferay.portal.kernel.service.GroupLocalServiceUtil;
import com.liferay.portal.kernel.theme.ThemeDisplay;
import com.liferay.portal.kernel.util.HashMapBuilder;
import com.liferay.portal.kernel.util.WebKeys;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
* @author Víctor Galán
*/
public class ConfigurationDisplayContext {
public ConfigurationDisplayContext(
HttpServletRequest httpServletRequest,
LiferayPortletResponse liferayPortletResponse) {
_httpServletRequest = httpServletRequest;
_defaultInputFragmentEntryConfigurationProvider =
(DefaultInputFragmentEntryConfigurationProvider)
httpServletRequest.getAttribute(
DefaultInputFragmentEntryConfigurationProvider.class.
getName());
_fragmentCollectionContributorRegistry =
(FragmentCollectionContributorRegistry)
httpServletRequest.getAttribute(
FragmentCollectionContributorRegistry.class.getName());
_liferayPortletResponse = liferayPortletResponse;
}
public Map getData() {
ThemeDisplay themeDisplay =
(ThemeDisplay)_httpServletRequest.getAttribute(
WebKeys.THEME_DISPLAY);
return HashMapBuilder.put(
"formTypes",
() -> {
List