Updater Editor And CND

41 views
Skip to first unread message

Juan Simon Rico Jimenez

unread,
Feb 27, 2015, 5:48:13 PM2/27/15
to hippo-c...@googlegroups.com
Hello,

I have been using the updater editor tool to make some changes to the content on my existing repository, mostly deleting some fields that i didn't need to use but among those fields where some compounds that i also want to remove from my namespace, so i would also like to remove them from the CND. I was wondering if there is a way for me to access the cnd file with a groovy script updater and remove this compound i dont need anymore and also change the supertype of one of my document types, or if maybe i can just replace the cnd altogether?


Thank you,

Jeroen Hoffman

unread,
Mar 2, 2015, 6:51:09 AM3/2/15
to hippo-c...@googlegroups.com
Hi,

These kind of CND changes are in the category of "incompatible node type
changes", which means that the upgrade path is not easy as for changes supported
by the relaxed node types, see [1].

This means that you will have to bump the version of your project namespace in
your local project and also write a project specific migrator tool to bump it in
existing repositories.

Detailed information is at [2]

HTH
Jeroen Hoffman


[1]
http://www.onehippo.org/library/concepts/document-types/introduction-to-relaxed-node-types.html
[2] http://www.onehippo.org/library/upgrade/namespace-migration.html
> --
> Hippo Community Group: The place for all discussions and announcements about
> Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups "Hippo
> Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to hippo-communi...@googlegroups.com
> <mailto:hippo-communi...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.

Juan Simon Rico Jimenez

unread,
Mar 2, 2015, 10:19:15 AM3/2/15
to hippo-c...@googlegroups.com
Hi, 

Thank you. What if i dont need to make changes on the namespace nodes as i imported the changes from my local environment to the test environment's repository, and the content already has the right primary types it is just the cnd file that is not consistent. so i only need to update the cnd. could I use an updater mode with a namespace visitor just to update the cnd?

Mathijs den Burger

unread,
Mar 2, 2015, 10:30:25 AM3/2/15
to hippo-c...@googlegroups.com
On Mon, Mar 2, 2015 at 4:19 PM, Juan Simon Rico Jimenez <sir...@gmail.com> wrote:
Hi, 

Thank you. What if i dont need to make changes on the namespace nodes as i imported the changes from my local environment to the test environment's repository, and the content already has the right primary types it is just the cnd file that is not consistent. so i only need to update the cnd. could I use an updater mode with a namespace visitor just to update the cnd?

If it doesn't need to be automated you can also use the 'CND Import' option in the toolbar of the Console (http://example.com/cms/console).

Mathijs
 
To unsubscribe from this group and stop receiving emails from it, send an email to hippo-communi...@googlegroups.com.

Juan Simon Rico Jimenez

unread,
Mar 2, 2015, 10:56:02 AM3/2/15
to hippo-c...@googlegroups.com
Well the import tool wont work because it is keeping some document types that don't exist anymore and the import wont update the primary type on the cnd for the documents i have changed.

Jeroen Hoffman

unread,
Mar 2, 2015, 11:50:12 AM3/2/15
to hippo-c...@googlegroups.com

Hi,

Indeed console's CND import doesn't work for incompatible changes, Jackrabbit doesn't allow it. Also an updater script won't do it.

IMO you have the option to change/bump the namespace identifier with migrator tool, or to start a clean repository (and reimport existing content?) or to leave the unused cnd entries in there .

HTH
Jeroen

Op 2 mrt. 2015 16:56 schreef "Juan Simon Rico Jimenez" <sir...@gmail.com>:

Juan Simon Rico Jimenez

unread,
Mar 2, 2015, 11:59:28 AM3/2/15
to hippo-c...@googlegroups.com
Could I use an updater module? I have tried this approach but the updater doesn't run, i have included the start tag in the hippo:initialize version and added the updater to the manifest. But it doesn't seem to run this is the code for the updater:

 @Override
    public void register(final UpdaterContext context) { 
        log.info("Updating CND with updater module---------------------------------------------------------------"); 
        context.registerName("MTOT-CNDUpdater"); 
        context.registerStartTag("mtot-cnd-update-trigger"); 
        context.registerEndTag("mtot-cnd-Updated"); 
        InputStream cndStream = getClass().getClassLoader().getResourceAsStream("MTOT.cnd");
        context.registerVisitor(new UpdaterItemVisitor.NamespaceVisitor(context, "MTOT", cndStream)); 
    } 


would this work? am I missing something

I am currently using hippo 7.9.3

Jeroen Hoffman

unread,
Mar 3, 2015, 4:48:23 AM3/3/15
to hippo-c...@googlegroups.com
Hi Juan,

Well yes you could use a
org.hippoecm.repository.ext.UpdaterItemVisitor.NamespaceVisitor, although it's
usage is discouraged, see it's Javadoc, especially the note on never to use it
in a clustered environment. The migrator tool is safer.

But if you do want that, you are missing a -Drepo.upgrade=true system property
for it start executing. Then you'll see some INFO logging in
org.hippoecm.repository.LocalHippoRepository#readUpgradeFlag

