<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Contribute to &amp;quot;File&amp;quot; core DocumentType to add extra metadata in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313475#M476</link>
    <description>&lt;P&gt;Not sure this is it but I would change the namespace in the schema definition&lt;/P&gt;</description>
    <pubDate>Fri, 19 Oct 2012 14:50:15 GMT</pubDate>
    <dc:creator>bruce_Grant</dc:creator>
    <dc:date>2012-10-19T14:50:15Z</dc:date>
    <item>
      <title>Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313472#M473</link>
      <description>&lt;P&gt;hi @ all,&lt;/P&gt;
&lt;P&gt;I'm tring to add extra data to "File" core DocumentType. To achive this i have created a schema with extra informations. like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xs:schema
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  targetNamespace="http://nuxeo.com/schemas/com/nuxeo/myproject/metadata/extra/"
  xmlns:nxs="http://nuxeo.com/schemas/com/nuxeo/myproject/metadata/extra/"
  &amp;gt;
 
    &amp;lt;xs:element name="test1" type="xs:string"/&amp;gt;
    &amp;lt;xs:element name="test2" type="xs:string"/&amp;gt;   
&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And added a contrib xml file for extend "schema" and "doctype":&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema"&amp;gt;
    &amp;lt;schema name="extra" src="schemas/extra.xsd" prefix="extra" /&amp;gt;
  &amp;lt;/extension&amp;gt;
 
  &amp;lt;extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype"&amp;gt;
    &amp;lt;doctype name="File" extends="Document"&amp;gt;
      &amp;lt;schema name="common"/&amp;gt;
      &amp;lt;schema name="uid"/&amp;gt;
      &amp;lt;schema name="dublincore"/&amp;gt;
      &amp;lt;schema name="file"/&amp;gt;
      &amp;lt;schema name="file_schema"/&amp;gt;
      &amp;lt;schema name="files"/&amp;gt;
      &amp;lt;schema name="extra"/&amp;gt;
      &amp;lt;facet name="Versionable"/&amp;gt;
    &amp;lt;/doctype&amp;gt;
  &amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, i have created a new table to add extra metadata and i have added the contrib in the xml file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory" point="directories"&amp;gt;
    &amp;lt;directory name="myextrametadata"&amp;gt;
      &amp;lt;schema&amp;gt;vocabulary&amp;lt;/schema&amp;gt;
      &amp;lt;dataSource&amp;gt;java:/nxsqldirectory&amp;lt;/dataSource&amp;gt;
      &amp;lt;cacheTimeout&amp;gt;3600&amp;lt;/cacheTimeout&amp;gt;
      &amp;lt;cacheMaxSize&amp;gt;1000&amp;lt;/cacheMaxSize&amp;gt;
      &amp;lt;table&amp;gt;my_extrametadata&amp;lt;/table&amp;gt;
      &amp;lt;idField&amp;gt;id&amp;lt;/idField&amp;gt;
      &amp;lt;autoincrementIdField&amp;gt;true&amp;lt;/autoincrementIdField&amp;gt;
      &amp;lt;dataFile&amp;gt;directories/myextrametadata-def.csv&amp;lt;/dataFile&amp;gt;
      &amp;lt;createTablePolicy&amp;gt;on_missing_columns&amp;lt;/createTablePolicy&amp;gt;
    &amp;lt;/directory&amp;gt;
  &amp;lt;/extension&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want to add extra metadata that no one (using webinterface) can use, but that can be usable by me via nuxeo automation client. Using a call like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;PropertyMap props = new PropertyMap();
props.set("dc:title","MyTest");
props.set("dc:description", "Descr of my Test");
props.set("extra:test1", "myextrainfo");
    			
