| 
 | WebObjects 5.2.3 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.webobjects.directtoweb.D2WModel
The D2WModel class manages a set of rules for a Direct to Web application. It provides support for file input/output, as well as for the Web Assistant.
The implementation is subject to change in future releases.
Rule| Nested Class Summary | 
| Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving | 
| EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support | 
| Field Summary | |
| static String | ActionsKeyThe actions key. | 
| static String | AllMarkerA constant that represents a wildcard, for example, "any task." | 
| static String | AllowCollapsingKeyThe allow collapsing key; the literal "allowCollapsing". | 
| static String | AlternateRowColorKeyThe alternate row color key; the literal "alternateRowColor". | 
| static String | AttributeKeyThe attribute key. | 
| static String | AttributeTypeKeyThe attribute type key; the literal "a". | 
| static String | BackgroundColorForPageKeyThe background-color-for-page key; the literal "backgroundColorForPage". | 
| static String | BackgroundColorForTableKeyThe background-color-for-table key; the literal "backgroundColorForTable". | 
| static String | BoldKeyThe bold key. | 
| static String | ColorKeyThe color key. | 
| static String | ComponentAvailableKeyThe component available key; the literal "componentAvailable". | 
| static String | ComponentNameKeyThe component name key; the literal "componentName". | 
| static String | ComponentsToShowAtEndKeyThe components-to-show-at-end-of-list key; the literal "componentsToShowAtEndOfList". | 
| static String | CustomTypeKeyThe custom type key; the literal "c". | 
| static String | DisplayNameForPropertyKeyThe display-name-for-property key; the literal "displayNameForProperty". | 
| static String | DisplayPropertyKeysKeyThe display-property-keys key; the literal "displayPropertyKeys". | 
| static String | DummyTrueKeyThe dummy-true key; the literal "dummyTrue"; for a rule without pre-conditions. | 
| static String | DynamicPageKeyThe dynamic page key; the literal "pageConfiguration". | 
| static String | EntityKeyThe entity key. | 
| static String | FormatterKeyThe formatter key. | 
| static String | FrameKeyThe frame key. | 
| static String | FramesActiveKeyThe frames active key; the literal "framesActive". | 
| static String | IsGeneratingKeyThe is generating key; the literal "isGenerating". | 
| static String | ItalicKeyThe italic key. | 
| static String | KeyPathTypeKeyThe key path type key; the literal "k". | 
| static String | KeyWhenRelationshipKeyThe key-when-relationship key; the literal "keyWhenRelationship". | 
| static String | LengthKeyThe length key. | 
| static String | LookKeyThe look key. | 
| static String | NoneMarkerA constant that represents the lack of a selection. | 
| static Integer | OneA constant that represents a logical true value. | 
| static String | PageAvailableKeyThe page available key; the literal "pageAvailable". | 
| static String | PageNameKeyThe page name key; the literal "pageName". | 
| static String | PropertyIsKeyPathKeyThe property-is-key path key; the literal "propertyIsKeyPath". | 
| static String | PropertyKeyThe property key. | 
| static String | PropertyKeyKeyThe property-key key; the literal "propertyKey". | 
| static String | PropertyKeyPortionInModelKeyThe property-key-portion-in-model key; the literal "propertyKeyPortionInModel". | 
| static String | PropertyTypeKeyThe property type key; the literal "propertyType". | 
| static String | ReadOnlyEntityNamesKeyThe read-only entity names key; the literal "readOnlyEntityNames". | 
| static String | RelationshipKeyThe relationship key. | 
| static String | RelationshipTypeKeyThe relationship type key; the literal "r". | 
| static String | RequiresEntityKeyThe requires entity key; the literal "requiresEntity". | 
| static String | SessionKeyThe session key. | 
| static String | ShowBannerKeyThe show banner key; the literal "showBanner". | 
| static String | StartupEntityNameKeyThe startup entity name key; the literal "startupEntityName". | 
| static String | StartupTaskKeyThe startup task key; the literal "startupTask". | 
| static String | TargetKeyThe target key. | 
| static String | TaskKeyThe task key. | 
| static String | VisibleEntityNamesKeyThe visible entity names key; the literal "visibleEntityNames". | 
| static String | WebAssistantPageNameKeyThe Web Assistant page name key; the literal "webAssistantPageName". | 
| static Integer | ZeroA constant that represents a logical false value. | 
| Constructor Summary | |
| protected  | D2WModel(EOKeyValueUnarchiver unarchiver)Creates an instance of D2WModel with the specified unarchiver. | 
| protected  | D2WModel(File f)Creates an instance of D2WModel with the specified file. | 
| protected  | D2WModel(NSArray rules)Creates an instance of D2WModel with the specified rules. | 
| protected  | D2WModel(URL url)Creates an instance of D2WModel from the contents of the specified URL. | 
| Method Summary | |
| protected  void | addRule(Rule newRule)Adds the specified rule; dirties the model. | 
| protected  void | addRules(NSArray extraRules)Invokes the addRulemethod on each of the specified rules. | 
| protected  void | addRuleToItsBucket(Rule r)Adds the specified rule to the local rule caches. | 
| protected  void | addRuleTrace(Rule newRule)Invokes the addRulemethod and logs a trace. | 
| protected  Vector | candidates(String keyPath,
           D2WContext context)Gets rules from the local rule caches for the specified key path. | 
