12-01-2008 06:16 AM
<property name="my:grupo">
<title>Grupo</title>
<type>d:text</type>
<mandatory>true</mandatory>
<multiple>true</multiple>
</property>
String propiedad = "my:grupo";
DictionaryServiceSoapBindingStub dssbs= WebServiceFactory.getDictionaryService();
org.alfresco.webservice.types.PropertyDefinition[] propDefs = dssbs.getProperties(new String[] {propiedad});
System.out.println(" Descripción: "+propDefs[0].getDescription());
System.out.println(" DefaultValue: "+propDefs[0].getDefaultValue());
System.out.println(" Name: "+propDefs[0].getName());
System.out.println(" Title: "+propDefs[0].getTitle());
12-01-2008 06:47 AM
/**
* Property wrapper class
*/
public class Property
{
private QName name;
private boolean isCollection = false;
private DataModel values;
private String datatype;
private String residual;
/**
* Construct
*
* @param name property name
* @param value property values
*/
public Property(QName name, Serializable value)
{
this.name = name;
PropertyDefinition propDef = dictionaryService.getProperty(name);
if (propDef != null)
{
datatype = propDef.getDataType().getName().toString();
residual = "false";
}
else
{
residual = "true";
}
// handle multi/single values
// TODO: perhaps this is not the most efficient way - lots of list creations
List<Value> values = new ArrayList<Value>();
if (value instanceof Collection)
{
isCollection = true;
for (Serializable multiValue : (Collection<Serializable>)value)
{
values.add(new Value(multiValue));
}
}
else
{
values.add(new Value(value));
}
this.values = new ListDataModel(values);
}
Si te fijas lo que hace es mirar si el valor de la propiedad es instancia de un Collection. Si es así, se considera la propiedad Multiple…El propio autor del código reconoce que no es la vía mas eficiente…pero bueno, es lo que hay. Además, da la sensación que simplemente a través de la definición del modelo no hay ningún mecanismo para obtenerlo.12-01-2008 06:59 AM
12-01-2008 11:43 AM
05-22-2009 03:10 AM
<property name="controlado:fechaFirmas">
<title>Fecha de la ultima firma</title>
<type>d:date</type>
<multiple>true</multiple>
</property>
05-22-2009 03:21 AM
05-22-2009 05:10 AM
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.