Adding new DocTypes to map CMIS variables.

CONTEXT:

I would like to import scanned documents similar to the process described in this tutorial: https://www.nuxeo.com/blog/direct-document-capture-nuxeo-using-ephesoft-cmis/ where the variables captured by the scanning software can be mapped as attributes of a Nuxeo document (therefore making the document searchable by those attributes).

Under the title “Configure Field Mapping”, the author seems to map Ephesoft variables with their equivalent variable within Nuxeo, including the document type itself. I am assuming that this document type must have been set up previous to this attempted mapping, however, the tutorial doesn't go through how to do that.

I have found great documentation on how to create new document types but they all relate to Nuxeo Studio, which is unfortunately out of the question. Bits and pieces on using XML to configure Nuxeo has been helpful but there is no complete tutorial on how to create a doc type without Studio.

MY ATTEMPT:

I have found some useful info from various similar forum threads and have added an XML file to the nxserver > config folder. The XML is as follows (this snippet will make it quite apparent I have no idea what I'm doing):

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

    <extension-point name="doctype">

        <code>
            <doctype name="VehReport" extends="Document">
                <schema name="docID" />
                <schema name="image" />
            </doctype>
        </code>

        <code>
            <doctype name="Checklist" extends="Document">
                <schema name="entryID" />
                <schema name="VehID" />
                <schema name="RegoNo" />
                <schema name="image" />
            </doctype>
        </code>

        <object class="org.nuxeo.ecm.core.schema.DocumentTypeDescriptor" />
    </extension-point>

    <extension target="org.nuxeo.runtime.EventService" point="listeners">
        <listener class="org.nuxeo.ecm.core.schema.FlushPendingRegistrationOnReloadListener">
            <topic>org.nuxeo.runtime.reload</topic>
        </listener>
    </extension>
</component>

The aim of this code is to create two document types: Vehicle Report and Checklist. The report has should have variables “docID” and “image”, and the checklist should have variables “entryID”, “VehID”, “RegoNo”, and “image” so that their respective scanned documents' variables can be mapped.

This code produces a bunch of errors in the server log similar to these:

ERROR [localhost-startStop-1] [org.nuxeo.runtime.model.impl.ComponentInstanceImpl] Warning: target extension point 'schema' of 'org.nuxeo.ecm.core.schema.TypeService' is unknown. Check your extension in component service:org.nuxeo.ecm.core.CoreExtensions
ERROR [localhost-startStop-1] [org.nuxeo.runtime.model.impl.ComponentInstanceImpl] Warning: target extension point 'configuration' of 'org.nuxeo.ecm.core.schema.TypeService' is unknown. Check your extension in component service:org.nuxeo.ecm.core.CoreExtensions
etc.

Upon further exploration I've seen some answers suggest further modification to schemas and other configs but no in-depth guides on how to do any of it.

QUESTION:

Would you instruct me or direct me to instructions on the whole process of adding new document types without Studio? Or, if you've read through the context and have a better suggestion than adding docTypes, would you inform me?

0 votes

2 answers

1897 views

ANSWER



Hi,

here you are a sample definition of a Book document type. https://github.com/dmetzler/nuxeo-book/tree/master/nuxeo-book-core

Look for the schema book.xsd definition in src/main/resources/schemas, and in src/main/resources/OSGI-INF directory, with the XML contributions to define your document types.

Hope it helps.

Regards, VS!

0 votes



You can use Nuxeo Studio for simpler configuration steps.

-1 votes