package org.alfresco.extension;
import java.util.List;
import org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint;
import org.alfresco.extension.CustomGroupsBean;;
public abstract class MyListofValuesConstraint extends ListOfValuesConstraint{
@Override
public List<String> getAllowedValues()
{
CustomGroupsBean customGroup= new CustomGroupsBean();
List<String> allowedValues = customGroup.getGroupList();
super.setAllowedValues(allowedValues);
return allowedValues;
}
}
<constraints>
<constraint name="custom:miLista" type="org.alfresco.extension.MyListofValuesConstraint">
<parameter name="allowedValues">
<list>
</list>
</parameter>
</constraint>
</constraints>
<property name="custom:organizador">
<title>Grupo organizador</title>
<type>d:text</type>
<constraints>
<constraint ref="custom:miLista"/>
</constraints>
</property>
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<beans>
<bean id="MyListofValuesConstraintInitializer"
class="org.alfresco.extension.MyListofValuesConstraint">
</bean>
<!– Registration of new models –>
<bean id="extension.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap">
<property name="models">
<list>
<value>alfresco/extension/customModel.xml</value>
</list>
</property>
</bean>
</beans>
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
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.