03-30-2010 02:30 PM
for (NamedValue prop : props) {
if (prop.getName().endsWith(Constants.PROP_NAME) == true) {
document.setName(prop.getValue());
}
if (prop.getName().endsWith(Constants.PROP_TITLE) == true) {
document.setTitle(prop.getValue());
}
if (prop.getName().endsWith(Constants.PROP_DESCRIPTION) == true) {
document.setDescription(prop.getValue());
}
if (!prop.getName()
.startsWith("{http://www.alfresco.org/model")) {
String contentString = prop.getName();
String[] values = contentString.split("[}]");
attributeList.put(values[1], prop.getValue());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!– Modelo personalizado –>
<!– Note: This model is pre-configured to load at startup of the Repository. So, all custom –>
<!– types and aspects added here will automatically be registered –>
<model name="fact:ModeloPersonalizado" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>Modelo personalizado</description>
<author>mgomarg</author>
<version>1.0</version>
<imports>
<!– Import Alfresco Dictionary Definitions –>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<!– Import Alfresco Content Domain Model Definitions –>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<!– Registramos el Nuevo namespaces que se utilizara en este modelo –>
<!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>
<namespaces>
<namespace uri="modelo.miniguia" prefix="fact"/>
</namespaces>
<types>
<!– Definicion de los tipos de contenido personalizados –>
<!– Definicion del tipo de contenido fact:factura –>
<type name="fact:factura">
<title>Factura</title>
<parent>cm:content</parent>
<properties>
<property name="fact:Concepto">
<title>Concepto</title>
<type>d:text</type>
</property>
<property name="fact:Importe">
<title>Importe</title>
<type>d:float</type>
</property>
<property name="fact:Proveedor">
<title>Proveedor</title>
<type>d:text</type>
</property>
<property name="fact:NumFac">
<title>Numero de factura</title>
<type>d:int</type>
</property>
<property name="fact:FecFac">
<title>Fecha de la factura</title>
<type>d:date</type>
</property>
</properties>
</type>
</types>
</model>
04-05-2010 10:54 AM
DictionaryServiceSoapBindingStub dssbs = WebServiceFactory
.getDictionaryService();
PropertyDefinition[] propDefs = dssbs.getProperties(new String[] {
"fact:FecFac" });
int j = 0;
while (j < propDefs.length) {
System.out.println("DataType = " + propDefs[j].getDataType());
System.out.println("Title = " + propDefs[j].getTitle());
j++;
}
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.