Project Wonder 5.0

er.directtoweb
Class ERDirectToWeb

java.lang.Object
  extended by er.extensions.ERXFrameworkPrincipal
      extended by er.directtoweb.ERDirectToWeb

public class ERDirectToWeb
extends ERXFrameworkPrincipal

Principle class of the ERDirectToWeb framework. This class is loaded when the NSBundle of this framework is loaded. When loaded this class configures the directtoweb runtime to use the ERD2WModel and ERD2WFactory subclasses instead of the default implementations. See each class for a description of the additions/improvements made to the base implementation. This class also has a bunch of utility methods that are used throughout this framework.


Nested Class Summary
static class ERDirectToWeb.D2WException
          Subclass of NSForwardException that can hold a d2wContext.
 
Nested classes/interfaces inherited from class er.extensions.ERXFrameworkPrincipal
ERXFrameworkPrincipal.Observer
 
Field Summary
static org.apache.log4j.Logger componentNameLog
           
static com.webobjects.foundation.NSSelector D2WCONTEXT_SELECTOR
           
static java.lang.String D2WDEBUGGING_ENABLED_KEY
           
static java.lang.String D2WDISPLAY_COMPONENTNAMES_KEY
           
static java.lang.String D2WDISPLAY_DETAILED_PAGE_METRICS_KEY
           
static java.lang.String D2WDISPLAY_PAGE_METRICS_KEY
           
static java.lang.String D2WDISPLAY_PROPERTYKEYS_KEY
           
static org.apache.log4j.Logger debugLog
           
static org.apache.log4j.Logger log
          logging support
static org.apache.log4j.Logger propertyKeyLog
           
static java.lang.Class[] REQUIRES
           
static org.apache.log4j.Logger trace
           
 
Fields inherited from class er.extensions.ERXFrameworkPrincipal
initializedFrameworks, launchingFrameworks
 
Constructor Summary
ERDirectToWeb()
           
 
Method Summary
static boolean booleanForKey(com.webobjects.directtoweb.D2WContext context, java.lang.String key)
           
static void configureTraceRuleFiring()
           
 void configureTraceRuleFiring(com.webobjects.foundation.NSNotification n)
           
static com.webobjects.foundation.NSMutableArray convertedPropertyKeyArray(com.webobjects.foundation.NSArray keyArray, char startChar, char endChar)
          Converts a given array of keys to a format usable for section and tab display.
static java.lang.String convertedPropertyKeyFromString(java.lang.String s, char start, char end)
          Checks if a given property key is in the format (foo) or [foo] and returns the stripped string.
static java.lang.String createConfigurationForEntityNamed(java.lang.String entityName)
           
static com.webobjects.appserver.WOComponent csvExportPageForD2WContext(com.webobjects.directtoweb.D2WContext context, com.webobjects.appserver.WOSession session)
          Deprecated. use ERD2WFactory.erFactory().csvExportPageForD2WContext(D2WContext context, WOSession session)
static boolean d2wComponentNameDebuggingEnabled(com.webobjects.appserver.WOSession s)
           
static java.lang.Object d2wContextValueForKey(java.lang.String key, java.lang.String entityName)
           
static java.lang.Object d2wContextValueForKey(java.lang.String key, java.lang.String entityName, com.webobjects.foundation.NSDictionary extraValuesForContext)
           
static boolean d2wDebuggingEnabled(com.webobjects.appserver.WOSession s)
           
static boolean d2wPropertyKeyDebuggingEnabled(com.webobjects.appserver.WOSession s)
           
static boolean detailedPageMetricsEnabled()
           
static com.webobjects.foundation.NSArray displayableArrayForKeyPathArray(com.webobjects.foundation.NSArray array, java.lang.String entityForReportName)
           
static java.lang.String displayNameForPropertyKey(java.lang.String key, java.lang.String entityName)
           
static com.webobjects.appserver.WOComponent errorPageForException(java.lang.Throwable e, com.webobjects.appserver.WOSession session)
          Deprecated. use ERD2WFactory.erFactory().errorPageForException(Throwable e, WOSession session)
 void finishInitialization()
          Overridden by subclasses to provide framework initialization.
