Permalink
Browse files

LPS-25035 Deleting a shortcut in Media Gallery should not delete the …

…original
  • Loading branch information...
Zsolt Berentey authored and brianchandotcom committed May 9, 2012
1 parent 8eebde8 commit c3da4990e2a40633d7fe52983951e24d40a3bbb7
@@ -748,6 +748,11 @@
<forward name="portlet.document_library.error" path="portlet.document_library.error" />
</action>
+ <action path="/image_gallery_display/edit_shortcut" type="com.liferay.portlet.documentlibrary.action.EditFileShortcutAction">
+ <forward name="portlet.document_library.edit_file_shortcut" path="portlet.document_library.edit_file_shortcut" />
+ <forward name="portlet.document_library.error" path="portlet.document_library.error" />
+ </action>
+
<action path="/image_gallery_display/embedded_player" forward="portlet.image_gallery_display.embedded_player" />
<action path="/image_gallery_display/find_folder" type="com.liferay.portlet.documentlibrary.action.FindFolderAction" />
@@ -0,0 +1,64 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:choose>
+ <c:when test="<%= (fileShortcut == null) %>">
+ <c:if test="<%= showActions && DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.DELETE) %>">
+ <c:choose>
+ <c:when test="<%= fileEntry.getModel() instanceof DLFileEntry %>">
+ <portlet:actionURL var="deleteURL">
+ <portlet:param name="struts_action" value="/document_library/edit_file_entry" />
+ <portlet:param name="<%= Constants.CMD %>" value="<%= Constants.MOVE_TO_TRASH %>" />
+ <portlet:param name="redirect" value="<%= viewFolderURL.toString() %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileEntry.getFileEntryId()) %>" />
+ </portlet:actionURL>
+
+ <liferay-ui:icon-delete
+ trash="<%= true %>"
+ url="<%= deleteURL %>"
+ />
+ </c:when>
+ <c:otherwise>
+ <portlet:actionURL var="deleteURL">
+ <portlet:param name="struts_action" value="/document_library/edit_file_entry" />
+ <portlet:param name="<%= Constants.CMD %>" value="<%= Constants.DELETE %>" />
+ <portlet:param name="redirect" value="<%= viewFolderURL.toString() %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileEntry.getFileEntryId()) %>" />
+ </portlet:actionURL>
+
+ <liferay-ui:icon-delete
+ url="<%= deleteURL %>"
+ />
+ </c:otherwise>
+ </c:choose>
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <c:if test="<%= showActions && DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.DELETE) %>">
+ <portlet:actionURL var="deleteShortcutURL">
+ <portlet:param name="struts_action" value="/document_library/edit_file_shortcut" />
+ <portlet:param name="<%= Constants.CMD %>" value="<%= Constants.DELETE %>" />
+ <portlet:param name="redirect" value="<%= viewFolderURL.toString() %>" />
+ <portlet:param name="fileShortcutId" value="<%= String.valueOf(fileShortcut.getFileShortcutId()) %>" />
+ </portlet:actionURL>
+
+ <liferay-ui:icon-delete
+ trash="<%= true %>"
+ url="<%= deleteShortcutURL %>"
+ />
+ </c:if>
+ </c:otherwise>
+</c:choose>
@@ -0,0 +1,36 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:choose>
+ <c:when test="<%= (fileShortcut == null) %>">
+ <c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.VIEW) %>">
+ <liferay-ui:icon
+ image="download"
+ message='<%= LanguageUtil.get(pageContext, "download") + " (" + TextFormatter.formatStorageSize(fileEntry.getSize(), locale) + ")" %>'
+ url="<%= DLUtil.getPreviewURL(fileEntry, fileEntry.getFileVersion(), themeDisplay, StringPool.BLANK, false, true) %>"
+ />
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <c:if test="<%= DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.VIEW) %>">
+ <liferay-ui:icon
+ image="download"
+ message='<%= LanguageUtil.get(pageContext, "download") + " (" + TextFormatter.formatStorageSize(fileEntry.getSize(), locale) + ")" %>'
+ url='<%= themeDisplay.getPortalURL() + themeDisplay.getPathContext() + "/documents/" + fileShortcut.getFileShortcutId() %>'
+ />
+ </c:if>
+ </c:otherwise>
+</c:choose>
@@ -0,0 +1,47 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:choose>
+ <c:when test="<%= (fileShortcut == null) %>">
+ <c:if test="<%= showActions && DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.UPDATE) %>">
+ <portlet:renderURL var="editURL">
+ <portlet:param name="struts_action" value="/document_library/edit_file_entry" />
+ <portlet:param name="redirect" value="<%= currentURL %>" />
+ <portlet:param name="backURL" value="<%= currentURL %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileEntry.getFileEntryId()) %>" />
+ </portlet:renderURL>
+
+ <liferay-ui:icon
+ image="edit"
+ url="<%= editURL %>"
+ />
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <c:if test="<%= showActions && DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.UPDATE) %>">
+ <portlet:renderURL var="editShortcutURL">
+ <portlet:param name="struts_action" value="/document_library/edit_file_shortcut" />
+ <portlet:param name="redirect" value="<%= currentURL %>" />
+ <portlet:param name="fileShortcutId" value="<%= String.valueOf(fileShortcut.getFileShortcutId()) %>" />
+ </portlet:renderURL>
+
+ <liferay-ui:icon
+ image="edit"
+ url="<%= editShortcutURL %>"
+ />
+ </c:if>
+ </c:otherwise>
+</c:choose>
@@ -14,7 +14,7 @@
*/
--%>
-<c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.UPDATE) && fileEntry.isSupportsLocking() %>">
+<c:if test="<%= showActions && DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.UPDATE) && fileEntry.isSupportsLocking() %>">
<c:choose>
<c:when test="<%= !fileEntry.isCheckedOut() %>">
<portlet:actionURL var="checkOutURL">
@@ -0,0 +1,29 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:if test="<%= showActions && DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.UPDATE) %>">
+ <portlet:renderURL var="moveURL">
+ <portlet:param name="struts_action" value="/document_library/move_file_entry" />
+ <portlet:param name="redirect" value="<%= viewFolderURL.toString() %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileEntry.getFileEntryId()) %>" />
+ </portlet:renderURL>
+
+ <liferay-ui:icon
+ image="submit"
+ message="move"
+ url="<%= moveURL %>"
+ />
+</c:if>
@@ -0,0 +1,50 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:choose>
+ <c:when test="<%= (fileShortcut == null) %>">
+ <c:if test="<%= showActions && DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.PERMISSIONS) %>">
+ <liferay-security:permissionsURL
+ modelResource="<%= DLFileEntryConstants.getClassName() %>"
+ modelResourceDescription="<%= HtmlUtil.unescape(fileEntry.getTitle()) %>"
+ redirect="<%= currentURL %>"
+ resourcePrimKey="<%= String.valueOf(fileEntry.getFileEntryId()) %>"
+ var="permissionsURL"
+ />
+
+ <liferay-ui:icon
+ image="permissions"
+ url="<%= permissionsURL %>"
+ />
+ </c:if>
+ </c:when>
+ <c:otherwise>
+ <c:if test="<%= showActions && DLFileShortcutPermission.contains(permissionChecker, fileShortcut, ActionKeys.PERMISSIONS) %>">
+ <liferay-security:permissionsURL
+ modelResource="<%= DLFileShortcut.class.getName() %>"
+ modelResourceDescription="<%= fileEntry.getTitle() %>"
+ redirect="<%= currentURL %>"
+ resourcePrimKey="<%= String.valueOf(fileShortcut.getFileShortcutId()) %>"
+ var="shortcutPermissionsURL"
+ />
+
+ <liferay-ui:icon
+ image="permissions"
+ url="<%= shortcutPermissionsURL %>"
+ />
+ </c:if>
+ </c:otherwise>
+</c:choose>
@@ -0,0 +1,31 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:if test="<%= (fileShortcut == null) %>">
+ <c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.VIEW) %>">
+ <portlet:renderURL var="viewFileEntryURL">
+ <portlet:param name="struts_action" value="/document_library/view_file_entry" />
+ <portlet:param name="redirect" value="<%= currentURL %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileEntry.getFileEntryId()) %>" />
+ </portlet:renderURL>
+
+ <liferay-ui:icon
+ image="view"
+ message="view"
+ url="<%= viewFileEntryURL %>"
+ />
+ </c:if>
+</c:if>
@@ -0,0 +1,31 @@
+<%--
+/**
+ * Copyright (c) 2000-2012 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.
+ */
+--%>
+
+<c:if test="<%= (fileShortcut != null) %>">
+ <c:if test="<%= DLFileEntryPermission.contains(permissionChecker, fileEntry, ActionKeys.VIEW) %>">
+ <portlet:renderURL var="viewOriginalFileURL">
+ <portlet:param name="struts_action" value="/document_library/view_file_entry" />
+ <portlet:param name="redirect" value="<%= currentURL %>" />
+ <portlet:param name="fileEntryId" value="<%= String.valueOf(fileShortcut.getToFileEntryId()) %>" />
+ </portlet:renderURL>
+
+ <liferay-ui:icon
+ image="view"
+ message="view-original-file"
+ url="<%= viewOriginalFileURL %>"
+ />
+ </c:if>
+</c:if>
Oops, something went wrong.

0 comments on commit c3da499

Please sign in to comment.