hi @ all,
I'm tring to add extra data to "File" core DocumentType. To achive this i have created a schema with extra informations. like:
<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/"
>
<xs:element name="test1" type="xs:string"/>
<xs:element name="test2" type="xs:string"/>
</xs:schema>
And added a contrib xml file for extend "schema" and "doctype":
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
<schema name="extra" src="schemas/extra.xsd" prefix="extra" />
</extension>
<extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
<doctype name="File" extends="Document">
<schema name="common"/>
<schema name="uid"/>
<schema name="dublincore"/>
<schema name="file"/>
<schema name="file_schema"/>
<schema name="files"/>
<schema name="extra"/>
<facet name="Versionable"/>
</doctype>
</extension>
Also, i have created a new table to add extra metadata and i have added the contrib in the xml file:
<extension target="org.nuxeo.ecm.directory.sql.SQLDirectoryFactory" point="directories">
<directory name="myextrametadata">
<schema>vocabulary</schema>
<dataSource>java:/nxsqldirectory</dataSource>
<cacheTimeout>3600</cacheTimeout>
<cacheMaxSize>1000</cacheMaxSize>
<table>my_extrametadata</table>
<idField>id</idField>
<autoincrementIdField>true</autoincrementIdField>
<dataFile>directories/myextrametadata-def.csv</dataFile>
<createTablePolicy>on_missing_columns</createTablePolicy>
</directory>
</extension>
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:
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();
But when i try to create a "File" into workspace via Web user interface i have a runtime error with this full stacktrace:
To make more readable the post i have pasted the stacktrace here: http://pastebin.com/7pCzE26Z
Can you help me? There is a way to "extend" metadata for Document Type "File" ? What's my fault?
Thank you!!!
I have followed this nuxeo official howto: http://doc.nuxeo.com/display/NXDOC/How-to+configure+document+types%2C+actions+and+operation+chains#How-toconfiguredocumenttypes,actionsandoperationchains-Extensionofmetadata