import com.xxxxx.beans.Article
import org.apache.jackrabbit.util.*
import org.hippoecm.repository.api.*
import org.hippoecm.repository.util.JcrUtils
import org.onehippo.repository.update.BaseNodeUpdateVisitor
import org.onehippo.forge.content.pojo.model.*
import org.onehippo.forge.content.exim.core.*
import org.onehippo.forge.content.exim.core.impl.*
import org.onehippo.forge.content.exim.core.util.*
import org.hippoecm.hst.content.beans.query.*
import org.hippoecm.hst.content.beans.query.exceptions.*;
import org.hippoecm.hst.site.HstServices
import java.io.*
import javax.jcr.*
...
private List<Article> queryArticles() {
final Node scope = JcrUtils.getNodeIfExists(SCOPE_PATH, eximSession)
//final ContentBeansTool cbt = HstServices.componentManager.getComponent(ContentBeansTool.class.name)
//final HstQueryManager queryManager = cbt.createQueryManager(eximSession)
final HstQuery hstQuery = HstQueryBuilder.create(scope)
.ofTypes(Article.class)
.build()
final String queryString = hstQuery.getQueryAsString(false)
try {
HstQueryResult result = hstQuery.execute()
log.info "article query found ${result.totalSize} with ${queryString}"
return result.hippoBeans.collect { it as Article }
} catch (QueryException qe) {
log.error "QueryException(${qe.message}) from ${queryString}"
} catch (Exception e) {
log.error("kerblooey", e)
}
return []}
[INFO] [talledLocalContainer] 29.11.2017 16:08:54 ERROR ObservationManager [UpdaterRegistry.buildRegistry:88] Failed to register updater 'set-article-author': org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:[INFO] [talledLocalContainer] updater: 15: unable to resolve class org.hippoecm.hst.site.HstServices[INFO] [talledLocalContainer] @ line 15, column 1.[INFO] [talledLocalContainer] import org.hippoecm.hst.site.HstServices[INFO] [talledLocalContainer] ^[INFO] [talledLocalContainer][INFO] [talledLocalContainer] updater: 3: unable to resolve class com.dhi.efc.beans.Article[INFO] [talledLocalContainer] @ line 3, column 1.[INFO] [talledLocalContainer] import com.xxxxx.beans.Article[INFO] [talledLocalContainer] ^[INFO] [talledLocalContainer][INFO] [talledLocalContainer] updater: 79: unable to resolve class QueryException[INFO] [talledLocalContainer] @ line 79, column 11.[INFO] [talledLocalContainer] } catch (QueryException qe) {[INFO] [talledLocalContainer] ^[INFO] [talledLocalContainer][INFO] [talledLocalContainer] 3 errors
I want to write an EXIM script to update documents/node properties based on some queries.When I attempted to write a script based on the Fluent Search API, I discovered several classpaths aren't available to the script.
--
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.
For more options, visit https://groups.google.com/d/optout.
Hi Brian,
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.
QueryManager queryManager = session.getWorkspace().getQueryManager();Query query = queryManager.createQuery("hippo:namespaces//element(*,hippogallery:imageset)", "xpath");QueryResult queryResult = query.execute();NodeIterator nodeIterator = queryResult.getNodes();