Class ItemTypeExtractionStrategy


  • public class ItemTypeExtractionStrategy
    extends Object
    Encapsulates the work of figuring out what type the item is. Right now, uses static methods, later, we might want to change, add to factory. We use the QTI qmd_itemtype in itemmetadata as the preferred way to ascertain type. We fall back on title and then item structure, also attempring keyword matching. Note, this may be deprecated in favor of a vocabulary based approach. Need to investigate. Anyway, this is the form that is backwardly compatible.
    Author:
    Ed Smiley
    • Constructor Detail

      • ItemTypeExtractionStrategy

        public ItemTypeExtractionStrategy()
    • Method Detail

      • calculate

        public static Long calculate​(String title,
                                     String itemIntrospect,
                                     String qmdItemtype)
        Obtain Long item type id from strings extracted from item.
        Parameters:
        title - the item title
        itemIntrospect - hte structure based guess from XSL
        qmdItemtype - hte item type meta information
        Returns:
        Long item type id
      • calculate

        public static Long calculate​(Map itemMap)
      • main

        public static void main​(String[] args)
        simple unit test
        Parameters:
        args - not used