Skip to content

Instantly share code, notes, and snippets.

@mkgl
mkgl / VirtualUriMappingEval.groovy
Last active January 31, 2020 10:46
Show all Magnolia Virtual URI mappings that matched a given URI and their associated weights
@Field private registry
import groovy.transform.Field
import info.magnolia.objectfactory.Components
import info.magnolia.virtualuri.VirtualUriRegistry
import static java.util.stream.Collectors.joining
registry = Components.getComponent(VirtualUriRegistry.class)
@abubelinha
abubelinha / appsScript_ListFilesFolders_Mesgarpour.js
Created July 24, 2017 00:03 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/**
* Google Apps Script - List all files & folders in a Google Drive folder, & write into a speadsheet.
* - Main function 1: List all folders
* - Main function 2: List all files & folders
*
* Hint: Set your folder ID first! You may copy the folder ID from the browser's address field.
* The folder ID is everything after the 'folders/' portion of the URL.
*
* @version 1.0
* @see https://github.com/mesgarpour
@rah003
rah003 / content
Last active November 16, 2015 09:50
List all components used in specified page and all it's subpages
import info.magnolia.repository.RepositoryConstants
import javax.jcr.Node
import info.magnolia.jcr.util.NodeUtil
import org.apache.commons.lang.StringUtils
import info.magnolia.cms.util.QueryUtil
website = ctx.getJCRSession("website")
listComponents(website.getNode("/some-path"))
@rah003
rah003 / content
Last active October 7, 2015 06:39
Script to generate nice confluence image-like tables showing config tree from magnolia
import static info.magnolia.jcr.util.NodeUtil.isNodeType;
import static org.apache.commons.lang3.StringUtils.substringBeforeLast;
exportPath = "/modules/ui-admincentral/commands"
filterJCR = true
filterMGNL = true
session = MgnlContext.getJCRSession('config')
node = session.getNode(exportPath);
zeroDepth = node.getDepth()