|  boolean | canSaveUserModel()Indicates whether the user model can be saved, that is, whether the user model is the project bundle. | 
|  boolean | checkPossibilityToSaveUserModel(boolean throwp)Calculates whether it is possible to save the user model. | 
|  void | checkRules()Checks the rules. | 
|  Hashtable | clientConfiguration()Gets the client configuration. | 
|  Vector | clientConfigurationFilesInBundles()Deprecated. use clientConfigurationFilesPathURLsInBundles instead | 
|  Vector | clientConfigurationFilesPathURLsInBundles()Gets the client configuration files in bundles. | 
|  Hashtable | componentDefinitions()Gets the component definitions. | 
| protected  void | createWebAssistantRulesWithSettings(ServerSideSettings settings)Creates Web Assistant rules with the specified settings. | 
| protected  Vector | dataTypesInvolved()Gets the data types involved for the rules. | 
| static D2WModel | defaultModel()Gets the default model. | 
|  boolean | dirty()Indicates whether rules have been added to or removed from the model since the last merge or saving or reverting of the Web Assistant rules. | 
| protected  Vector | dynamicPages()Gets a list of all the dynamic pages found in the model. | 
|  Hashtable | editors()Gets the editors. | 
| protected  NSDictionary | encodeWebAssistantRulesWithKeyValueArchiver(EOKeyValueArchiver archiver)Encodes the Web Assistant rules with the specified key-value archiver. | 
|  void | encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)Asks the receiver to archive its state into the EOKeyValueArchiver archiver. | 
| protected  Vector | fireAllRulesForKeyPathInContext(String keyPath,
                                D2WContext context)Fires all candidate rules for the specified key path that can fire in the specified context; aggregates the results of all firings. | 
| protected  Object | fireRuleForKeyPathInContext(String keyPath,
                            D2WContext context)Fires the first candidate rule for the specified key path that can fire in the specified context. | 
| protected  Object | fireSystemRuleForKeyPathInContext(String keyPath,
                                  D2WContext context)Fires the first candidate rule for the specified key path that can fire in the specified context but is not authored by the Web Assistant. | 
|  Hashtable | inferrableKeys()Gets the inferrable keys. | 
| protected  void | initializeClientConfiguration()Intializes the client configuration. | 
| protected  void | invalidateCaches()Clears the local caches of dynamic pages and rules. | 
|  boolean | isPageStatic(String pageName,
             D2WContext aContext)Indicates whether the page with the specified name is static in the specified context. | 
