Customizing an existing Alfresco class

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

Customizing an existing Alfresco class

Hello,

my objective is customizing an existing Alfresco class instead of changing directly in the org.alfresco:

the solution was "creation of a custom content store implementation that inherit from StoreSelectorAspectContentStore and register you implementation in spring configuration extension", I did that but my problem is thatI I dont know how to register my implementation in spring configuration extension.

thank you for your help.

3 Replies
Advanced

Re: Customizing an existing Alfresco classYou can define a bean named fileContentStore in your sprin

You can define a bean named fileContentStore in your spring context file ,alfresco will use your fileContentStore implementation to override it's default.
Like following
    <bean id="fileContentStore" class="Your StoreSelectorAspectContentStore  implementation">
 ....
    </bean>
Active Member

Re: Customizing an existing Alfresco classYou can define a bean named fileContentStore in your sprin

Thank you for reply,

after adding the bean here is the error displayed:

Error creating bean with name 'contentDataDAO' defined in class path resource [alfresco/dao/dao-context.xml]: Cannot resolve reference to bean 'eagerContentStoreCleaner' while setting bean property 'contentStoreCleaner'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eagerContentStoreCleaner' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'contentStoresToClean' while setting bean property 'stores'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'contentStoresToClean' defined in class path resource [alfresco/content-services-context.xml]: Cannot resolve reference to bean 'fileContentStore' while setting constructor argument with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileContentStore' defined in file [C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\content-store-selector-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 09280000 Property 'storesByName' has not been set: fr.alfresco.enterprise.repo.content.routing.StoreSelectorAspectContentStore@2bd4501d (class fr.alfresco.enterprise.repo.content.routing.StoreSelectorAspectContentStore)

...

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'eagerContentStoreCleaner' defined in file [C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\content-store-selector-context.xml]: Cannot resolve reference to bean 'fileContentStore' while setting bean property 'storesByName' with key [TypedStringValue: value [default], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileContentStore' defined in file [C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\extension\content-store-selector-context.xml]: Invocation of init method failed; nested exception is org.alfresco.error.AlfrescoRuntimeException: 09280000 Property 'storesByName' has not been set:

Advanced

Re: Customizing an existing Alfresco classYou can define a bean named fileContentStore in your sprin

StoreSelectorAspectContentStore has a storesByName property dependency  which should be injected by constructor in your spring content-store-selector-context.xml file.