AnsweredAssumed Answered

Custom action property-based parameters

Question asked by mtielemans on Jul 11, 2013
I have defined a custom action that takes 4 parameters, the ftl controls for which are textfield, authority and date(x2).

On the content type this action is enabled for, there is an aspect with 4 properties. I would want to use these for the action parameters form. I hoped to do this much in the same way as defining a share form for edit metadata.

The plan was to add this aspect after submitting the form for the first time, but if this makes it much more complicated (I can see why it would, considering the properties would be absent on the first time opening the form) I can make the aspect mandatory without problems.

Using the following code in share-config-custom, the most fruitful of many tries, only displays the fields for which I specifically defined controls. These behave as any statically defined form, no property values or constraints whatsoever. Additionally, the authority control throws an error and doesn't work (it works exactly this way if.

<config evaluator="string-compare" condition="my-custom-action my:customAspect">
     <forms>
        <form>
           <field-visibility>
          <show id="my:strProperty" />
              <show id="my:authorityAssocProperty" />
          <show id="my:firstDateProperty" />
          <show id="my:secondDateProperty" />
           </field-visibility>
           <appearance>
      <set id="stringPropSet" appearance="bordered-panel" label="strProp"/>
           <field id="my:strProperty" label="strProp" set="stringPropSet" />
           
      <set id="otherSet" appearance="bordered-panel" label="Other"/>
               <field id="my:authorityAssocProperty" label="Person" set="otherSet" >
            <control template="/org/alfresco/components/form/controls/authority.ftl" >
             <control-param name="compactMode">true</control-param>
            </control>
      </field>
      <field id="my:firstDateProperty" label="Date1" set="otherSet">
       <control template="/org/alfresco/components/form/controls/date.ftl" />
      </field>
      <field id="my:secondDateProperty" label="Date2" set="otherSet">
            <control template="/org/alfresco/components/form/controls/date.ftl" />
      </field>
           </appearance>
        </form>
     </forms>
  </config>         

Outcomes