AnsweredAssumed Answered

Surf Extension - edit-metadata forms component override

Question asked by loftux Moderator on May 3, 2012
Latest reply on May 4, 2012 by afaust
In the edit-metadata page I want to use a special form if the document has a specific aspect applied. For what I can tell by mere forms config you cannot do this based on aspect, only on document type.
So instead looking into surf extension, if I can do something like

<extension>
   <modules>
      <module>
         <id>ReplaceForm</id>
         <description>Show edit metadata for specific form</description>
         <components>
            <component>
               <region-id>edit-metadata</region-id>
               <source-id>edit-metadata</source-id>
               <scope>template</scope>
               <sub-components>
                  <sub-component id="edit-metadata">
                     <evaluations>
                        <evaluation id="hide">
                           <render>false</render>
                        </evaluation>
                     </evaluations>
                  </sub-component>
                  <sub-component id="edit-metadata-new" index="25">
                     <url>/components/form</url>
                     <properties>
                        <itemKind>node</itemKind>
                        <itemId>{nodeRef}</itemId>
                        <formId>customformid</formId>
                        <mode>edit</mode>
                        <submitType>json</submitType>
                        <showCaption>true</showCaption>
                        <showCancelButton>true</showCancelButton>
                     </properties>
                  </sub-component>
               </sub-components>
            </component>
         </components>
      </module>
   </modules>
</extension>
and  with the new subcomponent adding <formId>customformid</formId> I think I can achieve what I want, using a special form.
But that means an evaluator that can evaluate on hasAspect. There is one org.alfresco.web.evaluator.HasAspectEvaluator but is this available in this context? Does Surf at this time now about the node, and can do evaluations based on that?

Outcomes