AnsweredAssumed Answered

Type not supported error with custom content

Question asked by monitloth on Nov 14, 2008
Latest reply on Nov 14, 2008 by monitloth
I would like to create a folder, which is a custom folder type (memo:myproject). I get the following error:

org.alfresco.error.AlfrescoRuntimeException: The type is not supported by this service: {http://www.memo.com/model/content/1.0}myproject
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.create(FileFolderServiceImpl.java:768)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
   at org.alfresco.repo.model.filefolder.TempFileMarkerInterceptor.invoke(TempFileMarkerInterceptor.java:83)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:131)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.model.filefolder.MLTranslationInterceptor.invoke(MLTranslationInterceptor.java:210)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:49)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.alfresco.repo.audit.AuditComponentImpl.audit(AuditComponentImpl.java:245)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:69)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
   at $Proxy42.create(Unknown Source)
   at be.mygroup.alfresco.extention.CreateMyProjectWizard.getSummary(CreateMyIProjectWizard.java:368)
My memo-model-context.xml file is correct.
memoModel.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!– Definition of new Model –>
<model name="memo:mymodels" xmlns="http://www.alfresco.org/model/dictionary/1.0">

   <!– Optional meta-data about the model –>
   <description>MyModels</description>
   <author>Mustafa</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 –>
   <namespaces>
      <namespace uri="http://www.memo.com/model/content/1.0" prefix="memo" />
   </namespaces>

   <types>
      <!– Enterprise-wide generic document type –>
      <type name="memo:myproject">
         <title>My Project Space</title>
         <parent>cm:folder</parent>
         <properties>
            <property name="memo:begindate">
               <type>d:date</type>
            </property>
            <property name="memo:enddate">
               <type>d:date</type>
            </property>
            <property name="memo:finished">
               <type>d:boolean</type>
               <default>false</default>
            </property>
         </properties>

      </type>
   </types>
</model>
I did not test if this model is read by Alfresco, because now I want to create it to test it.
It is a folder derived type. If there is some other way (like node browser), please tell.

In my code

FileInfo fileInfo = this.getFileFolderService().create(
            this.navigator.getCurrentNode().getNodeRef(), projName,
            QName.createQName(MyProjectModel.NAMESPACE_MEMO_CONTENT_MODEL, "myproject"));
And I get the following by JSF:

The type is not supported by this service: {http://www.memo.com/model/content/1.0}myproject
It should a simple error.

Thanks.

Outcomes