AnsweredAssumed Answered

Custom Action only for certain types

Question asked by dave984 on Feb 3, 2014
Following the tutorial(http://goo.gl/6QZh9t) i've succesfully implemented the "Send as email" action in Share.
It works on every single file…my goal now is activate the send as email action, depending on the type of the document, with different fields and controls in the box displated. So if the document is type A the form will be to,subject,body(default), if document is type B the form will have why,when, where fiels and so on…
The code for the action in share-custom-config.xaml is:

<config evaluator="string-compare" condition="send-as-email">
        <forms>
            <form>
                <field-visibility>
                    <show id="to"/>
                    <show id="subject"/>
                    <show id="body_text"/>
                    <show id="to2"/>
                    <show id="subject2"/>
                    <show id="body_text2"/>
                </field-visibility>
                <appearance>
                    <field id="to" label-id="send-as-email.field.to">
                       <control template="/org/alfresco/components/form/controls/checkbox.ftl" />
                    </field>
                    <field id="subject" label-id="send-as-email.field.subject"/>
                    <field id="body_text" label-id="send-as-email.field.body_text">
                        <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                    </field>
                    <field id="to2" label-id="send-as-email.field.to2">
                       <control template="/org/alfresco/components/form/controls/selectone.ftl">
                          <control-param name="options">1|First,2|Second,3|Third,4|Fourth</control-param>
                       </control>
                    </field>
                    <field id="subject2" label-id="send-as-email.field.subject2"/>
                    <field id="body_text2" label-id="send-as-email.field.body_text2">
                        <control template="/org/alfresco/components/form/controls/textarea.ftl" />
                    </field>
                </appearance>
            </form>
        </forms>
    </config>   


Is there a way to add another condition on the type of the document?

Outcomes