Skip to content

Instantly share code, notes, and snippets.

View jdorrance's full-sized avatar

John Dorrance jdorrance

View GitHub Profile
private def deployFiles(rootfile:File,filePath:String,progressLog: mutable.Buffer[String]):Unit={
val sardine:Sardine = SardineFactory.begin()
if(rootfile.isDirectory)rootfile.listFiles().foreach{file:File => deployFiles(file,filePath,progressLog)}
else{
val path = parentPath + rootfile.getPath.replace(filePath,"").replace("\\","/")
progressLog += s"Deploying file @ $path<br>"
try{
if(MigrationProcessor.is_file(rootfile) && sardine.exists(s"http://${authorInfo.username}:${authorInfo.password}@${authorInfo.authorUrl.replaceFirst("http://", "")}${CRX_ROOT}$path")){
sardine.put(s"http://${authorInfo.username}:${authorInfo.password}@${authorInfo.authorUrl.replaceFirst("http://", "")}${CRX_ROOT}$path",FileUtils.readFileToByteArray(rootfile))
}
package com.pennwell.wcm.migrator.configuration
import org.springframework.context.annotation._
import akka.actor.{ActorRef, ActorSystem}
import com.pennwell.wcm.migrator.service.{DirectorySyncActor, FolderReOrgActor,MigrationTracker, MigrationProcessingActor}
import javax.sql.DataSource
import org.springframework.jndi.JndiObjectFactoryBean
import java.lang.RuntimeException
import javax.naming.NamingException
import org.springframework.scala.jdbc.core.JdbcTemplate
package com.pennwell.wcm.migrator.service
import com.pennwell.wcm.migrator.model.AuthorInfo
import org.slf4j.LoggerFactory
import java.io._
import java.net.URL
import java.sql.DriverManager
import scala.collection.mutable
import java.util.Arrays
import com.google.common.io.Files
package com.pennwell.wcm.migrator.service
import com.pennwell.wcm.migrator.model.AuthorInfo
import org.slf4j.LoggerFactory
import java.io._
import java.net.URL
import java.sql.DriverManager
import scala.collection.mutable
import java.util.Arrays
import com.google.common.io.Files
@echo off
setlocal
:::: MKEC
call set_env.cmd
set HTTP_PROXYHOST=cache
set HTTP_PROXYPORT=8080
set HTTP_NONPROXYHOSTS="afkanatest*|localhost|%COMPUTERNAME%"
:::: end MKEC
@jdorrance
jdorrance / RSSPostWriter.java
Created September 25, 2013 09:15
This is a spring framework based tool to import an RSS feed into a collection of articles in CQ5
package com.pennwell.wcm.services.rss;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
<div id="f0a6a0fca8ea4a93a30681fe1d46cad7"><object type="application/x-shockwave-flash" data="http://c.brightcove.com/services/viewer/federated_f9?&amp;width=480&amp;height=270&amp;flashID=myExperience_f0a6a0fca8ea4a93a30681fe1d46cad7&amp;bgcolor=%23FFFFFF&amp;playerID=2660322760001&amp;playerKey=AQ~~%2CAAACa0igRDk~%2C4HJ74hz_HgvXniUNCLOWSn5VlVR-mmah&amp;isVid=true&amp;isUI=true&amp;dynamicStreaming=true&amp;%40videoPlayer=&amp;templateLoadHandler=onPlayerLoaded&amp;templateReadyHandler=brightcove%5B%22templateReadyHandlermyExperience_f0a6a0fca8ea4a93a30681fe1d46cad7%22%5D&amp;templateErrorHandler=onPlayerError&amp;includeAPI=true&amp;wmode=transparent&amp;htmlFallback=true&amp;autoStart=&amp;debuggerID=&amp;originalTemplateReadyHandler=onPlayerReady&amp;startTime=1379704890584" id="myExperience_f0a6a0fca8ea4a93a30681fe1d46cad7" width="480" height="270" class="BrightcoveExperience" seamlesstabbing="undefined"><param name="allowScriptAccess" value="always"><param name="allowFullScreen" value="true"><param name
<div class="image">
<a data-modal-title="${properties.imageTitle}" data-behavior="modal" href="${resource.path}.modal.html"><div class="contain"><div class="magnify"></div></div><img src="${imageProps.fileReference}" ${imageSize}/></a>
</div>
var BCLplayer;
var BCLexperienceModule;
var BCLvideoPlayer;
var BCLcurrentVideo;
//listener for player error
function onPlayerError(event) {
/* */
}
package controllers
//delete these -->
import actors.ApplicationActor
import play.api._
import play.api.mvc._
import play.api.libs.concurrent.Execution.Implicits._
import play.api.libs.json.{JsValue, Json}
import akka.actor.{ActorRef, Actor, Props}
import play.api.libs.ws.WS