Skip to content

Instantly share code, notes, and snippets.

View jdorrance's full-sized avatar

John Dorrance jdorrance

View GitHub Profile
@jdorrance
jdorrance / gist:6090323
Last active December 20, 2015 06:59 — forked from anonymous/gist:6090315
<%@include file="/libs/foundation/global.jsp" %>
<%@ page import="javax.jcr.Repository,
javax.jcr.Session,
javax.jcr.SimpleCredentials,
javax.jcr.Node,
java.net.URLEncoder,
java.util.Calendar,
java.util.Date,
java.util.List,
java.util.Iterator,
#GLOBAL
HTTPRESPONSE="json"
SUCCESS = "success"
#TEST
#UIARTFCT="org.acs.cq-code-476"
#UILOC="/appl/bamboo-home/xml-data/build-dir/393217/CQ5-MASTER-JOB1/ui/target/"
#AUTHORHOST="cmsautdev.acs.org"
#AUTHORPORT="443"
#AUTHORPROTOCOL="https://"
getPage("/content/acs1/en/pressroom/presspacs/2013/acs-presspac-march-20-2013").recurse{ p->
p.node.recurse{ n ->
def txtNode = n.get("text")
if(txtNode?.contains(p.name)){
def xml = new XmlSlurper().parseText(txtNode)?.childNodes()?.each(){
if(it.name =="img"){
def src = it.attributes().get("src")
println 'Page NAME : ' + p.name
println ' IMG TAG SRC : ' + src
println ' PARENT name ' + p.node.parent.name