Merging from EC-MC: Project compile

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5742 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-05-22 05:00:16 +00:00
parent 2e79d2e6d2
commit e34312ea05
12 changed files with 217 additions and 132 deletions

View File

@@ -7,7 +7,7 @@
<view:acl view:inherit="false"> <view:acl view:inherit="false">
<view:ace view:access="ALLOWED"> <view:ace view:access="ALLOWED">
<view:authority>GROUP_EVERYONE</view:authority> <view:authority>GROUP_EVERYONE</view:authority>
<view:permission>Coordinator</view:permission> <view:permission>Consumer</view:permission>
</view:ace> </view:ace>
</view:acl> </view:acl>
</cm:mlRoot> </cm:mlRoot>

View File

@@ -111,12 +111,12 @@
</constructor-arg> </constructor-arg>
</bean> </bean>
<bean id="contentFilterLanguagesService" class="org.alfresco.repo.model.ml.ContentFilterLanguagesMap" init-method="init" > <bean id="contentFilterLanguagesService" class="org.alfresco.repo.model.ml.ContentFilterLanguagesMap" init-method="init" >
<constructor-arg> <property name="configService">
<ref bean="contentFilterLanguagesConfigService" /> <ref bean="contentFilterLanguagesConfigService" />
</constructor-arg> </property>
</bean> </bean>
<bean id="openOfficeConnection" class="net.sf.jooreports.openoffice.connection.SocketOpenOfficeConnection" /> <bean id="openOfficeConnection" class="net.sf.jooreports.openoffice.connection.SocketOpenOfficeConnection" />
<bean id="openOfficeConnectionTester" class="org.alfresco.util.OpenOfficeConnectionTester" init-method="checkConnection" > <bean id="openOfficeConnectionTester" class="org.alfresco.util.OpenOfficeConnectionTester" init-method="checkConnection" >
<property name="connection"> <property name="connection">

View File

@@ -43,19 +43,19 @@
<!-- Multilingual specific service --> <!-- Multilingual specific service -->
<bean name="multilingualContentService" class="org.alfresco.repo.model.ml.MultilingualContentServiceImpl" > <bean name="multilingualContentService" class="org.alfresco.repo.model.ml.MultilingualContentServiceImpl" >
<property name="nodeService"> <property name="nodeService">
<ref bean="NodeService" /> <ref bean="nodeService" />
</property> </property>
<property name="searchService"> <property name="searchService">
<ref bean="SearchService" /> <ref bean="searchService" />
</property> </property>
<property name="versionService"> <property name="versionService">
<ref bean="VersionService" /> <ref bean="versionService" />
</property> </property>
<property name="contentFilterLanguagesService"> <property name="contentFilterLanguagesService">
<ref bean="ContentFilterLanguagesService" /> <ref bean="contentFilterLanguagesService" />
</property> </property>
<property name="fileFolderService"> <property name="fileFolderService">
<ref bean="FileFolderService" /> <ref bean="fileFolderService" />
</property> </property>
</bean> </bean>

View File

@@ -13,6 +13,16 @@
</property> </property>
</bean> </bean>
<bean id="mlTranslationInterceptor" class="org.alfresco.repo.node.MLTranslationInterceptor">
<property name="nodeService">
<ref bean="nodeService"/>
</property>
<property name="multilingualContentService">
<ref bean="multilingualContentService"/>
</property>
</bean>
<bean id="nodeService" class="org.springframework.aop.framework.ProxyFactoryBean" > <bean id="nodeService" class="org.springframework.aop.framework.ProxyFactoryBean" >
<property name="targetName"> <property name="targetName">
<value>mlAwareNodeService</value> <value>mlAwareNodeService</value>
@@ -24,6 +34,7 @@
</property> </property>
<property name="interceptorNames"> <property name="interceptorNames">
<list> <list>
<value>mlTranslationInterceptor</value>
<value>mlPropertyInterceptor</value> <value>mlPropertyInterceptor</value>
</list> </list>
</property> </property>

View File

