Class ModelBrowserHelper


  • public final class ModelBrowserHelper
    extends java.lang.Object
    Static class holding methods for managing the model browser in the query builder.
    Author:
    Matthew Wakeling, Richard Smith
    • Method Detail

      • makeSelectedNodes

        public static java.util.Collection<MetadataNode> makeSelectedNodes​(java.lang.String stringPath,
                                                                           java.lang.String prefix,
                                                                           Model model,
                                                                           boolean isSuperUser,
                                                                           PathQuery query,
                                                                           WebConfig webConfig,
                                                                           java.util.Map<java.lang.String,​java.util.List<FieldDescriptor>> classKeys,
                                                                           BagManager bagManager,
                                                                           Profile profile,
                                                                           ObjectStoreSummary oss)
                                                                    throws PathException
        Finds the collection of MetadataNode objects that the model browser needs to display.
        Parameters:
        stringPath - a deeper path in the query that must be added to the nodes
        prefix - the root class of the query, even if the query is empty
        model - a Model
        isSuperUser - true if the current user is a superuser
        query - a PathQuery
        webConfig - a WebConfig object
        classKeys - a Map of class keys, for working out if a path has any
        bagManager - a BagManager object, for working out if it is possible to constrain by bag
        profile - the profile of the current user, for fetching bags from the BagManager
        oss - to determine which collections/references/attributes are empty
        Returns:
        a Collection of MetadataNode objects
        Throws:
        PathException - if the query is not valid
      • makeNodes

        public static java.util.Collection<MetadataNode> makeNodes​(java.lang.String path,
                                                                   Model model,
                                                                   boolean isSuperUser,
                                                                   PathQuery query,
                                                                   WebConfig webConfig,
                                                                   java.util.Map<java.lang.String,​java.util.List<FieldDescriptor>> classKeys,
                                                                   BagManager bagManager,
                                                                   Profile profile,
                                                                   ObjectStoreSummary oss)
                                                            throws PathException
        Given a path, render a set of metadata Nodes to the relevant depth
        Parameters:
        path - of form Gene.organism.name
        model - the model used to resolve class names
        isSuperUser - true if the user is the superuser
        webConfig - the web configuration.
        query - a PathQuery, for working out possible loops
        classKeys - a Map of class keys, for working out if a path has any
        bagManager - a BagManager object, for working out if it is possible to constrain by bag
        profile - the profile of the current user, for fetching bags from the BagManager
        oss - to determine which nodes are null
        Returns:
        an ordered Set of nodes
        Throws:
        PathException - if the query is invalid.