From 8a372b620397406eee503e5781cf01a1b0b3792f Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Thu, 4 Sep 2008 01:54:39 +0000 Subject: [PATCH] Merged V2.2 to HEAD 10640: Fixed ETWOTWO-688: Node Path.Element strings are returned with numerical ordering suffix 10641: Fix for ETWOTWO-640: Cannot login through FTP 10665: Fix to generate legal Faces component IDs (in turn output as HTML element IDs). Fixes ETWOTWO-687 and ALFCOM-1756. 10666: Fix for ETWOTWO-539. 10675: Merged V2.1 to V2.2 10649: Fix for ETWOONE-98 and extra error/debug logging. ... other linkvalidation enable/disable changes 10711: Merged V2.1 to V2.2 10615: Fix to keep org.alfresco.repo.workflow.jbpm.* in the session git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10712 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- config/alfresco/core-services-context.xml | 1 + .../linkvalidation-messages.properties | 3 +++ .../linkvalidation/LinkValidationAction.java | 18 +++++++++++------- .../linkvalidation/LinkValidationService.java | 4 ++-- .../hibernate/SessionSizeResourceManager.java | 3 ++- .../repo/node/db/DbNodeServiceImpl.java | 4 ++++ 6 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 config/alfresco/messages/linkvalidation-messages.properties diff --git a/config/alfresco/core-services-context.xml b/config/alfresco/core-services-context.xml index 77da27184e..77d97fe631 100644 --- a/config/alfresco/core-services-context.xml +++ b/config/alfresco/core-services-context.xml @@ -346,6 +346,7 @@ alfresco.messages.webdav-messages alfresco.messages.copy-service alfresco.messages.avm-messages + alfresco.messages.linkvalidation-messages alfresco.messages.content-filter-languages diff --git a/config/alfresco/messages/linkvalidation-messages.properties b/config/alfresco/messages/linkvalidation-messages.properties new file mode 100644 index 0000000000..d03600c039 --- /dev/null +++ b/config/alfresco/messages/linkvalidation-messages.properties @@ -0,0 +1,3 @@ +# Link Validation related messages + +linkvalidation.disabled=Link validation not performed - currently disabled \ No newline at end of file diff --git a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java index a552271483..33d0b88d99 100644 --- a/source/java/org/alfresco/linkvalidation/LinkValidationAction.java +++ b/source/java/org/alfresco/linkvalidation/LinkValidationAction.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2007 Alfresco Software Limited. + * Copyright (C) 2005-2008 Alfresco Software Limited. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -29,6 +29,7 @@ import java.util.List; import org.alfresco.config.JNDIConstants; import org.alfresco.error.AlfrescoRuntimeException; +import org.alfresco.i18n.I18NUtil; import org.alfresco.repo.action.ParameterDefinitionImpl; import org.alfresco.repo.action.executer.ActionExecuterAbstractBase; import org.alfresco.repo.avm.AVMNodeConverter; @@ -51,6 +52,8 @@ import org.apache.commons.logging.LogFactory; */ public class LinkValidationAction extends ActionExecuterAbstractBase { + private static final String MSG_DISABLED = "linkvalidation.disabled"; + public static final String NAME = "avm-link-validation"; public static final String PARAM_COMPARE_TO_STAGING = "compare-to-staging"; @@ -163,12 +166,13 @@ public class LinkValidationAction extends ActionExecuterAbstractBase LinkValidationReport report = null; try { - if (this.linkValidationService.isLinkValidationDisabled()) - { - logger.warn("Link validation (action) not performed - currently disabled by system administrator"); - throw new AlfrescoRuntimeException("Link validation not performed - currently disabled by the system administrator"); - } - + if (this.linkValidationService.isLinkValidationDisabled()) + { + String warnMsg = I18NUtil.getMessage(MSG_DISABLED); + logger.warn(warnMsg); + throw new AlfrescoRuntimeException(warnMsg); + } + // determine which API to call depending on whether there is a destination webapp present if (destWebappPath != null) { diff --git a/source/java/org/alfresco/linkvalidation/LinkValidationService.java b/source/java/org/alfresco/linkvalidation/LinkValidationService.java index b503542b45..44bb79393a 100644 --- a/source/java/org/alfresco/linkvalidation/LinkValidationService.java +++ b/source/java/org/alfresco/linkvalidation/LinkValidationService.java @@ -29,9 +29,10 @@ package org.alfresco.linkvalidation; import java.net.SocketException; import java.util.List; + import javax.net.ssl.SSLException; + import org.alfresco.service.cmr.avm.AVMNotFoundException; -import org.alfresco.util.NameMatcher; public interface LinkValidationService { @@ -189,7 +190,6 @@ public interface LinkValidationService //------------------------------------------------------------------------- public List getHrefsDependentUponFile(String path); - public void setLinkValidationDisabled(boolean disabled); public boolean isLinkValidationDisabled(); diff --git a/source/java/org/alfresco/repo/domain/hibernate/SessionSizeResourceManager.java b/source/java/org/alfresco/repo/domain/hibernate/SessionSizeResourceManager.java index 6829593164..506d3d6614 100644 --- a/source/java/org/alfresco/repo/domain/hibernate/SessionSizeResourceManager.java +++ b/source/java/org/alfresco/repo/domain/hibernate/SessionSizeResourceManager.java @@ -182,7 +182,8 @@ public class SessionSizeResourceManager extends HibernateDaoSupport implements M { // This should probably be configurable but frankly the nauseous extrusion of Gavin King's // programmatic alimentary tract (hibernate) will go away before this could make a difference. - if (!key.getEntityName().startsWith("org.alfresco")) + String entityName = key.getEntityName(); + if (!entityName.startsWith("org.alfresco") || entityName.startsWith("org.alfresco.repo.workflow.jbpm")) { continue; } diff --git a/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java b/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java index 31020c5e1b..38bd762ac0 100644 --- a/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java +++ b/source/java/org/alfresco/repo/node/db/DbNodeServiceImpl.java @@ -1608,6 +1608,10 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl { continue; } + // Ordering is meaningless here as we are constructing a path upwards + // and have no idea where the node comes in the sibling order or even + // if there are like-pathed siblings. + assocRef.setNthSibling(-1); // build a path element Path.Element element = new Path.ChildAssocElement(assocRef); // create a new path that builds on the current path