AnsweredAssumed Answered

How setup spring surf form with dinamic variables from a properties file

Question asked by 4535992 on Sep 8, 2017
Latest reply on Dec 20, 2017 by 4535992

Hi i have a spring surf form extensions , in the specific a dropdown where i want to put the value on a dynamic way reading the value from alfresco or a properties file here the myaction-share-amp-actions-extension-modules:

<extension>

.................................................................

<config evaluator="string-compare" condition="signed">
                    <forms>
                        <form>
                            <field-visibility>
                              ............................................
                                <show id="my_form_sign_firma.tipo"/>
                                ...................................     
                            </field-visibility>
                            <appearance>

.....................

 <field id="my_form_sign_firma.tipo" label-id="property.form.sign.my_form_sign_firma.tipo">
                                      <control template="/org/alfresco/components/form/controls/selectone.ftl">
                                    <control-param name="options">${value1},${value2},${value3}</control-param>

                                      </control>
 </field>

 

or in alternative

 

<field id="my_form_sign_firma.tipo" label-id="property.form.sign.my_form_sign_firma.tipo">
                                      <control template="/org/alfresco/components/form/controls/selectone.ftl">
                                    <control-param name="options">${valueX}</control-param>

                                 <!-- where valueX= "value1,value2,value3" -->

                                      </control>
 </field>

....................

                            </appearance>
                        </form>
                    </forms>
                </config> 

...........................................

</extension>

And the properties file is set on the share-config.xml file:

<bean id="configurazioniBeanCompletoLocale" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath*:it/test/properties/alfresco.properties</value>
            </list>
        </property>
        <property name="ignoreResourceNotFound" value="true" />
        <property name="ignoreUnresolvablePlaceholders" value="true" />
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
        <property name="searchSystemEnvironment" value="false"/>           
        <property name="propertiesPersister">
            <bean class="org.alfresco.config.AlfrescoPropertiesPersister" />
        </property>
    </bean>

 

And the file alfresco.properties contains:

 

value1=hello

value2=hi

value3=goodbye

valueX=hello,hi,goodbye

 

in alternative i can accept to use property of a specific file on alfresco if anyone know how to do foe eaxmple :

Reapository/Data Dicitopnary/configuration.txt with properties of a aspect "Configurator" with properties:

value1=hello

value2=hi

value3=goodbye

valueX=hello,hi,goodbye

 

 

There is a way to do one of this ?

Outcomes