META-INF.resources.definition.details.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.commerce.product.definitions.web
Show all versions of com.liferay.commerce.product.definitions.web
Liferay Commerce Product Definitions Web
The newest version!
<%--
/**
* 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
*/
--%>
<%@ include file="/init.jsp" %>
<%
CPDefinitionsDisplayContext cpDefinitionsDisplayContext = (CPDefinitionsDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
CPDefinition cpDefinition = cpDefinitionsDisplayContext.getCPDefinition();
long cpDefinitionId = cpDefinitionsDisplayContext.getCPDefinitionId();
List commerceCatalogs = cpDefinitionsDisplayContext.getCommerceCatalogs();
String defaultLanguageId = cpDefinitionsDisplayContext.getCatalogDefaultLanguageId();
String productTypeName = BeanParamUtil.getString(cpDefinition, request, "productTypeName");
String friendlyURLBase = themeDisplay.getPortalURL() + cpDefinitionsDisplayContext.getProductURLSeparator();
boolean neverExpire = ParamUtil.getBoolean(request, "neverExpire", true);
if ((cpDefinition != null) && (cpDefinition.getExpirationDate() != null)) {
neverExpire = false;
}
%>
<%
for (CommerceCatalog curCommerceCatalog : commerceCatalogs) {
%>
<%
}
%>
<%
CommerceCatalog commerceCatalog = commerceCatalogs.get(0);
%>
<%
String descriptionMapAsXML = StringPool.BLANK;
if (cpDefinition != null) {
descriptionMapAsXML = cpDefinition.getDescriptionMapAsXML();
}
%>
document
.getElementById(' commerceCatalogGroupId')
.addEventListener('change', (event) => {
var languageId = event.target.querySelector(
'[value="' + event.target.value + '"]'
).dataset.languageid;
var nameInput = document.getElementById(
' nameMapAsXML'
);
var shortDescriptionInput = document.getElementById(
' shortDescriptionMapAsXML'
);
var descriptionInput =
window. descriptionMapAsXMLEditor;
var urlInput = document.getElementById(
' urlTitleMapAsXML'
);
var metaTitleInput = document.getElementById(
' metaTitleMapAsXML'
);
var metaDescriptionInput = document.getElementById(
' metaDescriptionMapAsXML'
);
var metaKeywordsInput = document.getElementById(
' metaKeywordsMapAsXML'
);
var nameInputLocalized = Liferay.component(
' nameMapAsXML'
);
var shortDescriptionInputLocalized = Liferay.component(
' shortDescriptionMapAsXML'
);
var descriptionInputLocalized = Liferay.component(
' descriptionMapAsXML'
);
var urlTitleInputLocalized = Liferay.component(
' urlTitleMapAsXML'
);
var metaTitleInputLocalized = Liferay.component(
' metaTitleMapAsXML'
);
var metaDescriptionInputLocalized = Liferay.component(
' metaDescriptionMapAsXML'
);
var metaKeywordsInputLocalized = Liferay.component(
' metaKeywordsMapAsXML'
);
nameInputLocalized.updateInputLanguage(nameInput.value, languageId);
shortDescriptionInputLocalized.updateInputLanguage(
shortDescriptionInput.value,
languageId
);
descriptionInputLocalized.updateInputLanguage(
descriptionInput.getHTML(),
languageId
);
urlTitleInputLocalized.updateInputLanguage(urlInput.value, languageId);
metaTitleInputLocalized.updateInputLanguage(
metaTitleInput.value,
languageId
);
metaDescriptionInputLocalized.updateInputLanguage(
metaDescriptionInput.value,
languageId
);
metaKeywordsInputLocalized.updateInputLanguage(
metaKeywordsInput.value,
languageId
);
nameInputLocalized.selectFlag(languageId, false);
shortDescriptionInputLocalized.selectFlag(languageId, false);
descriptionInputLocalized.selectFlag(languageId, false);
urlTitleInputLocalized.selectFlag(languageId, false);
metaTitleInputLocalized.selectFlag(languageId, false);
metaDescriptionInputLocalized.selectFlag(languageId, false);
metaKeywordsInputLocalized.selectFlag(languageId, false);
});