Project Wonder 2.0

er.directtoweb
Class ERD2WModel

java.lang.Object
  extended bycom.webobjects.directtoweb.D2WModel
      extended byer.directtoweb.ERD2WModel
All Implemented Interfaces:
EOKeyValueArchiving

public class ERD2WModel
extends D2WModel

Overhaul of the caching system.


Nested Class Summary
static class ERD2WModel._PatchedRule
          Rule class that works around two problems: when you have an assignment class that is not present in the classpath then the model will not load, making for very strange errors.
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving._NullValueSupport, EOKeyValueArchiving._NumberSupport, EOKeyValueArchiving._TimestampSupport, EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
protected  File _currentFile
           
protected  Hashtable _filePathRuleTraceCache
           
protected  Hashtable _uniqueAndQualifiers
           
protected  Hashtable _uniqueAssignments
           
protected  Hashtable _uniqueKeyValueQualifiers
           
protected  Hashtable _uniqueNotQualifiers
           
protected  Hashtable _uniqueOrQualifiers
           
protected static String ATTRIBUTE_PREFIX
           
protected static String ENTITY_PREFIX
           
static ERXLogger log
          logging support
static String ModelWillReset
           
protected static String RELATIONSHIP_PREFIX
           
static ERXLogger ruleDecodeLog
          logs rules being decoded
static ERXLogger ruleTraceEnabledLog
          main category for enabling or disabling tracing of rules
protected  int totalQualifiers
           
protected  int uniquedQualifiers
           
static String WillSortRules
           
 
Fields inherited from class com.webobjects.directtoweb.D2WModel
_PageWrapperNameKey, _tasks, ActionsKey, AllMarker, AllowCollapsingKey, AlternateRowColorKey, AttributeKey, AttributeTypeKey, BackgroundColorForPageKey, BackgroundColorForTableKey, BoldKey, ColorKey, ComponentAvailableKey, ComponentNameKey, ComponentsToShowAtEndKey, CustomTypeKey, DisplayNameForPropertyKey, DisplayPropertyKeysKey, DummyTrueKey, DynamicPageKey, EntityKey, FormatterKey, FrameKey, FramesActiveKey, IsGeneratingKey, ItalicKey, KeyPathTypeKey, KeyWhenRelationshipKey, LengthKey, LookKey, NoneMarker, One, PageAvailableKey, PageNameKey, PropertyIsKeyPathKey, PropertyKey, PropertyKeyKey, PropertyKeyPortionInModelKey, PropertyTypeKey, ReadOnlyEntityNamesKey, RelationshipKey, RelationshipTypeKey, RequiresEntityKey, SessionKey, ShowBannerKey, StartupEntityNameKey, StartupTaskKey, TargetKey, TaskKey, VisibleEntityNamesKey, WebAssistantPageNameKey, Zero
 
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving
_CLASS
 
Constructor Summary
protected ERD2WModel(EOKeyValueUnarchiver unarchiver)
           
protected ERD2WModel(File file)
           
protected ERD2WModel(NSArray rules)
          Main constructor.
 
Method Summary
 void addRule(Rule rule)
           
 void addRules(NSArray rules)
           
protected  EOAndQualifier andQualifierInCache(EOAndQualifier q)
           
protected  Assignment assignmentContainedInVector(Assignment a1, Vector v)
           
protected  Hashtable cacheFromBytes(byte[] bytes)
           
protected  byte[] cacheToBytes(Hashtable cache)
           
 NSArray canidateRuleSetForRHSInContext(String rhs, D2WContext context)
           
protected  File currentFile()
           
protected  Object decodeObject(Object o)
           
protected  String descriptionForRule(Rule r)
           
protected  String descriptionForRuleSet(NSArray set)
           
protected static NSDictionary dictionaryFromFile(File file)
           
 void dumpCache(String fileName)
          Means to dump the cache.
protected  Object encodeObject(Object o)
           
static ERD2WModel erDefaultModel()
          Gets the default D2W model cast as an ERD2WModel.
