
META-INF.resources.configuration_dynamic.jsp Maven / Gradle / Ivy
<%--
/**
* 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.
*/
--%>
<%@ include file="/init.jsp" %>
<%
List> classTypesAssetRendererFactories = (List>)request.getAttribute("configuration.jsp-classTypesAssetRendererFactories");
PortletURL configurationRenderURL = (PortletURL)request.getAttribute("configuration.jsp-configurationRenderURL");
String redirect = (String)request.getAttribute("configuration.jsp-redirect");
String selectScope = (String)request.getAttribute("configuration.jsp-selectScope");
String selectStyle = (String)request.getAttribute("configuration.jsp-selectStyle");
%>
<%= selectStyle %>
<%= selectScope %>
<%
Set availableClassNameIdsSet = SetUtil.fromArray(assetPublisherDisplayContext.getAvailableClassNameIds());
// Left list
List typesLeftList = new ArrayList();
long[] classNameIds = assetPublisherDisplayContext.getClassNameIds();
for (long classNameId : classNameIds) {
String className = PortalUtil.getClassName(classNameId);
typesLeftList.add(new KeyValuePair(String.valueOf(classNameId), ResourceActionsUtil.getModelResource(locale, className)));
}
// Right list
List typesRightList = new ArrayList();
Arrays.sort(classNameIds);
%>
">
<%
for (long classNameId : availableClassNameIdsSet) {
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));
%>
" id=" classNamesBoxes">
<%
List> assetRendererFactories = ListUtil.sort(AssetRendererFactoryRegistryUtil.getAssetRendererFactories(company.getCompanyId()), new AssetRendererFactoryTypeNameComparator(locale));
for (AssetRendererFactory> assetRendererFactory : assetRendererFactories) {
ClassTypeReader classTypeReader = assetRendererFactory.getClassTypeReader();
List classTypes = classTypeReader.getAvailableClassTypes(assetPublisherDisplayContext.getReferencedModelsGroupIds(), locale);
if (classTypes.isEmpty()) {
continue;
}
classTypesAssetRendererFactories.add(assetRendererFactory);
String className = AssetPublisherUtil.getClassName(assetRendererFactory);
Long[] assetSelectedClassTypeIds = AssetPublisherUtil.getClassTypeIds(portletPreferences, className, classTypes);
// Left list
List subtypesLeftList = new ArrayList();
for (long subtypeId : assetSelectedClassTypeIds) {
subtypesLeftList.add(new KeyValuePair(String.valueOf(subtypeId), HtmlUtil.escape(classTypeReader.getClassType(subtypeId, locale).getName())));
}
Arrays.sort(assetSelectedClassTypeIds);
// Right list
List subtypesRightList = new ArrayList();
boolean anyAssetSubtype = GetterUtil.getBoolean(portletPreferences.getValue("anyClassType" + className, Boolean.TRUE.toString()));
%>
<%
String label = ResourceActionsUtil.getModelResource(locale, assetRendererFactory.getClassName()) + StringPool.SPACE + assetRendererFactory.getSubtypeTitle(themeDisplay.getLocale());
%>
" id=" <%= className %>Boxes">
<%
}
%>
">
<%
DuplicateQueryRuleException dqre = null;
%>
<%
dqre = (DuplicateQueryRuleException)errorException;
String name = dqre.getName();
%>
( - - )
<%
String queryLogicIndexesParam = ParamUtil.getString(request, "queryLogicIndexes");
int[] queryLogicIndexes = null;
if (Validator.isNotNull(queryLogicIndexesParam)) {
queryLogicIndexes = StringUtil.split(queryLogicIndexesParam, 0);
}
else {
queryLogicIndexes = new int[0];
for (int i = 0; true; i++) {
String queryValues = PrefsParamUtil.getString(portletPreferences, request, "queryValues" + i);
if (Validator.isNull(queryValues)) {
break;
}
queryLogicIndexes = ArrayUtil.append(queryLogicIndexes, i);
}
if (queryLogicIndexes.length == 0) {
queryLogicIndexes = ArrayUtil.append(queryLogicIndexes, -1);
}
}
int index = 0;
for (int queryLogicIndex : queryLogicIndexes) {
String queryValues = StringUtil.merge(portletPreferences.getValues("queryValues" + queryLogicIndex, new String[0]));
String tagNames = ParamUtil.getString(request, "queryTagNames" + queryLogicIndex, queryValues);
String categoryIds = ParamUtil.getString(request, "queryCategoryIds" + queryLogicIndex, queryValues);
if (Validator.isNotNull(tagNames) || Validator.isNotNull(categoryIds) || (queryLogicIndexes.length == 1)) {
request.setAttribute("configuration.jsp-categorizableGroupIds", assetPublisherDisplayContext.getReferencedModelsGroupIds());
request.setAttribute("configuration.jsp-index", String.valueOf(index));
request.setAttribute("configuration.jsp-queryLogicIndex", String.valueOf(queryLogicIndex));
String cssClass = StringPool.BLANK;
if (dqre != null) {
boolean queryContains = PrefsParamUtil.getBoolean(portletPreferences, request, "queryContains" + queryLogicIndex, true);
boolean queryAndOperator = PrefsParamUtil.getBoolean(portletPreferences, request, "queryAndOperator" + queryLogicIndex);
String queryName = PrefsParamUtil.getString(portletPreferences, request, "queryName" + queryLogicIndex, "assetTags");
String dqreQueryName = dqre.getName();
if ((dqre.isContains() == queryContains) && (dqre.isAndOperator() == queryAndOperator) && dqreQueryName.equals(queryName)) {
cssClass = "asset-query-rule-error";
}
}
%>
<%
}
index++;
}
%>
var autoFields = new Liferay.AutoFields(
{
contentBox: '# queryRules',
fieldIndexes: ' queryLogicIndexes',
namespace: ' ',
url: ' '
}
).render();
<%
List assetEntryQueryProcessors = AssetPublisherUtil.getAssetEntryQueryProcessors();
for (AssetEntryQueryProcessor assetEntryQueryProcessor : assetEntryQueryProcessors) {
%>
<%
assetEntryQueryProcessor.include(request, new PipingServletResponse(pageContext));
%>
<%
}
%>
<%
String orderByColumn1 = assetPublisherDisplayContext.getOrderByColumn1();
%>
<%
String orderByType1 = assetPublisherDisplayContext.getOrderByType1();
%>
<%
String orderByColumn2 = assetPublisherDisplayContext.getOrderByColumn2();
%>
<%
String orderByType2 = assetPublisherDisplayContext.getOrderByType2();
%>
<%
long assetVocabularyId = GetterUtil.getLong(portletPreferences.getValue("assetVocabularyId", null));
%>
<%
Group companyGroup = company.getGroup();
if (scopeGroupId != companyGroup.getGroupId()) {
List assetVocabularies = AssetVocabularyLocalServiceUtil.getGroupVocabularies(scopeGroupId, false);
if (!assetVocabularies.isEmpty()) {
%>
">
<%
for (AssetVocabulary assetVocabulary : assetVocabularies) {
assetVocabulary = assetVocabulary.toEscapedModel();
%>
<%
}
%>
<%
}
}
%>
<%
List assetVocabularies = AssetVocabularyLocalServiceUtil.getGroupVocabularies(companyGroup.getGroupId(), false);
if (!assetVocabularies.isEmpty()) {
%>
( )">
<%
for (AssetVocabulary assetVocabulary : assetVocabularies) {
assetVocabulary = assetVocabulary.toEscapedModel();
%>
<%
}
%>
<%
}
%>
<%@ include file="/display_settings.jspf" %>
<%@ include file="/email_subscription_settings.jspf" %>
var Util = Liferay.Util;
var MAP_DDM_STRUCTURES = {};
var assetMultipleSelector = $('# currentClassNameIds');
var assetSelector = $('# anyAssetType');
var ddmStructureFieldName = $('# ddmStructureFieldName');
var orderByColumn1 = $('# orderByColumn1');
var orderByColumn2 = $('# orderByColumn2');
var sourcePanel = $('# assetPublisherSourcePanel');
<%
for (AssetRendererFactory> curRendererFactory : classTypesAssetRendererFactories) {
String className = AssetPublisherUtil.getClassName(curRendererFactory);
%>
Util.toggleSelectBox(' anyClassType<%= className %>', 'false', ' <%= className %>Boxes');
var <%= className %>Options = $('# <%= className %>Options');
function toggle<%= className %>(removeOrderBySubtype) {
var assetOptions = assetMultipleSelector.find('option');
var showOptions = ((assetSelector.val() == '<%= curRendererFactory.getClassNameId() %>') ||
((assetSelector.val() == 'false') && (assetOptions.length == 1) && (assetOptions.eq(0).val() == '<%= curRendererFactory.getClassNameId() %>')));
<%= className %>Options.toggleClass('hide', !showOptions);
if (removeOrderBySubtype) {
orderByColumn1.find('.order-by-subtype').remove();
orderByColumn2.find('.order-by-subtype').remove();
}
<%= className %>toggleSubclassesFields(true);
}
<%
ClassTypeReader classTypeReader = curRendererFactory.getClassTypeReader();
List assetAvailableClassTypes = classTypeReader.getAvailableClassTypes(assetPublisherDisplayContext.getReferencedModelsGroupIds(), locale);
if (assetAvailableClassTypes.isEmpty()) {
continue;
}
for (ClassType classType : assetAvailableClassTypes) {
List classTypeFields = classType.getClassTypeFields();
if (classTypeFields.isEmpty()) {
continue;
}
%>
var optgroupClose = '';
var optgroupOpen = '
© 2015 - 2025 Weber Informatics LLC | Privacy Policy