org.objectweb.telosys.uil.screenmap
Class ScreenConventions

java.lang.Object
  extended byorg.objectweb.telosys.common.TelosysObject
      extended byorg.objectweb.telosys.uil.screenmap.ScreenConventions

public class ScreenConventions
extends TelosysObject

This class contains the "conventions" to use by default ( for "Convention Over Configuration" ).

It provides all the attributes loaded from the "screen_conventions" tag of the "screens.xml" file.
It allows to build a ScreenDefinition by applying the conventions
There's one instance of this class ( held by ScreenDefinitions )

Since:
1.0.5

Constructor Summary
protected ScreenConventions()
          Constructor
 
Method Summary
protected  ScreenDefinition buildScreenDefinition(javax.servlet.ServletContext servletContext, java.lang.String sScreenName, ScreenDefRootDir rootDir)
          Build a ScreenDefinition replacing the SCREENNAME by the given screen name parameter
The screen existence is checked here,
if the required resources for the screen are not found this method returns null
 java.lang.String getBody()
          Returns the default "body resource" to use by convention
 java.lang.String getContextAction()
          Returns the default "context action"
 java.lang.String getContextId()
          Returns the default "context id"
 java.lang.String getContextName()
          Returns the default "context name"
 java.lang.String getCss()
          Returns the default "CSS resource" to use by convention
 java.lang.String getScript()
          Returns the default "javascript resource" to use by convention
 java.lang.String getTemplate()
          Returns the default "template resource" to use by convention
 
Methods inherited from class org.objectweb.telosys.common.TelosysObject
error, error, error, getFlagTrace, info, setFlagTrace, trace, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenConventions

protected ScreenConventions()
Constructor

Method Detail

getBody

public java.lang.String getBody()
Returns the default "body resource" to use by convention

Returns:
the resource ( e.g. "/screen/${SCREENNAME_UC}/${SCREENNAME_UC}.jsp" ), or null if none

getScript

public java.lang.String getScript()
Returns the default "javascript resource" to use by convention

Returns:
the resource ( e.g. "/screen/${SCREENNAME_UC}/${SCREENNAME_UC}.js" ), or null if none

getCss

public java.lang.String getCss()
Returns the default "CSS resource" to use by convention

Returns:
the resource ( e.g. "/screen/${SCREENNAME_UC}/${SCREENNAME_UC}.css" ), or null if none

getTemplate

public java.lang.String getTemplate()
Returns the default "template resource" to use by convention

Returns:
the resource ( e.g. "mytemplate.jsp" ) , or null if none

getContextId

public java.lang.String getContextId()
Returns the default "context id"

Returns:
the id, or null if none

getContextName

public java.lang.String getContextName()
Returns the default "context name"

Returns:
the context name ( e.g. "${SCREENNAME_UC}" ), or null if none

getContextAction

public java.lang.String getContextAction()
Returns the default "context action"

Returns:
the action : "none" or "open" or "use" ( or null if not defined )

buildScreenDefinition

protected ScreenDefinition buildScreenDefinition(javax.servlet.ServletContext servletContext,
                                                 java.lang.String sScreenName,
                                                 ScreenDefRootDir rootDir)
Build a ScreenDefinition replacing the SCREENNAME by the given screen name parameter
The screen existence is checked here,
if the required resources for the screen are not found this method returns null

Parameters:
servletContext -
sScreenName -
rootDir -
Returns:
a ScreenDefinition or null if the required resources don't exist
Since:
1.0.5