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.
<%--
/**
* 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="/asset_categories_navigation/init.jsp" %>
<%
boolean hidePortletWhenEmpty = GetterUtil.getBoolean((String)request.getAttribute("liferay-asset:asset-tags-navigation:hidePortletWhenEmpty"));
long[] vocabularyIds = (long[])request.getAttribute("liferay-asset:asset-tags-navigation:vocabularyIds");
long categoryId = ParamUtil.getLong(request, "categoryId");
List vocabularies = null;
if (vocabularyIds == null) {
vocabularies = AssetVocabularyServiceUtil.getGroupVocabularies(PortalUtil.getCurrentAndAncestorSiteGroupIds(scopeGroupId));
}
else {
vocabularies = new ArrayList();
for (long vocabularyId : vocabularyIds) {
try {
vocabularies.add(AssetVocabularyServiceUtil.getVocabulary(vocabularyId));
}
catch (PortalException pe) {
}
}
}
PortletURL portletURL = renderResponse.createRenderURL();
%>
<%
for (int i = 0; i < vocabularies.size(); i++) {
AssetVocabulary vocabulary = vocabularies.get(i);
String vocabularyNavigation = _buildVocabularyNavigation(vocabulary, categoryId, portletURL, themeDisplay);
if (Validator.isNotNull(vocabularyNavigation)) {
hidePortletWhenEmpty = false;
%>
<%= vocabularyNavigation %>
<%
}
}
%>
<%
if (hidePortletWhenEmpty) {
renderRequest.setAttribute(WebKeys.PORTLET_CONFIGURATOR_VISIBILITY, Boolean.TRUE);
%>
<%
}
if (categoryId > 0) {
AssetCategoryUtil.addPortletBreadcrumbEntries(categoryId, request, portletURL, false);
}
%>
var treeViews = A.all('#<%= namespace %>taglibAssetCategoriesNavigationPanel .lfr-asset-category-list-container');
treeViews.each(
function(item, index, collection) {
var assetCategoryList = item.one('.lfr-asset-category-list');
var treeView = new A.TreeView(
{
boundingBox: item,
contentBox: assetCategoryList,
type: 'normal'
}
).render();
var selected = assetCategoryList.one('.tree-node .tag-selected');
if (selected) {
var selectedChild = treeView.getNodeByChild(selected);
selectedChild.expand();
selectedChild.eachParent(
function(node) {
if (node instanceof A.TreeNode) {
node.expand();
}
}
);
}
}
);
<%!
private void _buildCategoriesNavigation(List categories, long categoryId, PortletURL portletURL, ThemeDisplay themeDisplay, StringBundler sb) throws Exception {
portletURL.setParameter("categoryId", StringPool.BLANK);
String originalPortletURLString = portletURL.toString();
for (AssetCategory category : categories) {
List categoriesChildren = AssetCategoryServiceUtil.getChildCategories(category.getCategoryId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
sb.append("