<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Pouplate dropdown values from datalist using ListofValueConstraint in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108939#M30563</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to dynamically populate the dropdown values in alfresco share. I have created a datalist to store the dropdown values and created a class extending the ListOfValuesConstraint class and calling it from the model file. But there is no option to get the search service or node service to look for the datalist values from the custom class. I dont want to store the dropdown values in database since the maintenence also will be difficult. To add a new value later we may have to contact the DB team insert values on that table. Please see the code below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Model File configuration&lt;BR /&gt; &amp;lt;constraint name="hr&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocesDropdownList"&lt;BR /&gt; type="com.poc.ddl.ProcessDropdownListConstraint"&amp;gt;&lt;BR /&gt; &amp;lt;parameter name="allowedValues"&amp;gt;&lt;BR /&gt; &amp;lt;list&amp;gt;&lt;BR /&gt; &amp;lt;/list&amp;gt;&lt;BR /&gt; &amp;lt;/parameter&amp;gt;&lt;BR /&gt; &amp;lt;/constraint&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;lt;property name="hr&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocess"&amp;gt;&lt;BR /&gt; &amp;lt;title&amp;gt;Process&amp;lt;/title&amp;gt;&lt;BR /&gt; &amp;lt;type&amp;gt;d:text&amp;lt;/type&amp;gt;&lt;BR /&gt; &amp;lt;mandatory&amp;gt;false&amp;lt;/mandatory&amp;gt;&lt;BR /&gt; &amp;lt;index enabled="true"&amp;gt;&lt;BR /&gt; &amp;lt;tokenised&amp;gt;TRUE&amp;lt;/tokenised&amp;gt;&lt;BR /&gt; &amp;lt;facetable&amp;gt;false&amp;lt;/facetable&amp;gt;&lt;BR /&gt; &amp;lt;/index&amp;gt;&lt;BR /&gt; &amp;lt;constraints&amp;gt;&lt;BR /&gt; &amp;lt;constraint ref="hr&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocesDropdownList" /&amp;gt;&lt;BR /&gt; &amp;lt;/constraints&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;share-config-custom.xml&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;lt;field id="hr&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rocess"&lt;BR /&gt; label-id="form.field.label.hr_process" set="hrDocSet"&amp;gt;&lt;BR /&gt; &amp;lt;control&lt;BR /&gt; template="/org/alfresco/components/form/controls/selectone.ftl" /&amp;gt;&lt;BR /&gt; &amp;lt;/field&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class ProcessDropdownListConstraint extends ListOfValuesConstraint{&lt;/P&gt;&lt;P&gt;private static ServiceRegistry serviceRegistry;&lt;BR /&gt; &lt;BR /&gt; @Override&lt;BR /&gt; public void initialize() {&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;//I am unable to get the service registry object or&amp;nbsp; node Service or Search service here&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public void setAllowedValues(List allowedValues) {&lt;BR /&gt; List&amp;lt;String&amp;gt; allowedValues1 = new ArrayList&amp;lt;String&amp;gt;();&lt;BR /&gt; allowedValues1.add("Payroll");&lt;BR /&gt; allowedValues1.add("Holiday and Absense");&lt;BR /&gt; allowedValues1.add("Hiring");&lt;BR /&gt; System.out.println("allowedValues1 "+allowedValues1);&lt;BR /&gt; super.setAllowedValues(allowedValues1);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Tried below code not working&lt;/STRONG&gt;&lt;/EM&gt;&lt;BR /&gt; ApplicationContext ctx = ApplicationContextHelper.getApplicationContext();&lt;BR /&gt; System.out.println("ctx "+ctx);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Also tried this way still getting application context as null.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public class ProcessDropdownListConstraint extends ListOfValuesConstraint implements ApplicationContextAware{&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; private static ServiceRegistry registry;&lt;BR /&gt; private static ApplicationContext applicationContext;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {&lt;BR /&gt; this.applicationContext = applicationContext;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anyone pelase help me on this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance,&lt;/P&gt;&lt;P&gt;Sandhya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jul 2019 07:50:56 GMT</pubDate>
    <dc:creator>sandhya_nair</dc:creator>
    <dc:date>2019-07-15T07:50:56Z</dc:date>
    <item>
      <title>Pouplate dropdown values from datalist using ListofValueConstraint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108939#M30563</link>
      <description>Hi,I want to dynamically populate the dropdown values in alfresco share. I have created a datalist to store the dropdown values and created a class extending the ListOfValuesConstraint class and calling it from the model file. But there is no option to get the search service or node service to look</description>
      <pubDate>Mon, 15 Jul 2019 07:50:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108939#M30563</guid>
      <dc:creator>sandhya_nair</dc:creator>
      <dc:date>2019-07-15T07:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Pouplate dropdown values from datalist using ListofValueConstraint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108940#M30564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should declare your ProcessDropdownListConstraint as an Spring bean an XML in order to inject ServiceRegistry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could find also interesting this approach:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/keensoft/alfresco-datalist-constraints" title="https://github.com/keensoft/alfresco-datalist-constraints" rel="nofollow noopener noreferrer"&gt;GitHub - keensoft/alfresco-datalist-constraints: Use datalists to maintain Alfresco model constraints&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This project allows the users to maintain the values in the datalists using Alfresco Share web interface.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2019 09:21:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108940#M30564</guid>
      <dc:creator>angelborroy</dc:creator>
      <dc:date>2019-07-15T09:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Pouplate dropdown values from datalist using ListofValueConstraint</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108941#M30565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. I have added&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;ProcessDropdownListConstraint class in a bean as below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;BR /&gt; &amp;lt;bean id="ProcessDropdownListConstraint" class="com.util.ProcessDropdownListConstraint" &lt;BR /&gt; depends-on="repositoryEndBootstrapBean" lazy-init="default"&amp;gt; &lt;BR /&gt; &amp;lt;property name="nodeService"&amp;gt;&lt;BR /&gt; &amp;lt;ref bean="nodeService"/&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="searchService"&amp;gt;&lt;BR /&gt; &amp;lt;ref bean="searchService"/&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;/bean&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;I am getting the below error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;Caused by: org.springframework.beans.MethodInvocationException: Property 'allowedValues' threw exception; nested exception is org.alfresco.error.AlfrescoRuntimeException: 06150022 &lt;STRONG&gt;SOLR queries can not be executed while the repository is bootstrapping&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;Caused by: org.alfresco.error.AlfrescoRuntimeException: 06150022 &lt;STRONG&gt;SOLR queries can not be executed while the repository is bootstrapping&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jul 2019 10:07:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/pouplate-dropdown-values-from-datalist-using/m-p/108941#M30565</guid>
      <dc:creator>sandhya_nair</dc:creator>
      <dc:date>2019-07-15T10:07:45Z</dc:date>
    </item>
  </channel>
</rss>

