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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
jcr_root/apps/bottles
.gitignore
LICENSE
README.md
pom.xml

README.md

99 bottles of beer lyrics in Apache Sling

proposal for a candidate of http://99-bottles-of-beer.net leveraging:

mvn clean install content-package

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

run egrep 'http://99-bottles-of-beer.net/lyrics.html' @ 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("org.apache.sling.pipes.Plumber");

plumber.newPipe(resourceResolver)
  .echo("/var")
  .children('sling:Folder#bottles')
  .$('[sling:resourceType=bottles/line]').name("line")
  .outputs("On the Wall!",'${line.onTheWall}')
  .build("/services/adapt/list");

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/bottles-backup.zip

Now enjoy the lyrics of the song by accessing

GET /var/bottles.html

You can’t perform that action at this time.