cancel
Showing results for 
Search instead for 
Did you mean: 

Document type add error (The property at 'testTp:test' doesn't exists)

John_
Champ in-the-making
Champ in-the-making

I need help. Nuxeo happened 3 days after study Add a Document Type error occurs I do not know why.

schema.xsd

<xs:element name="test" type="xs:string" />

type-contrib.xml

<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="testTp" src="schema/testTp.xsd" prefix="testTp" />
  </extension>

  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">

    <doctype name="TestFolder" extends="Document">
      <schema name="testTp" />
      <schema name="common"/>
      <schema name="dublincore"/>
      <facet name="Folderish"/>
      <subtypes>
        <type>Folder</type>
        <type>File</type>
        <type>Note</type>
      </subtypes>
    </doctype>
  </extension>

WebEngine source

DocumentModel dm = systemSession.createDocumentModel("/asset-library/test", "type_test", "TestFolder");

        DocumentType type = dm.getDocumentType();
        for (Schema schema : type.getSchemas()) {
            log.error(" ===== " + type.getName());
            for (Field f : schema.getFields()) {
                log.error(">>>> " + f.getName().getLocalName());
            }
        }

        Map<String, Object> map = dm.getProperties("testTp");
        log.error("====================");
        for (String key : map.keySet()) {
            log.error(key + " : " + map.get(key));
        }
        log.error("====================");
        log.error("====================");

        DocumentHelper.setProperty(systemSession, dm, "mime_type", "ssssss");

result

===== TestFolder
>>>> mime_type
===== TestFolder
>>>> icon
>>>> icon-expanded
>>>> size
===== TestFolder
>>>> creator
>>>> source
>>>> nature
>>>> contributors
>>>> created
>>>> description
>>>> rights
>>>> subjects
>>>> publisher
>>>> valid
>>>> format
>>>> issued
>>>> modified
>>>> language
>>>> coverage
>>>> expired
>>>> lastContributor
>>>> title
====================
ubion:mime_type : null
====================
====================

error msg

Caused by: org.nuxeo.ecm.core.model.NoSuchPropertyException: The property at 'testTp:test' doesn't exists
	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.makeProperties(SQLSession.java:1038)
	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.makeProperty(SQLSession.java:993)
	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.getProperty(SQLDocumentLive.java:164)
	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLComplexProperty.setPropertyValue(SQLComplexProperty.java:222)
	at org.nuxeo.ecm.core.storage.sql.coremodel.SQLDocumentLive.writeDocumentPart(SQLDocumentLive.java:178)
	at org.nuxeo.ecm.core.api.DocumentModelFactory.writeDocumentModel(DocumentModelFactory.java:298)
	at org.nuxeo.ecm.core.api.AbstractSession.writeModel(AbstractSession.java:557)
	at org.nuxeo.ecm.core.api.AbstractSession.saveDocument(AbstractSession.java:1968)
1 REPLY 1

Greg_Drayon
Star Contributor
Star Contributor

The question is one-year-old, but