|  void | loadRules()Loads the rules. | 
| protected  void | mergeFile(File modelFile)Deprecated. use mergePathURL instead | 
| protected  void | mergePathURL(URL modelPathURL)Adds the rules from the specified model file path URL; dirties the model. | 
|  Vector | modelFilesInBundles()Deprecated. use modelFilesPathURLsInBundles instead | 
|  Vector | modelFilesPathURLsInBundles()Gets the model files in the bundles | 
| static String | nameFromFrameworkBundle(NSBundle bundle)Gets the name of the specified framework bundle. | 
| protected  void | newSettings(ServerSideSettings settings)Updates the model with the specified settings. | 
|  Vector | pageRuleKeysForPage(String pageName)Gets the page rule keys for the specified page. | 
|  Vector | pageRuleKeysFromClientConfiguration()Gets the page rule keys from the client configuration. | 
|  Vector | propertyRuleKeysForComponents(Vector componentsAvailable)Gets the property rule keys for the specified components. | 
|  Vector | propertyRuleKeysFromClientConfiguration()Gets the property rule keys from the client configuration. | 
| protected  void | removeAllWebAssistantRules()Removes all of the Web Assistant rules. | 
| protected  void | removeDynamicPage(ServerSideSettings settings)Removes the Web Assistant rules with the same context as the specified settings if the specified settings are for a dynamic page. | 
| protected  void | removeRule(Rule rule)Removes the specified rule; dirties the model. | 
| protected  void | removeWebAssistantRulesWithSameContextAsSettings(com.apple.client.directtoweb.common.Settings settings)Removes the Web Assistant rules that have the same context as the specified settings. | 
| protected  void | revertWebAssistantRules()Reverts the Web Assistant rules; un-dirties the model. | 
| protected  NSArray | rules()Gets the rules. | 
| protected  void | saveWebAssistantRulesIntoUsedModelFile()Saves Web Assistant rules in the used model file. | 
| static void | setDefaultModel(D2WModel newModel)Sets the default model to the specified value. | 
| protected  void | setDirty(boolean newValue)Sets whether the model is dirty to the specified value. | 
| protected  void | setRules(NSArray newRules)Sets the rules to the specified value; sorts the rules. | 
| protected  void | sortRules()Invalidates caches. | 
| protected  Enumeration | tasks()Get an enumeration of the tasks in the model. | 
| protected  Vector | taskVector()Gets a list of all tasks found in the model. | 
| protected  void | toFile(File f)Writes the dictionary of the key-value archiver to the specified file. | 
|  String | toString() | 
|  String | typeForRuleKey(String key)Gets the type for the specified rule key. | 
|  void | updateUserSettingsForNewPageAvailableRule(ServerSideSettings settings,
                                          String dtwComponentName)Updates user settings for a new page available rule. | 
|  File | userClientConfigurationFile()Deprecated. use userClientConfigurationFilePathURL instead | 
|  URL | userClientConfigurationFilePathURL()Gets the user client configuration file. | 
|  File | userModelFile()Deprecated. use userModelFilePathURL instead. | 
|  URL | userModelFilePathURL()Gets the user model file. | 
| protected  NSArray | webAssistantRulesForSave()Gets the Web Assistant rules for saving. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
public static final String ActionsKey
public static final String AllMarker
Rule.hasSameSettingsAs(Settings, boolean), 
Settings.AllMarkerpublic static final String AllowCollapsingKey
public static final String AlternateRowColorKey
public static final String AttributeKey
public static final String AttributeTypeKey
public static final String BackgroundColorForPageKey
public static final String BackgroundColorForTableKey
public static final String BoldKey
public static final String ColorKey
public static final String ComponentAvailableKey
public static final String ComponentNameKey
public static final String ComponentsToShowAtEndKey
public static final String CustomTypeKey
public static final String DisplayNameForPropertyKey
public static final String DisplayPropertyKeysKey
public static final String DummyTrueKey
ServerSideSettings.dummyTrueQualifierpublic static final String DynamicPageKey
public static final String EntityKey
public static final String FormatterKey
public static final String FrameKey
public static final String FramesActiveKey
public static final String IsGeneratingKey
public static final String ItalicKey
public static final String KeyPathTypeKey
public static final String KeyWhenRelationshipKey
public static final String LengthKey
public static final String LookKey
public static final String NoneMarker
AllMarker, 
Settings.NoneMarkerpublic static final Integer One
Zero, 
BooleanAssignmentpublic static final String PageAvailableKey
public static final String PageNameKey
public static final String PropertyIsKeyPathKey
public static final String PropertyKey
public static final String PropertyKeyKey
public static final String PropertyKeyPortionInModelKey
public static final String PropertyTypeKey
public static final String ReadOnlyEntityNamesKey
public static final String RelationshipKey
public static final String RelationshipTypeKey
public static final String RequiresEntityKey
public static final String SessionKey
public static final String ShowBannerKey
public static final String StartupEntityNameKey
public static final String StartupTaskKey
public static final String TargetKey
public static final String TaskKey
public static final String VisibleEntityNamesKey
public static final String WebAssistantPageNameKey
public static final Integer Zero
One, 
BooleanAssignment| Constructor Detail | 
protected D2WModel(File f)
f - instance of java.io.FileD2WModel(EOKeyValueUnarchiver)protected D2WModel(URL url)
url - instance of java.io.URLD2WModel(EOKeyValueUnarchiver)protected D2WModel(EOKeyValueUnarchiver unarchiver)
unarchiver - instance of EOKeyValueUnarchiverD2WModel(NSArray)protected D2WModel(NSArray rules)
rules - instance of NSArraysetRules(NSArray)| Method Detail | 
protected void addRule(Rule newRule)
newRule - instance of Rulerules(), 
setDirty(boolean), 
removeRule(Rule)protected void addRuleToItsBucket(Rule r)
r - instance of RulesortRules(), 
createWebAssistantRulesWithSettings(ServerSideSettings)protected void addRuleTrace(Rule newRule)
addRule method and logs a trace.
newRule - instance of RuleaddRule(Rule)protected void addRules(NSArray extraRules)
addRule method on each of the specified rules.
extraRules - instance of NSArrayaddRule(Rule), 
mergeFile(File)public boolean canSaveUserModel()
checkPossibilityToSaveUserModel(boolean)
protected Vector candidates(String keyPath,
                            D2WContext context)
