Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

99 bottles of beer lyrics in Apache Sling

proposal for a candidate of leveraging:

mvn clean install content-package

in gogo shell, run the following command that parses the website and creates /var/bottles tree

run egrep '' @ name bottles @ with 'pattern=(?<number>\d(\d)?) bottle(s)? of beer on the wall,' / mkdir '/var/bottles/${bottles.number}' / write 'onTheWall=${bottles.number}' 'offTheWall=${Number(bottles.number)-1}' 'sling:resourceType=bottles/line'

in your favourite groovy console, run the following groovy script, build a list pipe like this one:

def plumber = getService("");

  .outputs("On the Wall!",'${line.onTheWall}')

check that list pipe is working my running following queries:

GET /services/adapt/list.csv?size=99

GET /services/adapt/list.json

now, back in gogo, add a subnode to describe the song component how to search for lines

run mkdir /var/bottles/pipes/lines / write "sling:resourceType=slingPipes/reference" "expr=/services/adapt/list"

still in gogo run that command that will set resource type of the song, allow access to user imccoy, and package up bottles for safety

run echo /var/bottles / write 'sling:resourceType=bottles/song' / allow imccoy / pkg /etc/packages/

Now enjoy the lyrics of the song by accessing

GET /var/bottles.html

You can’t perform that action at this time.