Skip to content

Card Content Type Maintenance Guide

Erik Hetzner edited this page Apr 18, 2018 · 2 revisions

Card Content Type Maintenance Guide

Steps for adding and updating content types

Allow new stuff to come in

Java dependency of ruby-jing

Please note, that he ruby-jing gem used for card XML validation has a dependency on server side Java runtime. Unfortunately (at least for Mac OSX) ruby-jing seems to require the legacy Java SE 6 runtime (https://support.apple.com/kb/DL1572?locale=en_US), and XML validation when run locally on Mac OSX will prompt for installation of Java, even if the latest version of the Java runtime is already installed (see https://www.java.com/en/download/faq/yosemite_java.xml).

  1. Update any information in the card xml schema /config/card.rnc) file. Remember that you'll need
    to use trang to create the card.rng file from the card.rnc.

Useful guide for relaxNG schema: http://books.xmlschemata.org/relaxng/relax-PART-1.html
2. If you're making a new content type, you'll need to update the validation information
for the card content value types in app/models/card_content.rb; check the VALUE_TYPES_FOR_CONTENT hash.
3. Update the XmlCardLoader at /app/services/xml_card_loader.rb so that information from the xml editor will get translated into
updated card content, and ideally update spec/services/xml_card_loader_spec.rb too.

Allow new stuff to go out

  1. Update the to_xml method of /app/models/card_content.rb
  2. Update /app/serializers/card_content_serializer.rb with new attributes
  3. Update client/app/models/card-content.js with new attributes that need to be recognized on the client side
  4. Make a new component if needed in the app/pods/components/card-content folder, also update /client/app/pods/components/card-content/component.js if need be.

Update sample data

- Update data.yml

  • Update /lib/tasks/card_loading/configurations/nonstandard_configurations/card_configuration_sampler.rb
Clone this wiki locally