mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
. Added unlock action to doc details list of actions.
- fixes AWC-566 and AWC-195 and AWC-221 . Fix for unreported issue where an error would occur when showing the details of a locked doc where it's associated working-copy had been deleted. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2912 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -173,6 +173,8 @@ working_copy_document=Working Copy
|
||||
copy_of=Copy of
|
||||
link_to=Link to
|
||||
icon=Icon
|
||||
lock=Lock
|
||||
unlock=Unlock
|
||||
|
||||
# Properties
|
||||
username=User Name
|
||||
@@ -526,6 +528,7 @@ select_category=Select a category
|
||||
selected_categories=Selected categories
|
||||
no_selected_categories=No categories selected.
|
||||
success_ownership=Successfully took ownership of the object.
|
||||
success_unlock=Successfully unlocked the document.
|
||||
inherit_permissions=Inherit Parent Space Permissions
|
||||
success_inherit_permissions=Successfully changed Inherit Parent Permissions to 'Yes'
|
||||
success_not_inherit_permissions=Successfully changed Inherit Parent Permissions to 'No'
|
||||
|
@@ -396,6 +396,17 @@
|
||||
<action-listener>#{SpaceDetailsBean.takeOwnership}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Unlock document -->
|
||||
<action id="unlock_doc">
|
||||
<permissions>
|
||||
<permission allow="true">Unlock</permission>
|
||||
</permissions>
|
||||
<evaluator>org.alfresco.web.action.evaluator.UnlockDocEvaluator</evaluator>
|
||||
<label-id>unlock</label-id>
|
||||
<image>/images/icons/unlock.gif</image>
|
||||
<action-listener>#{DocumentDetailsBean.unlock}</action-listener>
|
||||
</action>
|
||||
|
||||
<!-- Manage Content Users -->
|
||||
<action id="manage_content_users">
|
||||
<permissions>
|
||||
@@ -560,6 +571,7 @@
|
||||
<action idref="cut_node" />
|
||||
<action idref="copy_node" />
|
||||
<action idref="delete_doc" />
|
||||
<action idref="unlock_doc" />
|
||||
<action idref="take_ownership_doc" />
|
||||
<action idref="manage_content_users" />
|
||||
<action idref="create_shortcut" />
|
||||
|
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2005 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
package org.alfresco.web.action.evaluator;
|
||||
|
||||
import org.alfresco.web.action.ActionEvaluator;
|
||||
import org.alfresco.web.bean.repository.Node;
|
||||
|
||||
/**
|
||||
* UI Action Evaluator - Unlock a locked document.
|
||||
*
|
||||
* @author Kevin Roast
|
||||
*/
|
||||
public final class UnlockDocEvaluator implements ActionEvaluator
|
||||
{
|
||||
/**
|
||||
* @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
|
||||
*/
|
||||
public boolean evaluate(Node node)
|
||||
{
|
||||
return (node.isLocked() == true);
|
||||
}
|
||||
}
|
@@ -334,6 +334,8 @@ public abstract class BaseDetailsBean
|
||||
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
|
||||
fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg);
|
||||
|
||||
getNode().reset();
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
}
|
||||
|
@@ -24,6 +24,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.faces.application.FacesMessage;
|
||||
import javax.faces.context.FacesContext;
|
||||
import javax.faces.event.ActionEvent;
|
||||
import javax.transaction.UserTransaction;
|
||||
@@ -64,6 +65,7 @@ public class DocumentDetailsBean extends BaseDetailsBean
|
||||
|
||||
private static final String MSG_HAS_FOLLOWING_CATEGORIES = "has_following_categories";
|
||||
private static final String MSG_NO_CATEGORIES_APPLIED = "no_categories_applied";
|
||||
private static final String MSG_SUCCESS_UNLOCK = "success_unlock";
|
||||
private static final String MSG_ERROR_ASPECT_INLINEEDITABLE = "error_aspect_inlineeditable";
|
||||
private static final String MSG_ERROR_ASPECT_VERSIONING = "error_aspect_versioning";
|
||||
private static final String MSG_ERROR_ASPECT_CLASSIFY = "error_aspect_classify";
|
||||
@@ -820,6 +822,41 @@ public class DocumentDetailsBean extends BaseDetailsBean
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Action Handler to unlock a locked document
|
||||
*/
|
||||
public void unlock(ActionEvent event)
|
||||
{
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
|
||||
UserTransaction tx = null;
|
||||
|
||||
try
|
||||
{
|
||||
tx = Repository.getUserTransaction(fc);
|
||||
tx.begin();
|
||||
|
||||
this.lockService.unlock(getNode().getNodeRef());
|
||||
|
||||
String msg = Application.getMessage(fc, MSG_SUCCESS_UNLOCK);
|
||||
FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
|
||||
String formId = Utils.getParentForm(fc, event.getComponent()).getClientId(fc);
|
||||
fc.addMessage(formId + ':' + getPropertiesPanelId(), facesMsg);
|
||||
|
||||
getNode().reset();
|
||||
|
||||
// commit the transaction
|
||||
tx.commit();
|
||||
}
|
||||
catch (Throwable e)
|
||||
{
|
||||
// rollback the transaction
|
||||
try { if (tx != null) {tx.rollback();} } catch (Exception ex) {}
|
||||
Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
|
||||
fc, Repository.ERROR_GENERIC), e.getMessage()), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies the inlineeditable aspect to the current document
|
||||
*/
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 886 B After Width: | Height: | Size: 989 B |
@@ -77,22 +77,22 @@
|
||||
</div>
|
||||
<a:panel id="working-copy" rendered="#{DocumentDetailsBean.locked}">
|
||||
<div class="mainSubText">
|
||||
<h:outputText value="#{msg.working_copy_document}" />:
|
||||
<a:actionLink value="#{DocumentDetailsBean.workingCopyDocument.properties.name}" actionListener="#{BrowseBean.setupContentAction}" action="showDocDetails">
|
||||
<h:outputText id="out-workingcopy" value="#{msg.working_copy_document}" />:
|
||||
<a:actionLink id="act-details" rendered="#{DocumentDetailsBean.workingCopyDocument != null}" value="#{DocumentDetailsBean.workingCopyDocument.properties.name}" actionListener="#{BrowseBean.setupContentAction}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.workingCopyDocument.id}" />
|
||||
</a:actionLink>
|
||||
</div>
|
||||
</a:panel>
|
||||
<div class="mainSubText"><h:outputText value="#{msg.documentdetails_description}" /></div>
|
||||
<div class="mainSubText"><h:outputText id="doc-details" value="#{msg.documentdetails_description}" /></div>
|
||||
</td>
|
||||
|
||||
<%-- Navigation --%>
|
||||
<td align=right>
|
||||
<a:actionLink value="#{msg.previous_item}" image="/images/icons/nav_prev.gif" showLink="false" actionListener="#{DocumentDetailsBean.previousItem}" action="showDocDetails">
|
||||
<a:actionLink id="act-prev" value="#{msg.previous_item}" image="/images/icons/nav_prev.gif" showLink="false" actionListener="#{DocumentDetailsBean.previousItem}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
<img src="<%=request.getContextPath()%>/images/icons/nav_file.gif" width=24 height=24 align=absmiddle>
|
||||
<a:actionLink value="#{msg.next_item}" image="/images/icons/nav_next.gif" showLink="false" actionListener="#{DocumentDetailsBean.nextItem}" action="showDocDetails">
|
||||
<a:actionLink id="act-next" value="#{msg.next_item}" image="/images/icons/nav_next.gif" showLink="false" actionListener="#{DocumentDetailsBean.nextItem}" action="showDocDetails">
|
||||
<f:param name="id" value="#{DocumentDetailsBean.id}" />
|
||||
</a:actionLink>
|
||||
</td>
|
||||
@@ -116,8 +116,6 @@
|
||||
<table cellspacing="0" cellpadding="3" border="0" width="100%">
|
||||
<tr>
|
||||
<td width="100%" valign="top">
|
||||
<a:errors message="An error occurred" styleClass="errorMessage" />
|
||||
|
||||
<%-- wrapper comment used by the panel to add additional component facets --%>
|
||||
<h:panelGroup id="dashboard-panel-facets">
|
||||
<f:facet name="title">
|
||||
@@ -222,7 +220,8 @@
|
||||
action="#{DocumentDetailsBean.applyInlineEditable}"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" />
|
||||
</r:permissionEvaluator>
|
||||
<h:message for="document-props" styleClass="statusMessage" />
|
||||
<h:messages id="error1" globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
<h:message id="msg1" for="document-props" styleClass="statusMessage" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -253,7 +252,8 @@
|
||||
columns="1" mode="view" labelStyleClass="propertiesLabel" externalConfig="true" />
|
||||
<h:outputText id="no-inline-msg2" value="<br/>#{msg.not_inline_editable}<br/>"
|
||||
rendered="#{DocumentDetailsBean.inlineEditable == false}" escape="false" />
|
||||
<h:messages id="props-locked-msgs" styleClass="errorMessage" layout="table" />
|
||||
<h:messages id="error2" globalOnly="true" styleClass="errorMessage" layout="table" />
|
||||
<h:message id="msg2" for="document-props-locked" styleClass="statusMessage" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -383,7 +383,7 @@
|
||||
<table cellpadding="1" cellspacing="1" border="0" width="100%">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<h:commandButton value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
||||
<h:commandButton id="close-btn" value="#{msg.close}" action="dialog:close" styleClass="wizardButton" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user