<namespaces>
<namespace uri="my.new.model" prefix="my"/>
</namespaces>
<types>
<type name="my:mitipo1">
<title>Mi Tipo 1</title>
<properties>
<property name="my:fecha">
<title>Fecha</title>
<type>d:date</type>
<mandatory>true</mandatory>
</property>
<property name="my:nombre">
<title>Nombre</title>
<type>d:text</type>
<mandatory>true</mandatory>
</property>
</properties>
</type>
<types>
me gustaría que dado un nombre de propiedad, p.e. my:fecha, ver de qué tipo es
getPropertyEl cual permite obtener la definición de la propiedad, dado el nombre completo de ésta.
@NotAuditable
PropertyDefinition getProperty(QName propertyName)
Gets the definition of the property as defined by its owning Class.
Parameters:
propertyName - the property name
Returns:
the property definition (or null, if it doesn't exist)
if (miTipo.equals(DataTypeDefinition.DATE)) {
// Casting a Date
}
if …
DictionaryService ds = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getDictionaryService();
Necesitarás importar la interfaz del servicio de diccionario: import org.alfresco.service.cmr.dictionary.DictionaryService;<bean id="miBean" class="miPaquete.miClase">
<property name="dictionaryService">
<ref bean="dictionaryService"/>
</property>
</bean>
y en tu clase tener un atributo dictionaryService, que se inicializará cuando arranque de nuevo tu Alfresco… private DictionaryService dictionaryService;
public DictionaryService getDictionaryService() {
return dictionaryService;
}
public void setDictionaryService(DictionaryServicedictionaryService) {
this.dictionaryService= dictionaryService;
}
Bueno, espero que más que liarte te esté sirviendo de ayuda :? 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.