Package org.ametys.web
Class WebHelper
- java.lang.Object
-
- org.ametys.web.WebHelper
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Site
findSite(Event event)
Retrieves the site from an observationEvent
.
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 ofSiteAwareAmetysObject
static String
getSiteName(Request request)
Get the site name from the request.static String
getSiteName(Request request, AmetysObject object)
Get the site name from a object or current request.
-
-
-
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 observationEvent
.
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 ofSiteAwareAmetysObject
- Parameters:
event
- theEvent
.- Returns:
- the current site or null if not found.
-
-