cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new content types is not as easy as described

jbaton
Champ in-the-making
Champ in-the-making
Hi all,

I'm trying to add a very simple new content type : Process consisting of a title and sub-processes.
The goal is to be able to create the processes through the web client.
I followed the wiki sayings but it did not work, so I'm doing it all over, step by step on a fresh reinstall (rc1b)


I did create a new model , reference it in application-context.xml like this


<bean id="dictionaryBootstrap" class="org.alfresco.repo.dictionary.DictionaryBootstrap" init-method="bootstrap">
        <property name="dictionaryDAO"><ref local="dictionaryDAO"/></property>
        <property name="models">
            <list>
                <value>alfresco/model/dictionaryModel.xml</value>
                <value>alfresco/model/systemModel.xml</value>
                <value>alfresco/model/contentModel.xml</value>
                <value>alfresco/model/applicationModel.xml</value>
                <value>alfresco/model/gcModel.xml</value>

                <!– Implementation models –>
                <value>org/alfresco/repo/security/authentication/userModel.xml</value>
                <value>org/alfresco/repo/action/actionModel.xml</value>
                <value>org/alfresco/repo/rule/ruleModel.xml</value>
                <value>org/alfresco/repo/version/version_model.xml</value>
            </list>
        </property>
        <property name="labels">
            <list>
                <value>alfresco/model/dataTypeAnalyzers</value>
                <value>alfresco/messages/system-model</value>
                <value>alfresco/messages/dictionary-model</value>
                <value>alfresco/messages/content-model</value>
                <value>alfresco/messages/application-model</value>
            </list>
        </property>
    </bean>

The new model is here


<model name="example:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>Example custom Model</description>
   <author>JB</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>
   <namespaces>
      <!– Define a Namespace for my new definitions –>
      <namespace uri="http://gc.com/quality" prefix="gc" />
   </namespaces>

   <!– Type and Aspect definitions go here –>
   <type name="gc:process">
         <title>Process</title>
         <parent>cm:cmobject</parent>
         <properties>
            <property name="gc:code">
               <type>d:text</type>
            </property>
            <property name="gc:title">
               <type>d:text</type>
            </property>
         </properties>
         <mandatory-aspects>
            <aspect>cm:ownable</aspect>
         </mandatory-aspects>
      </type>
  
<!–         <associations>
            <child-association name="cm:gcsubprocesses">
               <target>
                  <class>gc:process</class>
               </target>
            </child-association>
         </associations>
–>        
</model>

As you can see, I simplified it so that the composition does not appear.

Unfortunately, I get the following exception on startup


11:34:26,218 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DictionaryService' defined in cl
ass path resource [alfresco/public-services-context.xml]: Can't resolve reference to bean 'dictionaryService' while sett
ing property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'dictionaryBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bea
n failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model
alfresco/model/gcModel.xml
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in
class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.alfresco.
service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/model/gcModel.xml
org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/model/gcModel.xml
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:94)
        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.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractA
utowireCapableBeanFactory.java:971)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowi
reCapableBeanFactory.java:941)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab
leBeanFactory.java:334)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab
leBeanFactory.java:281)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueRes
olver.java:176)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionV
alueResolver.java:105)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAuto
wireCapableBeanFactory.java:891)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCap
ableBeanFactory.java:707)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapab
leBeanFactory.java:316)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:146)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListable
BeanFactory.java:271)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:310)
        at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableW
ebApplicationContext.java:133)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:230)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:156)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:48)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4104)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
        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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.apache.catalina.core.StandardContext.init(StandardContext.java:5005)
        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.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
        at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:150)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:274)
        at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:91)
        at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:357)
        at org.jboss.web.WebModule.startModule(WebModule.java:68)
        at org.jboss.web.WebModule.startService(WebModule.java:46)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:418)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy36.start(Unknown Source)
        at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:394)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
        at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy8.deploy(Unknown Source)
        at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:325)
        at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:501)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:20
4)
        at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
        at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
        at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:897)
        at $Proxy0.start(Unknown Source)
        at org.jboss.system.ServiceController.start(ServiceController.java:418)
        at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy4.start(Unknown Source)
        at org.jboss.deployment.SARDeployer.start(SARDeployer.java:273)
        at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
        at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
        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.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
        at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
        at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:121)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
        at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
        at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
        at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
        at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
        at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
        at $Proxy5.deploy(Unknown Source)
        at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:434)
        at org.jboss.system.server.ServerImpl.start(ServerImpl.java:315)
        at org.jboss.Main.boot(Main.java:195)
        at org.jboss.Main$1.run(Main.java:463)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.alfresco.service.cmr.dictionary.DictionaryException: Failed to parse model
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:91)
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:89)
        … 141 more
