diff --git a/config/alfresco/messages/webclient.properties b/config/alfresco/messages/webclient.properties index 5cb9e6869c..bf1000a700 100644 --- a/config/alfresco/messages/webclient.properties +++ b/config/alfresco/messages/webclient.properties @@ -522,6 +522,9 @@ download_complete=When the download is complete, click OK. undo_checkout_for=Undo Check Out for undo_checkout=Undo Check Out undo_checkout_info=If you undo the check out of a document, the associated working copy will be deleted and all changes to it since the Check Out will be lost. +complete=complete +working_copy_for=Working copy for +working_copy_missing_info=The working copy is no longer available. This could be due to an active rule(s) applied to the space you checked-out to. # Document and Space details messages details_of=Details of @@ -1272,6 +1275,7 @@ title_advanced_search=Advanced Search title_checkin_file=Check In File title_checkout_file=Check Out File title_checkout_file_link=Check Out File Download +title_missing_working_copy=Working Copy No Longer Available title_delete_file=Delete File title_delete_rule=Delete Rule title_delete_user=Delete User diff --git a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java index 85554f5a1d..dd32c7f540 100644 --- a/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java +++ b/source/java/org/alfresco/web/bean/CheckinCheckoutBean.java @@ -445,6 +445,7 @@ public class CheckinCheckoutBean public String checkoutFile() { String outcome = null; + boolean checkoutSuccessful = false; UserTransaction tx = null; @@ -518,8 +519,8 @@ public class CheckinCheckoutBean // commit the transaction tx.commit(); - // show the page that display the checkout link - outcome = "checkoutFileLink"; + // mark as successful + checkoutSuccessful = true; } catch (Throwable err) { @@ -534,6 +535,23 @@ public class CheckinCheckoutBean logger.warn("WARNING: checkoutFile called without a current Document!"); } + // determine which page to show next if the checkout was successful. + if (checkoutSuccessful) + { + // If a check-in rule is present in the space + // the document was checked out to the working copy would have already disappeared! + if (this.nodeService.exists(this.workingDocument.getNodeRef())) + { + // go to the page that allows the user to download the content for editing + outcome = "checkoutFileLink"; + } + else + { + // show a page telling the user that the content has already been checked in + outcome = "workingCopyMissing"; + } + } + return outcome; } diff --git a/source/web/WEB-INF/faces-config-navigation.xml b/source/web/WEB-INF/faces-config-navigation.xml index 878f5022f4..31c804edd9 100644 --- a/source/web/WEB-INF/faces-config-navigation.xml +++ b/source/web/WEB-INF/faces-config-navigation.xml @@ -269,6 +269,10 @@ checkoutFileLink /jsp/dialog/checkout-file-link.jsp + + workingCopyMissing + /jsp/dialog/working-copy-missing.jsp + diff --git a/source/web/jsp/dialog/checkout-file-link.jsp b/source/web/jsp/dialog/checkout-file-link.jsp index 5bcaa2f9d6..665060b409 100644 --- a/source/web/jsp/dialog/checkout-file-link.jsp +++ b/source/web/jsp/dialog/checkout-file-link.jsp @@ -70,7 +70,7 @@