As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Hello,
I'm Java Developer, but I have a question, It's possible add new field when a user create a new document,? without nuxeo studio?
Thanks a lot
Certainly!
Many configurations and customizations are possible without Nuxeo Studio. However, as it may be more enjoyable for the overzealous developer, it's definitely the more difficult route and requires a good understanding of the many extension points Nuxeo provides exactly for this purpose. Does that make sense?
There are a lot of steps necessary to do this. In general, you will need to:
For example, in order to add a new field to an existing Document Type's schema, you will need to:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:nxs="http://www.nuxeo.org/ecm/project/schemas/project1-testproject/companies" xmlns:nxsv="http://www.nuxeo.org/ecm/schemas/core/validation/" xmlns:ref="http://www.nuxeo.org/ecm/schemas/core/external-references/" targetNamespace="http://www.nuxeo.org/ecm/project/schemas/project1-testproject/companies"> <!-- helper XSD definitions for list types --> <xs:complexType name="content"> <xs:sequence> <xs:element name="encoding" type="xs:string"/> <xs:element name="mime-type" type="xs:string"/> <xs:element name="data" type="xs:base64Binary"/> <xs:element name="name" type="xs:string"/> <xs:element name="length" type="xs:long"/> <xs:element name="digest" type="xs:string"/> </xs:sequence> </xs:complexType> <xs:simpleType name="stringList"> <xs:list itemType="xs:string"/> </xs:simpleType> <xs:simpleType name="doubleList"> <xs:list itemType="xs:double"/> </xs:simpleType> <xs:simpleType name="dateList"> <xs:list itemType="xs:date"/> </xs:simpleType> <xs:simpleType name="integerList"> <xs:list itemType="xs:integer"/> </xs:simpleType> <xs:simpleType name="booleanList"> <xs:list itemType="xs:boolean"/> </xs:simpleType> <xs:complexType name="blobList"> <xs:sequence> <xs:element name="item" type="nxs:content" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!--References my custom companies vocabulary that was created, again, through extensions--> <xs:element name="company"> <xs:simpleType> <xs:restriction base="xs:string" ref:resolver="directoryResolver" ref:directory="companies"/> </xs:simpleType> </xs:element> </xs:schema>
<extension point="doctype" target="org.nuxeo.ecm.core.schema.TypeService"> <facet name="Picture"> <schema name="file"/> <schema name="picture"/> <schema name="image_metadata"/> </facet> <!-- deprecated since 7.1, here for compat --> <facet name="MultiviewPicture"/> <doctype extends="Document" name="Picture"> <schema name="common"/> <schema name="uid"/> <schema name="dublincore"/> <!--Put your new schema here. Obviously you'd name it something better than this...--> <schema name="my-new-doc-schema"/> <facet name="Picture"/> <facet name="Versionable"/> <facet name="Publishable"/> <facet name="Commentable"/> <facet name="HasRelatedText"/> </doctype> </extension>
Make sure, when packaging your project, to declare 'override' in your extension point contribution header. You can learn more about building a Nuxeo compliant marketplace package here: https://doc.nuxeo.com/display/NXDOC/Understanding+Bundles+Deployment.
You can view the available extension points for your Nuxeo Platform release, here: http://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20DM-7.10/
Also, the Nuxeo Yeoman bootstrap generator may be of interest to you, found here: https://www.nuxeo.com/blog/the-new-way-to-bootstrap-your-application-with-nuxeo-generator/
Hopefully this is enough to get you started. If I were to provide you examples for each step, it would become more of a tutorial, and less of an answer. Am I right?
Of course, you can avoid all of this by registering your Nuxeo Platform with Nuxeo. Nuxeo Studio makes all of this 'easy-peezy-lemon-squeezy'.
-Yousuf
Thanks a lot for your response. I'd like to add a new field (list type) with database information, for example, a contract type...
Thank u for your help
Hi Zetta,
Hi Yousuf