protected Journal searchArticle(final HstRequest request, final String articleName) {
Journal journal = null;
final HstRequestContext ctx = request.getRequestContext();
HippoBean siteContentBean = ctx.getSiteContentBaseBean();
if (siteContentBean == null) {
LOG.error("Scope for search is null");
return journal;
}
try {
HstQueryManager manager = ctx.getQueryManager();
HstQuery hstQuery = manager.createQuery(siteContentBean, Journal.class);
if (!StringUtils.isEmpty(articleName)) {
// Name field
Filter nameFilter = hstQuery.createFilter();
nameFilter.addContains("jcr:name", articleName);
hstQuery.setFilter(nameFilter);
}
System.out.println("####################### hippo query:" + hstQuery.getQueryAsString(true));
HstQueryResult result = hstQuery.execute();
HippoBeanIterator beans = result.getHippoBeans();
if (beans.hasNext()) {
journal = (Journal) beans.next();
}
} catch (QueryException e) {
if (LOG.isDebugEnabled()) {
LOG.warn("Error during search: ", e);
} else {
LOG.warn("Error during search: ", e.getMessage());
}
}
return journal;
}articleName" and I don´t know whats wrong. commercetools GmbH
SPHERE.IO The E-Commerce Platform.
Adams-Lehmann-Strasse 44, 80797 München
Amtsgericht München, HRB 161496
Geschäftsführer: Denis Werner, Dirk Hörig, Dr. Robert Zores
Filter nameFilter = hstQuery.createFilter();
nameFilter.addEqualTo("fn:name()", articleName);
hstQuery.setFilter(nameFilter);
org.hippoecm.hst.content.beans.query.exceptions.QueryException: Encountered "fn:name(" at line 1, column 150.
Was expecting one of:
<ElementType> ...
<AttributeType> ...
<SchemaElementType> ...
<SchemaAttributeType> ...
"*" ...
<NCNameColonStar> ...
<StarColonNCName> ...
<DocumentLpar> ...
<DocumentLparForKindTest> ...
<NodeLpar> ...
<CommentLpar> ...
<TextLpar> ...
<ProcessingInstructionLpar> ...
<ElementTypeForKindTest> ...
<ElementTypeForDocumentTest> ...
<AttributeTypeForKindTest> ...
<SchemaElementTypeForKindTest> ...
<SchemaElementTypeForDocumentTest> ...
<SchemaAttributeTypeForKindTest> ...
<ProcessingInstructionLparForKindTest> ...
<TextLparForKindTest> ...
<CommentLparForKindTest> ...
<NodeLparForKindTest> ...
<QName> ...
for statement: for $v in //*[(@hippo:paths='996bcac5-86cf-49b5-a7a3-16a74863e814') and (@hippo:availability='live') and not(@jcr:primaryType='nt:frozenNode') and (@fn:name() = 'article1') and ((@jcr:primaryType='carhartt:journal'))] order by @jcr:score descending return $v
Filter nameFilter = hstQuery.createFilter();
nameFilter.addEqualTo("fn:name", articleName);
hstQuery.setFilter(nameFilter);
nameFilter.addJCRExpression("fn:name()='"+ articleName + "'")
--
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 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-community@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-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
Amsterdam - Oosteinde 11, 1017 WT Amsterdam +31 20 522 44 66
Boston - 71 Summer Street, 2nd Floor, MA 02110 +1 877 414 47 76
London - 2 Eastbourne Terrace London W2 6LG +44 20 35 14 99 60Oldenburg - Blumenstraße 1 26121 Oldenburg +49 441 36138 290
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 https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
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 https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
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 https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
--
Amsterdam - Oosteinde 11, 1017 WT Amsterdam +31 20 522 44 66
Boston - 71 Summer Street, 2nd Floor, MA 02110 +1 877 414 47 76
London - 2 Eastbourne Terrace London W2 6LG +44 20 35 14 99 60Oldenburg - Blumenstraße 1 26121 Oldenburg +49 441 36138 290
To post to this group, send email to hippo-community@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-community+unsubscribe@googlegroups.com.
To post to this group, send email to hippo-community@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-community+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/hippo-community.
For more options, visit https://groups.google.com/d/optout.
XPath query: //element(*,my:Product)[hippostdpubwf:createdBy='writeuser']Number of results found: 98,235