Merged V3.0 to HEAD

11489: Added step for JDBC info
   11490: Fixed: ETHREEOH-452 Error appear when a user trying to view metadata for item, which is deleting
   11491: Blog integration package rename and removal of obsolete web-client beans
   11492: Adding missing web-extension dir to dynamic-website project
   11493: ETHREEOH_520: Fixes to prevent new users from being created when existing users invited to a site
   11494: Updated version to beta2
   11495: Fixes ETHREEOH-252, 392 & 393. When merged to 2.2 will also fix ETWOTWO-246 & 616 and when merged to HEAD will fix ALFCOM-1685 & 1712. 
   11496: Partial fix for ETHREEOH-27, fixes 2 out of the final 3 error conditions.
   11497: Fix for ETHREEOH-550

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@12447 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast 2008-12-17 13:28:44 +00:00
parent afc473ec7f
commit 4669d51678
15 changed files with 127 additions and 21 deletions

View File

@ -7,7 +7,7 @@
<bean id="BlogIntegrationService" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>org.alfresco.repo.blogIntegration.BlogIntegrationService</value>
<value>org.alfresco.repo.blog.BlogIntegrationService</value>
</property>
<property name="target">
<ref bean="blogIntegrationService"/>
@ -35,7 +35,7 @@
<bean id="BlogIntegrationService_security" class="org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor" />
<bean id="blogIntegrationService" class="org.alfresco.repo.blogIntegration.BlogIntegrationServiceImpl">
<bean id="blogIntegrationService" class="org.alfresco.repo.blog.BlogIntegrationServiceImpl">
<property name="nodeService" ref="NodeService"/>
<property name="contentService" ref="ContentService"/>
</bean>
@ -46,12 +46,12 @@
<property name="blogIntegrationService" ref="blogIntegrationService"/>
</bean>
<bean id="wordPressBlogIntegration" parent="baseBlogIntegrationImplmentation" class="org.alfresco.repo.blogIntegration.wordpress.WordPressIntegration">
<bean id="wordPressBlogIntegration" parent="baseBlogIntegrationImplmentation" class="org.alfresco.repo.blog.wordpress.WordPressIntegration">
<property name="name" value="wordpress"/>
<property name="displayName" value="WordPress"/>
</bean>
<bean id="typePadBlogIntegration" parent="baseBlogIntegrationImplmentation" class="org.alfresco.repo.blogIntegration.typepad.TypepadIntegration">
<bean id="typePadBlogIntegration" parent="baseBlogIntegrationImplmentation" class="org.alfresco.repo.blog.typepad.TypepadIntegration">
<property name="name" value="typepad"/>
<property name="displayName" value="Typepad"/>
</bean>

View File

