Skip to content

Instantly share code, notes, and snippets.

@mmulich
Last active May 10, 2016 19:54
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 mmulich/93f5ed32cb9e094e5a97415ced480a16 to your computer and use it in GitHub Desktop.
Save mmulich/93f5ed32cb9e094e5a97415ced480a16 to your computer and use it in GitHub Desktop.
  1. View of book in json representation, then transition to html representation. The reason for looking at one then the other is to note the collated value, then to to show the more human readable format. /contents/02040312-72c8-441e-a685-20e9333f3e1d%406.14.json
  2. Briefly talk about the tools and the workaround for collating an existing book.
    • internal epub exportation, because this is our single file representation of a book. All the data is wrapped up in a single ball. This is to be used in transformation services & content copy in the near future. It is currently used as the format for publishing material from an authoring tool into the archive.
    • single-html file from an internal epub, because this is what we feed to cnx-easybake
    • resource injection, because neither legacy, authoring or publishing have the means of allowing the insertion of miscellaneous resources on book.
    • cnx-easybake is the ruleset parser and engine, it collates the content
    • collation invocation route, because need to be able to invoke the collation process manually. At this time, the publication pipeline in legacy will not be equipt to trigger the collation process; so we poke at it manually. Later this will be handled via a subcriber job.
  3. Inject a ruleset into the archive in association with the book to be collated.
    • wget https://raw.githubusercontent.com/Connexions/cte/rulesets/books/rulesets/output/physics.css
    • /var/cnx/venvs/archive/bin/cnx-archive-inject_resource --resource-filename "ruleset.css" --media-type "text/css" /etc/cnx/archive/app.ini 031da8d3-b525-429c-80cf-6c8ed997733a@9.30 physics.css
  4. Invoke the collation via a the python interpreter import requests; resp = requests.post('http://cte-cnx-dev.cnx.org:6543/contents/031da8d3-b525-429c-80cf-6c8ed997733a/collate-content', headers={'x-api-key': 'cte-dev--sprint-6.7'}); print(resp)
  5. View the book in json representation, noting the toggling of the collated value /contents/031da8d3-b525-429c-80cf-6c8ed997733a@9.30.json
  6. View the book in html representation. The newly created composite-page links should be available /contents/031da8d3-b525-429c-80cf-6c8ed997733a@9.30.html
  7. View one of the composite-pages for proof that it worked. /contents/031da8d3-b525-429c-80cf-6c8ed997733a@9.30:a477c930-dcb0-456c-a9fe-1c99a5ef494d%401.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment