cancel
Showing results for 
Search instead for 
Did you mean: 

Custom NodeService Interceptor problem

janasko
Champ in-the-making
Champ in-the-making
Alfresco version: 1.4.

I'm trying to intercept calls to NodeService to notify other parties of created/modified/etc content.
The problem is that I'm only getting addAspect calls with null values when new content is created from the web interface. What is expected is a createNode call!
Is the method of implementation right or should it be done differently?

br, Jani Askolin / Quosis Oy


The implementation follows:


modified public-services-context.xml fragment:

    <!– Node Service –>
    <bean id="NodeService" class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <list>
                <value>org.alfresco.service.ServiceDescriptor</value>
                <value>org.alfresco.service.cmr.repository.NodeService</value>
            </list>
        </property>
        <property name="target">
            <ref bean="nodeService"/>
        </property>
        <property name="interceptorNames">
            <list>
<!– quosis node service interceptor –>
                <idref local="NodeInterceptor" />

                <idref local="NodeService_transaction"/>
                <idref local="AuditMethodInterceptor"/>
                <idref local="exceptionTranslator"/>
                <idref bean="NodeService_security"/>
                <idref local="NodeService_descriptor"/>
            </list>
        </property>
    </bean>


And NodeInterceptor.java fragment:

public class NodeInterceptor implements MethodInterceptor
{
 
    @SuppressWarnings("unchecked")
    public Object invoke(MethodInvocation invocation) throws Throwable
    {
        Object o = invocation.proceed();
        System.out.println( "ALFRESCO NODESERVICE: "+invocation );
        return o;
    }

}
1 REPLY 1

derek
Star Contributor
Star Contributor
Hi,

I don't see any NodeInterceptor bean defined.  Was that an omission?