META-INF.resources.edit_folder.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" %>
<%
String redirect = ParamUtil.getString(request, "redirect");
JournalFolder folder = journalDisplayContext.getFolder();
long folderId = BeanParamUtil.getLong(folder, request, "folderId");
long parentFolderId = BeanParamUtil.getLong(folder, request, "parentFolderId", JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID);
boolean rootFolder = ParamUtil.getBoolean(request, "rootFolder");
boolean workflowEnabled = WorkflowHandlerRegistryUtil.getWorkflowHandler(JournalArticle.class.getName()) != null;
List workflowDefinitions = null;
if (workflowEnabled) {
workflowDefinitions = WorkflowDefinitionManagerUtil.liberalGetActiveWorkflowDefinitions(company.getCompanyId(), QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
}
String languageId = LocaleUtil.toLanguageId(locale);
portletDisplay.setShowBackIcon(true);
portletDisplay.setURLBack(redirect);
portletDisplay.setURLBackTitle(portletDisplay.getPortletDisplayName());
String title = StringPool.BLANK;
if (rootFolder) {
title = LanguageUtil.get(request, "home");
}
else {
if (folder == null) {
title = LanguageUtil.get(request, "new-folder");
}
else {
title = folder.getName();
}
}
renderResponse.setTitle(title);
%>
<%
for (WorkflowDefinition workflowDefinition : workflowDefinitions) {
%>
<%
}
%>
<%
String parentFolderName = LanguageUtil.get(request, "home");
JournalFolder parentFolder = JournalFolderServiceUtil.fetchFolder(parentFolderId);
if (parentFolder != null) {
parentFolderName = parentFolder.getName();
}
%>
<%
List ddmStructures = journalDisplayContext.getDDMStructures(JournalFolderConstants.RESTRICTION_TYPE_DDM_STRUCTURES_AND_WORKFLOW);
String headerNames = null;
if (workflowEnabled) {
headerNames = "name,workflow,null";
}
else {
headerNames = "name,null";
}
%>
<%
JournalFolder parentFolder = JournalFolderLocalServiceUtil.fetchFolder(folder.getParentFolderId());
String parentFolderName = LanguageUtil.get(request, "home");
if (parentFolder != null) {
parentFolderName = parentFolder.getName();
}
%>
" id=" restrictionTypeDefinedDiv">
<%
WorkflowDefinitionLink workflowDefinitionLink = WorkflowDefinitionLinkLocalServiceUtil.fetchWorkflowDefinitionLink(company.getCompanyId(), scopeGroupId, JournalFolder.class.getName(), folderId, ddmStructure.getStructureId(), true);
for (WorkflowDefinition workflowDefinition : workflowDefinitions) {
boolean selected = false;
if ((workflowDefinitionLink != null) && Objects.equals(workflowDefinitionLink.getWorkflowDefinitionName(), workflowDefinition.getName()) && (workflowDefinitionLink.getWorkflowDefinitionVersion() == workflowDefinition.getVersion())) {
selected = true;
}
%>
<%
}
%>
" id=" restrictionTypeWorkflowDiv">
<%
WorkflowDefinitionLink workflowDefinitionLink = WorkflowDefinitionLinkLocalServiceUtil.fetchWorkflowDefinitionLink(company.getCompanyId(), scopeGroupId, JournalFolder.class.getName(), folderId, JournalArticleConstants.DDM_STRUCTURE_ID_ALL, true);
for (WorkflowDefinition workflowDefinition : workflowDefinitions) {
boolean selected = false;
if ((workflowDefinitionLink != null) && Objects.equals(workflowDefinitionLink.getWorkflowDefinitionName(), workflowDefinition.getName()) && (workflowDefinitionLink.getWorkflowDefinitionVersion() == workflowDefinition.getVersion())) {
selected = true;
}
%>
<%
}
%>
Liferay.Util.toggleRadio(' restrictionTypeInherit', '', [
' restrictionTypeDefinedDiv',
' restrictionTypeWorkflowDiv',
]);
Liferay.Util.toggleRadio(
' restrictionTypeDefined',
' restrictionTypeDefinedDiv',
' restrictionTypeWorkflowDiv'
);
Liferay.Util.toggleRadio(
' restrictionTypeWorkflow',
' restrictionTypeWorkflowDiv',
' restrictionTypeDefinedDiv'
);
© 2015 - 2024 Weber Informatics LLC | Privacy Policy