SiteMapItem matching

44 views
Skip to first unread message

Abdul Patnam

unread,
Apr 17, 2015, 11:57:47 AM4/17/15
to hippo-c...@googlegroups.com
Hi,

I have a sitemap pattern like news/_any_/archive. The url will be like, localhost:8080/news/global/archive, localhost:8080/news/usa/archive. 
I'm trying to get the value global, usa(_any_) from the url in my component class. The hst:componentconfigurationid for _any_ and archive points to 
hst:pages. The hst:pages has hst:componentclassname and hst:parameternames/hst:parametervalues. 
One of the parameter name is path and the matching value is ${1}. I was expecting ${1} to be global or usa, but it is coming as global/archive, usa/archive. 
Is it possible to just get usa, global from the url instead of usa/archive, global/archive?

Thanks,
Abdul.

Woonsan Ko

unread,
Apr 17, 2015, 12:03:00 PM4/17/15
to hippo-c...@googlegroups.com
I think you can define hst component parameter names/values referring to
${1} for instance.
See the following [1]:
"Parameter values can contain propertyplaceholders like ${1}, ${2}.
These propertyplaceholders are substituted by the respectively first,
second, etc, wildcard values of the matched SiteMapItem ancestors that
are contain wildcards."

[1]
http://www.onehippo.org/library/concepts/component-development/hstcomponent-configuration-properties.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.


--
w....@onehippo.com www.onehippo.com
Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
Amsterdam - Oosteinde 11, 1017 WT Amsterdam
US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466

Abdul Patnam

unread,
Apr 17, 2015, 12:10:22 PM4/17/15
to hippo-c...@googlegroups.com
Thanks for the quick reply. I did use the property placeholder ${1}. But the value for it is coming as usa/archive, global/archive. I need only usa, global. I thought ${1} will match to usa and ${2} will match to archive.

Woonsan Ko

unread,
Apr 17, 2015, 12:15:01 PM4/17/15
to hippo-c...@googlegroups.com
A placeholder is matched by either _default_ or _any_. That's why you
have only one (you have only one _any_).
Maybe can you try to split the matcher? e.g, news/_default_/_any_
Then maybe ${1} will match with either 'global' or 'usa' while ${2} with
the string after that.

Regards,

Woonsan
> <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:>>.
> <http://groups.google.com/group/hippo-community>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> w....@onehippo.com <javascript:> www.onehippo.com
> <http://www.onehippo.com>
> Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
> US +1 877 414 4776 (toll free)
> Europe +31(0)20 522 4466
>
> --
> 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>.

Abdul Patnam

unread,
Apr 17, 2015, 2:36:57 PM4/17/15
to hippo-c...@googlegroups.com
Spliting the matcher works great. Thanks a lot for your help.

Regards,
Abdul.
>     > <mailto:hippo-community+unsub...@googlegroups.com <javascript:>>.
>     > 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>.
>
>
>     --
>     w....@onehippo.com <javascript:>     www.onehippo.com
>     <http://www.onehippo.com>
>     Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
>     Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>     US +1 877 414 4776 (toll free)
>     Europe +31(0)20 522 4466
>
> --
> 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

Ard Schrijvers

unread,
Apr 17, 2015, 2:46:31 PM4/17/15
to hippo-c...@googlegroups.com
Also note that 'news/_any_/archive' does not work. _default_ is the
equivalent for * and _any_ is the equivalent for **.

* matches one path element : thus something between two slashes

** is a greedy match, aka, anything, regardless number of slashes

Thus

news/{anything}/archive is not valid. Don't you also get a warning in the logs?

Regards Ard
>> > > <mailto:hippo-communi...@googlegroups.com
>> > <javascript:>>.
>> > > 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>.
>> >
>> >
>> > --
>> > w....@onehippo.com <javascript:> www.onehippo.com
>> > <http://www.onehippo.com>
>> > Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
>> > Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>> > US +1 877 414 4776 (toll free)
>> > Europe +31(0)20 522 4466
>> >
>> > --
>> > 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.
>>
>>
>> --
>> w....@onehippo.com www.onehippo.com
>> Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
>> Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>> US +1 877 414 4776 (toll free)
>> Europe +31(0)20 522 4466
>
> --
> 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.
> Visit this group at http://groups.google.com/group/hippo-community.
> For more options, visit https://groups.google.com/d/optout.



--
Hippo Netherlands, Oosteinde 11, 1017 WT Amsterdam, Netherlands
Hippo USA, Inc.- 745 Atlantic Ave, Eight Floor, Boston MA 02111,
United states of America.

US +1 877 414 4776 (toll free)
Europe +31(0)20 522 4466
www.onehippo.com

Ard Schrijvers

unread,
Apr 17, 2015, 2:47:12 PM4/17/15
to hippo-c...@googlegroups.com
On Fri, Apr 17, 2015 at 8:46 PM, Ard Schrijvers
<a.schr...@onehippo.com> wrote:
> Also note that 'news/_any_/archive' does not work. _default_ is the
> equivalent for * and _any_ is the equivalent for **.
>
> * matches one path element : thus something between two slashes
>
> ** is a greedy match, aka, anything, regardless number of slashes
>
> Thus
>
> news/{anything}/archive is not valid. Don't you also get a warning in the logs?

Extremely simple rule of thumb: ** (_any_) matchers are only allowed
as leaf nodes.

Regards Ard
Message has been deleted

Abdul Patnam

unread,
Apr 17, 2015, 3:46:48 PM4/17/15
to hippo-c...@googlegroups.com
Hi,
Thanks for letting me know that _any_ should be used only as leaf node.
I'm not seeing any warnings in the logs. May be the logs are disabled for that part.
>>> > <javascript:>>.
>>> >     > 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>.
>>> >
>>> >
>>> >     --
>>> >     w....@onehippo.com <javascript:>     www.onehippo.com
>>> >     <http://www.onehippo.com>
>>> >     Boston - 745 Atlantic Ave, 8th Floor, Boston MA 02111
>>> >     Amsterdam - Oosteinde 11, 1017 WT Amsterdam
>>> >     US +1 877 414 4776 (toll free)
>>> >     Europe +31(0)20 522 4466
>>> >
>>> > --
>>> > 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

Abdul Patnam

unread,
Apr 20, 2015, 11:06:53 AM4/20/15
to hippo-c...@googlegroups.com
I fixed this issue by changing news/_any_/archive to news/_default_/archive.
Thanks a lot for your help.

Ard Schrijvers

unread,
Apr 20, 2015, 3:35:13 PM4/20/15
to hippo-c...@googlegroups.com
On Mon, Apr 20, 2015 at 5:06 PM, Abdul Patnam <patnam...@gmail.com> wrote:
> I fixed this issue by changing news/_any_/archive to news/_default_/archive.
> Thanks a lot for your help.

Thanks for your feedback. Indeed _default_ is a not greedy matcher so
this is a correct setup

Regards Ard
>>> >>> > > <mailto:hippo-communi...@googlegroups.com
>>> >>> > <mailto:hippo-communi...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages