AnsweredAssumed Answered

Custom Content Type error

Question asked by mattew80 on Nov 9, 2007
Latest reply on Nov 9, 2007 by mattew80
hi,

I want create a new content type for press release. I'm studing from Alfresco Enterprise Content Management Implementation book that use Alfresco 1.4, but I use the 2.1 version of Alfresco.

Add this line to /extension/customModel.xm file


<types>
   <!– Definition of new Content Type: Press Release –>
   <type name="custom:pressrelease">
      <title>Press Release</title>
      <parent>cm:content</parent>
      <properties>
         <property name="custom:PRName">
   <title>PR Person Name</title>
   <type>d:text</type>
         </property>

         <property name="custom:PREmail">
   <title>PR Person Email</title>
   <type>d:text</type>
         </property>

         <property name="custom:PRPhone">
   <title>PR Person Phone</title>
   <type>d:text</type>
         </property>

         <property name="custom:PRDate">
   <title>PR Released Date</title>
   <type>d:date</type>
         </property>
      </properties>

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

Open the web-client-config-custom.xml file and add the following lines of code.

<!– Lists the custom aspect in business rules Action wizard –>
<config evaluator="string-compare" condition="Action Wizards">
   <aspects>
      <aspect name="custom:CustomerDetails"/>
   </aspects>  
   <subtypes>
      <type name="custom:pressrelease"/>
   </subtypes>
</config>

Add the following XML code just before the block shown above. This code ensures that the press release content type is listed when you create new content.


<config evaluator="string-compare" condition="Content Wizards">
   <content-types>
      <type name="custom:pressrelease" />
   </content-types>
</config>

Add the following XML code just before the block shown above. This code ensures that the properties are available to edit in the edit properties window for press release content.


<config evaluator="node-type" condition="custom:pressrelease">
   <property-sheet>
      <show-property name="mimetype"
        display-label-id="content_type"
        component-generator="MimeTypeSelectorGenerator" />
     <show-property name="size"
        display-label-id="size"
        converter="org.alfresco.faces.BByteSizeConverter"
        show-in-edit-mode="false" />
     <show-property name="custom:PRName" />
     <show-property name="custom:PREmail" />
     <show-property name="custom:PRPhone" />
     <show-property name="custom:PRDate" />
   </property-sheet>
</config>

After making these changes to the configuration files, restart Alfresco.

The DOS shell of Alfresco gimme the following error:

GRAVE: Error listenerStart
9-nov-2007 11.03.44 org.apache.catalina.core.StandardContext start
GRAVE: Context [/alfresco] startup failed due to previous errors
Exception in thread "HSQLDB Timer @1d86a73" java.lang.NullPointerException
        at org.hsqldb.lib.HsqlTimer.nextTask(Unknown Source)
        at org.hsqldb.lib.HsqlTimer$TaskRunner.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:595)
9-nov-2007 11.03.51 org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
9-nov-2007 11.03.51 org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
9-nov-2007 11.03.52 org.apache.catalina.startup.Catalina start
INFO: Server startup in 133988 ms

The browser at http://localhost:8080/alfresco/faces/jsp/login.jsp gimme this result:

type Status report

message /alfresco/faces/jsp/login.jsp

description The requested resource (/alfresco/faces/jsp/login.jsp) is not available.

Best regards, thanks in advance and sorry for wordiness.
Matteo

Outcomes