keyPath - the key pathcontext - instance of D2WContext - ignored
java.util.VectoraddRuleToItsBucket(Rule), 
invalidateCaches()public boolean checkPossibilityToSaveUserModel(boolean throwp)
throwp - whether to forward or quietly log an exception
IllegalStateException - if the web assistant is enabled,
            the user model is not in the project bundle, and throwp argument is truecanSaveUserModel()public void checkRules()
The reload will abort if there are rules modified by the Web Assistant that have yet to be saved.
modelFilesInBundles(), 
clientConfigurationFilesInBundles(), 
userClientConfigurationFile(), 
userModelFile(), 
initializeClientConfiguration(), 
loadRules()public Hashtable clientConfiguration()
java.util.HashtableinitializeClientConfiguration()public Vector clientConfigurationFilesInBundles()
java.util.VectornameFromFrameworkBundle(NSBundle)public Vector clientConfigurationFilesPathURLsInBundles()
java.util.VectornameFromFrameworkBundle(NSBundle)public Hashtable componentDefinitions()
java.util.Hashtableprotected void createWebAssistantRulesWithSettings(ServerSideSettings settings)
settings - instance of ServerSideSettingspageRuleKeysForPage(String), 
propertyRuleKeysForComponents(Vector), 
propertyRuleKeysFromClientConfiguration(), 
pageRuleKeysFromClientConfiguration()protected Vector dataTypesInvolved()
java.util.Vectorrules(), 
Rule.dataTypesInvolved()public static D2WModel defaultModel()
setDefaultModel(D2WModel)public boolean dirty()
setDirty(boolean), 
mergeFile(File), 
addRule(Rule), 
removeRule(Rule), 
saveWebAssistantRulesIntoUsedModelFile(), 
revertWebAssistantRules(), 
removeWebAssistantRulesWithSameContextAsSettings(Settings)protected Vector dynamicPages()
The current implementation caches the values.
The implementation is subject to change in future releases.
java.util.VectorinvalidateCaches()public Hashtable editors()
java.util.Hashtableprotected NSDictionary encodeWebAssistantRulesWithKeyValueArchiver(EOKeyValueArchiver archiver)
archiver - instance of EOKeyValueArchiver
webAssistantRulesForSave()public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
EOKeyValueArchivingarchiver.
encodeWithKeyValueArchiver in interface EOKeyValueArchivingarchiver - the EOKeyValueArchiverEOKeyValueArchiver
protected Vector fireAllRulesForKeyPathInContext(String keyPath,
                                                 D2WContext context)
keyPath - the key pathcontext - instance of D2WContext
java.util.Vectorcandidates(String, D2WContext), 
fireRuleForKeyPathInContext(String, D2WContext), 
Rule.canFireInContext(D2WContext), 
Rule.fire(D2WContext)
protected Object fireRuleForKeyPathInContext(String keyPath,
                                             D2WContext context)
keyPath - the key pathcontext - instance of D2WContext
fireSystemRuleForKeyPathInContext(String, D2WContext), 
fireAllRulesForKeyPathInContext(String, D2WContext)
protected Object fireSystemRuleForKeyPathInContext(String keyPath,
                                                   D2WContext context)
keyPath - the key pathcontext - instance of D2WContext
fireRuleForKeyPathInContext(String, D2WContext)public Hashtable inferrableKeys()
java.util.Hashtableprotected void initializeClientConfiguration()
clientConfiguration()protected void invalidateCaches()
dynamicPages(), 
addRuleToItsBucket(Rule), 
candidates(String, D2WContext)
public boolean isPageStatic(String pageName,
                            D2WContext aContext)
The current implementation checks the client configuration; an entry
 implies the page is dynamic.  Then checks pageAvailable
 rules, which refer to non-static pages.  Finally checks whether the page
 is in the application wrapper which implies the page is static.
