Jahia in English > JQOM and Query selector

0 (0 Good)
0 (0 Bad)

JQOM and Query selector

by  minijoey92 »  2014/08/25 13:20

Hi everyone !

I have a web service that save some properties in an external database based on the jnt:user of Jahia. The problem is that I've more than 26000 users and the query selector can't create the JSON object that contain the properties I want to update in my DB ... Any idea that could help me ?

Here's the JSP code that call the jnt:user map and check the properties for each account before pushing to the JSON :

"<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="jcr" uri="http://www.jahia.org/tags/jcr" %>
<%@ taglib prefix="query" uri="http://www.jahia.org/tags/queryLib" %>
<%@ taglib prefix="template" uri="http://www.jahia.org/tags/templateLib"%>

<template:addResources type="css" resources="comptesAdherents.css" />

<jcr:jqom var="usersmaps">
    <query:selector nodeTypeName="jnt:user"/>

<c:url var="updateAdherentsUrl"  value='${url.base}${currentNode.path}.UpdateAdherents.do'/>

<script type="text/javascript">
    var json = { "data" : [] };
    <c:forEach items="${usersmaps.nodes}" varStatus="status" var="usermapEL">
        <c:set var="src" value="${usermapEL.properties['j:externalSource'].string}" />
        <c:if test="${!empty src && src == 'rest' }">
            <c:set var="created" value="${usermapEL.properties['jcr:created'].string}" />
            <c:set var="email" value="${usermapEL.properties['j:email'].string}" />
            <c:if test="${!empty email && !empty created}">
                json.data.push({ "email":"${email}", "created":"${created}" });

Thank for your help !

Number of messages  1
Not registered

Get in touch

Whether you are a current user or if you are just evaluating Jahia, we are here to help.

Contact us

Share this page