Class WebHelper

    • Method Detail

      • getSiteName

        public static String getSiteName​(Request request)
        Get the site name from the request. The site name is searched in the following order: the 'siteName' request parameter, the 'site' request attribute, the 'siteName' request attribute.
        Parameters:
        request - the request. Cannot be null.
        Returns:
        the site name or null if not found
      • getSiteName

        public static String getSiteName​(Request request,
                                         AmetysObject object)
        Get the site name from a object or current request. The site name is searched in the following order: the Ametys object, the 'siteName' request parameter, the 'site' request attribute, the 'siteName' request attribute.
        Parameters:
        request - the request. Cannot be null.
        object - the object. Can be null.
        Returns:
        the site name or null if not found
      • findSite

        public static Site findSite​(Event event)
        Retrieves the site from an observation Event.
        This method search in the events' arguments to find :
        • ObservationConstants.ARGS_SITE
        • ObservationConstants.ARGS_PAGE
        • ObservationConstants.ARGS_ZONE_ITEM
        • ObservationConstants.ARGS_ACL_CONTEXT
        • object if it's instance of SiteAwareAmetysObject
        Parameters:
        event - the Event.
        Returns:
        the current site or null if not found.