cancel
Showing results for 
Search instead for 
Did you mean: 

content rule condition by type

kay_be_
Champ in-the-making
Champ in-the-making
I made several custom models. I receive scanned documents with CMIS and I want the dropfolder to run content rules that has a condition that depends on the model the document has.
example:
ephesoftModel.xml
<?xml version="1.0" encoding="UTF-8"?>
<!– Custom Model –>
<!– 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="ephesoft:demomodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<!– Optional meta-data about the model –>
<description>VLC</description>
<author>Tjarda Peelen - VLC</author>
<version>0.1</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>
<!– Introduction of new namespaces defined by this model –>
<!– NOTE: The following namespace custom.model should be changed to reflect your own namespace –>   <namespaces>      <namespace uri="com.ephesoftalfresco.demo" prefix="ephesoft"/>   </namespaces>
  <constraints />
  <types>
      <type name="ephesoft:document">
         <title>ephesoft_scan</title>
         <parent>cm:content</parent>
         <properties>
      <property name="ephesoft:state">
        <title>State</title>
             <type>d:text</type>
          </property>
          <property name="ephesoft:city">
        <title>City</title>
            <type>d:text</type>
         </property>
      </properties>
    </type>
  </types>
</model>

Now I want a rule to run only on documents on documents of that model. Is that possible? How can that be done?
When I select condition by type or subtype, I only see content and space as options. Do I have to configu that list with the new models?
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
Definitely possible. All you have to do is tell the web client (Explorer or Share) about your custom content model. Then the rule config UI will know to list those types in the dropdowns. Take a look at this tutorial which covers both Explorer and Share.

Not to spoil the ending, but here's the config you'd add to share-config-custom.xml to expose the content model in Share:

<config evaluator="string-compare" condition="DocumentLibrary">
  <types>
    <type name="cm:content">
      <subtype name="ephesoft:document" />
    </type>
  </types>
</config>
Jeff

kay_be_
Champ in-the-making
Champ in-the-making
Thanks! I think I know what I can read this weekend.  :lol:
Keep up the good work!
Regards,
Kris