<?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 Re: Connect External Databse in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51854#M19633</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please read again what I have linked. The constraint been needs to be registered with the constraint registry, which are set as properties on the bean. The bean class (which I did not link but would have been easy to find) extends from AbstractConstraint which contains all the logic and properties for registration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2018 15:36:32 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2018-08-15T15:36:32Z</dc:date>
    <item>
      <title>Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51847#M19626</link>
      <description>I am trying to connect external database from alfresco to get constraint like below way.&amp;lt;bean id="DataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="driverClassName" value="${jdbcDriver}" /&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;property name="url" value="${jdbcUr</description>
      <pubDate>Wed, 15 Aug 2018 11:10:14 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51847#M19626</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T11:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51848#M19627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How did you register that constraint with the model? Did you use the class name as the type of the constraint in the data model? Then&amp;nbsp;that is the cause for the problem - when you use the class name as the type, the class is instantiated using the default constructor without any parameters passed into it. So instead of using your defined bean, it uses an unitialized instance where of course the field for your DAO is null. You need to use a registered constraint to reference your Spring bean.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 11:33:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51848#M19627</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-15T11:33:32Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51849#M19628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Like this way,&lt;/P&gt;&lt;P&gt;&amp;lt;constraint name="mbs:batchTypeAspectList" type="com.mbs.constraints.BatchTypeConstraints"&amp;gt;&lt;BR /&gt; &amp;lt;parameter name="allowedValues"&amp;gt;&lt;BR /&gt; &amp;lt;list&amp;gt;&lt;BR /&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 11:51:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51849#M19628</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T11:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51850#M19629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to use&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;registered constraint&lt;SPAN&gt;&amp;nbsp;? Can you Give me some idea?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 11:51:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51850#M19629</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T11:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51851#M19630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See the Alfresco&amp;nbsp;code for smart folders:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/d8f828324419f101d6e1f7a19020864d801b3b64/src/main/resources/alfresco/model/smartfolder-model.xml#L23" rel="nofollow noopener noreferrer"&gt;constraint in model&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/27d9cd63ab141f67b0fc7f493ac937f50bb51705/src/main/resources/alfresco/smartfolder-context.xml#L40" rel="nofollow noopener noreferrer"&gt;bean definition&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 12:34:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51851#M19630</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-15T12:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51852#M19631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have defined constraint as per above link but it is giving me error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bean :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &amp;lt;bean id="batchType" class="com.mbs.constraints.BatchTypeConstraints" init-method="initialize"&amp;gt;&lt;BR /&gt; &amp;lt;property name="shortName"&amp;gt;&lt;BR /&gt; &amp;lt;value&amp;gt;batchType&amp;lt;/value&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="documentDAOImpl" ref="documentDAOImpl" /&amp;gt;&lt;BR /&gt; &amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constraint :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;constraint name="mbs:batchTypeAspectList"&lt;BR /&gt; type="REGISTERED"&amp;gt;&lt;BR /&gt; &amp;lt;parameter name="registeredName"&amp;gt;&lt;BR /&gt; &amp;lt;value&amp;gt;batchType&amp;lt;/value&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;/P&gt;&lt;P&gt;Error :&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no constraint registered by name '&lt;SPAN&gt;batchType&lt;/SPAN&gt;'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 13:30:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51852#M19631</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T13:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51853#M19632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using SDK2 for customization.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 13:32:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51853#M19632</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T13:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51854#M19633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please read again what I have linked. The constraint been needs to be registered with the constraint registry, which are set as properties on the bean. The bean class (which I did not link but would have been easy to find) extends from AbstractConstraint which contains all the logic and properties for registration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:36:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51854#M19633</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-15T15:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51855#M19634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Still Error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="batchType" class="com.mbs.constraints.BatchTypeConstraints" init-method="initialize"&amp;gt;&lt;BR /&gt; &amp;lt;property name="shortName"&amp;gt;&lt;BR /&gt; &amp;lt;value&amp;gt;batchType&amp;lt;/value&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="registry"&amp;gt;&lt;BR /&gt; &amp;lt;ref bean="cm:constraintRegistry" /&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="sorted" value="true" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="documentDAOImpl" ref="documentDAOImpl" /&amp;gt;&lt;BR /&gt; &amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2018 15:58:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51855#M19634</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-15T15:58:25Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51856#M19635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you guide me how can i implement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 05:17:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51856#M19635</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-16T05:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51857#M19636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your Spring file is actually loaded / processed. When building a module it should be in alfresco/module/&amp;lt;moduleId&amp;gt;/module-context.xml file (or a file imported there). If you are just doing customisation without really building a proper module (you SHOULD consider building a module), then it can be any alfresco/extension/&amp;lt;xyz&amp;gt;-context.xml file&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 07:54:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51857#M19636</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2018-08-16T07:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Connect External Databse</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51858#M19637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;B&gt;Axel Faust&lt;/B&gt;‌ for help.&lt;/P&gt;&lt;P&gt;I have solved this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Constraints:&lt;/P&gt;&lt;P&gt;&amp;lt;constraint name="mbs:batchTypeAspectList" type="REGISTERED"&amp;gt;&lt;BR /&gt; &amp;lt;parameter name="registeredName"&amp;gt;&lt;BR /&gt; &amp;lt;value&amp;gt;batchType&amp;lt;/value&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;Bean:&lt;/P&gt;&lt;P&gt;&amp;lt;bean id="batchType"&lt;BR /&gt; class="com.mbs.constraints.BatchTypeConstraints"&lt;BR /&gt; init-method="initialize"&amp;gt;&lt;BR /&gt; &amp;lt;property name="shortName"&amp;gt;&lt;BR /&gt; &amp;lt;value&amp;gt;batchType&amp;lt;/value&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="sorted" value="true" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="registry"&amp;gt;&lt;BR /&gt; &amp;lt;ref bean="cm:constraintRegistry" /&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;/bean&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;public class BatchTypeConstraints extends ListOfValuesConstraint implements Serializable{&lt;BR /&gt; /**&lt;BR /&gt; * &lt;BR /&gt; */&lt;BR /&gt; private static final long serialVersionUID = -2561245100862732935L;&lt;BR /&gt; @Autowired&lt;BR /&gt; DocumentDAOImpl documentDaoImpl;&lt;/P&gt;&lt;P&gt;public BatchTypeConstraints() {&lt;BR /&gt; super();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public List&amp;lt;String&amp;gt; getRawAllowedValues() {&lt;BR /&gt; List&amp;lt;String&amp;gt; result = new ArrayList&amp;lt;&amp;gt;();&lt;BR /&gt; List&amp;lt;MetaDataModel&amp;gt; providers = documentDaoImpl.getAllBatchByWorkFlowType();&lt;BR /&gt; for (MetaDataModel data : providers) {&lt;BR /&gt; result.add(data.getName());&lt;BR /&gt; }&lt;BR /&gt; super.setAllowedValues(result);&lt;BR /&gt; return result;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; public List&amp;lt;String&amp;gt; getAllowedValues() {&lt;BR /&gt; return super.getAllowedValues();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;@Override&lt;BR /&gt; protected void evaluateSingleValue(Object value) {&lt;BR /&gt; super.setAllowedValues(getAllowedValues());&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2018 02:59:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/connect-external-databse/m-p/51858#M19637</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2018-08-17T02:59:21Z</dc:date>
    </item>
  </channel>
</rss>

