Class TemplateSummariser


  • public class TemplateSummariser
    extends java.lang.Object
    This class manages summaries of possible values for editable constraints for template queries.
    Author:
    Matthew Wakeling
    • Constructor Detail

      • TemplateSummariser

        public TemplateSummariser​(ObjectStore os,
                                  ObjectStoreWriter osw,
                                  ObjectStoreSummary oss)
        Construct a TemplateSummariser.
        Parameters:
        os - ObjectStore containing production data
        osw - ObjectStoreWriter containing ProfileManager data
        oss - A summary of the ObjectStore - will be null
    • Method Detail

      • summarise

        public void summarise​(ApiTemplate templateQuery)
                       throws ObjectStoreException
        Populates the possibleValues data for a given TemplateQuery from the os.
        Parameters:
        templateQuery - a TemplateQuery to summarise
        Throws:
        ObjectStoreException - if something goes wrong
      • isSummarised

        public boolean isSummarised​(ApiTemplate templateQuery)
        Returns true if the given template has been summarised.
        Parameters:
        templateQuery - a TemplateQuery
        Returns:
        a boolean
      • getPossibleValues

        public java.util.List<java.lang.Object> getPossibleValues​(ApiTemplate templateQuery,
                                                                  java.lang.String path)
        Returns the possible values that a particular path in a template query can take, for dropdowns on template forms.
        Parameters:
        templateQuery - a TemplateQuery
        path - the path that is being constrained
        Returns:
        a List of possible values
      • getPossibleValues

        public java.util.Map<java.lang.String,​java.util.List<java.lang.Object>> getPossibleValues​(ApiTemplate templateQuery)
        Returns a Map of the possible values for editable nodes on a template query.
        Parameters:
        templateQuery - a TemplateQuery
        Returns:
        a Map from String path to List