Hi all,

I'm trying to create a new module that permit to create document of type
'project' that can contain document of type 'task'.

I have modified the sample project and I have created this files


* schemas/project.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://project.nuxeo.org/sample/schemas/sample/";>
<xs:element name="codice" type="xs:string"/>
<xs:element name="descrizione" type="xs:string"/>
</xs:schema>

* OSGI-INF/ecm-types-contrib.xml
<?xml version="1.0"?>
<component name="com.company.sandbox.ecm.types">
  <extension target="org.nuxeo.ecm.platform.types.TypeService"
point="types">
    <type id="Project" coretype="Project">
      <label>New Project</label>
      <icon>/icons/file.gif</icon>
      <default-view>view_documents</default-view>
      <subtypes>
        <type>Task</type>
      </subtypes>
      <layout>
        <widget jsfcomponent="h:inputText"
          schemaname="project" fieldname="codice"/>
        <widget jsfcomponent="h:inputText"
          schemaname="project" fieldname="descrizione"/>
      </layout>
    </type>
  </extension>
</component>

* OSGI-INF/core-types-contrib.xml
<?xml version="1.0"?>
<component name="com.company.sandbox.coreTypes">
  <extension target="org.nuxeo.ecm.core.schema.TypeService"
point="schema">
    <schema name="project" src="schemas/project.xsd" prefix="smp"/>
    <schema name="task" src="schemas/task.xsd" prefix="smp"/>
  </extension>
  <extension target="org.nuxeo.ecm.core.schema.TypeService"
point="doctype">
    <doctype name="Project" extends="Document">
      <schema name="common"/>
      <schema name="dublincore"/>
      <schema name="project"/>
    </doctype>
  </extension>

</component>

when I try click on 'new document' i see my new type "New Project". I
click on "New Project" I see the mask in order to insert 'codice' and
'descrizione' but when I clik 'save' I obtain this exception:


13:03:41,631 ERROR [ClientException] ClientException created...
org.nuxeo.ecm.core.api.ClientException
        at 
org.nuxeo.ecm.core.api.ejb.EJBExceptionHandler.wrapException(EJBExceptionHandler.java:65)
        at 
org.nuxeo.ecm.webapp.contentbrowser.DocumentActionsBean.saveDocument(DocumentActionsBean.java:437)

..........
..........
..........
Caused by: java.lang.NullPointerException
        at
org.nuxeo.common.utils.StringUtils.toAscii(StringUtils.java:65)
        at org.nuxeo.common.utils.IdUtils.generateId(IdUtils.java:80)
        at org.nuxeo.common.utils.IdUtils.generateId(IdUtils.java:125)
        at
org.nuxeo.ecm.webapp.contentbrowser.DocumentActionsBean.saveDocument(
DocumentActionsBean.java:419)


What should be my issue?

An other question: the creation mask show two fields for input 'codice'
and 'descrizione' and the label that the user see is 'codice' and
descrizione that I think are read from fieldname="codice" and
fieldname="descrizione"; This label could be I10n?

Thanks for your patience.

Regards,
Marco Balcon

_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm

Reply via email to