All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
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.
META-INF.resources.asset_list.source.jsp 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
*/
--%>
<%@ include file="/init.jsp" %>
<%
List> classTypesAssetRendererFactories = new ArrayList<>();
List> classTypesList = new ArrayList<>();
%>
<%
// Left list
List typesLeftList = new ArrayList();
long[] classNameIds = editAssetListDisplayContext.getClassNameIds();
for (long classNameId : classNameIds) {
typesLeftList.add(new KeyValuePair(String.valueOf(classNameId), ResourceActionsUtil.getModelResource(locale, PortalUtil.getClassName(classNameId))));
}
// Right list
List typesRightList = new ArrayList();
Arrays.sort(classNameIds);
%>
">
<%
for (long classNameId : editAssetListDisplayContext.getAvailableClassNameIds()) {
ClassName className = ClassNameLocalServiceUtil.getClassName(classNameId);
if (Arrays.binarySearch(classNameIds, classNameId) < 0) {
typesRightList.add(new KeyValuePair(String.valueOf(classNameId), ResourceActionsUtil.getModelResource(locale, className.getValue())));
}
%>
<%
}
%>
">
<%
typesRightList = ListUtil.sort(typesRightList, new KeyValuePairComparator(false, true));
%>
<%
UnicodeProperties unicodeProperties = editAssetListDisplayContext.getUnicodeProperties();
List> assetRendererFactories = ListUtil.sort(AssetRendererFactoryRegistryUtil.getAssetRendererFactories(company.getCompanyId()), new AssetRendererFactoryTypeNameComparator(locale));
for (AssetRendererFactory> assetRendererFactory : assetRendererFactories) {
ClassTypeReader classTypeReader = assetRendererFactory.getClassTypeReader();
List classTypes = classTypeReader.getAvailableClassTypes(editAssetListDisplayContext.getReferencedModelsGroupIds(), locale);
if (classTypes.isEmpty()) {
continue;
}
classTypes.sort(new ClassTypeNameComparator(locale));
classTypesAssetRendererFactories.add(assetRendererFactory);
String className = editAssetListDisplayContext.getClassName(assetRendererFactory);
Long[] assetSelectedClassTypeIds = editAssetListDisplayContext.getClassTypeIds(unicodeProperties, className, classTypes);
// Left list
List subtypesLeftList = new ArrayList();
for (long subtypeId : assetSelectedClassTypeIds) {
try {
ClassType classType = classTypeReader.getClassType(subtypeId, locale);
subtypesLeftList.add(new KeyValuePair(String.valueOf(subtypeId), HtmlUtil.escape(classType.getName())));
}
catch (NoSuchModelException nsme) {
}
}
Arrays.sort(assetSelectedClassTypeIds);
// Right list
List subtypesRightList = new ArrayList();
boolean noAssetSubtypeSelected = false;
if (Validator.isNull(unicodeProperties.getProperty("anyClassType" + className))) {
noAssetSubtypeSelected = true;
}
boolean anyAssetSubtype = GetterUtil.getBoolean(unicodeProperties.getProperty("anyClassType" + className, Boolean.TRUE.toString()));
if (noAssetSubtypeSelected) {
anyAssetSubtype = false;
}
%>
">
<%
for (ClassType classType : classTypes) {
if (Arrays.binarySearch(assetSelectedClassTypeIds, classType.getClassTypeId()) < 0) {
subtypesRightList.add(new KeyValuePair(String.valueOf(classType.getClassTypeId()), HtmlUtil.escape(classType.getName())));
}
%>
<%
}
%>
">
<%= HtmlUtil.escape(editAssetListDisplayContext.getDDMStructureFieldLabel()) %>: <%= HtmlUtil.escape(editAssetListDisplayContext.getDDMStructureDisplayFieldValue()) %>
<%
for (ClassType classType : classTypes) {
if (classType.getClassTypeFieldsCount() == 0) {
continue;
}
%>
<%
}
typesRightList = ListUtil.sort(typesRightList, new KeyValuePairComparator(false, true));
%>
" id="
<%= className %>Boxes">
<%
}
for (AssetRendererFactory> curAssetRendererFactory : classTypesAssetRendererFactories) {
ClassTypeReader classTypeReader = curAssetRendererFactory.getClassTypeReader();
List> classSubtypes = new ArrayList<>();
List assetAvailableClassTypes = classTypeReader.getAvailableClassTypes(editAssetListDisplayContext.getReferencedModelsGroupIds(), locale);
if (assetAvailableClassTypes.isEmpty()) {
continue;
}
for (ClassType classType : assetAvailableClassTypes) {
List classTypeFields = classType.getClassTypeFields();
List> classTypeFieldsList = new ArrayList<>();
if (classTypeFields.isEmpty()) {
continue;
}
String orderByColumn1 = editAssetListDisplayContext.getOrderByColumn1();
String orderByColumn2 = editAssetListDisplayContext.getOrderByColumn2();
for (ClassTypeField classTypeField : classTypeFields) {
String value = editAssetListDisplayContext.encodeName(classTypeField.getClassTypeId(), classTypeField.getFieldReference(), null);
String selectedOrderByColumn1 = StringPool.BLANK;
String selectedOrderByColumn2 = StringPool.BLANK;
if (orderByColumn1.equals(value)) {
selectedOrderByColumn1 = "selected";
}
if (orderByColumn2.equals(value)) {
selectedOrderByColumn2 = "selected";
}
classTypeFieldsList.add(
HashMapBuilder.put(
"label", HtmlUtil.escape(classTypeField.getLabel())
).put(
"selectedOrderByColumn1", selectedOrderByColumn1
).put(
"selectedOrderByColumn2", selectedOrderByColumn2
).put(
"value", value
).build());
}
classSubtypes.add(
HashMapBuilder.put(
"classTypeFields", classTypeFieldsList
).put(
"classTypeId", classType.getClassTypeId()
).put(
"name", HtmlUtil.escape(classType.getName())
).build());
}
classTypesList.add(
HashMapBuilder.put(
"className", editAssetListDisplayContext.getClassName(curAssetRendererFactory)
).put(
"classNameId", curAssetRendererFactory.getClassNameId()
).put(
"classSubtypes", classSubtypes
).build());
}
%>