Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianjriddle/300317 to your computer and use it in GitHub Desktop.
Save brianjriddle/300317 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'java'
module Polopoly
include_package "com.polopoly.cm"
include_package "com.polopoly.pear"
end
if ARGV.empty? or not ARGV.length == 2
puts "usage: #{__FILE__} PATH_TO/polopolyclient.properties contentid "
else
application = Polopoly::ApplicationFactory.createApplication([ARGV[0]].to_java(:string))
cm_server = application.getPolicyCMServer
major, minor = ARGV[1].split '.'
story_department = cm_server.getPolicy(Polopoly::ContentId.new(major.to_i, minor.to_i))
content_list = story_department.getContentList
for i in 0...content_list.size
policy = cm_server.getPolicy(content_list.entry(i).referred_content_id)
puts "#{policy.name} #{policy.content_list('articles').size}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment