cancel
Showing results for 
Search instead for 
Did you mean: 

Query

fagiano
Champ in-the-making
Champ in-the-making
io ho creato una tabbella in C:\Alfresco\alf_data\mysql\alfresco di nome lettere.frm.
ho creato il seguente file ma invece che inserire i tipi di lettera (raccomandata fax..)come ho fattto vorrei importarli dalla tabella lettera.frm. Si puo fare Come?
<?xml version="1.0" encoding="UTF-8" ?>
- <!–  Definition of new Model
  –>
- <!–  The important part here is the name - Note: the use of the ass: namespace
     which is defined further on in the document
  –>
- <model name="ass:assnewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
- <!–  Optional meta-data about the model
  –>
  <description>Example assicurativa Model</description>
  <author />
  <version>1.0</version>
- <!–  Imports are required to allow references to definitions in other models
  –>
- <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>
- <!–  Introduction of new namespaces defined by this model
  –>
- <!–  NOTE: The following namespace my.new.model should be changed to reflect your own namespace
  –>
- <namespaces>
  <namespace uri="ass.new.model" prefix="ass" />
  </namespaces>
- <constraints>
- <constraint name="ass:allowedStatus" type="LIST">
- <parameter name="allowedValues">
- <list>
  <value>non specificato</value>
  <value>raccomandata</value>
  <value>fax</value>
  <value>prioritaria</value>
  </list>
  </parameter>
  </constraint>
  </constraints>
- <types>
- <!–  Definition of new Content Type:assicurativa
  –>
- <type name="ass:as">
  <title>Assicurativa</title>
  <parent>cm:content</parent>
- <properties>
- <property name="ass:cliente">
  <type>d:text</type>
  <mandatory>true</mandatory>
  </property>
- <property name="ass:numero_Pratica_assicurativa">
  <type>d:int</type>
  <mandatory>true</mandatory>
  </property>
- <property name="ass:lettera">
  <type>d:text</type>
  <mandatory>false</mandatory>
  <default>non specificato</default>
- <constraints>
  <constraint ref="ass:allowedStatus" />
  </constraints>
  </property>
  </properties>
- <mandatory-aspects>
  <aspect>cm:versionable</aspect>
  </mandatory-aspects>
  </type>
  </types>
  </model>
1 REPLY 1

alarocca_5413
Champ in-the-making
Champ in-the-making
L'ho fatto anni fa per la versione 2.1

In pratica si tratta di estendere la classe org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint e fare in modo che i valori da elencare siano recuperati attraverso una query i cui parametri sono specifciati nel constraint.

<constraint name="dnw:comune_constraint" type="it.datanetwork.alfresco.repo.dictionary.constraint.ListOfValuesQueryConstraint">
   <parameter name="driver"><value>org.gjt.mm.mysql.Driver</value></parameter>
   <parameter name="url"><value>jdbc:mysql://localhost/demo</value></parameter>
   <parameter name="sql"><value>select comune from comuni order by comune</value></parameter>
   <parameter name="username"><value>root</value></parameter>
   <parameter name="password"><value>password</value></parameter>
</constraint>