Caused by: org.jibx.runtime.JiBXException: Expected end tag, found start tag "{http://www.alfresco.org/model/dictionary/
1.0}title" (line 18, col 17)
        at org.jibx.runtime.impl.UnmarshallingContext.toEnd(UnmarshallingContext.java:548)
        at org.jibx.runtime.impl.UnmarshallingContext.parsePastEndTag(UnmarshallingContext.java:805)
        at org.alfresco.repo.dictionary.JiBX_repository_source_java_org_alfresco_repo_dictionary_m2bindingM2Model_access
.unmarshal()
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2515)
        at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2675)
        at org.alfresco.repo.dictionary.M2Model.createModel(M2Model.java:86)
        … 142 more
11:34:26,687 ERROR [[/alfresco]] Exception sending context initialized event to listener instance of class org.springfra
mework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DictionaryService' defined in cl
ass path resource [alfresco/public-services-context.xml]: Can't resolve reference to bean 'dictionaryService' while sett
ing property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'dictionaryBootstrap' defined in class path resource [alfresco/application-context.xml]: Initialization of bea
n failed; nested exception is org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model
alfresco/model/gcModel.xml
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dictionaryBootstrap' defined in
class path resource [alfresco/application-context.xml]: Initialization of bean failed; nested exception is org.alfresco.
service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/model/gcModel.xml
org.alfresco.service.cmr.dictionary.DictionaryException: Could not import bootstrap model alfresco/model/gcModel.xml
        at org.alfresco.repo.dictionary.DictionaryBootstrap.bootstrap(DictionaryBootstrap.java:94)

A helping hand would be appreciated.
What is the procedure for adding new types ? For example, has the db to be destroyed ? Or tables cleared ?

Thanks


Jerome

I'm using RC1b on w2k
12 REPLIES 12

jbaton
Champ in-the-making
Champ in-the-making
My new model is in folder
C:\alfresco\jboss\server\default\conf\alfresco\model

Final symptom is that war file is not deployed, thus making application 404.

I tried to use a working uri in attribute uri of namespace, dropping mandatory aspects to reduce xml length to minimum.
Still got the same start problem.

What can be the problem with my new file ? As it for sure is the cause (as dropping its reference in application-context.xml lets jboss start normally)


Jerome, trying voodoo incantations on his pc  :twisted:

jbaton
Champ in-the-making
Champ in-the-making
XML file now does validate against 'modelSchema.xsd' , "types" tags were missing.

It now looks like this


<model name="example:mynewmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>GC Model</description>
   <author>JB</author>
   <version>0.1</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />

      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <namespaces>
      <namespace uri="http://jeromeb.free.fr/" prefix="gc" />
   </namespaces>

   <types>
      <type name="gc:process">
         <title>Process</title>

         <parent>cm:cmobject</parent>

         <properties>
            <property name="gccode">
               <type>d:text</type>
            </property>

            <property name="gctitle">
               <type>d:text</type>
            </property>
         </properties>

         <mandatory-aspects>
            <aspect>cm:ownable</aspect>

            <aspect>cm:versionable</aspect>
         </mandatory-aspects>

         <associations>
            <child-association name="cm:gcsubprocesses">
               <target>
                  <class>gc:process</class>
               </target>
            </child-association>
         </associations>
      </type>
   </types>
  
  
</model>

But is still does not work.


Jerome

jbaton
Champ in-the-making
Champ in-the-making
Not thanks to voodoo tricks, I succeeded in first step of adding a new content type. Well, not as straightforward as written in the wiki.


Here is the working stuff, bolded the important points


<model name="gc:gcmodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
   <description>GC Model</description>
   <author>JB</author>
   <version>0.1</version>

   <imports>
      <import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d" />
      <import uri="http://www.alfresco.org/model/system/1.0" prefix="sys"/>
      <import uri="http://www.alfresco.org/model/content/1.0" prefix="cm" />
   </imports>

   <namespaces>
      <namespace uri="http://www.wadael.org/model/content/0.1" prefix="gc" />
   </namespaces>

   <types>
     <type name="gcSmiley Tonguerocessus">
         <title>Process</title>
         <parent>sys:base</parent> <!– and not cmSmiley Surprisedbject –>

         <properties>
            <property name="gc:code">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
            <property name="gc:titre">
               <type>d:text</type>
               <mandatory>true</mandatory>
            </property>
         </properties>

         <associations>
            <child-association name="gc:subprocessus">
               <target>
                  <class>gcSmiley Tonguerocessus</class>
               </target>
            </child-association>
         </associations>
        
         <mandatory-aspects>
            <aspect>cmSmiley Surprisedwnable</aspect>
            <aspect>cm:versionable</aspect>
         </mandatory-aspects>
        
      </type>
   </types>
