Skip to content

Instantly share code, notes, and snippets.

View jdorrance's full-sized avatar

John Dorrance jdorrance

View GitHub Profile
@jdorrance
jdorrance / Default (Windows).sublime-commands
Last active December 27, 2015 17:19
sublimetext cq5 integration --> Will 'PUT' to the corresponding path in CQ5. Uses coffeescript if the file is *.coffee, and compiles to JS
[
{
"caption": "Save to CQ5",
"command": "cq5_save"
}
]
@jdorrance
jdorrance / original.js
Last active December 27, 2015 12:19
coffee to JS - which is easier to read?
PWFE.TabbedContentRotator = function() {};
PWFE.TabbedContentRotator.prototype = {
tabCount: 0,
tabCompId:"",
currentPagePath:"",
resourcePath:"",
init : function(tabCount, tabCompId, currentPagePath, resourcePath) {
... 44 more
30.10.2013 12:01:24.216 *ERROR* [127.0.0.1 [1383148884214] POST /system/console/bundles/256 HTTP/1.1] cqse-httpservice %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Activator start error in bundle com.pennwell.wcm.cq-aggregator-support [256].) org.osgi.framework.BundleException: Activator start error in bundle com.pennwell.wcm.cq-aggregator-support [256].
at org.apache.felix.framework.Felix.activateBundle(Felix.java:1882)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1752)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:909)
at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:298)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:473)
(defn format-date [publication-date]
(format-date (-> publication-date (add-days 90) (add-hours 12) (add-minutes (- (rand-int 60) 30)))))
(defn off-time [entry]
(let [status (-> entry :NewsManagement :PublishingStatus)]
(case status
"Usable" format-date(pubdate entry)
"Embargoed" now
"Withheld" now
"Canceled" now
(ns com.pennwell.wcm.services.importers.APNewsBulkImporter
(:import [com.pennwell.wcm.services.taxonomy.bulk BulkTaggingService]
[com.pennwell.wcm.services.importers APNewsBulkImporter]
[java.io File]
[java.net URL]
[javax.imageio ImageIO])
(:use [clojure.data.json :only [read-json json-str]]
[clojure.pprint :only [pprint]]
[clojure.tools.logging :only (info error debug warn)]
[com.pennwell.wcm.services.importers.core :only [now
$("#containerBottom_tabs .ui-tabs-nav").sortable
update: (event, ui) ->
thisID = $(ui.item).attr("nodePath")
thisParent = $(ui.item).attr("parentPath")
next = $(ui.item).next().attr("nodePath")
params = "cmd=movePage" + "&_charset_=utf-8" + "&srcPath=" + thisID
params += "&destParentPath=" + thisParent += "&before="
if(next?)
params += next
if(thisID? and thisParent?)
###
The <code>CQ.form.MultiFieldMultiField</code> class represents an editable list
of form fields for editing multi value properties.
@class CQ.form.MultiFieldMultiField
@extends CQ.form.CompositeField
###
CQ.form.MultiFieldMultiField = CQ.Ext.extend(CQ.form.CompositeField,
###
###
The <code>CQ.form.MultiFieldMultiField</code> class represents an editable list
of form fields for editing multi value properties.
@class CQ.form.MultiFieldMultiField
@extends CQ.form.CompositeField
###
CQ.form.MultiFieldMultiField = CQ.Ext.extend(CQ.form.CompositeField,
###
/**
* The <code>CQ.form.MultiFieldMultiField</code> class represents an editable list
* of form fields for editing multi value properties.
*
* @class CQ.form.MultiFieldMultiField
* @extends CQ.form.CompositeField
*/
CQ.form.MultiFieldMultiField = CQ.Ext.extend(CQ.form.CompositeField, {
/**
<%
Boolean isMicroSite = false;
List<Site> sites = sling.getService(SiteHostService.class).getSiteMappings();
for(Site site : sites){
if(currentPage.getPath().contains("/content/" + site.getKey())
|| currentPage.getPath().contains("/content/dam" + site.getKey())){
isMicroSite = true;
}
}