<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());
/**
* 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.<property name="controlado:fechaFirmas">
<title>Fecha de la ultima firma</title>
<type>d:date</type>
<multiple>true</multiple>
</property>
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.