@@ -927,6 +927,14 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
} }
} }
/**
* TODO: Implement
*/
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
{
throw new UnsupportedOperationException();
}
/** /**
* @param nodeRef * @param nodeRef
* @return Returns all properties keyed by their qualified name * @return Returns all properties keyed by their qualified name

View File

@@ -74,12 +74,11 @@ public class ContentFilterLanguagesMap implements ContentFilterLanguagesService
/** /**
* @param configService the config service to use to read languages * @param configService the config service to use to read languages
*/ */
public ContentFilterLanguagesMap(ConfigService configService) public void setConfigService(ConfigService configService)
{ {
this.configService = configService; this.configService = configService;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.alfresco.service.cmr.ml.ContentFilterLanguagesService#getFilterLanguages() * @see org.alfresco.service.cmr.ml.ContentFilterLanguagesService#getFilterLanguages()
*/ */

View File

@@ -875,11 +875,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
public void testRemoveSpecificChild() throws Exception public void testRemoveSpecificChild() throws Exception
{ {
NodeRef parentRef = nodeService.createNode( ChildAssociationRef pathPrimaryRef = nodeService.createNode(
rootNodeRef, rootNodeRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN, ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("parent_child"), QName.createQName("parent_child"),
ContentModel.TYPE_CONTAINER).getChildRef(); ContentModel.TYPE_CONTAINER);
NodeRef parentRef = pathPrimaryRef.getParentRef();
ChildAssociationRef pathARef = nodeService.createNode( ChildAssociationRef pathARef = nodeService.createNode(
parentRef, parentRef,
ASSOC_TYPE_QNAME_TEST_CHILDREN, ASSOC_TYPE_QNAME_TEST_CHILDREN,
@@ -890,12 +891,34 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
pathARef.getChildRef(), pathARef.getChildRef(),
ASSOC_TYPE_QNAME_TEST_CHILDREN, ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathB")); QName.createQName("pathB"));
ChildAssociationRef pathCRef = nodeService.addChild(
parentRef,
pathARef.getChildRef(),
ASSOC_TYPE_QNAME_TEST_CHILDREN,
QName.createQName("pathC"));
// now remove the second association // remove the path B association
boolean removed = nodeService.removeChildAssociation(pathBRef); boolean removedB = nodeService.removeChildAssociation(pathBRef);
assertTrue("Association was not removed", removed); assertTrue("Association was not removed", removedB);
removed = nodeService.removeChildAssociation(pathBRef); removedB = nodeService.removeChildAssociation(pathBRef);
assertFalse("Non-existent association was apparently removed", removed); assertFalse("Non-existent association was apparently removed", removedB);
// remove the path C association
boolean removedC = nodeService.removeChildAssociation(pathCRef);
assertTrue("Association was not removed", removedC);
removedC = nodeService.removeSeconaryChildAssociation(pathCRef);
assertFalse("Non-existent association was apparently removed", removedC);
// Now verify that primary associations are caught
try
{
nodeService.removeSeconaryChildAssociation(pathPrimaryRef);
fail("Primary association not detected");
}
catch (IllegalArgumentException e)
{
// Expected
}
} }
public void testRemoveChildByRef() throws Exception public void testRemoveChildByRef() throws Exception

View File

@@ -150,7 +150,8 @@ public class MLTranslationInterceptor implements MethodInterceptor
} }
} }
} else }
else
{ {
ret = invocation.proceed(); ret = invocation.proceed();
} }

View File

@@ -836,6 +836,31 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
return deleted; return deleted;
} }
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
{
Node parentNode = getNodeNotNull(childAssocRef.getParentRef());
Node childNode = getNodeNotNull(childAssocRef.getChildRef());
QName typeQName = childAssocRef.getTypeQName();
QName qname = childAssocRef.getQName();
ChildAssoc assoc = nodeDaoService.getChildAssoc(parentNode, childNode, typeQName, qname);
if (assoc == null)
{
// No association exists
return false;
}
if (assoc.getIsPrimary())
{
throw new IllegalArgumentException(
"removeSeconaryChildAssociation can not be applied to a primary association: \n" +
" Child Assoc: " + assoc);
}
// Delete the secondary association
nodeDaoService.deleteChildAssoc(assoc, false);
invokeOnDeleteChildAssociation(childAssocRef);
// Done
return true;
}
/** /**
* Remove properties that should not be persisted as general properties. Where necessary, the * Remove properties that should not be persisted as general properties. Where necessary, the
* properties are set on the node. * properties are set on the node.

View File

@@ -245,6 +245,14 @@ public class NodeServiceImpl implements NodeService, VersionModel
throw new UnsupportedOperationException(MSG_UNSUPPORTED); throw new UnsupportedOperationException(MSG_UNSUPPORTED);
} }
/**
* @throws UnsupportedOperationException always
*/
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
{
throw new UnsupportedOperationException(MSG_UNSUPPORTED);
}
/** /**
* @throws UnsupportedOperationException always * @throws UnsupportedOperationException always
*/ */

View File

@@ -339,6 +339,16 @@ public interface NodeService
@Auditable(key = Auditable.Key.ARG_0 ,parameters = {"childAssocRef"}) @Auditable(key = Auditable.Key.ARG_0 ,parameters = {"childAssocRef"})
public boolean removeChildAssociation(ChildAssociationRef childAssocRef); public boolean removeChildAssociation(ChildAssociationRef childAssocRef);
/**
* Remove a specific secondary child association.
*
* @param childAssocRef the association to remove
* @return Returns <tt>true</tt> if the association existed, otherwise <tt>false</tt>.
* @throws IllegalArgumentException if the association is primary
*/
@Auditable(key = Auditable.Key.ARG_0 ,parameters = {"childAssocRef"})
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef);
/** /**
* @param nodeRef * @param nodeRef
* @return Returns all properties keyed by their qualified name * @return Returns all properties keyed by their qualified name