protected  Object fireRuleForKeyPathInContext(String keyPath, D2WContext context)
           
protected  Object fireSystemRuleForKeyPathInContext(String keyPath, D2WContext context)
           
protected  void flushUniqueCache()
           
protected  void invalidateCaches()
           
protected  EOKeyValueQualifier keyValueQualifierInCache(EOKeyValueQualifier q)
           
protected  void mergeFile(File modelFile)
           
protected  void mergePathURL(URL modelURL)
           
 Vector modelFilesInBundles()
           
 String nameForSet(NSSet set)
           
protected  EONotQualifier notQualifierInCache(EONotQualifier q)
           
protected  EOOrQualifier orQualifierInCache(EOOrQualifier q)
           
 void prepareDataStructures()
           
protected  EOQualifier qualifierContainedInEnumeration(EOQualifierEvaluation q1, Enumeration e)
           
protected  EOQualifier qualifierInCache(EOQualifier q)
           
protected  ERXMultiKey readEntry(Hashtable cache, ObjectInputStream in)
           
 void removeRule(Rule rule)
           
 void resetModel()
           
 void restoreCache(String fileName)
          Means to restore the cache.
 NSArray rules()
           
protected  void setCurrentFile(File currentFile)
           
protected  void sortRules()
           
protected  void uniqueQualifiers(NSArray rules)
           
protected  void uniqueRuleAssignments(NSArray rules)
           
protected  boolean writeEntry(ERXMultiKey key, Object value, ObjectOutputStream out)
           
 
Methods inherited from class com.webobjects.directtoweb.D2WModel
_fireRule, addRuleToItsBucket, addRuleTrace, candidates, canSaveUserModel, checkPossibilityToSaveUserModel, checkRules, clientConfiguration, clientConfigurationFilesInBundles, clientConfigurationFilesPathURLsInBundles, componentDefinitions, createWebAssistantRulesWithSettings, dataTypesInvolved, defaultModel, dirty, dynamicPages, editors, encodeWebAssistantRulesWithKeyValueArchiver, encodeWithKeyValueArchiver, fireAllRulesForKeyPathInContext, inferrableKeys, initializeClientConfiguration, isPageStatic, loadRules, modelFilesPathURLsInBundles, nameFromFrameworkBundle, newSettings, pageRuleKeysForPage, pageRuleKeysFromClientConfiguration, propertyRuleKeysForComponents, propertyRuleKeysFromClientConfiguration, removeAllWebAssistantRules, removeDynamicPage, removeWebAssistantRulesWithSameContextAsSettings, revertWebAssistantRules, saveWebAssistantRulesIntoUsedModelFile, setDefaultModel, setDirty, setRules, tasks, taskVector, toFile, toString, typeForRuleKey, updateUserSettingsForNewPageAvailableRule, userClientConfigurationFile, userClientConfigurationFilePathURL, userModelFile, userModelFilePathURL, webAssistantRulesForSave
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support


ruleDecodeLog

public static final ERXLogger ruleDecodeLog
logs rules being decoded


ruleTraceEnabledLog

public static final ERXLogger ruleTraceEnabledLog
main category for enabling or disabling tracing of rules


WillSortRules

public static final String WillSortRules
See Also:
Constant Field Values

ModelWillReset

public static final String ModelWillReset
See Also:
Constant Field Values

_filePathRuleTraceCache

protected Hashtable _filePathRuleTraceCache

_currentFile

protected File _currentFile

_uniqueAssignments

protected Hashtable _uniqueAssignments

uniquedQualifiers

protected int uniquedQualifiers

totalQualifiers

protected int totalQualifiers

_uniqueAndQualifiers

protected Hashtable _uniqueAndQualifiers

_uniqueOrQualifiers

protected Hashtable _uniqueOrQualifiers

_uniqueNotQualifiers

protected Hashtable _uniqueNotQualifiers

_uniqueKeyValueQualifiers

protected Hashtable _uniqueKeyValueQualifiers

ENTITY_PREFIX

