cancel
Showing results for 
Search instead for 
Did you mean: 

Interceptor not matche with 4.1.7 migration

titiabackup
Champ in-the-making
Champ in-the-making
Hi,

I have a problems that i don't understand.
I have an interceptor from the 3.0.0 version which have ok but since the 4.1.7 migrationit's not call and i don't understand why.

THe interceptor is in a module which is correctly include in alfresco, because the log describe a call to the default constructor method and this trace to the log:
preRegister called. Server=com.sun.jmx.mbeanserver.JmxMBeanServer@152544e, name=log4j:logger= …. ‍‍


But this interceptor is not call when i had a document, but before migration yes.

Here an extract of the class:
public Object invoke(MethodInvocation mi) throws Throwable {                if (logger.isDebugEnabled() == true) {         logger.debug("Begin call invoke interceptor");      }      NodeRef nodeRef;      QName propertyQName;      String contentUrl;      ContentData contentData = null;      // check if "getReader" is called      if (mi.getMethod().getName().equals("getReader")) {‍‍‍‍‍‍‍‍‍‍‍‍


here the declaration:
<!– A simple class that is initialized by Spring –>    <bean id="nonIndexingRunning" class="org.alfresco.module.nonindexingamp.NonIndexing" init-method="init" />    <!– A simple module component that will be executed once –>    <bean id="nonIndxingModule" class="org.alfresco.module.nonindexingamp.NonIndexingComponent" parent="module.baseComponent" >        <property name="moduleId" value="notIndexing" />  <!– See module.properties –>        <property name="name" value="NonIndexingComponent" />        <property name="description" value="Do not index content if aspect is added" />        <property name="sinceVersion" value="1.0" />        <property name="appliesFromVersion" value="1.0" />    </bean>   <bean id="doNotIndexInterceptor" class="org.alfresco.module.nonindexingamp.DoNotIndexIntercempor">            <property name="nodeService">            <ref bean="nodeService" />            </property>    </bean>    <bean id="proxiedContentService" class="org.springframework.aop.framework.ProxyFactoryBean">        <property name="proxyInterfaces">            <value>org.alfresco.service.cmr.repository.ContentService</value>        </property>        <property name="target">            <ref bean="contentService"/>        </property>        <property name="interceptorNames">            <list>                <idref local="doNotIndexInterceptor"/>            </list>        </property>    </bean>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍


Does anyone have an idea?
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
Can't see anything wrong with what you have posted.   But I suggest you double check the bean names since the spring configuration may have changed, since 3.0.0.    (You may be intercepting the wrong bean now.  And I note that you are intercepting "contentService" rather than "ContentService".)

Also please note that index control is now provided by alfresco 4.X so your module may no longer be necessary.

mrogers
Star Contributor
Star Contributor
Can't see anything wrong with what you have posted.   But I suggest you double check the bean names since the spring configuration may have changed, since 3.0.0.    (You may be intercepting the wrong bean now.  And I note that you are intercepting "contentService" rather than "ContentService".)

Also please note that index control is now provided by alfresco 4.X so your module may no longer be necessary.

titiabackup
Champ in-the-making
Champ in-the-making
THanks a lot, the bean intercept exists but i'm not sure that what the same use for indexing now.

Do you know the bean used for read the content to index it ?

Otherwise, i find this configuration which wil be used to not index the content.
<type name="cm:content">        <title>Content</title>        <parent>cm:cmobject</parent>        <properties>           <property name="cm:content">              <type>d:content</type>              <mandatory>false</mandatory>              <index enabled="false">              </index>           </property>        </properties>     </type>‍‍‍‍‍‍‍‍‍‍‍‍‍‍


THe documentation link is : <a>http://docs.alfresco.com/4.1/concepts/search-fts-config.html</a>

But when i had this code to the share-config-custom.xml, the content indexed and it's not that i want.

what method is used to not indexe content of a document ?

titiabackup
Champ in-the-making
Champ in-the-making
Hi,

i finally set the property cm:isContentIndexed to false when i had the document by java code:
<java>
contentProps.put(ContentModel.PROP_IS_CONTENT_INDEXED, false);
</java>

and it's work fine.

The interceptor problems came from the fact that contentService wasn't the service call by the indexing .

The interceptor deprecated in my code.

Thanks for all.

titia