As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<webscript> <shortname>Model test</shortname> <family>Tutorials</family> <description>Creates content of a custom type</description> <url>/modeltest/{documentName}</url> <format default="html">extension</format> <authentication>user</authentication> </webscript>
<p>Creating the following document:</p> <ul> <li>${document.name}</li> <li>${document.type}</li> </ul> <b>${msg}</b>
var contentType = "my:whitepaper"; var documentName = url.templateArgs.documentName; var document = companyhome.createNode(documentName, contentType); if (document != null){ model.document = document; model.msg = "Created OK!"; } else { model.msg = "Failed to create document!"; }
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <!– Registration of new models –> <bean id="custommodel.dictionaryBootstrap" parent="dictionaryModelBootstrap" depends-on="dictionaryBootstrap"> <property name="models"> <list> <value>alfresco/extension/customModel.xml</value> </list> </property> </bean> </beans>
<?xml version="1.0" encoding="UTF-8"?> <!– Definition of new Model –> <!– The important part here is the name - Note: the use of the my: namespace which is defined further on in the document –> <model name="my:custommodel" xmlns="http://www.alfresco.org/model/dictionary/1.0"> <!– Optional meta-data about the model –> <description>Example Custom Model</description> <author>Alfresco Documentation Team</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="http://www.mycompany.com/model/content/1.0" prefix="my" /> </namespaces> <constraints> <constraint name="my:productListConstraint" type="LIST"> <parameter name="allowedValues"> <list> <value>Foobar Widget</value> <value>Flux Capacitor</value> <value>Big Bold App</value> </list> </parameter> </constraint> </constraints> <types> <!– Enterprise-wide generic document type –> <type name="my:doc"> <title>MyCompany Generic Document</title> <parent>cm:content</parent> </type> <type name="my:marketingDoc"> <title>MyCompany Marketing Document</title> <parent>my:doc</parent> <properties> <property name="my:product"> <type>d:text</type> <multiple>true</multiple> <constraints> <constraint ref="my:productListConstraint" /> </constraints> </property> </properties> </type> <type name="my:whitepaper"> <title>MyCompany Whitepaper</title> <parent>my:marketingDoc</parent> </type> </types> </model>