10-30-2008 08:37 AM
<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>10-30-2008 09:06 AM
me gustaría que dado un nombre de propiedad, p.e. my:fecha, ver de qué tipo es
10-30-2008 12:06 PM
10-30-2008 12:20 PM
10-30-2008 12:38 PM
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 …10-30-2008 12:44 PM
10-30-2008 02:58 PM
10-30-2008 05:52 PM
DictionaryService ds = Repository.getServiceRegistry(
FacesContext.getCurrentInstance()).getDictionaryService();Necesitarás importar la interfaz del servicio de diccionario: import org.alfresco.service.cmr.dictionary.DictionaryService;11-03-2008 04:31 AM
11-03-2008 06:55 AM
<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 :? Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.