jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-771) Make the CND files AUTOMATICALLY loaded from its natural place: /repository/nodetypes
Date Wed, 28 Feb 2007 16:34:57 GMT

    [ https://issues.apache.org/jira/browse/JCR-771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476634
] 

Stefan Guggisberg commented on JCR-771:
---------------------------------------

On 2/27/07, Wolf Benz (JIRA) <jira@apache.org> wrote:
> Currently there is no AUTOMATIC support for the predefined custom node type files.
> They have to be loaded manually, same as the fact as for every getSession() the namespaces
are to be registered...

for the sake of clarity:

there are built-in, i.e. 'predefined' node types. those node types (most of them defined by
jsr 170) are provided by jackrabbit out-of-the box, e.g. nt:unstructured, nt:file etc.

there's also the possibilty of defining your own 'custom' node types. those node types have
to be registered once. namespaces referenced by your custom node type definitions have to
be registered once.

> I think these 2 issues could best be solved together:
> 
> It would be a tremendous improvement if we could just put the cnd file inside /repository/nodetypes.
Such file starts by declaring the namepsaces anyway so it would also make the tedious NS registration
redundant.

note that the repository home directory (which includes repository/nodetypes) is a 'system'
directory managed exclusively by jackrabbit. it's not meant to be externally accessed/manipulated.

JackrabbitNodeTypeManager.registerNodeTypes(InputStream, String) provides an easy and convenient
way of registering your custom node types incl. any referenced namespaces, e.g. 

                JackrabbitNodeTypeManager manager = (JackrabbitNodeTypeManager)
                        session.getWorkspace().getNodeTypeManager();
                manager.registerNodeTypes(new FileInputStream("mytypes.cnd"),
                        JackrabbitNodeTypeManager.TEXT_X_JCR_CND);


you have to register your custom types only once, just like you have to deploy your custom
database schema objects once in a rdbms. 

btw: i don't know any rdbms that automatically picks up and executes custom ddl files on startup.

-1 for the proposed functionality


> Make the CND files AUTOMATICALLY loaded from its natural place: /repository/nodetypes
> -------------------------------------------------------------------------------------
>
>                 Key: JCR-771
>                 URL: https://issues.apache.org/jira/browse/JCR-771
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: nodetype
>    Affects Versions: 1.2.2
>         Environment: any
>            Reporter: Wolf Benz
>            Priority: Minor
>             Fix For: 1.3
>
>
> Currently there is no AUTOMATIC support for the predefined custom node type files in
CND format. 
> They have to be loaded manually, same as the fact as for every getSession() the namespaces
are to be registered... 
> I think these 2 issues could best be solved together: 
> It would be a tremendous improvement if we could just put the cnd file inside /repository/nodetypes.
Such file starts by declaring the namepsaces anyway so it would also make the tedious NS registration
redundant.
> Both are currenlty boilerplate code and lot of newcomers (like myself :-) struggle with
it.
> For more info, please have a look at this thread on the JR maling list: "Namespaces -
questions" (posted by myself)
> Wolf

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message