cancel
Showing results for 
Search instead for 
Did you mean: 

I can't create a new file based on a custom model

vincent_roye
Champ in-the-making
Champ in-the-making
Hi,

I have added a model in the data dictionary and activated it :


<!–  Dynamic Model  –>
<model xmlns="http://www.alfresco.org/model/dictionary/1.0" name="dynamic:dynamicModel">
<!–  Optional meta-data about the model  –>
<description>Dynamic Model</description>
<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>
<!–
Introduction of new namespaces defined by this model
–>
<!–
NOTE: The following namespace dynamic.model should be changed to reflect your own namespace
–>
<namespaces>
<namespace uri="dynamic.model" prefix="dynamic"/>
</namespaces>
<types>
<!–  Definition of new Content Type: Model1  –>
<type name="dynamic:Model1">
<title>Dynamic Model ONE</title>
<parent>cm:content</parent>
<properties>
<property name="dynamic:property11">
<title>Dynamic Property 11</title>
<type>d:text</type>
</property>
<property name="dynamic:property12">
<title>Dynamic Property 12</title>
<type>d:text</type>
</property>
</properties>
</type>
</types>
</model>


And I have added in share-config-custom.xml :


<alfresco-config>
<create-content>
      <content id="plain-text" mimetype="text/plain" label="Create content" itemid="dynamic:dynamicModel" icon="plain-text"/>
   </create-content>…


But I can't do : Create -> New document based on a model

It just doesn't appear as an option.

What is the problem ?

thanks,

Vincent
2 REPLIES 2

niketapatel
Star Contributor
Star Contributor
Hi , Configuration looks OK, I dont see any error or flaw.

Can you make sure updated share-config-custom.xml is deployed and also clear your browser cache once and try.

And configurations you are trying is as per older version which is still allowed but you may try this new configurations also!


<config evaluator="string-compare" condition="DocumentLibrary">
   <create-content>
      <content id="plain-text" label="My Custom content" type="pagelink" index="210" icon="text">
             <param name="page">create-content?destination={nodeRef}&amp;itemId=dynamic:dynamicModel&amp;mimeType=text/plain</param>
      </content>
   </create-content>  
</config>  
      


Hope it helps!

mitpatoliya
Star Collaborator
Star Collaborator
Hi Vincent,

I think you have missed the "config" tag under "alfresco-config" you "create-content" tag should be nested under config.
Also as suggested by Niketa you can use new config as well.