All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.document_library.folder_action.jsp Maven / Gradle / Ivy

The newest version!
<%--
/**
 * 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="/document_library/init.jsp" %>

<%
String randomNamespace = null;

if (portletName.equals(DLPortletKeys.DOCUMENT_LIBRARY) || portletName.equals(DLPortletKeys.DOCUMENT_LIBRARY_ADMIN)) {
	randomNamespace = PortalUtil.generateRandomKey(request, "portlet_document_library_folder_action") + StringPool.UNDERLINE;
}
else {
	randomNamespace = PortalUtil.generateRandomKey(request, "portlet_image_gallery_display_folder_action") + StringPool.UNDERLINE;
}

String redirect = currentURL;

ResultRow row = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);

Folder folder = null;

long repositoryId = 0;

if (row != null) {
	Object result = row.getObject();

	if (result instanceof Folder) {
		folder = (Folder)result;

		repositoryId = folder.getRepositoryId();
	}
}
else {
	folder = (Folder)request.getAttribute("info_panel.jsp-folder");

	repositoryId = GetterUtil.getLong((String)request.getAttribute("view.jsp-repositoryId"));
}

long folderId = DLFolderConstants.DEFAULT_PARENT_FOLDER_ID;

if (folder != null) {
	folderId = folder.getFolderId();
}

int status = WorkflowConstants.STATUS_APPROVED;

if (permissionChecker.isContentReviewer(user.getCompanyId(), scopeGroupId)) {
	status = WorkflowConstants.STATUS_ANY;
}

boolean folderSelected = GetterUtil.getBoolean((String)request.getAttribute("view_entries.jsp-folderSelected"));

String modelResource = null;
String modelResourceDescription = null;
String resourcePrimKey = null;

boolean showPermissionsURL = false;

if (folder != null) {
	modelResource = DLFolderConstants.getClassName();
	modelResourceDescription = folder.getName();
	resourcePrimKey = String.valueOf(folderId);

	showPermissionsURL = DLFolderPermission.contains(permissionChecker, folder, ActionKeys.PERMISSIONS);
}
else {
	modelResource = "com.liferay.document.library";
	modelResourceDescription = themeDisplay.getScopeGroupName();
	resourcePrimKey = String.valueOf(scopeGroupId);

	showPermissionsURL = DLPermission.contains(permissionChecker, scopeGroupId, ActionKeys.PERMISSIONS);
}

DLPortletInstanceSettingsHelper dlPortletInstanceSettingsHelper = new DLPortletInstanceSettingsHelper(dlRequestHelper);

boolean view = false;

if ((row == null) && portletName.equals(DLPortletKeys.MEDIA_GALLERY_DISPLAY)) {
	view = true;
}
%>


	

		<%
		boolean hasViewPermission = DLFolderPermission.contains(permissionChecker, scopeGroupId, folderId, ActionKeys.VIEW);
		%>

		
			
				
				
			

			
		

		
			

				<%
				boolean hasUpdatePermission = DLFolderPermission.contains(permissionChecker, scopeGroupId, folderId, ActionKeys.UPDATE);
				%>

				
					
						
							
								
								
								
								
							

							
						
						
							
								
								
								
								
							

							
						
					
				

				
					
						
						
						
						
					

					
				

				
					
						
						
						
						
						
					

					
				

				

					<%
					LocalRepository localRepository = null;

					try {
						localRepository = RepositoryProviderUtil.getLocalRepository(folder.getRepositoryId());
					}
					catch (RepositoryException re) {
					}

					if ((localRepository != null) && localRepository.isCapabilityProvided(TemporaryFileEntriesCapability.class)) {
					%>

						
							
							
							
						

						

					<%
					}
					%>

				
			
			

				<%
				boolean workflowEnabled = WorkflowEngineManagerUtil.isDeployed() && (WorkflowHandlerRegistryUtil.getWorkflowHandler(DLFileEntry.class.getName()) != null);
				%>

				
					
						
						
						
						
						
					

					
				

				
					
						
						
						
						
						
					

					
				

				
					
						
						
						
					

					
				
			
		

		
			
				
					
					
					
					
				

				

				
					
						
						
						
						
						
					

					
				
			

			
				
			

			
				
					
					
					
					
				

				
			
		

		
			
		

		
			

			
		

		<%
		boolean hasDeletePermission = DLFolderPermission.contains(permissionChecker, scopeGroupId, folderId, ActionKeys.DELETE);
		%>

		

			<%
			String mvcRenderCommandName = "/image_gallery_display/view";

			if (!portletName.equals(DLPortletKeys.MEDIA_GALLERY_DISPLAY)) {
				mvcRenderCommandName = "/document_library/view";

				if (folder.getParentFolderId() != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
					mvcRenderCommandName = "/document_library/view_folder";
				}
			}
			%>

			
				
					
						
						
					

					
						
						
						
					

					
				
				
					
						
						
					

					
						
						
						
					

					
				
			
		
	

	
		if (!A.UA.ios && (A.Uploader.TYPE != 'none')) {
			var uploadMultipleDocumentsIcon = A.all('.upload-multiple-documents:hidden');

			uploadMultipleDocumentsIcon.show();
		}

		var slideShow = A.one('.<%= randomNamespace %>-slide-show');

		if (slideShow) {
			slideShow.on(
				'click',
				function(event) {
					
						
						
					

					var slideShowWindow = window.open('<%= viewSlideShowURL %>', 'slideShow', 'directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');

					slideShowWindow.focus();
				}
			);
		}
	




© 2015 - 2025 Weber Informatics LLC | Privacy Policy