Skip to content

Instantly share code, notes, and snippets.

View gist:9e2654f42ece23829d17
import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory
import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions
import info.magnolia.cms.core.*
import info.magnolia.repository.*
import info.magnolia.jcr.util.*
class TemplateReport {
static def mgnl45 = true
String basePath
def templates = [:]
@molaschi
molaschi / export_pages_templates.groovy
Last active Apr 8, 2018
Magnolia export pages and used templates
View export_pages_templates.groovy
import net.sourceforge.openutils.mgnlcriteria.jcr.query.JCRCriteriaFactory
import net.sourceforge.openutils.mgnlcriteria.jcr.query.criterion.Restrictions
import info.magnolia.cms.core.*
import info.magnolia.repository.*
import info.magnolia.jcr.util.*
// if you don't know which is magnolia version
mgnl45 = JCRCriteriaFactory.createCriteria().setWorkspace("website").setBasePath("/jcr:root/*").execute().items.next() instanceof javax.jcr.Node
// otherwise set it directly to true or false
// e.g.
@molaschi
molaschi / stash_slack_integration.md
Created Jun 4, 2014
Integrate Stash with Slack using webhooks
View stash_slack_integration.md

This is a short article on how we integrate stash and slack in openmind

First of all i assume you have:

  • a working stash installation
  • a repository you to notify slack on pushes
  • stash user with administration priviledges
  • full access to the server (linux) where stash is installed on
  • a team configured on slack
  • slack user with administration priviledges
@molaschi
molaschi / datastoregc.groovy
Created Feb 15, 2012
Run datastore garbage collector on magnolia project via groovy shell
View datastoregc.groovy
import info.magnolia.context.MgnlContext
// fill "repositories" list with one workspace for each repository defined in your repositories.xml jackrabbit configuration file
// (if you have different repositories using the same datastore modify this script according to http://wiki.apache.org/jackrabbit/DataStore#line-212)
def repositories = ["website", "media"]
def removedDataStoreEntries = 0
repositories.each() { repo ->
def session = MgnlContext.getHierarchyManager(repo).getWorkspace().getSession()
def gc = session.createDataStoreGarbageCollector()
You can’t perform that action at this time.