Interface ExternalLogic


  • public interface ExternalLogic
    • Method Detail

      • isUserAdmin

        boolean isUserAdmin​(String userId)
        Check if this user has super admin access
        Parameters:
        userId - the internal user id (not username)
        Returns:
        true if the user has admin access, false otherwise
      • isUserAdmin

        boolean isUserAdmin()
        Check if the current user has super admin access
        Parameters:
        userId - the internal user id (not username)
        Returns:
        true if the user has admin access, false otherwise
      • getCurrentLocationId

        String getCurrentLocationId()
        Returns:
        the current location id of the current user
      • getCurrentLocationReference

        String getCurrentLocationReference()
        Returns:
        the current location reference of the current user
      • getCurrentToolURL

        String getCurrentToolURL()
        Returns:
        the current tool URL of the current user
      • getCurrentUserId

        String getCurrentUserId()
        Returns:
        the current sakai user id (not username)
      • getCurrentuserReference

        String getCurrentuserReference()
        Get the current user reference (/user/admin)
        Returns:
      • getUserEidFromId

        String getUserEidFromId​(String userId)
        Given a userId, return the associated userEid
        Parameters:
        userId - The userId
        Returns:
        The userEid
      • isAllowedInLocation

        boolean isAllowedInLocation​(String permission,
                                    String locationReference)
        is the current user allowed to perform the action in the current location?
        Parameters:
        permission -
        locationReference -
      • isAllowedInLocation

        boolean isAllowedInLocation​(String permission,
                                    String locationReference,
                                    String userRefence)
        is the current user allowed to perform the action in the current location?
        Parameters:
        permission -
        locationReference -
        the - user
      • getSitesForUser

        List<String> getSitesForUser​(String userId,
                                     String permission)
        Get the sites users is a member of
        Parameters:
        userId -
        permission -
        Returns:
        a list of site references
      • postEvent

        void postEvent​(String eventId,
                       String reference,
                       boolean modify)
        Post a new event to the event tracking service
        Parameters:
        eventId -
        reference -
        does - the event modify state?
      • registerFunction

        void registerFunction​(String function,
                              boolean userMutable)
        Register a function with the Sakai Function manager
        Parameters:
        function -
        userMutable -
      • getLocalTimeZone

        TimeZone getLocalTimeZone()
        get the correct Timezone for the the current user
        Returns:
      • getRoleIdsInRealm

        List<String> getRoleIdsInRealm​(String realmId)
        Get a list of RoleIds in a the given realms
        Parameters:
        RealmId -
        Returns:
        a list os frings of the role Ids
      • isRoleAllowedInRealm

        boolean isRoleAllowedInRealm​(String roleId,
                                     String realmId,
                                     String permission)
        is the role allowed to perform the function in the given realm?
        Parameters:
        RoleId -
        realmId -
        Returns:
      • getSiteTile

        String getSiteTile​(String siteId)
        Parameters:
        siteId -
        Returns:
      • getSiteRefFromId

        String getSiteRefFromId​(String siteId)
        Get a site reference "/site/ABCD from its id (ABCD)
        Parameters:
        siteId -
        Returns:
      • getRoles

        Map<String,​PollRolePerms> getRoles​(String locationReference)
        Get the Roles in a site
        Parameters:
        locationReference -
        Returns:
      • userIsViewingAsRole

        boolean userIsViewingAsRole()
        is the user using the "view as ..." feature
        Returns:
      • notifyDeletedOption

        void notifyDeletedOption​(List<String> userEids,
                                 String siteTitle,
                                 String pollQuestion)
        Notify a list of users that an option they voted for in a poll has been deleted.
        Parameters:
        userEids - A List of user EID's that identify the users to be notified
        pollQuestion - The text of the poll whose option was deleted
        siteTitle - The title of the site that owns the option's poll
      • getCurrentToolSession

        org.sakaiproject.tool.api.ToolSession getCurrentToolSession()
        Needed to invoke helper tools
      • isResultsChartEnabled

        boolean isResultsChartEnabled()
        Are charts enabled on the results page? poll.results.chart.enabled=true|false, default false
        Returns:
      • isShowPublicAccess

        boolean isShowPublicAccess()
        Are the public access options available to the Instructor? poll.allow.public.access=true|false, default false
        Returns:
      • isMobileBrowser

        boolean isMobileBrowser()
        Is the current user using a mobile browser?
        Returns:
      • getPermissionKeys

        List<String> getPermissionKeys()
        Get a list of the permission keys for the tool
        Returns:
      • registerStatement

        void registerStatement​(String pollText,
                               Vote vote)
        Register a statement with the system LearningResourceStoreService
      • registerStatement

        void registerStatement​(String pollText,
                               boolean newPoll,
                               String pollId)
        Register a statement with the system LearningResourceStoreService
      • getNumberUsersCanVote

        int getNumberUsersCanVote()
        Get the total number of users that have permission for voting
      • convertFormattedTextToPlaintext

        String convertFormattedTextToPlaintext​(String text)
        Parameters:
        text -
        Returns:
      • processFormattedText

        String processFormattedText​(String text,
                                    StringBuilder errorMessages)
        Parameters:
        text -
        errorMessages -
        Returns:
      • processFormattedText

        String processFormattedText​(String strFromBrowser,
                                    StringBuilder errorMessages,
                                    boolean checkForEvilTags,
                                    boolean replaceWhitespaceTags)
        Parameters:
        strFromBrowser -
        errorMessages -
        checkForEvilTags -
        replaceWhitespaceTags -
        Returns: