Skip to content

Instantly share code, notes, and snippets.

@ronnyfm
ronnyfm / delete-unpublished-nonreferenced-assets.groovy
Created April 25, 2023 15:30
This Groovy script can be used to delete assets that have never been published or deactivated assets that are not referenced in any pages or DAM. It is a cleanup script. Optionally you can generate a report. It requires the Groovy Console
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.query.Query;
import javax.jcr.query.QueryManager;
import javax.jcr.query.QueryResult;
final String BASE_UNPUBLISHED_STATEMENT = "select * from [dam:Asset] as a where([jcr:content/cq:lastReplicationAction] is null or [jcr:content/cq:lastReplicationAction] = 'Deactivate') and isdescendantnode(a, '%s')";
@ronnyfm
ronnyfm / AEM cURL
Created June 28, 2016 04:58 — forked from joemaffia/AEM cURL
AEM cURL commands
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console)
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle"
Install a bundle
curl -u admin:admin -F action=install -F bundlestartlevel=20 -F
bundlefile=@"name of jar.jar" http://localhost:4505/system/console/bundles
Build a bundle
curl -u admin:admin -F bundleHome=/apps/centrica/bundles/name of bundle -F
descriptor=/apps/centrica/bundles/com.centrica.cq.wcm.core-bundle/name_of_bundle.bnd
@ronnyfm
ronnyfm / sml.html
Created September 11, 2012 16:54 — forked from THEtheChad/sml.html
SML
{% partial name:'media_data' %}
{% editable_setting GDS type:'string' default:'http://involver-gatorade.herokuapp.com' %}
{% contest name:'test' %}
<script>
var temp = [
/*{% paginate contest.contest_entries per_page:9999 keywords:filters %}*/
// total: {{total_entries}}
{% for media in contest_entries %}