@ -28,9 +28,9 @@ package org.alfresco.repo.action.executer;
import java.util.List;
import org.alfresco.repo.action.ParameterDefinitionImpl;
import org.alfresco.repo.blogIntegration.BlogDetails;
import org.alfresco.repo.blogIntegration.BlogIntegrationRuntimeException;
import org.alfresco.repo.blogIntegration.BlogIntegrationService;
import org.alfresco.repo.blog.BlogDetails;
import org.alfresco.repo.blog.BlogIntegrationRuntimeException;
import org.alfresco.repo.blog.BlogIntegrationService;
import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.action.ParameterDefinition;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
/**
* Base blog implementation class. Extend this when writting a blog integration implementation.

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.io.Serializable;
import java.util.Map;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.util.Map;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import org.alfresco.error.AlfrescoRuntimeException;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.util.List;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.io.Serializable;
import java.util.ArrayList;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.io.Serializable;
import java.util.Date;

View File

@ -22,7 +22,7 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration;
package org.alfresco.repo.blog;
import java.net.MalformedURLException;
import java.net.URL;

View File

@ -22,10 +22,10 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration.typepad;
package org.alfresco.repo.blog.typepad;
import org.alfresco.repo.blogIntegration.BlogDetails;
import org.alfresco.repo.blogIntegration.DefaultBlogIntegrationImplementation;
import org.alfresco.repo.blog.BlogDetails;
import org.alfresco.repo.blog.DefaultBlogIntegrationImplementation;
/**
* Typepad integration implementation

View File

@ -22,10 +22,10 @@
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing
*/
package org.alfresco.repo.blogIntegration.wordpress;
package org.alfresco.repo.blog.wordpress;
import org.alfresco.repo.blogIntegration.BlogDetails;
import org.alfresco.repo.blogIntegration.DefaultBlogIntegrationImplementation;
import org.alfresco.repo.blog.BlogDetails;
import org.alfresco.repo.blog.DefaultBlogIntegrationImplementation;
/**
* @author Roy Wetherall

View File

@ -30,6 +30,7 @@ import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.transaction.UserTransaction;
@ -50,6 +51,7 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.repository.StoreRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.RegexQNamePattern;
import org.alfresco.service.transaction.TransactionService;
import org.alfresco.util.Pair;
import org.apache.commons.lang.mutable.MutableInt;
@ -488,4 +490,70 @@ public class DbNodeServiceImplTest extends BaseNodeServiceTest
handler);
assertTrue("Set value not found.", count.intValue() == 1);
}
public void testAspectRemovalWithCommit() throws Throwable
{
// Create a node to add the aspect to
NodeRef sourceNodeRef = nodeService.createNode(
rootNodeRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName(BaseNodeServiceTest.NAMESPACE, "testAspectRemoval-source"),
ContentModel.TYPE_CONTAINER).getChildRef();
// Create a target for the associations
NodeRef targetNodeRef = nodeService.createNode(
rootNodeRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName(BaseNodeServiceTest.NAMESPACE, "testAspectRemoval-target"),
ContentModel.TYPE_CONTAINER).getChildRef();
// Add the aspect to the source
nodeService.addAspect(sourceNodeRef, ASPECT_WITH_ASSOCIATIONS, null);
// Make the associations
nodeService.addChild(
sourceNodeRef,
targetNodeRef,
ASSOC_ASPECT_CHILD_ASSOC,
QName.createQName(NAMESPACE, "aspect-child"));
nodeService.createAssociation(sourceNodeRef, targetNodeRef, ASSOC_ASPECT_NORMAL_ASSOC);
// Check that the correct associations are present
assertEquals("Expected exactly one child",
1, nodeService.getChildAssocs(sourceNodeRef).size());
assertEquals("Expected exactly one target",
1, nodeService.getTargetAssocs(sourceNodeRef, RegexQNamePattern.MATCH_ALL).size());
// Force a commit here
setComplete();
endTransaction();
// start another transaction to remove the aspect
UserTransaction txn = txnService.getUserTransaction();
txn.begin();
try
{
Set<QName> aspects = nodeService.getAspects(sourceNodeRef);
int noAspectsBefore = aspects.size();
// Now remove the aspect
nodeService.removeAspect(sourceNodeRef, ASPECT_WITH_ASSOCIATIONS);
// Check that the associations were removed
assertEquals("Expected exactly zero child",
0, nodeService.getChildAssocs(sourceNodeRef).size());
assertEquals("Expected exactly zero target",
0, nodeService.getTargetAssocs(sourceNodeRef, RegexQNamePattern.MATCH_ALL).size());
aspects = nodeService.getAspects(sourceNodeRef);
assertEquals("Expected exactly one less aspect",
noAspectsBefore-1, aspects.size());
txn.commit();
}
catch (Throwable e)
{
try { txn.rollback(); } catch (Throwable ee) {}
throw e;
}
}
}

View File

@ -27,6 +27,7 @@ package org.alfresco.repo.node.integrity;
import java.util.List;
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@ -136,6 +137,23 @@ public class AssocSourceMultiplicityIntegrityEvent extends AbstractIntegrityEven
// it is not mandatory and it allows many on both sides of the assoc
return;
}
// check the target of the association if this is a delete
if (isDelete)
{
// get the class the association is defined for and see if it is an aspect
ClassDefinition classDef = assocDef.getTargetClass();
if (classDef.isAspect())
{
// see if the target node has the aspect applied, if it does not
// there's no need to check multiplicity
if (!this.nodeService.hasAspect(targetNodeRef, classDef.getName()))
{
return;
}
}
}
int actualSize = 0;
if (assocDef.isChild())
{
@ -152,6 +170,7 @@ public class AssocSourceMultiplicityIntegrityEvent extends AbstractIntegrityEven
List<AssociationRef> sourceAssocRefs = nodeService.getSourceAssocs(targetNodeRef, assocTypeQName);
actualSize = sourceAssocRefs.size();
}
if ((mandatory && actualSize == 0) || (!allowMany && actualSize > 1))
{
String parentOrSourceStr = (assocDef.isChild() ? "parent" : "source");

View File

@ -27,6 +27,7 @@ package org.alfresco.repo.node.integrity;
import java.util.List;
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ClassDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef;
@ -136,6 +137,23 @@ public class AssocTargetMultiplicityIntegrityEvent extends AbstractIntegrityEven
// it is not mandatory and it allows many on both sides of the assoc
return;
}
// check the source of the association if this is a delete
if (isDelete)
{
// get the class the association is defined for and see if it is an aspect
ClassDefinition classDef = assocDef.getSourceClass();
if (classDef.isAspect())
{
// see if the source node has the aspect applied, if it does not
// there's no need to check multiplicity
if (!this.nodeService.hasAspect(sourceNodeRef, classDef.getName()))
{
return;
}
}
}
int actualSize = 0;
if (assocDef.isChild())
{
@ -152,6 +170,7 @@ public class AssocTargetMultiplicityIntegrityEvent extends AbstractIntegrityEven
List<AssociationRef> targetAssocRefs = nodeService.getTargetAssocs(sourceNodeRef, assocTypeQName);
actualSize = targetAssocRefs.size();
}
if ((mandatory && actualSize == 0) || (!allowMany && actualSize > 1))
{
String childOrTargetStr = (assocDef.isChild() ? "child" : "target");