The implementation is subject to change in future releases.
pageName - the name of the pageaContext - instance of D2WContext
NullPointerException - if the client configuration information
            for components cannot be foundcandidates(String, D2WContext)public void loadRules()
modelFilesInBundles(), 
mergeFile(File), 
clientConfigurationFilesInBundles(), 
userClientConfigurationFile(), 
userModelFile()protected void mergeFile(File modelFile)
modelFile - instance of java.io.FileaddRules(NSArray), 
setDirty(boolean)protected void mergePathURL(URL modelPathURL)
modelPathURL - instance of java.net.URLaddRules(NSArray), 
setDirty(boolean)public Vector modelFilesInBundles()
java.util.Vector
IllegalStateException - if the model files in the Direct To Web
            framework cannot be foundnameFromFrameworkBundle(NSBundle)public Vector modelFilesPathURLsInBundles()
java.util.Vector
IllegalStateException - if the model files in the Direct To Web
            framework cannot be foundnameFromFrameworkBundle(NSBundle)public static String nameFromFrameworkBundle(NSBundle bundle)
bundle - instance of NSBundle
protected void newSettings(ServerSideSettings settings)
The current implementation sets the current rules and creates Web Assistant rules depending on the settings.
The implementation is subject to change in future releases.
settings - instance of ServerSideSettingsrules(), 
setRules(NSArray), 
createWebAssistantRulesWithSettings(ServerSideSettings)public Vector pageRuleKeysForPage(String pageName)
pageName - the name of the page
java.util.Vectorpublic Vector pageRuleKeysFromClientConfiguration()
java.util.VectorclientConfiguration(), 
editors()public Vector propertyRuleKeysForComponents(Vector componentsAvailable)
componentsAvailable - instance of java.util.Vector
java.util.Vector
IllegalStateException - if a component has not been defined
            in the client configuration property list filepublic Vector propertyRuleKeysFromClientConfiguration()
The current implementation caches the keys.
The implementation is subject to change in future releases.
java.util.Vectoreditors()protected void removeAllWebAssistantRules()
rules(), 
setRules(NSArray), 
removeWebAssistantRulesWithSameContextAsSettings(Settings)protected void removeDynamicPage(ServerSideSettings settings)
settings - instance of ServerSideSettingsremoveWebAssistantRulesWithSameContextAsSettings(Settings), 
Settings.forADynamicPage()protected void removeRule(Rule rule)
rule - instance of Rulerules(), 
setDirty(boolean), 
addRule(Rule)protected void removeWebAssistantRulesWithSameContextAsSettings(com.apple.client.directtoweb.common.Settings settings)
settings - instance of Settingsrules(), 
setRules(NSArray), 
setDirty(boolean), 
removeAllWebAssistantRules()protected void revertWebAssistantRules()
The current implementation removes all Web Assistant rules, merges the user model file, and sorts the rules.
The implementation is subject to change in future releases.
removeAllWebAssistantRules(), 
mergeFile(File), 
userModelFile(), 
sortRules(), 
setDirty(boolean)protected NSArray rules()
setRules(NSArray)protected void saveWebAssistantRulesIntoUsedModelFile()
public static void setDefaultModel(D2WModel newModel)
newModel - instance of D2WModeldefaultModel()protected void setDirty(boolean newValue)
newValue - booleandirty()protected void setRules(NSArray newRules)
newRules - instance of NSArrayrules(), 
sortRules()protected void sortRules()
invalidateCaches()protected Vector taskVector()
java.util.Vectortasks()protected Enumeration tasks()
java.util.EnumerationtaskVector()
protected void toFile(File f)
               throws IOException
f - instance of java.io.File
IOException - if the archive dictionary cannot be writtenencodeWithKeyValueArchiver(EOKeyValueArchiver)public String toString()
public final String typeForRuleKey(String key)
key - the key
public void updateUserSettingsForNewPageAvailableRule(ServerSideSettings settings,
                                                      String dtwComponentName)
The current implementation adds the page available rule to the model, updates the client configuration property list file, and updates the memory caches so that the settings take effect.
The implementation is subject to change in future releases.
settings - instance of ServerSideSettingsdtwComponentName - name of the Direct to Web component
NSForwardException - if there is an error reading from or
            writing to the client configuration property list fileaddRuleTrace(Rule), 
componentDefinitions(), 
clientConfiguration()public File userClientConfigurationFile()
java.io.Filepublic URL userClientConfigurationFilePathURL()
java.net.URLpublic File userModelFile()
java.io.Filepublic URL userModelFilePathURL()
java.net.URLprotected NSArray webAssistantRulesForSave()
| 
 | Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||