Package org.silverpeas.core.web.look
Class SilverpeasLook
- java.lang.Object
-
- org.silverpeas.core.web.look.SilverpeasLook
-
@Singleton public class SilverpeasLook extends Object
It is a singleton that represents the current look of the running Silverpeas. Its single object provides an access to the different look of the widgets that compound Silverpeas.
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_WALLPAPER_PROPERTY
The property in which is defined the URL of the default wallpaper for the Silverpeas application.static String
SPACE_CSS
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCSSOfSpace(String spaceId)
return the CSS URL of space with a specific CSS.String
getCSSOfSpaceLook(String spaceId)
static SilverpeasLook
getSilverpeasLook()
Gets the look of Silverpeas.String
getSpaceBasePath(String spaceId)
String
getSpaceLook(String spaceId)
String
getSpaceWithCSS(String spaceId)
return the first space id with a specific CSS in path of given space This space can be the given space itself or one of its parentsString
getWallpaperOfSpace(String spaceId)
Gets the wallpaper of the specified space.String
getWallpaperOfSpaceOrDefaultOne(String spaceId)
Gets the wallpaper of the specified space.boolean
hasSpaceWallpaper(String spaceId)
Is the specified space has a specific wallpaper?
-
-
-
Field Detail
-
DEFAULT_WALLPAPER_PROPERTY
public static final String DEFAULT_WALLPAPER_PROPERTY
The property in which is defined the URL of the default wallpaper for the Silverpeas application. If this property is not set, then the SILVERPEAS_CONTEXT/admin/jsp/icons/silverpeasV5/bandeauTop.jpg is taken as the URL of the default wallpaper, with SILVERPEAS_CONTEXT the web context at which Silverpeas is deployed.- See Also:
- Constant Field Values
-
SPACE_CSS
public static final String SPACE_CSS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSilverpeasLook
public static SilverpeasLook getSilverpeasLook()
Gets the look of Silverpeas.- Returns:
- an instance representing the current look of the Silverpeas application.
-
hasSpaceWallpaper
public boolean hasSpaceWallpaper(String spaceId)
Is the specified space has a specific wallpaper?- Parameters:
spaceId
- the unique identifier of the space. It shouldn't be null.- Returns:
- true if a wallpaper is set specifically for the space, false otherwise.
-
getWallpaperOfSpace
@Nullable public String getWallpaperOfSpace(String spaceId)
Gets the wallpaper of the specified space. The wallpaper of a space is either the path of an image specifically set for itself or, in the case it has no specific wallpaper set, the one of its closest parent space.- Parameters:
spaceId
- the unique identifier of the space. The spaceId shouldn't be null.- Returns:
- the URL of the wallpaper image or null if both no wallpaper is set for the specified space and for any of its parent spaces.
-
getWallpaperOfSpaceOrDefaultOne
public String getWallpaperOfSpaceOrDefaultOne(String spaceId)
Gets the wallpaper of the specified space. If the space or one of its parent have no specific wallpaper set, then returns the default one.- Parameters:
spaceId
- the identifier of the space.- Returns:
- the URL of the wallpaper image or the default one if the space or its parents have no wallpaper.
- See Also:
getWallpaperOfSpace(java.lang.String)
-
getSpaceWithCSS
public String getSpaceWithCSS(String spaceId)
return the first space id with a specific CSS in path of given space This space can be the given space itself or one of its parents- Parameters:
spaceId
- the identifier of a space.- Returns:
- the first space id (from given space to root) with a specific CSS. If no space in path have got specific CSS, returns null.
-
getCSSOfSpace
public String getCSSOfSpace(String spaceId)
return the CSS URL of space with a specific CSS. This space can be the given space itself or one of its parents. It is this URL which must be applied to given space.- Parameters:
spaceId
- the identifier of a space.- Returns:
- the CSS URL of first space (from given space to root) with a specific CSS. If no space in path have got specific CSS, returns null.
-
-