AnsweredAssumed Answered

custom site model

Question asked by .jan on Jul 20, 2015
Hello,
I am trying to create custom site model in Alfresco. I created model as you can see here:
<blockcode>
<?xml version="1.0" encoding="UTF-8"?>
<model name="ts:testModel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
    <description>Model</description>
    <author>User</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" />
        <import uri="http://www.alfresco.org/model/site/1.0" prefix="st" />
    </imports>

    <!– Introduction of new namespaces defined by this model –>
    <namespaces>
        <namespace uri="http://www.test.com/model/content/1.0" prefix="ts" />
    </namespaces>
    <types>
       <!– New Signia company doc types –>
       <type name="ts:userSite">
            <title>Test User Site</title>
            <parent>st:site</parent>
            <properties>
               <property name="ts:userName">
                    <type>d:text</type>
                </property>
            </properties>
        </type>
       </types>
</model>
</blockcode>
I registered it and it looks like it is working correctly (Dont know how to proper test if my model is loaded and site type is avalaible), but when I am creating site by
siteService.createSite("test-site", "test-site", "Test Site", "A site description", "ts:userSite");
, I will catch error as
Site could not be create, because {}st:site is not a valid site type.


Thanks for help

Outcomes