Skip to content

Instantly share code, notes, and snippets.

View jdorrance's full-sized avatar

John Dorrance jdorrance

View GitHub Profile
@jdorrance
jdorrance / OGJ before.json
Created March 19, 2014 04:18
ogj & MAE before and after
{
"results": [{
"path": "/content/ogj/en/site-license/pennwell/jcr:content/leftinheritedtop/text_0",
"type": "nt:unstructured"
}, {
"path": "/content/ogj/en/index/search/jcr:content/leaderads2/text",
"type": "nt:unstructured"
}, {
"path": "/content/ogj/en/site-license/petrobras/jcr:content/leftinheritedtop/text",
"type": "nt:unstructured"
package org.mavendc.cq.test.workflow.impl
import org.apache.commons.lang.text.StrLookup
import org.apache.commons.mail.HtmlEmail
import org.apache.felix.scr.annotations.Component
import org.apache.felix.scr.annotations.Reference
import org.apache.felix.scr.annotations.Service
import org.apache.jackrabbit.api.security.user.Authorizable
import org.apache.jackrabbit.api.security.user.Group
import org.apache.sling.api.resource.Resource
package org.mavendc.cq.test.workflow.impl
import javax.servlet.Servlet;
import com.day.cq.mailer.MessageGateway
import com.day.cq.mailer.MessageGatewayService
import com.day.cq.commons.mail.MailTemplate;
import org.mavendc.cq.test.workflow.EmailTest
import javax.jcr.Session;
package org.mavendc.cq.test.workflow.impl
import org.mavendc.cq.test.workflow.WorkflowUtils
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.jackrabbit.api.security.user.Authorizable;
import org.apache.jackrabbit.api.security.user.Group
import org.apache.jackrabbit.api.security.user.UserManager;
import org.apache.sling.api.resource.Resource
/**
*
*/
package org.mavendc.cq.test.workflow
import javax.jcr.Value
import org.mavendc.cq.test.workflow.impl.WorkflowUtilsImpl;
import org.apache.commons.mail.HtmlEmail
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
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
#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://"
pwd
ls -lah
cp coreBuild/*.jar ui/src/main/content/jcr_root/apps/acs/install
ls -lah
cd ui/src/main/content/jcr_root/apps/acs/install
ls -lah
#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://"
files="$(find . -not -path "*/build/*" -not -path "*/node_modules/*" -regex '.*\.\(js\|css\|png\|jpg|\jpeg|\gif|\|mov|\)' -type f)"
echo "Count: $(echo -n "$files" | wc -l)"
echo "$files" | while read file; do
echo "Gzipping - $file"
gzip < $file > $file.gz
rm $file -f
cp $file.gz $file
rm $file.gz -f
done