org.dspace.app.xmlui.wing
Class WingContext

java.lang.Object
  extended by org.dspace.app.xmlui.wing.WingContext

public class WingContext
extends Object


Field Summary
static char DIVIDER
          The nameing divider
 
Constructor Summary
WingContext()
           
 
Method Summary
 void checkValidity()
          Check that the context is valid, and able to be used.
 void dispose()
          Recycle this context for future use by another wing element
 String generateID(String application, String name)
          Generate a unique id based upon the locally unique name and the application.
 String generateID(String application, String name, String subName)
          Generate a unique id with a sub name.
 String generateName(String name)
          Generate a specialized name based on the callers name.
 String getComponentName()
          Return the current transformer's name.
 org.apache.commons.logging.Log getLogger()
          Return the cocoon logger
 ObjectManager getObjectManager()
          Get the objectManager.
 void setComponentName(String componentName)
          Set the current transformer's name
 void setLogger(org.apache.commons.logging.Log log)
          Set the cocoon logger
 void setObjectManager(ObjectManager objectManager)
          Set the objectManager which is repsonsible for managing the object store in the DRI document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIVIDER

public static final char DIVIDER
The nameing divider

See Also:
Constant Field Values
Constructor Detail

WingContext

public WingContext()
Method Detail

setComponentName

public void setComponentName(String componentName)
Set the current transformer's name

Parameters:
componentName - the current transformer's name.

getComponentName

public String getComponentName()
Return the current transformer's name.

Returns:

getLogger

public org.apache.commons.logging.Log getLogger()
Return the cocoon logger

Returns:
the current logger

setLogger

public void setLogger(org.apache.commons.logging.Log log)
Set the cocoon logger

Parameters:
log - A new logger.

generateID

public String generateID(String application,
                         String name)
Generate a unique id based upon the locally unique name and the application. The format of the unique id typically is: dot dot typically the componentName is the Java class path of the Wing component.

Parameters:
application - The application of this element, typically this is the element type that is being identified. Such as p, div, table, field, etc...
name - A locally unique name that distinguished this element from among its siblings.
Returns:
A globally unique identifier.

generateID

public String generateID(String application,
                         String name,
                         String subName)
Generate a unique id with a sub name. Like the other form of generateID this will append another sub-name. This is typically used for when duplicate names are used but further identification is needed for globally unique names.

Parameters:
application - The application of this element, typically this is the element type that is being identified. Such as p, div, table, field, etc...
name - A locally unique name that distinguished this element from among its siblings.
subName - An additional name to the original name to further identify it in cases when just the name alone does not accomplish this.
Returns:

generateName

public String generateName(String name)
Generate a specialized name based on the callers name. This is typically used in situations where two namespaces are being merged together so that each namespace is prepended with the current scope's name.

Parameters:
name - A locally unique name that distinguished this element from among it's siblings.

setObjectManager

public void setObjectManager(ObjectManager objectManager)
Set the objectManager which is repsonsible for managing the object store in the DRI document.

Parameters:
objectManager - The new objectManager

getObjectManager

public ObjectManager getObjectManager()
Get the objectManager.

Returns:
Return the objectManager associated with this component.

checkValidity

public void checkValidity()
                   throws WingException
Check that the context is valid, and able to be used. An error should be thrown if it is not in a valid sate.

Throws:
WingException

dispose

public void dispose()
Recycle this context for future use by another wing element



Copyright © 2012 DuraSpace. All Rights Reserved.