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
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());
}
}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.