mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -7,7 +7,7 @@
|
||||
<view:acl view:inherit="false">
|
||||
<view:ace view:access="ALLOWED">
|
||||
<view:authority>GROUP_EVERYONE</view:authority>
|
||||
<view:permission>Coordinator</view:permission>
|
||||
<view:permission>Consumer</view:permission>
|
||||
</view:ace>
|
||||
</view:acl>
|
||||
</cm:mlRoot>
|
||||
|
@@ -111,12 +111,12 @@
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="contentFilterLanguagesService" class="org.alfresco.repo.model.ml.ContentFilterLanguagesMap" init-method="init" >
|
||||
<constructor-arg>
|
||||
<property name="configService">
|
||||
<ref bean="contentFilterLanguagesConfigService" />
|
||||
</constructor-arg>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="openOfficeConnection" class="net.sf.jooreports.openoffice.connection.SocketOpenOfficeConnection" />
|
||||
<bean id="openOfficeConnectionTester" class="org.alfresco.util.OpenOfficeConnectionTester" init-method="checkConnection" >
|
||||
<property name="connection">
|
||||
|
@@ -43,19 +43,19 @@
|
||||
<!-- Multilingual specific service -->
|
||||
<bean name="multilingualContentService" class="org.alfresco.repo.model.ml.MultilingualContentServiceImpl" >
|
||||
<property name="nodeService">
|
||||
<ref bean="NodeService" />
|
||||
<ref bean="nodeService" />
|
||||
</property>
|
||||
<property name="searchService">
|
||||
<ref bean="SearchService" />
|
||||
<ref bean="searchService" />
|
||||
</property>
|
||||
<property name="versionService">
|
||||
<ref bean="VersionService" />
|
||||
<ref bean="versionService" />
|
||||
</property>
|
||||
<property name="contentFilterLanguagesService">
|
||||
<ref bean="ContentFilterLanguagesService" />
|
||||
<ref bean="contentFilterLanguagesService" />
|
||||
</property>
|
||||
<property name="fileFolderService">
|
||||
<ref bean="FileFolderService" />
|
||||
<ref bean="fileFolderService" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
@@ -13,6 +13,16 @@
|
||||
</property>
|
||||
</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" >
|
||||
<property name="targetName">
|
||||
<value>mlAwareNodeService</value>
|
||||
@@ -24,6 +34,7 @@
|
||||
</property>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
<value>mlTranslationInterceptor</value>
|
||||
<value>mlPropertyInterceptor</value>
|
||||
</list>
|
||||
</property>
|
||||
|
@@ -927,6 +927,14 @@ public class AVMNodeService extends AbstractNodeServiceImpl implements NodeServi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: Implement
|
||||
*/
|
||||
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param nodeRef
|
||||
* @return Returns all properties keyed by their qualified name
|
||||
|
@@ -74,12 +74,11 @@ public class ContentFilterLanguagesMap implements ContentFilterLanguagesService
|
||||
/**
|
||||
* @param configService the config service to use to read languages
|
||||
*/
|
||||
public ContentFilterLanguagesMap(ConfigService configService)
|
||||
public void setConfigService(ConfigService configService)
|
||||
{
|
||||
this.configService = configService;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.service.cmr.ml.ContentFilterLanguagesService#getFilterLanguages()
|
||||
*/
|
||||
|
@@ -875,11 +875,12 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
|
||||
public void testRemoveSpecificChild() throws Exception
|
||||
{
|
||||
NodeRef parentRef = nodeService.createNode(
|
||||
ChildAssociationRef pathPrimaryRef = nodeService.createNode(
|
||||
rootNodeRef,
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
QName.createQName("parent_child"),
|
||||
ContentModel.TYPE_CONTAINER).getChildRef();
|
||||
ContentModel.TYPE_CONTAINER);
|
||||
NodeRef parentRef = pathPrimaryRef.getParentRef();
|
||||
ChildAssociationRef pathARef = nodeService.createNode(
|
||||
parentRef,
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
@@ -890,12 +891,34 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
pathARef.getChildRef(),
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
QName.createQName("pathB"));
|
||||
ChildAssociationRef pathCRef = nodeService.addChild(
|
||||
parentRef,
|
||||
pathARef.getChildRef(),
|
||||
ASSOC_TYPE_QNAME_TEST_CHILDREN,
|
||||
QName.createQName("pathC"));
|
||||
|
||||
// now remove the second association
|
||||
boolean removed = nodeService.removeChildAssociation(pathBRef);
|
||||
assertTrue("Association was not removed", removed);
|
||||
removed = nodeService.removeChildAssociation(pathBRef);
|
||||
assertFalse("Non-existent association was apparently removed", removed);
|
||||
// remove the path B association
|
||||
boolean removedB = nodeService.removeChildAssociation(pathBRef);
|
||||
assertTrue("Association was not removed", removedB);
|
||||
removedB = nodeService.removeChildAssociation(pathBRef);
|
||||
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
|
||||
|
@@ -150,7 +150,8 @@ public class MLTranslationInterceptor implements MethodInterceptor
|
||||
}
|
||||
}
|
||||
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = invocation.proceed();
|
||||
}
|
||||
|
@@ -836,6 +836,31 @@ public class DbNodeServiceImpl extends AbstractNodeServiceImpl
|
||||
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
|
||||
* properties are set on the node.
|
||||
|
@@ -245,6 +245,14 @@ public class NodeServiceImpl implements NodeService, VersionModel
|
||||
throw new UnsupportedOperationException(MSG_UNSUPPORTED);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
public boolean removeSeconaryChildAssociation(ChildAssociationRef childAssocRef)
|
||||
{
|
||||
throw new UnsupportedOperationException(MSG_UNSUPPORTED);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws UnsupportedOperationException always
|
||||
*/
|
||||
|
@@ -339,6 +339,16 @@ public interface NodeService
|
||||
@Auditable(key = Auditable.Key.ARG_0 ,parameters = {"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
|
||||
* @return Returns all properties keyed by their qualified name
|
||||
|
Reference in New Issue
Block a user