On 19 Sep 2008, at 08:11, Enrique Perez wrote:
> Recently, I modified the fields of the default metadata. I tell you  
> the
> steps that I follow:
>
> 1. Create a new plugin.
> 2. Modify the dublincore schema and place it in resources/schemas in
> your project folder.
> 3. Override the old dublincore using the following extension point:
>
>    <require>org.nuxeo.ecm.core.schema.TypeService</require>
>    <require>org.nuxeo.ecm.core.CoreExtensions</require>

This <require> part is now deprecated (although it works), it's  
simpler to have in your MANIFEST.MF the dependency as:
Require-Bundle: org.nuxeo.ecm.core.schema,org.nuxeo.ecm.core

>    <extension target="org.nuxeo.ecm.core.schema.TypeService"
> point="schema">
>        <schema name="dublincore" prefix="dc" override="true"
> src="schemas/dublincore.xsd" />
>    </extension>
>
> 4. Define a layout for the dublincore schema. For example:

This one requires an additional dependency in the Require-Bundle, to  
org.nuxeo.ecm.platform.forms.layout.client

>    <extension
>        target="org.nuxeo.ecm.platform.forms.layout.WebLayoutManager"
>        point="layouts">
>
>        <layout name="dublincore">
>            <templates>
>                <template mode="any">
>                    /layouts/layout_default_template.xhtml
>                </template>
>            </templates>
>            <rows>
>                <row>
>                    <widget>widget1</widget>
>                </row>
>                <row>
>                    <widget>widget2</widget>
>                </row>
>
>                    ...
>
>                <row>
>                    <widget>widgetn</widget>
>                </row>
>            </rows>
>            <widget name="widget1" type="template">
>                <labels>
>                    <label mode="any">label.dublincore.widget1</label>
>                </labels>
>                <translated>true</translated>
>                <fields>
>                    <field>dc:field1</field>
>                    <field>dc:field2</field>
>                    <field>dc:field3</field>
>                </fields>
>                <properties mode="any">
>                    <property name="template">
>                        /widgets/values_widget1.xhtml
>                    </property>
>                </properties>
>            </widget>
>
>                ...
>
>            <widget name="widgetn" type="template">
>                <labels>
>                    <label mode="any">
>                        label.dublincore.widgetn
>                    </label>
>                </labels>
>                <translated>true</translated>
>                <fields>
>                    <field>dc:fieldn</field>
>                </fields>
>                <properties mode="any">
>                    <property name="template">
>                        /widgets/values_widgetn.xhtml
>                    </property>
>                </properties>
>                <properties widgetMode="edit">
>                    <property name="styleClass">dataInputText</ 
> property>
>                </properties>
>            </widget>
>        </layout>
>
>    </extension>
>
> As you can see, the widget called widget1 uses the fields dc:field1,
> dc:field2 and dc:field3 (these fields are defined in the dublincore
> schema that we created before) and uses a view placed in
> /widgets/values_widget1.xhtml (you must create all the views that you
> need and place it in your plugin folder).
>
> Regards.
>
> -- 
> Enrique Pérez Olivares.
> Dpto I+D.
> Yerbabuena Software.
> [EMAIL PROTECTED]
> http://www.yerbabuena.es
> Tlf/Fax: 902 995 246
>
> _______________________________________________
> ECM mailing list
> [email protected]
> http://lists.nuxeo.com/mailman/listinfo/ecm

-- 
Florent Guillaume, Director of R&D, Nuxeo
Open Source Enterprise Content Management (ECM)
http://www.nuxeo.com   http://www.nuxeo.org   +33 1 40 33 79 87

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

Reply via email to