AnsweredAssumed Answered

how to use HasAspectEvaluator for hiding particular component through extension module

Question asked by mitpatoliya Moderator on Jun 20, 2013
I want to hide particular component through extension module

What I have done for this is as follow
one file spring-surf-extensibility-context.xml under WEB-INF\classes\org\springframework\extensions\surf


   <bean id="evaluator.custom.docdetails" class="org.alfresco.web.evaluator.HasAspectEvaluator">
      <property name="aspects">
         <list>
            <value>custom:customAspect</value>
         </list>
      </property>
   </bean>
     


and other file is


<extension>
   <modules>
<module>
            <id>Hide Publishing History</id>
            <components>
               <component>
                  <region-id>document-publishing</region-id>
                  <source-id>document-details</source-id>
                  <scope>template</scope>
                  <sub-components>
                     <sub-component id="default">
                        <evaluations>
                           <evaluation id="HidePublishOption">
                              <evaluators>
                                 <evaluator type="evaluator.custom.docdetails"></evaluator>
                              </evaluators>
                              <render> false </render>
                           </evaluation>
                        </evaluations>
                     </sub-component>
                  </sub-components>
               </component>
            </components>
         </module>
</modules>
</extension>


Error is as follow
 
2013-06-20 14:06:58,784  ERROR [extensibility.impl.DefaultSubComponentEvaluation] [http-apr-8080-exec-5] The bean with the id 'evaluator.custom.docdetails' was not an instance of org.springframework.extensions.surf.extensibility.SubComponentEvaluator
org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'evaluator.custom.docdetails' must be of type [org.springframework.extensions.surf.extensibility.SubComponentEvaluator], but was actually of type [org.alfresco.web.evaluator.HasAspectEvaluator]
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:349)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)


I am using 4.2 community version

Outcomes