static com.webobjects.foundation.NSMutableDictionary informationForContext(com.webobjects.appserver.WOContext context)
          Gathers D2W-related information from the current context.
static com.webobjects.foundation.NSMutableDictionary informationForD2WContext(com.webobjects.directtoweb.D2WContext d2wContext)
          Gathers D2W-related information from the current context.
static com.webobjects.appserver.WOComponent pageForTaskSubTaskAndEntityNamed(java.lang.String task, java.lang.String subtask, java.lang.String entityName, com.webobjects.appserver.WOSession session)
          Deprecated. use ERD2WFactory.erFactory().pageForTaskSubTaskAndEntityNamed(String task, String subtask, String entityName, WOSession session)
static boolean pageMetricsEnabled()
           
static com.webobjects.appserver.WOComponent printerFriendlyPageForD2WContext(com.webobjects.directtoweb.D2WContext context, com.webobjects.appserver.WOSession session)
          Deprecated. use ERD2WFactory.erFactory().printerFriendlyPageForD2WContext(D2WContext context, WOSession session)
static com.webobjects.directtoweb.QueryPageInterface queryPageWithFetchSpecificationForEntityNamed(java.lang.String fsName, java.lang.String entityName, com.webobjects.appserver.WOSession session)
          Deprecated. use ERD2WFactory.erFactory().queryPageWithFetchSpecificationForEntityNamed(String fsName, String entityName, WOSession session)
static void reportException(java.lang.Exception ex, com.webobjects.directtoweb.D2WContext d2wContext)
          Logs some debugging info and and throws a D2WException that wraps the original exception.
 void resetModel(com.webobjects.foundation.NSNotification n)
           
static java.lang.String resolveUnit(java.lang.String userInfoUnitString, com.webobjects.eocontrol.EOEnterpriseObject object, java.lang.String prefixKeyPath)
           
static void setD2wComponentNameDebuggingEnabled(com.webobjects.appserver.WOSession s, boolean enabled)
           
static void setD2wDebuggingEnabled(com.webobjects.appserver.WOSession s, boolean enabled)
           
static void setD2wPropertyKeyDebuggingEnabled(com.webobjects.appserver.WOSession s, boolean enabled)
           
static void setDetailedPageMetricsEnabled(boolean value)
           
static void setPageMetricsEnabled(boolean value)
           
static boolean shouldRaiseException(boolean defaultValue)
          Checks the system property er.directtoweb.ERDirectToWeb.shouldRaiseExceptions.
static com.webobjects.foundation.NSArray<com.webobjects.eocontrol.EOSortOrdering> sortOrderings(com.webobjects.directtoweb.D2WContext d2wContext)
          Returns a valid sort ordering based on the defaultSortOrdering key.
 void sortRules(com.webobjects.foundation.NSNotification n)
           
static java.lang.String userInfoUnit(com.webobjects.eocontrol.EOEnterpriseObject object, java.lang.String key)
           
static void warmUpRuleCache()
           
 
Methods inherited from class er.extensions.ERXFrameworkPrincipal
didFinishInitialization, initialize, setUpFrameworkPrincipalClass, sharedInstance, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

REQUIRES

public static final java.lang.Class[] REQUIRES

log

public static final org.apache.log4j.Logger log
logging support


D2WDEBUGGING_ENABLED_KEY

public static final java.lang.String D2WDEBUGGING_ENABLED_KEY
See Also:
Constant Field Values

D2WDISPLAY_COMPONENTNAMES_KEY

public static final java.lang.String D2WDISPLAY_COMPONENTNAMES_KEY
See Also:
Constant Field Values

D2WDISPLAY_PROPERTYKEYS_KEY

public static final java.lang.String D2WDISPLAY_PROPERTYKEYS_KEY
See Also:
Constant Field Values

D2WDISPLAY_PAGE_METRICS_KEY

public static final java.lang.String D2WDISPLAY_PAGE_METRICS_KEY
See Also:
Constant Field Values

D2WDISPLAY_DETAILED_PAGE_METRICS_KEY

