Connect External Databse

cancel
Showing results for 
Search instead for 
Did you mean: 
afaust
Master

Re: Connect External Databse

Make sure your Spring file is actually loaded / processed. When building a module it should be in alfresco/module/<moduleId>/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/<xyz>-context.xml file

sanjaybandhniya
Intermediate

Re: Connect External Databse

Thanks Axel Faust‌ for help.

I have solved this way.

Constraints:

<constraint name="mbs:batchTypeAspectList" type="REGISTERED">
<parameter name="registeredName">
<value>batchType</value>
</parameter>
</constraint>

Bean:

<bean id="batchType"
class="com.mbs.constraints.BatchTypeConstraints"
init-method="initialize">
<property name="shortName">
<value>batchType</value>
</property>
<property name="sorted" value="true" />
<property name="registry">
<ref bean="cm:constraintRegistry" />
</property>
</bean>

Class:


public class BatchTypeConstraints extends ListOfValuesConstraint implements Serializable{
/**
*
*/
private static final long serialVersionUID = -2561245100862732935L;
@Autowired
DocumentDAOImpl documentDaoImpl;

public BatchTypeConstraints() {
super();
}

@Override
public List<String> getRawAllowedValues() {
List<String> result = new ArrayList<>();
List<MetaDataModel> providers = documentDaoImpl.getAllBatchByWorkFlowType();
for (MetaDataModel data : providers) {
result.add(data.getName());
}
super.setAllowedValues(result);
return result;
}

@Override
public List<String> getAllowedValues() {
return super.getAllowedValues();
}

@Override
protected void evaluateSingleValue(Object value) {
super.setAllowedValues(getAllowedValues());
}

}