|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.pull.tools.UITool
Manages all UI elements for a Turbine Application. Any UI element can be accessed in any template using the $ui handle (assuming you use the default PullService configuration). So, for example, you could access the background color for your pages by using $ui.bgcolor
This implementation provides a single level of inheritance in that if a property does not exist in a non-default skin, the value from the default skin will be used. By only requiring values different to those stored in the default skin to appear in the non-default skins the amount of memory consumed in cases where the UserManager instance is used at a non-global scope will potentially be reduced due to the fact that a shared instance of the default skin properties can be used. Note that this inheritance only applies to property values - it does not apply to any images or stylesheets that may form part of your skins.
This is an application pull tool for the template system. You should not use it in a normal application! Within Java code you should use TurbineUI.
This is an application pull tool for the template system. You should only use it in a normal application to set the skin attribute for a user (setSkin(User user, String skin)) and to initialize it for the user, otherwise use TurbineUI is probably the way to go.
UIService
Field Summary | |
static java.lang.String |
SKIN_ATTRIBUTE
Attribute name of skinName value in User's temp hashmap. |
Constructor Summary | |
UITool()
|
Method Summary | |
java.lang.String |
get(java.lang.String key)
Retrieve a skin property. |
java.lang.String |
getScript(java.lang.String filename)
Retrieve the URL for a given script that is part of the skin. |
java.lang.String |
getScript(java.lang.String filename,
RunData data)
Retrieve the URL for a given script that is part of the skin. |
java.lang.String |
getScript(java.lang.String filename,
ServerData serverData)
Retrieve the URL for a given script that is part of the skin. |
java.lang.String |
getSkin()
Retrieve the skin name. |
java.lang.String[] |
getSkinNames()
Provide access to the list of available skin names. |
java.lang.String |
getStylecss()
Retrieve the URL for the style sheet that is part of the skin. |
java.lang.String |
getStylecss(RunData data)
Retrieve the URL for the style sheet that is part of the skin. |
java.lang.String |
getStylecss(ServerData serverData)
Retrieve the URL for the style sheet that is part of the skin. |
java.lang.String |
getWebappSkinName()
Get the name of the default skin name for the web application from the TurbineResources.properties file. |
java.lang.String |
image(java.lang.String imageId)
Retrieve the URL for an image that is part of the skin. |
java.lang.String |
image(java.lang.String imageId,
RunData data)
Retrieve the URL for an image that is part of the skin. |
java.lang.String |
image(java.lang.String imageId,
ServerData serverData)
Retrieve the URL for an image that is part of the skin. |
void |
init(java.lang.Object data)
Initialize the UITool object. |
void |
refresh()
Refresh the tool. |
void |
setSkin()
Set the skin name to the skin from the TurbineResources.properties file. |
protected void |
setSkin(RunData data)
Set the skin name when the tool is configured to be loaded on a per-request basis. |
void |
setSkin(java.lang.String skinName)
Set the skin name to the specified skin. |
protected void |
setSkin(User user)
Set the skin name when the tool is configured to be loaded on a per-session basis. |
static void |
setSkin(User user,
java.lang.String skin)
Set the skin name in the user's temp hashmap for the current session. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String SKIN_ATTRIBUTE
Constructor Detail |
public UITool()
Method Detail |
public void refresh()
refresh
in interface ApplicationTool
public java.lang.String[] getSkinNames()
public java.lang.String getWebappSkinName()
public java.lang.String get(java.lang.String key)
null
will be returned.
key
- the key to retrieve from the skin.
null
,
depending on whether or not the property or skins exist.public java.lang.String getSkin()
public void setSkin()
public void setSkin(java.lang.String skinName)
skinName
- the skin name to use.protected void setSkin(RunData data)
data
- a RunData instanceprotected void setSkin(User user)
user
- a User instancepublic static void setSkin(User user, java.lang.String skin)
user
- a User instanceskin
- the skin name for the sessionpublic java.lang.String image(java.lang.String imageId, RunData data)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the image(String image) method would probably be enough, but I'm not absolutely positive.
imageId
- the id of the image whose URL will be generated.data
- the RunDate to use as the source of the ServerData to use as
the basis for the URL.public java.lang.String image(java.lang.String imageId, ServerData serverData)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the image(String image) method would probably be enough, but I'm not absolutely positive.
imageId
- the id of the image whose URL will be generated.serverData
- the serverData to use as the basis for the URL.public java.lang.String image(java.lang.String imageId)
imageId
- the id of the image whose URL will be generated.public java.lang.String getStylecss(RunData data)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the style() method would probably be enough, but I'm not absolutely positive.
data
- the RunDate to use as the source of the ServerData to use as
the basis for the URL.public java.lang.String getStylecss(ServerData serverData)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the style() method would probably be enough, but I'm not absolutely positive.
serverData
- the serverData to use as the basis for the URL.public java.lang.String getStylecss()
public java.lang.String getScript(java.lang.String filename, RunData data)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the image(String image) method would probably be enough, but I'm not absolutely positive.
filename
- the name of the script file whose URL will be generated.data
- the RunDate to use as the source of the ServerData to use as
the basis for the URL.public java.lang.String getScript(java.lang.String filename, ServerData serverData)
Use this if for some reason your server name, server scheme, or server port change on a per request basis. I'm not sure if this would happen in a load balanced situation. I think in most cases the image(String image) method would probably be enough, but I'm not absolutely positive.
filename
- the name of the script file whose URL will be generated.serverData
- the serverData to use as the basis for the URL.public java.lang.String getScript(java.lang.String filename)
filename
- the name of the script file whose URL will be generated.public void init(java.lang.Object data)
init
in interface ApplicationTool
data
- This is null, RunData or User depending upon specified tool
scope.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |