Class CollectionDropDown

java.lang.Object
org.dspace.app.util.CollectionDropDown

public class CollectionDropDown extends Object
Utility class for lists of collections.
  • Method Details

    • collectionPath

      public static String collectionPath(Context context, Collection col) throws SQLException
      Get full path starting from a top-level community via subcommunities down to a collection. The full path will not be truncated.
      Parameters:
      context - The relevant DSpace Context.
      col - Get full path for this collection
      Returns:
      Full path to the collection
      Throws:
      SQLException - if database error
    • collectionPath

      public static String collectionPath(Context context, Collection col, int maxchars) throws SQLException
      Get full path starting from a top-level community via subcommunities down to a collection. The full cat will be truncated to the specified number of characters and prepended with an ellipsis.
      Parameters:
      context - The relevant DSpace Context.
      col - Get full path for this collection
      maxchars - Truncate the full path to maxchar characters. 0 means do not truncate.
      Returns:
      Full path to the collection (truncated)
      Throws:
      SQLException - if database error
    • annotateWithPaths

      public static CollectionDropDown.CollectionPathEntry[] annotateWithPaths(Context context, List<Collection> collections) throws SQLException
      Annotates an array of collections with their respective full paths (@see #collectionPath() method in this class).
      Parameters:
      context - The relevant DSpace Context.
      collections - An array of collections to annotate with their hierarchical paths. The array and all its entries must be non-null.
      Returns:
      A sorted array of collection path entries (essentially collection/path pairs).
      Throws:
      SQLException - In case there are problems annotating a collection with its path.