cancel
Showing results for 
Search instead for 
Did you mean: 

How to add some fields to dublincore.xsd

Antonio_Pescion
Confirmed Champ
Confirmed Champ

I'm trying to add some fields to dublincore.xsd but without success. I created two files and copied them under nxserver/config folder The files contain: dublincore.xsd

<xs:schema
  targetNamespace="http://www.nuxeo.org/ecm/schemas/dublincore/"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:nxs="http://www.nuxeo.org/ecm/schemas/dublincore/">
           
  <xs:element name="note" type="xs:string" default="TEST"/>
  <xs:element name="noteExtended" type="xs:string" default="TEST"/>
</xs:schema>

and extension point extend-dublincore-config.xml

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.core.CoreExtensions.override">
	<require>org.nuxeo.ecm.core.schema.TypeService</require>

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

</component>

What's wrong? The fields in a REST AP are not visible

6 REPLIES 6

pibou_Bouvret
Elite Collaborator
Elite Collaborator

You may need to require org.nuxeo.ecm.core.CoreExtensions in your contribution

Anahide_Tchertc
Elite Collaborator
Elite Collaborator

Hi,

Schemas are not overridden by default, and you indeed need to make sure your contribution is deployed after the default one (and you do not need the require on the target extension point "org.nuxeo.ecm.core.schema.TypeService" as it is implicitly required).

Here's a sample configuration (not tested):

<?xml version="1.0"?>
<component name="org.nuxeo.ecm.core.CoreExtensions.override">
    <require>org.nuxeo.ecm.core.CoreExtensions</require>

    <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
        <schema name="dublincore" src="schemas/dublincore.xsd" override="true" />
    </extension>

</component>

These errors are displyed

Amir_Buzo
Confirmed Champ
Confirmed Champ

I think you should not touch dublincore as a core schema and add a new scheme attached to your document types. dublincore.xsd schema override is not suggested as it is used on dc:modified, creation etc. Why do not you follow the proposed way, declare another schema and attached it to anywhere you like.

Antonio_Pescion
Confirmed Champ
Confirmed Champ

Resolved. I have created a new schema called "extra" and added it to Picture and File type

Well i am glad to hear that! That's is the best way and nuxeo compliant.