</model>


I'm pretty sure it will help a lot of persons.
My 2cts to this incredible software


Jerome

davidc
Star Contributor
Star Contributor
Hi Jerome,

Well, I hoped that voodoo would not be required to configure a new content model 🙂

I've noticed a few people have had difficulties in this area, so I'll be taking a walk through the wiki instructions with your model (and some others I've collected too) to make sure there aren't errors in the instructions and examples etc with the aim of improving them.

In particular, I'll expand on namespace usage, as this seems to have been the cause of several problems.

jbaton
Champ in-the-making
Champ in-the-making
David,

In fact, neither voodoo nor kicking in the box did work Smiley Happy
But those medieval procedures had to be followed before further investigation.

As you have read, I succeeded to start Alfresco with my new content model. But I'm still on my way to be able to add my self-defined content using the web client.

I get NullPointerException in class BaseContentWizard (in method getObjectTypes, member dictionaryService is null which is bad).

Did I forget something so that the instanciation went wrong ?

Maybe a step is missing in the wiki's step by step. Like adding custom type at the end of the web-client-config.xml file (which I found in the forum)

I also read somewhere that a new wizard had to be provided. How ?

Thanks again.


Jerome

davidc
Star Contributor
Star Contributor
The nullpointer does indeed seem bad.  I shall step through this tomorrow.

gavinc
Champ in-the-making
Champ in-the-making
The NullPointerException as you say is because the dictionaryService member variable is null. This is becuase the DictionaryService is not being "injected" into the managed bean.

Open WEB-INF/faces-config.xml and find the "AddContentWizard" managed bean section. Add the following XML to the managed bean config:

<managed-property>
   <property-name>dictionaryService</property-name>
   <value>#{DictionaryService}</value>
</managed-property>

You may also want to add the same to the "CreateContentWizard" managed bean config (immeditaley below in the file) as this wizard is used for creating inline content.

This is a fairly new addition functionality wise, so you're right there is no wiki steps describing how to configure the drop down of custom content types. However, the change above is not one you should need to make so
I'll add this now so it appears in the next release. Thanks for your efforts in tracking this one down.

jbaton
Champ in-the-making
Champ in-the-making
Gavin, David,

I'm glad to have helped you with your great software.
I'm sure, you'll help me again Smiley Happy  as my evaluation is going on (the next big point is custom workflow, then authentification).

After adding the xml, I followed the instructions to add my simple custom content type and be able to populate some using the web client.

Well … I'm a bit frustrated, I believed it was to work as wanted.

The resulting workflow I get after hitting "create content" is
1/ getting the html editor …. well I expected some input fields
2/ hitting next, properties, i'm then allowed to choose "Process" as type.
3/ hitting next, summary displays "content" as type


AAMOF, I have not seen any of the properties I have defined.

It would be more user fiendly if my "Process" content type was in the "content type" drop down list and not in the "type" dropdown list.
Or better if changing the "type" value (from content to something) would disable the "content type" list.

Could you give me a hint on how to make my model work (a process has a few properties and a collection of processes) with the web client.

Should I use aspects instead of types so that it is more smooth of use ? (then, how to create a collection ?)

Do I have to create my own jsps/code/…  (what exactly?) to make it do what I want ?
No offense meant, I just mean that it is not easy to be generic and fulfill all requirements.

Thanks for your software that already fulfills many requirements.
(btw, a chart with planned and implemnted features would be nice)


Jerome

gavinc
Champ in-the-making
Champ in-the-making
Hi Jerome,

Yes, you're right, the custom properties will not get prompted for automatically yet. There are two issues covering this already, so we will add a solution in the future:

http://www.alfresco.org/jira/browse/AWC-243
http://www.alfresco.org/jira/browse/AWC-188

"Content type" should be read as mime type, if you want to add a new mime type you can edit the "mimetype-map.xml" configuration file.

To get prompted for your custom properties you would have to add a new JSP and modify org.alfresco.web.bean.wizard.*ContentWizard to save your extra properties and handle navigation. You will also need to add a navigation rule to get to your new JSP in faces-config-navigation.xml.

Hope some of that helps.