Forge Taxonomy Plugin - is it possible to filter categories based on the path of the processed document?

24 views
Skip to first unread message

mahip...@gmail.com

unread,
Nov 21, 2014, 4:17:28 PM11/21/14
to hippo-c...@googlegroups.com
Hi,

we want to filter some categories based on the path of the document which is
currently processed in the editor.

I found no way to get the document node which is processed in the cms.

It is possible to get this node?

an example:

my documents:
> /content/documents/site_de/test -> TextDocument
> /content/documents/site_en/test -> TextDocument

my taxonomy categories
> /content/taxonomies/de/first
> /content/taxonomies/de/second
> /content/taxonomies/en/first
> /content/taxonomies/en/second

I want do something like this:

> public class SiteCategoryFilter implements JcrCategoryFilter {
> @Override
> public boolean apply(JcrCategory category, HippoSession session) {
>
> Node textDokument = session.get_THE_PROCESSED_NODE_();
> if (textDokument.getPath().startsWith("/content/documents/site_de")
> && category.getJcrNode().getPath().startsWith("/content/taxonomies/de"))
> return true;
>
> return false;
> }
> }

Thank you for your help!

Regards,
Markus

Jeroen Hoffman

unread,
Nov 25, 2014, 4:03:25 AM11/25/14
to hippo-c...@googlegroups.com
Hi Markus,

Hmm no I'm afraid this is not possible ATM, we didn't have that use case in mind
when developing the filter. Might be a nice addition though.


You case wouldn't be just about translations of the categories, would it?
If it is, you wouldn't need two trees, see
http://taxonomy.forge.onehippo.org/category-localization.html

HTH
Jeroen
Reply all
Reply to author
Forward
0 new messages