Skip to content

Instantly share code, notes, and snippets.

Paul Rohrbeck paulrohrbeck

Block or report user

Report or block paulrohrbeck

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@paulrohrbeck
paulrohrbeck / delete-translation-projects.groovy
Last active Mar 7, 2017
AEM: delete all translation projects and associated data (to be executed in Groovy console)
View delete-translation-projects.groovy
import com.adobe.cq.projects.api.*;
import org.apache.jackrabbit.api.security.user.*;
ProjectFilter pf = new ProjectFilter();
Boolean dryRun = true;
List<String> templates = Arrays.asList("/libs/cq/core/content/projects/templates/create-translation-project");
pf.setProjectTemplates(templates);
ProjectManager pm = resourceResolver.adaptTo(ProjectManager.class);
@paulrohrbeck
paulrohrbeck / aem_find_i18n_strings.txt
Last active Aug 12, 2016
AEM: Finds all i18n strings in Sightly HTML files
View aem_find_i18n_strings.txt
# Run in parent Maven project to find all:
grep -riohE '\$\{(.)* ?@ ?i18n\}' .
# Example result: ${'Filter' @ i18n}
@paulrohrbeck
paulrohrbeck / aem_querybuilder_snippets
Created Oct 31, 2014
AEM/CQ Querybuilder snippet
View aem_querybuilder_snippets
Find pages with CUG on it:
path=/content
type=cq:PageContent
property=cq:cugEnabled
property.value=true
@paulrohrbeck
paulrohrbeck / mysql_find_duplicates
Created Sep 5, 2014
MySQL: find likely duplicates. SELECT first, then DELETE for safety. Alternatively, delete directly.
View mysql_find_duplicates
# Delete directly:
# -------------------------------------
DELETE
n1
FROM
`tableName` n1, `tableName` n2
WHERE
n1.id = n2.id AND
n1.lastmodifieddate = n2.lastmodifieddate AND
View adobecq_find_modified_nodes
path=/content
group.p.or=true
group.1_relativedaterange.property=jcr:lastModified
group.1_relativedaterange.lowerBound=-14d
group.1_relativedaterange.lowerOperation=>=
group.1_relativedaterange.upperBound=0
group.2_relativedaterange.property=jcr:created
group.2_relativedaterange.lowerBound=-14d
@paulrohrbeck
paulrohrbeck / download_images.py
Created Aug 1, 2014
Bulk download images from a defined page (including CSS selector).
View download_images.py
#!/usr/bin/python
"""
Download Images
"""
import optparse
from bs4 import BeautifulSoup
import requests
from urlparse import urlsplit
@paulrohrbeck
paulrohrbeck / typo3_list_headlines
Created May 26, 2014
TYPO3: show list of headlines of a page
View typo3_list_headlines
### Sitebar ###
marks.sitebar = COA
marks.sitebar {
10 = CONTENT
10 {
table = tt_content
select.where = colPos = 0
select.languageField = sys_language_uid
renderObj = COA
renderObj {
@paulrohrbeck
paulrohrbeck / typo3_optional_select
Created May 26, 2014
TYPO3: TCA make type „select“ optional with empty „option“
View typo3_optional_select
'feld' => array(
'exclude' => 0,
'label' => 'Feld Name',
'config' => array(
'type' => 'select',
'items' => Array (
Array("",0),
),
'foreign_table' => 'tx_deinetabelle',
'size' => 1,
@paulrohrbeck
paulrohrbeck / aem_filter_tag
Created Mar 25, 2014
Adobe CQ/AEM: Add filter by tag to the query builder (asset share)
View aem_filter_tag
<tab4
jcr:primaryType="nt:unstructured"
title="Filter"
xtype="panel">
<items jcr:primaryType="cq:WidgetCollection">
<tagFilter
jcr:primaryType="cq:Widget"
name="./tagFilter"
fieldDescription="Add tags to filter the result set."
fieldLabel="Filter by tags"
@paulrohrbeck
paulrohrbeck / aem_style_selector
Created Mar 7, 2014
Adobe CQ/AEM: Add style selector for text component. To be added in .content.xml under /etc/designs/...abc.../
View aem_style_selector
<basepage jcr:primaryType="nt:unstructured">
<mainParagraph
jcr:lastModified="{Date}2014-01-17T17:44:04.712-08:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
components="[group:General,group:Columns,group:Form]">
<section jcr:primaryType="nt:unstructured"/>
<text jcr:primaryType="nt:unstructured">
<cq:styles jcr:primaryType="nt:unstructured">
<columns
You can’t perform that action at this time.