protected static final String ENTITY_PREFIX
See Also:
Constant Field Values

RELATIONSHIP_PREFIX

protected static final String RELATIONSHIP_PREFIX
See Also:
Constant Field Values

ATTRIBUTE_PREFIX

protected static final String ATTRIBUTE_PREFIX
See Also:
Constant Field Values
Constructor Detail

ERD2WModel

protected ERD2WModel(NSArray rules)
Main constructor. Builds a model for a given set of rules.

Parameters:
rules - array of rules

ERD2WModel

protected ERD2WModel(File file)

ERD2WModel

protected ERD2WModel(EOKeyValueUnarchiver unarchiver)
Method Detail

erDefaultModel

public static ERD2WModel erDefaultModel()
Gets the default D2W model cast as an ERD2WModel.

Returns:
the default ERD2Model

sortRules

protected void sortRules()

rules

public NSArray rules()

addRule

public void addRule(Rule rule)

removeRule

public void removeRule(Rule rule)

descriptionForRuleSet

protected String descriptionForRuleSet(NSArray set)

descriptionForRule

protected String descriptionForRule(Rule r)

addRules

public void addRules(NSArray rules)

fireRuleForKeyPathInContext

protected Object fireRuleForKeyPathInContext(String keyPath,
                                             D2WContext context)

dumpCache

public void dumpCache(String fileName)
Means to dump the cache. You shouldn't use this unless you know what you are doing.


restoreCache

public void restoreCache(String fileName)
Means to restore the cache. You shouldn't use this unless you know what you are doing.


canidateRuleSetForRHSInContext

public NSArray canidateRuleSetForRHSInContext(String rhs,
                                              D2WContext context)

fireSystemRuleForKeyPathInContext

protected Object fireSystemRuleForKeyPathInContext(String keyPath,
                                                   D2WContext context)

prepareDataStructures

public void prepareDataStructures()

invalidateCaches

protected void invalidateCaches()

resetModel

public void resetModel()

setCurrentFile

protected void setCurrentFile(File currentFile)

currentFile

protected File currentFile()

dictionaryFromFile

protected static NSDictionary dictionaryFromFile(File file)

mergePathURL

protected void mergePathURL(URL modelURL)

mergeFile

protected void mergeFile(File modelFile)

uniqueRuleAssignments

protected void uniqueRuleAssignments(NSArray rules)

assignmentContainedInVector

protected Assignment assignmentContainedInVector(Assignment a1,
                                                 Vector v)

uniqueQualifiers

protected void uniqueQualifiers(NSArray rules)

modelFilesInBundles

public Vector modelFilesInBundles()

qualifierContainedInEnumeration

protected EOQualifier qualifierContainedInEnumeration(EOQualifierEvaluation q1,
                                                      Enumeration e)

qualifierInCache

protected EOQualifier qualifierInCache(EOQualifier q)

andQualifierInCache

protected EOAndQualifier andQualifierInCache(EOAndQualifier q)

orQualifierInCache

protected EOOrQualifier orQualifierInCache(EOOrQualifier q)

notQualifierInCache

protected EONotQualifier notQualifierInCache(EONotQualifier q)

keyValueQualifierInCache

protected EOKeyValueQualifier keyValueQualifierInCache(EOKeyValueQualifier q)

flushUniqueCache

protected void flushUniqueCache()

nameForSet

public String nameForSet(NSSet set)

encodeObject

protected Object encodeObject(Object o)

decodeObject

protected Object decodeObject(Object o)

writeEntry

protected boolean writeEntry(ERXMultiKey key,
                             Object value,
                             ObjectOutputStream out)
                      throws IOException
Throws:
IOException

readEntry

protected ERXMultiKey readEntry(Hashtable cache,
                                ObjectInputStream in)
                         throws IOException,
                                ClassNotFoundException
Throws:
IOException
ClassNotFoundException

cacheToBytes

protected byte[] cacheToBytes(Hashtable cache)

cacheFromBytes

protected Hashtable cacheFromBytes(byte[] bytes)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.