|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.util.ComponentPropertyManager
public class ComponentPropertyManager
The ComponentPropertyManager is responsible for holding global properties
which are application specific such as locations for images, javascript, and
templates. It also handles the changing and setting of themes. Themes will
override the default global properties used by the components. Changes to
properties made on a specific component will override the themes and default
global properties on the ComponentPropertyManager.
Only one ComponentPropertyManager is created per session per web application.
The same ComponentPropertyManager is used throughout that session.
If you want to override the defaults for the ComponentPropertyManager, then you can
place a file named "sas_ComponentProperties.config" into the web-inf directory of
your web application. The property names in the config file should be:
ImageLocation
StyleLocation
JavaScriptLocation
TemplateLocation
TemplateURLLocation
DynamicButtonRootName
OutputCharacterEncoding
InputCharacterEncoding
ContextMenuLaunchEvent
For example, you can change the ImageLocation by using: ImageLocation=foo/ or ImageLocation=http://myserver/myapp/foo. This would
change the ImageLocation directory to be "foo/" or "http://myserver/myapp/foo", respectively.
A good use of the sas_ComponentProperties.config file is to set the ImageLocation, StyleLocation, and TemplateURLLocation to be
the fully qualified path to an HTTP server hosting those resources. This will increase performance since those static resources will
not have to be served by the application server.
The order of precedence that the ComponentPropertyManager uses is as follows:
1. Calling the setters on the ComponentPropertyManager instance itself overrides all. The set value will be used.
2. If the above value was null, check and use a SAS Theme resource if available (only available for ImageLocation, StyleLocation, and TemplateURLLocation).
3. If the above value was null, check if the sas_ComponentProperties.config was present and use any non-null values as the new default values.
4. Otherwise, use the default locations with the determined path prefixed to the location.
Field Summary | |
---|---|
protected java.lang.String |
absolutePath
|
protected java.lang.String |
contextPath
|
protected static java.lang.String |
DEFAULT_CONTEXT_MENU_LAUNCH_EVENT
|
protected static java.lang.String |
DEFAULT_DOCTYPE
|
protected static java.lang.String |
DEFAULT_INPUT_CHARACTER_ENCODING
|
protected static java.lang.String |
DEFAULT_OUTPUT_CHARACTER_ENCODING
|
static java.lang.String |
DEFAULT_STYLE_SHEET
|
protected GraphStyle |
defaultGraphStyle
|
protected GraphStyle |
graphStyle
|
protected static java.lang.String |
META_REFRESH_INT
|
Constructor Summary | |
---|---|
protected |
ComponentPropertyManager()
|
Method Summary | |
---|---|
java.lang.String |
getAbsolutePath()
|
java.lang.String |
getContextMenuLaunchEvent(TransformationInterface tBean)
|
protected java.lang.String |
getContextPath()
The path to be prefixed to the default locations to create an absolute path. |
java.lang.String |
getDynamicButtonRootName()
Gets the dynamicButtonRootName property. |
GraphStyle |
getGraphStyle()
Returns the default graphStyle based the the current theme. |
java.lang.String |
getImageLocation()
The path location where all images for a web application can be found. |
java.lang.String |
getInputCharacterEncoding()
Gets the inputCharacterEncoding property. |
static ComponentPropertyManager |
getInstance(javax.servlet.http.HttpServletRequest request)
Returns the appropriate ComponentPropertyManager for the given request. |
java.lang.String |
getJavaScriptLocation()
The path location where all javascript (.js) files for a web application can be found. |
java.lang.String |
getOutputCharacterEncoding()
Gets the outputCharacterEncoding property. |
protected com.sas.preferences.SASProfileInterface |
getSASProfile()
Deprecated. |
java.lang.String |
getStyleLocation()
The path location where all style sheets (.css files) for a web application can be found. |
java.lang.String |
getStyleSheetLinks(java.util.List l)
Return the cascading style sheet link html tags to be used in a page. |
java.util.List |
getStyleSheetList()
Gets the java.util.List of cascading style sheets to be written out. |
java.lang.String |
getTemplateLocation()
The path location where all template files for a web application can be found. |
java.lang.String |
getTemplateURLLocation()
The path location where all template files for a web application can be found. |
boolean |
isAutoComplete()
Returns true if auto complete is turned on the forms and input elements, false otherwise. |
void |
setAbsolutePath(java.lang.String absolutePath)
|
void |
setAutoComplete(boolean value)
Sets the state of the autoComplete on FORM tbeans as well as input elements with type of TEXT & PASSWORD. |
void |
setContextMenuLaunchEvent(TransformationInterface tBean,
java.lang.String contextMenuLaunchEvent)
Associates contextMenuLaunchEvent with the viewer. |
protected void |
setContextPath(java.lang.String requestingURI)
The path to be prefixed to the default locations to create an absolute path. |
void |
setDynamicButtonRootName(java.lang.String root)
Sets the dynamicButtonRootName property. |
void |
setGraphStyle(GraphStyle graphStyle)
Sets the graphStyle used for this instance of the ComponentPropertyManager. |
void |
setImageLocation(java.lang.String location)
Sets the path location where all images for a web application can be found. |
void |
setInputCharacterEncoding(java.lang.String characterEncoding)
Sets the inputCharacterEncoding property. |
void |
setJavaScriptLocation(java.lang.String location)
Sets the path location where all javascript (.js) files for a web application can be found. |
void |
setOutputCharacterEncoding(java.lang.String characterEncoding)
Sets the outputCharacterEncoding property. |
void |
setSASProfile(com.sas.preferences.SASProfileInterface sasProfile)
Deprecated. |
void |
setStyleLocation(java.lang.String location)
Sets the path location where all style sheets (.css files) for a web application can be found. |
void |
setStyleSheetList(java.util.List list)
Sets the java.util.List of cascading style sheets to be written out. |
void |
setTemplateLocation(java.lang.String location)
Sets the path location where all template files for a web application can be found. |
void |
setTemplateURLLocation(java.lang.String url)
Sets the URL path location where all template files for a web application can be found. |
Field Detail |
---|
public static final java.lang.String DEFAULT_STYLE_SHEET
protected static final java.lang.String DEFAULT_INPUT_CHARACTER_ENCODING
protected static final java.lang.String DEFAULT_OUTPUT_CHARACTER_ENCODING
protected static final java.lang.String DEFAULT_CONTEXT_MENU_LAUNCH_EVENT
protected static final java.lang.String DEFAULT_DOCTYPE
protected static final java.lang.String META_REFRESH_INT
protected java.lang.String contextPath
protected java.lang.String absolutePath
protected GraphStyle graphStyle
protected GraphStyle defaultGraphStyle
Constructor Detail |
---|
protected ComponentPropertyManager()
Method Detail |
---|
public java.lang.String getStyleSheetLinks(java.util.List l)
public static ComponentPropertyManager getInstance(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest
public void setGraphStyle(GraphStyle graphStyle)
graphStyle
- the graph style.public GraphStyle getGraphStyle()
public java.lang.String getImageLocation()
public void setImageLocation(java.lang.String location)
location
- the path location for all imagespublic java.lang.String getStyleLocation()
public void setStyleLocation(java.lang.String location)
location
- the path location for all style sheetspublic java.lang.String getJavaScriptLocation()
public void setJavaScriptLocation(java.lang.String location)
location
- the path location for all javascript (.js) filespublic java.lang.String getTemplateLocation()
public void setTemplateLocation(java.lang.String location)
location
- the path location for all template filessetTemplateURLLocation(java.lang.String)
public java.lang.String getDynamicButtonRootName()
public void setDynamicButtonRootName(java.lang.String root)
root
- the root name for all images within a group of imagespublic java.lang.String getInputCharacterEncoding()
public void setInputCharacterEncoding(java.lang.String characterEncoding)
characterEncoding
- the character input encoding.public java.lang.String getOutputCharacterEncoding()
public void setOutputCharacterEncoding(java.lang.String characterEncoding)
characterEncoding
- the character encoding to set on the HttpServletResponsepublic void setStyleSheetList(java.util.List list)
list
- The list of style sheetspublic java.util.List getStyleSheetList()
public java.lang.String getTemplateURLLocation()
public void setTemplateURLLocation(java.lang.String url)
url
- The URL for the component template locationsetTemplateLocation(java.lang.String)
protected void setContextPath(java.lang.String requestingURI)
contextPath
- The contextPath to set.protected java.lang.String getContextPath()
protected com.sas.preferences.SASProfileInterface getSASProfile()
public void setSASProfile(com.sas.preferences.SASProfileInterface sasProfile)
SASProfile
- The SASProfile to set.public java.lang.String getAbsolutePath()
public void setAbsolutePath(java.lang.String absolutePath)
absolutePath
- The absolutePath to set.public void setAutoComplete(boolean value)
value
- the state of the forms and input elementspublic boolean isAutoComplete()
public void setContextMenuLaunchEvent(TransformationInterface tBean, java.lang.String contextMenuLaunchEvent)
tBean
- contextMenuLaunchEvent
- public java.lang.String getContextMenuLaunchEvent(TransformationInterface tBean)
tBean
-
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |