
META-INF.resources.common.websites.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" %>
<%
String className = (String)request.getAttribute("websites.className");
long classPK = (Long)request.getAttribute("websites.classPK");
List websites = Collections.emptyList();
int[] websitesIndexes = null;
String websitesIndexesParam = ParamUtil.getString(request, "websitesIndexes");
if (Validator.isNotNull(websitesIndexesParam)) {
websites = new ArrayList();
websitesIndexes = StringUtil.split(websitesIndexesParam, 0);
for (int websitesIndex : websitesIndexes) {
websites.add(new WebsiteImpl());
}
}
else {
if (classPK > 0) {
websites = WebsiteServiceUtil.getWebsites(className, classPK);
websitesIndexes = new int[websites.size()];
for (int i = 0; i < websites.size(); i++) {
websitesIndexes[i] = i;
}
}
if (websites.isEmpty()) {
websites = new ArrayList();
websites.add(new WebsiteImpl());
websitesIndexes = new int[] {0};
}
if (websitesIndexes == null) {
websitesIndexes = new int[0];
}
}
%>
<%
for (int i = 0; i < websitesIndexes.length; i++) {
int websitesIndex = websitesIndexes[i];
Website website = websites.get(i);
%>
<%
}
%>
new Liferay.AutoFields(
{
contentBox: '# websites',
fieldIndexes: ' websitesIndexes',
namespace: ' '
}
).render();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy