WebObjects 5.2.3

com.webobjects.directtoweb
Class D2WModel

java.lang.Object
  extended bycom.webobjects.directtoweb.D2WModel
All Implemented Interfaces:
EOKeyValueArchiving
Direct Known Subclasses:
D2WFastModel

public class D2WModel
extends Object
implements EOKeyValueArchiving

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.

See Also:
Rule

Nested Class Summary
 
Nested classes inherited from class com.webobjects.eocontrol.EOKeyValueArchiving
EOKeyValueArchiving.Awaking, EOKeyValueArchiving.FinishInitialization, EOKeyValueArchiving.Support
 
Field Summary
static String ActionsKey
          The actions key.
static String AllMarker
          A constant that represents a wildcard, for example, "any task."
static String AllowCollapsingKey
          The allow collapsing key; the literal "allowCollapsing".
static String AlternateRowColorKey
          The alternate row color key; the literal "alternateRowColor".
static String AttributeKey
          The attribute key.
static String AttributeTypeKey
          The attribute type key; the literal "a".
static String BackgroundColorForPageKey
          The background-color-for-page key; the literal "backgroundColorForPage".
static String BackgroundColorForTableKey
          The background-color-for-table key; the literal "backgroundColorForTable".
static String BoldKey
          The bold key.
static String ColorKey
          The color key.
static String ComponentAvailableKey
          The component available key; the literal "componentAvailable".
static String ComponentNameKey
          The component name key; the literal "componentName".
static String ComponentsToShowAtEndKey
          The components-to-show-at-end-of-list key; the literal "componentsToShowAtEndOfList".
static String CustomTypeKey
          The custom type key; the literal "c".
static String DisplayNameForPropertyKey
          The display-name-for-property key; the literal "displayNameForProperty".
static String DisplayPropertyKeysKey
          The display-property-keys key; the literal "displayPropertyKeys".
static String DummyTrueKey
          The dummy-true key; the literal "dummyTrue"; for a rule without pre-conditions.
static String DynamicPageKey
          The dynamic page key; the literal "pageConfiguration".
static String EntityKey
          The entity key.
static String FormatterKey
          The formatter key.
static String FrameKey
          The frame key.
static String FramesActiveKey
          The frames active key; the literal "framesActive".
static String IsGeneratingKey
          The is generating key; the literal "isGenerating".
static String ItalicKey
          The italic key.
static String KeyPathTypeKey
          The key path type key; the literal "k".
static String KeyWhenRelationshipKey
          The key-when-relationship key; the literal "keyWhenRelationship".
static String LengthKey
          The length key.
static String LookKey
          The look key.
static String NoneMarker
          A constant that represents the lack of a selection.
static Integer One
          A constant that represents a logical true value.
static String PageAvailableKey
          The page available key; the literal "pageAvailable".
static String PageNameKey
          The page name key; the literal "pageName".
static String PropertyIsKeyPathKey
          The property-is-key path key; the literal "propertyIsKeyPath".
static String PropertyKey
          The property key.
static String PropertyKeyKey
          The property-key key; the literal "propertyKey".
static String PropertyKeyPortionInModelKey
          The property-key-portion-in-model key; the literal "propertyKeyPortionInModel".
static String PropertyTypeKey
          The property type key; the literal "propertyType".
static String ReadOnlyEntityNamesKey
          The read-only entity names key; the literal "readOnlyEntityNames".
static String RelationshipKey
          The relationship key.
static String RelationshipTypeKey
          The relationship type key; the literal "r".
static String RequiresEntityKey
          The requires entity key; the literal "requiresEntity".
static String SessionKey
          The session key.
static String ShowBannerKey
          The show banner key; the literal "showBanner".
static String StartupEntityNameKey
          The startup entity name key; the literal "startupEntityName".
static String StartupTaskKey
          The startup task key; the literal "startupTask".
static String TargetKey
          The target key.
static String TaskKey
          The task key.
static String VisibleEntityNamesKey
          The visible entity names key; the literal "visibleEntityNames".
static String WebAssistantPageNameKey
          The Web Assistant page name key; the literal "webAssistantPageName".
static Integer Zero
          A 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 addRule method 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 addRule method 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

ActionsKey

public static final String ActionsKey
The actions key.


AllMarker

public static final String AllMarker
A constant that represents a wildcard, for example, "any task."

See Also:
Rule.hasSameSettingsAs(Settings, boolean), Settings.AllMarker

AllowCollapsingKey

public static final String AllowCollapsingKey
The allow collapsing key; the literal "allowCollapsing".


AlternateRowColorKey

public static final String AlternateRowColorKey
The alternate row color key; the literal "alternateRowColor".


AttributeKey

public static final String AttributeKey
The attribute key.


AttributeTypeKey

public static final String AttributeTypeKey
The attribute type key; the literal "a".


BackgroundColorForPageKey

public static final String BackgroundColorForPageKey
The background-color-for-page key; the literal "backgroundColorForPage".


BackgroundColorForTableKey

public static final String BackgroundColorForTableKey
The background-color-for-table key; the literal "backgroundColorForTable".


BoldKey

public static final String BoldKey
The bold key.


ColorKey

public static final String ColorKey
The color key.


ComponentAvailableKey

public static final String ComponentAvailableKey
The component available key; the literal "componentAvailable".


ComponentNameKey

public static final String ComponentNameKey
The component name key; the literal "componentName".


ComponentsToShowAtEndKey

public static final String ComponentsToShowAtEndKey
The components-to-show-at-end-of-list key; the literal "componentsToShowAtEndOfList".


CustomTypeKey

public static final String CustomTypeKey
The custom type key; the literal "c".


DisplayNameForPropertyKey

public static final String DisplayNameForPropertyKey
The display-name-for-property key; the literal "displayNameForProperty".


DisplayPropertyKeysKey

public static final String DisplayPropertyKeysKey
The display-property-keys key; the literal "displayPropertyKeys".


DummyTrueKey

public static final String DummyTrueKey
The dummy-true key; the literal "dummyTrue"; for a rule without pre-conditions.

See Also:
ServerSideSettings.dummyTrueQualifier

DynamicPageKey

public static final String DynamicPageKey
The dynamic page key; the literal "pageConfiguration".


EntityKey

public static final String EntityKey
The entity key.


FormatterKey

public static final String FormatterKey
The formatter key.


FrameKey

public static final String FrameKey
The frame key.


FramesActiveKey

public static final String FramesActiveKey
The frames active key; the literal "framesActive".


IsGeneratingKey

public static final String IsGeneratingKey
The is generating key; the literal "isGenerating".


ItalicKey

public static final String ItalicKey
The italic key.


KeyPathTypeKey

public static final String KeyPathTypeKey
The key path type key; the literal "k".


KeyWhenRelationshipKey

public static final String KeyWhenRelationshipKey
The key-when-relationship key; the literal "keyWhenRelationship".


LengthKey

public static final String LengthKey
The length key.


LookKey

public static final String LookKey
The look key.


NoneMarker

public static final String NoneMarker
A constant that represents the lack of a selection.

See Also:
AllMarker, Settings.NoneMarker

One

public static final Integer One
A constant that represents a logical true value.

See Also:
Zero, BooleanAssignment

PageAvailableKey

public static final String PageAvailableKey
The page available key; the literal "pageAvailable".


PageNameKey

public static final String PageNameKey
The page name key; the literal "pageName".


PropertyIsKeyPathKey

public static final String PropertyIsKeyPathKey
The property-is-key path key; the literal "propertyIsKeyPath".


PropertyKey

public static final String PropertyKey
The property key.


PropertyKeyKey

public static final String PropertyKeyKey
The property-key key; the literal "propertyKey".


PropertyKeyPortionInModelKey

public static final String PropertyKeyPortionInModelKey
The property-key-portion-in-model key; the literal "propertyKeyPortionInModel".


PropertyTypeKey

public static final String PropertyTypeKey
The property type key; the literal "propertyType".


ReadOnlyEntityNamesKey

public static final String ReadOnlyEntityNamesKey
The read-only entity names key; the literal "readOnlyEntityNames".


RelationshipKey

public static final String RelationshipKey
The relationship key.


RelationshipTypeKey

public static final String RelationshipTypeKey
The relationship type key; the literal "r".


RequiresEntityKey

public static final String RequiresEntityKey
The requires entity key; the literal "requiresEntity".


SessionKey

public static final String SessionKey
The session key.


ShowBannerKey

public static final String ShowBannerKey
The show banner key; the literal "showBanner".


StartupEntityNameKey

public static final String StartupEntityNameKey
The startup entity name key; the literal "startupEntityName".


StartupTaskKey

public static final String StartupTaskKey
The startup task key; the literal "startupTask".


TargetKey

public static final String TargetKey
The target key.


TaskKey

public static final String TaskKey
The task key.


VisibleEntityNamesKey

public static final String VisibleEntityNamesKey
The visible entity names key; the literal "visibleEntityNames".


WebAssistantPageNameKey

public static final String WebAssistantPageNameKey
The Web Assistant page name key; the literal "webAssistantPageName".


Zero

public static final Integer Zero
A constant that represents a logical false value.

See Also:
One, BooleanAssignment
Constructor Detail

D2WModel

protected D2WModel(File f)
Creates an instance of D2WModel with the specified file.

Parameters:
f - instance of java.io.File
See Also:
D2WModel(EOKeyValueUnarchiver)

D2WModel

protected D2WModel(URL url)
Creates an instance of D2WModel from the contents of the specified URL.

Parameters:
url - instance of java.io.URL
Since:
5.2.2
See Also:
D2WModel(EOKeyValueUnarchiver)

D2WModel

protected D2WModel(EOKeyValueUnarchiver unarchiver)
Creates an instance of D2WModel with the specified unarchiver.

Parameters:
unarchiver - instance of EOKeyValueUnarchiver
See Also:
D2WModel(NSArray)

D2WModel

protected D2WModel(NSArray rules)
Creates an instance of D2WModel with the specified rules.

Parameters:
rules - instance of NSArray
See Also:
setRules(NSArray)
Method Detail

addRule

protected void addRule(Rule newRule)
Adds the specified rule; dirties the model.

Parameters:
newRule - instance of Rule
See Also:
rules(), setDirty(boolean), removeRule(Rule)

addRuleToItsBucket

protected void addRuleToItsBucket(Rule r)
Adds the specified rule to the local rule caches.

Parameters:
r - instance of Rule
See Also:
sortRules(), createWebAssistantRulesWithSettings(ServerSideSettings)

addRuleTrace

protected void addRuleTrace(Rule newRule)
Invokes the addRule method and logs a trace.

Parameters:
newRule - instance of Rule
See Also:
addRule(Rule)

addRules

protected void addRules(NSArray extraRules)
Invokes the addRule method on each of the specified rules.

Parameters:
extraRules - instance of NSArray
See Also:
addRule(Rule), mergeFile(File)

canSaveUserModel

public boolean canSaveUserModel()
Indicates whether the user model can be saved, that is, whether the user model is the project bundle.

Returns:
true if the user model can be saved; false otherwise
See Also:
checkPossibilityToSaveUserModel(boolean)

candidates

protected Vector candidates(String keyPath,
                            D2WContext context)
Gets rules from the local rule caches for the specified key path.

Parameters:
keyPath - the key path
context - instance of D2WContext - ignored
Returns:
instance of java.util.Vector
See Also:
addRuleToItsBucket(Rule), invalidateCaches()

checkPossibilityToSaveUserModel

public boolean checkPossibilityToSaveUserModel(boolean throwp)
Calculates whether it is possible to save the user model.

Parameters:
throwp - whether to forward or quietly log an exception
Returns:
true if the user model can be saved; false otherwise.
Throws:
IllegalStateException - if the web assistant is enabled, the user model is not in the project bundle, and throwp argument is true
See Also:
canSaveUserModel()

checkRules

public void checkRules()
Checks the rules. The rules have to be reloaded if the following files have been modified since the time that the files were last read:

clientConfiguration

public Hashtable clientConfiguration()
Gets the client configuration.

Returns:
instance of java.util.Hashtable
See Also:
initializeClientConfiguration()

clientConfigurationFilesInBundles

public Vector clientConfigurationFilesInBundles()
Deprecated. use clientConfigurationFilesPathURLsInBundles instead

Gets the client configuration files in bundles.

Returns:
instance of java.util.Vector
See Also:
nameFromFrameworkBundle(NSBundle)

clientConfigurationFilesPathURLsInBundles

public Vector clientConfigurationFilesPathURLsInBundles()
Gets the client configuration files in bundles.

Returns:
instance of java.util.Vector
Since:
5.2.2
See Also:
nameFromFrameworkBundle(NSBundle)

componentDefinitions

public Hashtable componentDefinitions()
Gets the component definitions.

Returns:
instance of java.util.Hashtable

createWebAssistantRulesWithSettings

protected void createWebAssistantRulesWithSettings(ServerSideSettings settings)
Creates Web Assistant rules with the specified settings.

Parameters:
settings - instance of ServerSideSettings
See Also:
pageRuleKeysForPage(String), propertyRuleKeysForComponents(Vector), propertyRuleKeysFromClientConfiguration(), pageRuleKeysFromClientConfiguration()

dataTypesInvolved

protected Vector dataTypesInvolved()
Gets the data types involved for the rules.

Returns:
instance of java.util.Vector
See Also:
rules(), Rule.dataTypesInvolved()

defaultModel

public static D2WModel defaultModel()
Gets the default model.

Returns:
instance of D2WModel
See Also:
setDefaultModel(D2WModel)

dirty

public 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.

Returns:
true if the model is dirty; false otherwise
See Also:
setDirty(boolean), mergeFile(File), addRule(Rule), removeRule(Rule), saveWebAssistantRulesIntoUsedModelFile(), revertWebAssistantRules(), removeWebAssistantRulesWithSameContextAsSettings(Settings)

dynamicPages

protected Vector dynamicPages()
Gets a list of all the dynamic pages found in the model.

The current implementation caches the values.

The implementation is subject to change in future releases.

Returns:
instance of java.util.Vector
See Also:
invalidateCaches()

editors

public Hashtable editors()
Gets the editors.

Returns:
instance of java.util.Hashtable

encodeWebAssistantRulesWithKeyValueArchiver

protected NSDictionary encodeWebAssistantRulesWithKeyValueArchiver(EOKeyValueArchiver archiver)
Encodes the Web Assistant rules with the specified key-value archiver.

Parameters:
archiver - instance of EOKeyValueArchiver
Returns:
instance of NSDictionary
See Also:
webAssistantRulesForSave()

encodeWithKeyValueArchiver

public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
Description copied from interface: EOKeyValueArchiving
Asks the receiver to archive its state into the EOKeyValueArchiver archiver.

Specified by:
encodeWithKeyValueArchiver in interface EOKeyValueArchiving
Parameters:
archiver - the EOKeyValueArchiver
See Also:
EOKeyValueArchiver

fireAllRulesForKeyPathInContext

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.

Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
instance of java.util.Vector
See Also:
candidates(String, D2WContext), fireRuleForKeyPathInContext(String, D2WContext), Rule.canFireInContext(D2WContext), Rule.fire(D2WContext)

fireRuleForKeyPathInContext

protected Object fireRuleForKeyPathInContext(String keyPath,
                                             D2WContext context)
Fires the first candidate rule for the specified key path that can fire in the specified context.

Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
the result of firing if a rule fires; null otherwise
See Also:
fireSystemRuleForKeyPathInContext(String, D2WContext), fireAllRulesForKeyPathInContext(String, D2WContext)

fireSystemRuleForKeyPathInContext

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.

Parameters:
keyPath - the key path
context - instance of D2WContext
Returns:
the result of firing if a rule fires; null otherwise
See Also:
fireRuleForKeyPathInContext(String, D2WContext)

inferrableKeys

public Hashtable inferrableKeys()
Gets the inferrable keys.

Returns:
instance of java.util.Hashtable

initializeClientConfiguration

protected void initializeClientConfiguration()
Intializes the client configuration.

See Also:
clientConfiguration()

invalidateCaches

protected void invalidateCaches()
Clears the local caches of dynamic pages and rules.

See Also:
dynamicPages(), addRuleToItsBucket(Rule), candidates(String, D2WContext)

isPageStatic

public boolean isPageStatic(String pageName,
                            D2WContext aContext)
Indicates whether the page with the specified name is static in the specified context.

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.

Parameters:
pageName - the name of the page
aContext - instance of D2WContext
Returns:
true if the page is static; false otherwise.
Throws:
NullPointerException - if the client configuration information for components cannot be found
See Also:
candidates(String, D2WContext)

loadRules

public void loadRules()
Loads the rules. Merges model files in the bundles, client configuration files, and the user model file.

See Also:
modelFilesInBundles(), mergeFile(File), clientConfigurationFilesInBundles(), userClientConfigurationFile(), userModelFile()

mergeFile

protected void mergeFile(File modelFile)
Deprecated. use mergePathURL instead

Adds the rules from the specified model file; dirties the model.

Parameters:
modelFile - instance of java.io.File
See Also:
addRules(NSArray), setDirty(boolean)

mergePathURL

protected void mergePathURL(URL modelPathURL)
Adds the rules from the specified model file path URL; dirties the model.

Parameters:
modelPathURL - instance of java.net.URL
Since:
5.2.2
See Also:
addRules(NSArray), setDirty(boolean)

modelFilesInBundles

public Vector modelFilesInBundles()
Deprecated. use modelFilesPathURLsInBundles instead

Gets the model files in the bundles

Returns:
instance of java.util.Vector
Throws:
IllegalStateException - if the model files in the Direct To Web framework cannot be found
See Also:
nameFromFrameworkBundle(NSBundle)

modelFilesPathURLsInBundles

public Vector modelFilesPathURLsInBundles()
Gets the model files in the bundles

Returns:
instance of java.util.Vector
Throws:
IllegalStateException - if the model files in the Direct To Web framework cannot be found
Since:
5.2.2
See Also:
nameFromFrameworkBundle(NSBundle)

nameFromFrameworkBundle

public static String nameFromFrameworkBundle(NSBundle bundle)
Gets the name of the specified framework bundle.

Parameters:
bundle - instance of NSBundle
Returns:
the framework bundle name if the path ends with ".framework; null otherwise.

newSettings

protected void newSettings(ServerSideSettings settings)
Updates the model with the specified 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.

Parameters:
settings - instance of ServerSideSettings
See Also:
rules(), setRules(NSArray), createWebAssistantRulesWithSettings(ServerSideSettings)

pageRuleKeysForPage

public Vector pageRuleKeysForPage(String pageName)
Gets the page rule keys for the specified page.

Parameters:
pageName - the name of the page
Returns:
instance of java.util.Vector

pageRuleKeysFromClientConfiguration

public Vector pageRuleKeysFromClientConfiguration()
Gets the page rule keys from the client configuration.

Returns:
instance of java.util.Vector
See Also:
clientConfiguration(), editors()

propertyRuleKeysForComponents

public Vector propertyRuleKeysForComponents(Vector componentsAvailable)
Gets the property rule keys for the specified components.

Parameters:
componentsAvailable - instance of java.util.Vector
Returns:
instance of java.util.Vector
Throws:
IllegalStateException - if a component has not been defined in the client configuration property list file

propertyRuleKeysFromClientConfiguration

public Vector propertyRuleKeysFromClientConfiguration()
Gets the property rule keys from the client configuration.

The current implementation caches the keys.

The implementation is subject to change in future releases.

Returns:
instance of java.util.Vector
See Also:
editors()

removeAllWebAssistantRules

protected void removeAllWebAssistantRules()
Removes all of the Web Assistant rules.

See Also:
rules(), setRules(NSArray), removeWebAssistantRulesWithSameContextAsSettings(Settings)

removeDynamicPage

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.

Parameters:
settings - instance of ServerSideSettings
See Also:
removeWebAssistantRulesWithSameContextAsSettings(Settings), Settings.forADynamicPage()

removeRule

protected void removeRule(Rule rule)
Removes the specified rule; dirties the model.

Parameters:
rule - instance of Rule
See Also:
rules(), setDirty(boolean), addRule(Rule)

removeWebAssistantRulesWithSameContextAsSettings

protected void removeWebAssistantRulesWithSameContextAsSettings(com.apple.client.directtoweb.common.Settings settings)
Removes the Web Assistant rules that have the same context as the specified settings. Dirties the model if a non-look rule is removed; un-dirties otherwise.

Parameters:
settings - instance of Settings
See Also:
rules(), setRules(NSArray), setDirty(boolean), removeAllWebAssistantRules()

revertWebAssistantRules

protected void revertWebAssistantRules()
Reverts the Web Assistant rules; un-dirties the model.

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.

See Also:
removeAllWebAssistantRules(), mergeFile(File), userModelFile(), sortRules(), setDirty(boolean)

rules

protected NSArray rules()
Gets the rules.

Returns:
instance of NSArray
See Also:
setRules(NSArray)

saveWebAssistantRulesIntoUsedModelFile

protected void saveWebAssistantRulesIntoUsedModelFile()
Saves Web Assistant rules in the used model file.


setDefaultModel

public static void setDefaultModel(D2WModel newModel)
Sets the default model to the specified value.

Parameters:
newModel - instance of D2WModel
See Also:
defaultModel()

setDirty

protected void setDirty(boolean newValue)
Sets whether the model is dirty to the specified value.

Parameters:
newValue - boolean
See Also:
dirty()

setRules

protected void setRules(NSArray newRules)
Sets the rules to the specified value; sorts the rules.

Parameters:
newRules - instance of NSArray
See Also:
rules(), sortRules()

sortRules

protected void sortRules()
Invalidates caches.

See Also:
invalidateCaches()

taskVector

protected Vector taskVector()
Gets a list of all tasks found in the model.

Returns:
instance of java.util.Vector
See Also:
tasks()

tasks

protected Enumeration tasks()
Get an enumeration of the tasks in the model.

Returns:
instance of java.util.Enumeration
See Also:
taskVector()

toFile

protected void toFile(File f)
               throws IOException
Writes the dictionary of the key-value archiver to the specified file.

Parameters:
f - instance of java.io.File
Throws:
IOException - if the archive dictionary cannot be written
See Also:
encodeWithKeyValueArchiver(EOKeyValueArchiver)

toString

public String toString()

typeForRuleKey

public final String typeForRuleKey(String key)
Gets the type for the specified rule key.

Parameters:
key - the key
Returns:
instance of String that represents the type for the rule key

updateUserSettingsForNewPageAvailableRule

public void updateUserSettingsForNewPageAvailableRule(ServerSideSettings settings,
                                                      String dtwComponentName)
Updates user settings for a new page available rule.

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.

Parameters:
settings - instance of ServerSideSettings
dtwComponentName - name of the Direct to Web component
Throws:
NSForwardException - if there is an error reading from or writing to the client configuration property list file
See Also:
addRuleTrace(Rule), componentDefinitions(), clientConfiguration()

userClientConfigurationFile

public File userClientConfigurationFile()
Deprecated. use userClientConfigurationFilePathURL instead

Gets the user client configuration file.

Returns:
instance of java.io.File

userClientConfigurationFilePathURL

public URL userClientConfigurationFilePathURL()
Gets the user client configuration file.

Returns:
instance of java.net.URL
Since:
5.2.2

userModelFile

public File userModelFile()
Deprecated. use userModelFilePathURL instead.

Gets the user model file.

Returns:
instance of java.io.File

userModelFilePathURL

public URL userModelFilePathURL()
Gets the user model file.

Returns:
instance of java.net.URL
Since:
5.2.2

webAssistantRulesForSave

protected NSArray webAssistantRulesForSave()
Gets the Web Assistant rules for saving.

Returns:
instance of NSArray

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.