Cannot get name from taxonomy

26 views
Skip to first unread message

mounir moumli

unread,
Feb 27, 2017, 7:51:52 AM2/27/17
to Hippo Community
Hello,

We are trying to get the name of a taxonomy category.

The categories have locales (en, de, nl), we use the following code to retrieve the name
category.getInfo("en").getName();
where category is of type org.onehippo.taxonomy.api.Category

what we expect to return is the bold part of the following ("test english"):
<?xml version="1.0" encoding="UTF-8"?>
<sv:node sv:name="test-node-name" xmlns:sv="http://www.jcp.org/jcr/sv/1.0">
  <sv:property sv:name="jcr:primaryType" sv:type="Name">
    <sv:value>hippotaxonomy:category</sv:value>
  </sv:property>
  <sv:property sv:name="hippotaxonomy:key" sv:type="String">
    <sv:value>test-key</sv:value>
  </sv:property>
  <sv:node sv:name="hippotaxonomy:categoryinfos">
    <sv:property sv:name="jcr:primaryType" sv:type="Name">
      <sv:value>hippotaxonomy:categoryinfos</sv:value>
    </sv:property>
    <sv:node sv:name="en">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hippotaxonomy:categoryinfo</sv:value>
      </sv:property>
      <sv:property sv:name="hippotaxonomy:name" sv:type="String">
        <sv:value>test english</sv:value>
      </sv:property>
      <sv:property sv:multiple="true" sv:name="hippotaxonomy:synonyms" sv:type="String">
        <sv:value>english</sv:value>
      </sv:property>
    </sv:node>
    <sv:node sv:name="nl">
      <sv:property sv:name="jcr:primaryType" sv:type="Name">
        <sv:value>hippotaxonomy:categoryinfo</sv:value>
      </sv:property>
      <sv:property sv:name="hippotaxonomy:name" sv:type="String">
        <sv:value>test nl</sv:value>
      </sv:property>
    </sv:node>
  </sv:node>
</sv:node>


but what we are receiving is "test-node-name".

PS the names are obviously fictitious, and are used to represent which parts of the JCR node we want to talk about.

What we really want is to get the value for hippotaxonomy:name for a given locale. Any help would be greatly appreciated

Regards,
Mounir

Jeroen Hoffman

unread,
Feb 27, 2017, 8:03:56 AM2/27/17
to hippo-c...@googlegroups.com

I think you've hit https://issues.onehippo.com/browse/HIPPLUG-1426 which is already fixed in Hippo 11.1.1 with taxonomy
plugin 3.1.1.

HTH
Jeroen


On 27-02-2017 13:51, mounir moumli wrote:
> Hello,
>
> We are trying to get the name of a taxonomy category.
>
> The categories have locales (en, de, nl), we use the following code to retrieve the name
> |
> category.getInfo("en").getName();
> |
> where category is of type org.onehippo.taxonomy.api.Category
>
> what we expect to return is the bold part of the following ("test english"):
> |
> <?xml version="1.0" encoding="UTF-8"?>
> <sv:node sv:name="test-node-name" xmlns:sv="http://www.jcp.org/jcr/sv/1.0">
> <sv:property sv:name="jcr:primaryType" sv:type="Name">
> <sv:value>hippotaxonomy:category</sv:value>
> </sv:property>
> <sv:property sv:name="hippotaxonomy:key" sv:type="String">
> <sv:value>test-key</sv:value>
> </sv:property>
> <sv:node sv:name="hippotaxonomy:categoryinfos">
> <sv:property sv:name="jcr:primaryType" sv:type="Name">
> <sv:value>hippotaxonomy:categoryinfos</sv:value>
> </sv:property>
> <sv:node sv:name="en">
> <sv:property sv:name="jcr:primaryType" sv:type="Name">
> <sv:value>hippotaxonomy:categoryinfo</sv:value>
> </sv:property>
> <sv:property sv:name="hippotaxonomy:name" sv:type="String">
> *<sv:value>test english</sv:value>*
> </sv:property>
> <sv:property sv:multiple="true" sv:name="hippotaxonomy:synonyms" sv:type="String">
> <sv:value>english</sv:value>
> </sv:property>
> </sv:node>
> <sv:node sv:name="nl">
> <sv:property sv:name="jcr:primaryType" sv:type="Name">
> <sv:value>hippotaxonomy:categoryinfo</sv:value>
> </sv:property>
> <sv:property sv:name="hippotaxonomy:name" sv:type="String">
> <sv:value>test nl</sv:value>
> </sv:property>
> </sv:node>
> </sv:node>
> </sv:node>
>
> |
>
> but what we are receiving is "test-node-name".
>
> PS the names are obviously fictitious, and are used to represent which parts of the JCR node we want to talk about.
>
> What we really want is to get the value for hippotaxonomy:name for a given locale. Any help would be greatly appreciated
>
> Regards,
> Mounir
>
> --
> 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 https://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.

mounir moumli

unread,
Feb 27, 2017, 8:17:03 AM2/27/17
to Hippo Community

Thx Jeroen. I think we probably missed this update. I updated to 11.1.1 and everything works as expected.
Thnx again!

Rg,
Mounir

Op maandag 27 februari 2017 14:03:56 UTC+1 schreef jeroen.hoffman:

Jeroen Hoffman

unread,
Feb 27, 2017, 8:45:12 AM2/27/17
to hippo-c...@googlegroups.com

11.1.1 was announced only last friday so I'm not expected many to already have upgraded..

Thanks for the feedback!
Jeroen



On 27-02-2017 14:17, mounir moumli wrote:
>
> Thx Jeroen. I think we probably missed this update. I updated to 11.1.1 and everything works as expected.
> Thnx again!
>
> Rg,
> Mounir
>
> Op maandag 27 februari 2017 14:03:56 UTC+1 schreef jeroen.hoffman:
>
>
> I think you've hit https://issues.onehippo.com/browse/HIPPLUG-1426 <https://issues.onehippo.com/browse/HIPPLUG-1426>
> which is already fixed in Hippo 11.1.1 with taxonomy
> plugin 3.1.1.
>
> HTH
> Jeroen
>
>
> On 27-02-2017 13:51, mounir moumli wrote:
> > Hello,
> >
> > We are trying to get the name of a taxonomy category.
> >
> > The categories have locales (en, de, nl), we use the following code to retrieve the name
> > |
> > category.getInfo("en").getName();
> > |
> > where category is of type org.onehippo.taxonomy.api.Category
> >
> > what we expect to return is the bold part of the following ("test english"):
> > |
> > <?xml version="1.0" encoding="UTF-8"?>
> > <sv:node sv:name="test-node-name" xmlns:sv="http://www.jcp.org/jcr/sv/1.0 <http://www.jcp.org/jcr/sv/1.0>">
> > 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:> <mailto:hippo-communi...@googlegroups.com <javascript:>>.
> > Visit this group at https://groups.google.com/group/hippo-community <https://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>.
Reply all
Reply to author
Forward
0 new messages