nuxeosession.newRequest("Document.Create").setInput(new PathRef(workspacepath)).set("type", "File").set("name", "MyTest").set("properties", props).execute();
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But when i try to create a "File" into workspace &lt;STRONG&gt;via Web user interface&lt;/STRONG&gt; i have a runtime error with this full stacktrace:&lt;/P&gt;
&lt;P&gt;To make more readable the post i have pasted the stacktrace here: &lt;A href="http://pastebin.com/7pCzE26Z"&gt;http://pastebin.com/7pCzE26Z&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Can you help me? There is a way to "extend" metadata for Document Type "File" ? What's my fault?&lt;/P&gt;
&lt;P&gt;Thank you!!!&lt;/P&gt;
&lt;P&gt;I have followed this nuxeo official howto: &lt;A href="http://doc.nuxeo.com/display/NXDOC/How-to+configure+document+types%2C+actions+and+operation+chains#How-toconfiguredocumenttypes,actionsandoperationchains-Extensionofmetadata"&gt;http://doc.nuxeo.com/display/NXDOC/How-to+configure+document+types%2C+actions+and+operation+chains#How-toconfiguredocumenttypes,actionsandoperationchains-Extensionofmetadata&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 11:49:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313472#M473</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-19T11:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313473#M474</link>
      <description>&lt;P&gt;Try adding a &lt;REQUIRE&gt; at the beginning of your contribution to ensure that system defined File is properly overridden... see below&lt;/REQUIRE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;component name="com.concena.test.doctypes.contrib"&amp;gt;

	&amp;lt;require&amp;gt;org.nuxeo.runtime.started&amp;lt;/require&amp;gt;
    &amp;lt;extension target="....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2012 13:12:21 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313473#M474</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-19T13:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313474#M475</link>
      <description>&lt;P&gt;Thanks for your answer...&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 14:33:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313474#M475</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-19T14:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313475#M476</link>
      <description>&lt;P&gt;Not sure this is it but I would change the namespace in the schema definition&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 14:50:15 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313475#M476</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-19T14:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313476#M477</link>
      <description>&lt;P&gt;change nxs to extra doesn't solve the problem&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 15:39:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313476#M477</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-19T15:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313477#M478</link>
      <description>&lt;P&gt;Same error with SDK 5.6&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 15:54:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313477#M478</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-19T15:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313478#M479</link>
      <description>&lt;P&gt;I haven't followed either of these examples but I customize File on almost every Nuxeo project so I know that customizing File does work. Do you see any useful errors in the server startup log? Have you turned on additional startup logging (in Nuxeo server in the lib/log4j.xml file uncomment the following...&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 16:50:50 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313478#M479</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-19T16:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313479#M480</link>
      <description>&lt;P&gt;I haven't followed either of these examples but I customize File on almost every Nuxeo project so I know that customizing File does work. Do you see any useful errors in the server startup log? Have you turned on additional startup logging (in Nuxeo server in the lib/log4j.xml file uncomment the following... [had to create this as an answer because the XML wouldn't show up in Comment]&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;!-- Uncomment for fragments pre-processing --&amp;gt;
  &amp;lt;!--
  &amp;lt;category name="org.nuxeo.runtime.deployment.preprocessor"&amp;gt;
    &amp;lt;priority value="INFO" /&amp;gt;
  &amp;lt;/category&amp;gt;
  --&amp;gt;

and

  &amp;lt;!-- Uncomment for components registration info --&amp;gt;
  &amp;lt;!--
  &amp;lt;category name="org.nuxeo.runtime.model.impl"&amp;gt;
    &amp;lt;priority value="INFO" /&amp;gt;
  &amp;lt;/category&amp;gt;
  --&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Oct 2012 16:51:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313479#M480</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-19T16:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313480#M481</link>
      <description>&lt;P&gt;have u seen my config file to contrib to "File" DocType and think that all is right? I have enabled the extra logging (thank for info) but i don't have any error or extra info to resolve my issue. same error and, with sdk 5.6, i have this log when i try to reload my bundle&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 17:41:13 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313480#M481</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-19T17:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313481#M482</link>
      <description>&lt;P&gt;I have tried to change config files, redefing the environment, start from new IDE and from new Nuxeo installation. I have double check every config file but, only differences between the example and my component is that my component add extra metadata "hidden" (so can be used only via nuxeo automation not via we user interface) so i don't implemented the new widget and the new layout.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2012 09:23:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313481#M482</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-22T09:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313482#M483</link>
      <description>&lt;P&gt;can you share or just send me your config files (bruce@concena.com) and I will have a look later today&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2012 15:12:32 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313482#M483</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-22T15:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313483#M484</link>
      <description>&lt;P&gt;what kind of config file? Every config file i have created are added to the first answer. Are you think that i missed some config file or other stuff to create my contrib bundle? I have followed all the steps from official howto, only the widget creation and user interface is (intentionally) not added because i want access this extra information only via automation client (more general via CMIS)&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2012 17:44:57 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313483#M484</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-23T17:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313484#M485</link>
      <description>&lt;P&gt;Ok, I tried your base schema and doc contribs on a test 5.6 system and they worked.&lt;/P&gt;
&lt;P&gt;schema file:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
		   targetNamespace="http://nuxeo.com/schemas/com/nuxeo/myproject/metadata/extra/"
		   xmlns:extra="http://nuxeo.com/schemas/com/nuxeo/myproject/metadata/extra/"&amp;gt;

	&amp;lt;xs:element name="test1" type="xs:string" /&amp;gt;
	&amp;lt;xs:element name="test2" type="xs:string" /&amp;gt;
&amp;lt;/xs:schema&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And the schema/doc contrib:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;component name="test"&amp;gt;

	&amp;lt;require&amp;gt;org.nuxeo.ecm.directory.types&amp;lt;/require&amp;gt;
	&amp;lt;require&amp;gt;org.nuxeo.runtime.started&amp;lt;/require&amp;gt;

	&amp;lt;extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema"&amp;gt;
		&amp;lt;schema name="extra" src="data/schemas/extra.xsd" prefix="extra" /&amp;gt;
	&amp;lt;/extension&amp;gt;

	&amp;lt;extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype"&amp;gt;
		&amp;lt;doctype name="File" extends="Document"&amp;gt;
			&amp;lt;schema name="common" /&amp;gt;
			&amp;lt;schema name="uid" /&amp;gt;
			&amp;lt;schema name="dublincore" /&amp;gt;
			&amp;lt;schema name="file" /&amp;gt;
			&amp;lt;schema name="files" /&amp;gt;
			&amp;lt;schema name="extra" /&amp;gt;
			&amp;lt;facet name="Versionable" /&amp;gt;
		&amp;lt;/doctype&amp;gt;
	&amp;lt;/extension&amp;gt;

&amp;lt;/component&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I had to remove the "file_schema" schema because I dont have that defined. I created a new File doc and confirmed in Postgres that the extra table is created. So if your contribs look like those above then they are not the issue.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 14:45:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313484#M485</guid>
      <dc:creator>bruce_Grant</dc:creator>
      <dc:date>2012-10-25T14:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Contribute to "File" core DocumentType to add extra metadata</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313485#M486</link>
      <description>&lt;P&gt;Ok, confirm that now works for me! So thank you for your time, you are my guru now! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I don't know why but i think that in the last part of my test i have missed the "files" schema and all other works broke against this problem. In the meanwhile i have decided to create another File Type but, in my latest test, i have tried to extend "File" (based on my first question) and all works fine &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; So:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Duble check every time that all core schema are imported&lt;/LI&gt;
&lt;LI&gt;Enable extra logging&lt;/LI&gt;
&lt;LI&gt;Enable &lt;REQUIRE&gt; for contrib&lt;/REQUIRE&gt;&lt;/LI&gt;
&lt;LI&gt;When you have an exception like this, you miss something [1]&lt;/LI&gt;
&lt;LI&gt;Bruce is always right &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;[1]&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: java.lang.NullPointerException. message: null
            at org.nuxeo.ecm.core.api.impl.DataModelImpl.getSchema(DataModelImpl.java:86)
            at org.nuxeo.ecm.core.api.impl.DocumentModelImpl.addDataModel(DocumentModelImpl.java:569)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 Oct 2012 15:19:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/contribute-to-quot-file-quot-core-documenttype-to-add-extra/m-p/313485#M486</guid>
      <dc:creator>yayo_</dc:creator>
      <dc:date>2012-10-25T15:19:17Z</dc:date>
    </item>
  </channel>
</rss>

