Class InboxUtils


  • public class InboxUtils
    extends Object
    Author:
    XIMA MEDIA GmbH
    • Constructor Detail

      • InboxUtils

        public InboxUtils()
    • Method Detail

      • getFormRecordCount

        public static final int getFormRecordCount​(Long inboxId,
                                                   boolean onlyUnread)
        Gets the number of form records for the given inbox id
        Parameters:
        inboxId - Long id of the inbox
        onlyUnread - Boolean whether only unread form records should be counted or not
        Returns:
        number of form records
      • getFormRecordCount

        public static final int getFormRecordCount​(Postfach inbox,
                                                   boolean onlyUnread)
      • getFormRecordCount

        public static final int getFormRecordCount​(Postfach inbox,
                                                   Projekt project,
                                                   boolean onlyUnread)
        Gets the number of form records in the given inbox
        Parameters:
        inbox - Postfach
        onlyUnread - Boolean whether only unread form records should be counted or not
        Returns:
        number of form records
      • getFormRecordStateDisplayName

        public static final String getFormRecordStateDisplayName​(boolean newWorkflow,
                                                                 boolean saved,
                                                                 WorkflowState wfState,
                                                                 Status status,
                                                                 String verifyUuid,
                                                                 Date verifyDate,
                                                                 Locale locale)
      • getIds

        public static final <T extends de.xima.cmn.dao.interfaces.IEntity<I>,​I extends Serializable & Comparable<I>> List<I> getIds​(List<T> entities)
        Turns a list of entities into a list of IDs
        Parameters:
        entities - List of IEntitys
        Returns:
        List of IDs
      • getStateDisplayName

        public static final String getStateDisplayName​(Vorgang formRecord,
                                                       Locale locale)
      • getUserProfile

        public static UserProfile getUserProfile​(UUID userProfileUuid,
                                                 Set<UserProfile> profileCache)
        Returns the UserProfile for the given UUID from the given cache. If the cache is given and the user profile is not in the cache, the user profile is fetched from the database and added to the cache.
        Parameters:
        userProfileUuid - UUID of the user profile
        profileCache - HashSet of UserProfile to cache the user profiles
        Returns:
        UserProfile for the given UUID or null if there is no user profile for the given UUID.
      • toReadableByteSize

        public static String toReadableByteSize​(long bytes,
                                                Locale locale)
        Converts the given byte size to a human-readable format.
        Parameters:
        bytes - The byte size to convert.
        Returns:
        The human-readable byte size.