com.cc.framework.adapter
Interface FrameworkAdapter

All Known Implementing Classes:
StrutsFrameworkAdapter

public interface FrameworkAdapter

This adapter interface contains all methods a host framework (like struts) must provide for the common-controls framework

Version:
$Revision: 1.14 $
Author:
Harald Schulz

Method Summary
 void addTransactionToken(javax.servlet.jsp.PageContext pageContext, Hyperlink link)
          Adds the a transaction token (if any) to the given Parameter List.
 java.lang.String applyServletMapping(java.lang.String url)
          Applies the front controllers servlet mapping to the given URL
 ActionPainter createActionPainter(PainterContext ctx, ControlAction action)
          Creates an ActionPainter.
 java.lang.String getActionMappingURL(javax.servlet.jsp.PageContext pageContext, java.lang.String action)
          This Method maps an Action identifier to an URL
 java.lang.String getControlAction(javax.servlet.jsp.PageContext pageContext, javax.servlet.jsp.tagext.TagSupport taghandler)
          Gets the default Action which should be used to forward requests from this control.
 MessageDataModel getMessages(javax.servlet.jsp.PageContext pageContext, Severity severity)
          Returns the Framework Messages
 boolean hasMessages(javax.servlet.jsp.PageContext pageContext, Severity severity, java.lang.String property)
          Checks for framework messages
 java.util.Locale localeFromName(HttpContext context, java.lang.String localeName)
          Gets the Locale Object from a Locale Name
 java.util.Locale localeFromName(javax.servlet.jsp.PageContext pageContext, java.lang.String localeName)
          Gets the Locale Object from a Locale Name
 java.lang.String localizeKey(HttpContext context, java.lang.String resourceKey, java.util.Locale locale, boolean returnNull)
          Localizes a string depending on the localization settings of the Painter context.
 java.lang.String localizeKey(javax.servlet.jsp.PageContext pageContext, java.lang.String resourceKey, java.util.Locale locale, boolean returnNull)
          Localizes a string depending on the localization settings of the Painter context.
 java.lang.Object lookupBean(javax.servlet.jsp.PageContext pageContext, java.lang.String name, java.lang.String property, HttpScope scope)
          Lookup a Javabean for use in a JSP tag handler
 

Method Detail

localeFromName

public java.util.Locale localeFromName(javax.servlet.jsp.PageContext pageContext,
                                       java.lang.String localeName)
Gets the Locale Object from a Locale Name

Parameters:
pageContext - JSP Page Context
localeName - The Name
Returns:
Locale Object or null

localeFromName

public java.util.Locale localeFromName(HttpContext context,
                                       java.lang.String localeName)
Gets the Locale Object from a Locale Name

Parameters:
context - JSP Page Context
localeName - The Name
Returns:
Locale Object or null

localizeKey

public java.lang.String localizeKey(javax.servlet.jsp.PageContext pageContext,
                                    java.lang.String resourceKey,
                                    java.util.Locale locale,
                                    boolean returnNull)
Localizes a string depending on the localization settings of the Painter context. A key is searched in the following order:
  1. If no user defined resource bundle is used. The resource is searched under the STRUTS_MESSAGES_KEY.
  2. If an user defined resource bundle is used (key@bundle) the resource is searched in the specified resource bundle.
  3. If the key was not found before, the resource is searched in the framework resource bundle under the key Globals.MESSAGE.

Parameters:
pageContext - JSP Page Context
resourceKey - The resource key.
locale - Locale or null
returnNull - controls whether to return null or a not present indicator
Returns:
localized String

localizeKey

public java.lang.String localizeKey(HttpContext context,
                                    java.lang.String resourceKey,
                                    java.util.Locale locale,
                                    boolean returnNull)
Localizes a string depending on the localization settings of the Painter context. A key is searched in the following order:
  1. If no user defined resource bundle is used. The resource is searched under the STRUTS_MESSAGES_KEY.
  2. If an user defined resource bundle is used (key@bundle) the resource is searched in the specified resource bundle.
  3. If the key was not found before, the resource is searched in the framework resource bundle under the key Globals.MESSAGE.

Parameters:
context - JSP Page Context
resourceKey - The resource key.
locale - Locale or null
returnNull - controls whether to return null or a not present indicator
Returns:
localized String

hasMessages

public boolean hasMessages(javax.servlet.jsp.PageContext pageContext,
                           Severity severity,
                           java.lang.String property)
Checks for framework messages

Parameters:
pageContext - JSP Page Context
severity - Severity
property - Property name or null
Returns:
boolean

getMessages

public MessageDataModel getMessages(javax.servlet.jsp.PageContext pageContext,
                                    Severity severity)
                             throws java.lang.Exception
Returns the Framework Messages

Parameters:
pageContext - JSP Page Context
severity - Severity
Returns:
MessageDataModel
Throws:
java.lang.Exception - If an error occurs while loading the Message List

getActionMappingURL

public java.lang.String getActionMappingURL(javax.servlet.jsp.PageContext pageContext,
                                            java.lang.String action)
This Method maps an Action identifier to an URL

Parameters:
pageContext - PageContext
action - Action
Returns:
String

applyServletMapping

public java.lang.String applyServletMapping(java.lang.String url)
Applies the front controllers servlet mapping to the given URL

Parameters:
url - the URL to apply the servlet mapping to (e.g. "/main")
Returns:
mapped URL (e.g. "/main.do")

addTransactionToken

public void addTransactionToken(javax.servlet.jsp.PageContext pageContext,
                                Hyperlink link)
Adds the a transaction token (if any) to the given Parameter List. The Transaction token is used to track form re-submissions.

Parameters:
pageContext - Search the context's scopes for the resources.
link - Hyperlink

getControlAction

public java.lang.String getControlAction(javax.servlet.jsp.PageContext pageContext,
                                         javax.servlet.jsp.tagext.TagSupport taghandler)
Gets the default Action which should be used to forward requests from this control. This action is used when the action-property of the control is not set

Parameters:
pageContext - JSP Page Context
taghandler - The Controls JSP-Tag
Returns:
String or null

lookupBean

public java.lang.Object lookupBean(javax.servlet.jsp.PageContext pageContext,
                                   java.lang.String name,
                                   java.lang.String property,
                                   HttpScope scope)
                            throws java.lang.Exception
Lookup a Javabean for use in a JSP tag handler

Parameters:
pageContext - JSP page context
name - Name of the bean
property - Name of a beans property
scope - the scope where the bean should be located
Returns:
Java Bean or null
Throws:
java.lang.Exception - is thrown in case of an error

createActionPainter

public ActionPainter createActionPainter(PainterContext ctx,
                                         ControlAction action)
Creates an ActionPainter. The Painter is used by Controls to render Actions into the user interface

Parameters:
ctx - The Painter Context
action - ControlAction
Returns:
ActionPainter


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.