public static final java.lang.String D2WDISPLAY_DETAILED_PAGE_METRICS_KEY
See Also:
Constant Field Values

debugLog

public static final org.apache.log4j.Logger debugLog

componentNameLog

public static final org.apache.log4j.Logger componentNameLog

propertyKeyLog

public static final org.apache.log4j.Logger propertyKeyLog

D2WCONTEXT_SELECTOR

public static final com.webobjects.foundation.NSSelector D2WCONTEXT_SELECTOR

trace

public static org.apache.log4j.Logger trace
Constructor Detail

ERDirectToWeb

public ERDirectToWeb()
Method Detail

finishInitialization

public void finishInitialization()
Description copied from class: ERXFrameworkPrincipal
Overridden by subclasses to provide framework initialization.

Specified by:
finishInitialization in class ERXFrameworkPrincipal

resetModel

public void resetModel(com.webobjects.foundation.NSNotification n)

sortRules

public void sortRules(com.webobjects.foundation.NSNotification n)

setD2wDebuggingEnabled

public static void setD2wDebuggingEnabled(com.webobjects.appserver.WOSession s,
                                          boolean enabled)

d2wDebuggingEnabled

public static boolean d2wDebuggingEnabled(com.webobjects.appserver.WOSession s)

setD2wComponentNameDebuggingEnabled

public static void setD2wComponentNameDebuggingEnabled(com.webobjects.appserver.WOSession s,
                                                       boolean enabled)

d2wComponentNameDebuggingEnabled

public static boolean d2wComponentNameDebuggingEnabled(com.webobjects.appserver.WOSession s)

setD2wPropertyKeyDebuggingEnabled

public static void setD2wPropertyKeyDebuggingEnabled(com.webobjects.appserver.WOSession s,
                                                     boolean enabled)

d2wPropertyKeyDebuggingEnabled

public static boolean d2wPropertyKeyDebuggingEnabled(com.webobjects.appserver.WOSession s)

pageMetricsEnabled

public static boolean pageMetricsEnabled()

setPageMetricsEnabled

public static void setPageMetricsEnabled(boolean value)

detailedPageMetricsEnabled

public static boolean detailedPageMetricsEnabled()

setDetailedPageMetricsEnabled

public static void setDetailedPageMetricsEnabled(boolean value)

resolveUnit

public static java.lang.String resolveUnit(java.lang.String userInfoUnitString,
                                           com.webobjects.eocontrol.EOEnterpriseObject object,
                                           java.lang.String prefixKeyPath)

convertedPropertyKeyFromString

public static java.lang.String convertedPropertyKeyFromString(java.lang.String s,
                                                              char start,
                                                              char end)
Checks if a given property key is in the format (foo) or [foo] and returns the stripped string.

Parameters:
s - the String to convert
start - the start char
end - the end char to check for
Returns:
stripped String or null if the string does not start with start and ends with end.

convertedPropertyKeyArray

public static com.webobjects.foundation.NSMutableArray convertedPropertyKeyArray(com.webobjects.foundation.NSArray keyArray,
                                                                                 char startChar,
                                                                                 char endChar)
Converts a given array of keys to a format usable for section and tab display. For example ("(foo)", bar, baz) is transformed to a list of ERD2WContainers usable for section display. The format ((foo, bar, baz)) is also understood.

Parameters:
keyArray - the NSArray to convert
startChar - the start char
endChar - the end char to check for
Returns:
nested NSMutableArray.

sortOrderings

public static com.webobjects.foundation.NSArray<com.webobjects.eocontrol.EOSortOrdering> sortOrderings(com.webobjects.directtoweb.D2WContext d2wContext)
Returns a valid sort ordering based on the defaultSortOrdering key.

Parameters:
d2wContext -
Returns:

booleanForKey

public static boolean booleanForKey(com.webobjects.directtoweb.D2WContext context,
                                    java.lang.String key)

userInfoUnit

public static java.lang.String userInfoUnit(com.webobjects.eocontrol.EOEnterpriseObject object,
                                            java.lang.String key)

printerFriendlyPageForD2WContext

public static com.webobjects.appserver.WOComponent printerFriendlyPageForD2WContext(com.webobjects.directtoweb.D2WContext context,
                                                                                    com.webobjects.appserver.WOSession session)
Deprecated. use ERD2WFactory.erFactory().printerFriendlyPageForD2WContext(D2WContext context, WOSession session)


csvExportPageForD2WContext

public static com.webobjects.appserver.WOComponent csvExportPageForD2WContext(com.webobjects.directtoweb.D2WContext context,
                                                                              com.webobjects.appserver.WOSession session)
Deprecated. use ERD2WFactory.erFactory().csvExportPageForD2WContext(D2WContext context, WOSession session)


pageForTaskSubTaskAndEntityNamed

public static com.webobjects.appserver.WOComponent pageForTaskSubTaskAndEntityNamed(java.lang.String task,
                                                                                    java.lang.String subtask,
                                                                                    java.lang.String entityName,
                                                                                    com.webobjects.appserver.WOSession session)
Deprecated. use ERD2WFactory.erFactory().pageForTaskSubTaskAndEntityNamed(String task, String subtask, String entityName, WOSession session)


queryPageWithFetchSpecificationForEntityNamed

public static com.webobjects.directtoweb.QueryPageInterface queryPageWithFetchSpecificationForEntityNamed(java.lang.String fsName,
                                                                                                          java.lang.String entityName,
                                                                                                          com.webobjects.appserver.WOSession session)
Deprecated. use ERD2WFactory.erFactory().queryPageWithFetchSpecificationForEntityNamed(String fsName, String entityName, WOSession session)


errorPageForException

public static com.webobjects.appserver.WOComponent errorPageForException(java.lang.Throwable e,
                                                                         com.webobjects.appserver.WOSession session)
Deprecated. use ERD2WFactory.erFactory().errorPageForException(Throwable e, WOSession session)


reportException

public static void reportException(java.lang.Exception ex,
                                   com.webobjects.directtoweb.D2WContext d2wContext)
Logs some debugging info and and throws a D2WException that wraps the original exception. This is useful when your app fails very deep inside of a repetition of switch components and you need to find out just what the state of the D2WContext is.

Parameters:
ex -
d2wContext -

informationForContext

public static com.webobjects.foundation.NSMutableDictionary informationForContext(com.webobjects.appserver.WOContext context)
Gathers D2W-related information from the current context. This is mainly useful for debugging.

Parameters:
context - the current context
Returns:
a dictionary of D2W-related keys to describe the D2W state of the context.

informationForD2WContext

public static com.webobjects.foundation.NSMutableDictionary informationForD2WContext(com.webobjects.directtoweb.D2WContext d2wContext)
Gathers D2W-related information from the current context. This is mainly useful for debugging.

Parameters:
d2wContext - the D2W context from which to derive the debugging information
Returns:
a dictionary of D2W-related keys to describe the state of the provided D2W context.

shouldRaiseException

public static boolean shouldRaiseException(boolean defaultValue)
Checks the system property er.directtoweb.ERDirectToWeb.shouldRaiseExceptions.

Parameters:
defaultValue -

displayNameForPropertyKey

public static java.lang.String displayNameForPropertyKey(java.lang.String key,
                                                         java.lang.String entityName)

d2wContextValueForKey

public static java.lang.Object d2wContextValueForKey(java.lang.String key,
                                                     java.lang.String entityName)

d2wContextValueForKey

public static java.lang.Object d2wContextValueForKey(java.lang.String key,
                                                     java.lang.String entityName,
                                                     com.webobjects.foundation.NSDictionary extraValuesForContext)

createConfigurationForEntityNamed

public static java.lang.String createConfigurationForEntityNamed(java.lang.String entityName)

warmUpRuleCache

public static void warmUpRuleCache()

configureTraceRuleFiring

public void configureTraceRuleFiring(com.webobjects.foundation.NSNotification n)

configureTraceRuleFiring

public static void configureTraceRuleFiring()

displayableArrayForKeyPathArray

public static com.webobjects.foundation.NSArray displayableArrayForKeyPathArray(com.webobjects.foundation.NSArray array,
                                                                                java.lang.String entityForReportName)

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.