Class RecycleBinEntityBuilder

java.lang.Object
org.exoplatform.documents.rest.util.RecycleBinEntityBuilder

public final class RecycleBinEntityBuilder extends Object
Builds what the screens of the Recycle Bin read from what the service returns.
  • Method Details

    • toItemEntity

      public static RecycleBinItemEntity toItemEntity(org.exoplatform.documents.model.RecycleBinItem item, boolean viewable, org.exoplatform.social.core.manager.IdentityManager identityManager)
      Parameters:
      item - an item of a bin
      viewable - whether the bin is one its items are opened from: the caller's own or a space's, never the bin of a drive an administrator acts on
      identityManager - reads the name of who deleted the item
      Returns:
      the item as a screen lists it
    • toOriginalLocation

      public static String toOriginalLocation(String restorePath)
      Parameters:
      restorePath - the path an item was deleted from
      Returns:
      the folder it was in, from the root of its drive, "/" for the root itself, the public folder of a user and what it holds under "/Public"; the whole path of the folder when it is in no drive; null when no path was recorded
    • toOriginalLocation

      public static String toOriginalLocation(String restorePath, List<String> folderTitles)
      Parameters:
      restorePath - the path an item was deleted from
      folderTitles - the names the documents show of the folders of that path, one for each of them from the root of the repository, or null when not known
      Returns:
      the folder it was in, as toOriginalLocation(String) gives it, each folder of its drive named as the documents show it when the names are known
    • toDriveEntity

      public static RecycleBinDriveEntity toDriveEntity(org.exoplatform.documents.model.RecycleBinDrive drive, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService)
      Parameters:
      drive - the totals of the bin of a drive
      Returns:
      the drive as the Bin Overview lists it, with what is known of its owner