HTH
Jeroen
> <javascript:>>:
>
> Well the import tool wont work because it is keeping some document types
> that don't exist anymore and the import wont update the primary type on
> the cnd for the documents i have changed.
>
> El lunes, 2 de marzo de 2015, 10:30:25 (UTC-5), m.denburger escribió:
>
> On Mon, Mar 2, 2015 at 4:19 PM, Juan Simon Rico Jimenez
> <sir...@gmail.com> wrote:
>
> Hi,
>
> Thank you. What if i dont need to make changes on the namespace
> nodes as i imported the changes from my local environment to the
> test environment's repository, and the content already has the
> right primary types it is just the cnd file that is not
> consistent. so i only need to update the cnd. could I use an
> updater mode with a namespace visitor just to update the cnd?
>
>
> If it doesn't need to be automated you can also use the 'CND Import'
> option in the toolbar of the Console
> (http://example.com/cms/__console <http://example.com/cms/console>).
>
> Mathijs
>
>
> El lunes, 2 de marzo de 2015, 6:51:09 (UTC-5), Jeroen Hoffman
> escribió:
>
> Hi,
>
> These kind of CND changes are in the category of
> "incompatible node type
> changes", which means that the upgrade path is not easy as
> for changes supported
> by the relaxed node types, see [1].
>
> This means that you will have to bump the version of your
> project namespace in
> your local project and also write a project specific
> migrator tool to bump it in
> existing repositories.
>
> Detailed information is at [2]
>
> HTH
> Jeroen Hoffman
>
>
> [1]
> http://www.onehippo.org/__librar__y/concepts/document-__types/__introduction-to-relaxed-__node-__types.html
> <http://www.onehippo.org/library/concepts/document-types/introduction-to-relaxed-node-types.html>
>
> [2]
> http://www.onehippo.org/__librar__y/upgrade/namespace-__migration.__html
> <http://www.onehippo.org/library/upgrade/namespace-migration.html>
>
>
>
> Juan Simon Rico Jimenez wrote on 27-02-2015 23:48:
> > Hello,
> >
> > I have been using the updater editor tool to make some
> changes to the content on
> > my existing repository, mostly deleting some fields that
> i didn't need to use
> > but among those fields where some compounds that i also
> want to remove from my
> > namespace, so i would also like to remove them from the
> CND. I was wondering if
> > there is a way for me to access the cnd file with a
> groovy script updater and
> > remove this compound i dont need anymore and also change
> the supertype of one of
> > my document types, or if maybe i can just replace the cnd
> altogether?
> >
> >
> > Thank you,
> >
> > --
> > Hippo Community Group: The place for all discussions and
> announcements about
> > Hippo CMS (and HST, repository etc. etc.)
> >
> > To post to this group, send email to
> hippo-c...@googlegroups.__com
> > RSS:https://groups.google.com/__grou__p/hippo-community/feed/__rss_v2___0_msgs.xml?num=50
> <https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50>
>
> > ---
> > You received this message because you are subscribed to the Google Groups "Hippo
> > Community" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email
> > to hippo-communi...@__googlegroups.__com
> > <mailto:hippo-community...@googlegroups.com>.
> > Visit this group athttp://groups.google.com/__group__/hippo-community
> <http://groups.google.com/group/hippo-community>.
> > For more options, visithttps://groups.google.com/d/__op__tout
> <https://groups.google.com/d/optout>.
>
> --
> Hippo Community Group: The place for all discussions and
> announcements about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.__com
> RSS:
> https://groups.google.com/__group/hippo-community/feed/__rss_v2_0_msgs.xml?num=50
> <https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50>
> ---
> You received this message because you are subscribed to the
> Google Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to hippo-communi...@__googlegroups.com.
> Visit this group at
> http://groups.google.com/__group/hippo-community
> <http://groups.google.com/group/hippo-community>.
> For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/optout>.
>
>
> --
> Hippo Community Group: The place for all discussions and announcements
> about Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> <javascript:>
> RSS:
> https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> <https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50>
> ---
> You received this message because you are subscribed to the Google
> Groups "Hippo Community" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hippo-communi...@googlegroups.com <javascript:>.
> <http://groups.google.com/group/hippo-community>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
> Hippo Community Group: The place for all discussions and announcements about
> Hippo CMS (and HST, repository etc. etc.)
>
> To post to this group, send email to hippo-c...@googlegroups.com
> RSS: https://groups.google.com/group/hippo-community/feed/rss_v2_0_msgs.xml?num=50
> ---
> You received this message because you are subscribed to the Google Groups "Hippo
> Community" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to hippo-communi...@googlegroups.com
> <mailto:hippo-communi...@googlegroups.com>.

Unico Hommes

unread,
Mar 3, 2015, 6:36:35 AM3/3/15
to hippo-c...@googlegroups.com
On Tue, Mar 3, 2015 at 10:48 AM, Jeroen Hoffman <j.ho...@onehippo.com> wrote:
> Hi Juan,
>
> Well yes you could use a
> org.hippoecm.repository.ext.UpdaterItemVisitor.NamespaceVisitor, although
> it's usage is discouraged, see it's Javadoc, especially the note on never to
> use it in a clustered environment. The migrator tool is safer.
>
> But if you do want that, you are missing a -Drepo.upgrade=true system
> property for it start executing. Then you'll see some INFO logging in
> org.hippoecm.repository.LocalHippoRepository#readUpgradeFlag

You'll also have to explicitly declare a dependency on the deprecated
updater engine module in your cms pom.xml:

<dependency>
<groupId>org.onehippo.cms7</groupId>
<artifactId>hippo-repository-deprecated-updater-module</artifactId>
</dependency>

This module will no longer be available in the next Hippo CMS version.

--
Unico
> email to hippo-communi...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages