|
WebObjects 5.2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.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
Inner 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. |
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()
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)
Adds the rules from the specified model file; dirties the model. |
Vector |
modelFilesInBundles()
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()
Gets the user client configuration file. |
File |
userModelFile()
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.AllMarker
public 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.dummyTrueQualifier
public 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.NoneMarker
public static final Integer One
Zero
,
BooleanAssignment
public 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.File
D2WModel(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 - ignoredjava.util.Vector
addRuleToItsBucket(Rule)
,
invalidateCaches()
public boolean checkPossibilityToSaveUserModel(boolean throwp)
throwp
- whether to forward or quietly log an exceptionIllegalStateException
- 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.Hashtable
initializeClientConfiguration()
public Vector clientConfigurationFilesInBundles()
java.util.Vector
nameFromFrameworkBundle(NSBundle)
public Hashtable componentDefinitions()
java.util.Hashtable
protected void createWebAssistantRulesWithSettings(ServerSideSettings settings)
settings
- instance of ServerSideSettingspageRuleKeysForPage(String)
,
propertyRuleKeysForComponents(Vector)
,
propertyRuleKeysFromClientConfiguration()
,
pageRuleKeysFromClientConfiguration()
protected Vector dataTypesInvolved()
java.util.Vector
rules()
,
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.Vector
invalidateCaches()
public Hashtable editors()
java.util.Hashtable
protected NSDictionary encodeWebAssistantRulesWithKeyValueArchiver(EOKeyValueArchiver archiver)
archiver
- instance of EOKeyValueArchiverwebAssistantRulesForSave()
public void encodeWithKeyValueArchiver(EOKeyValueArchiver archiver)
EOKeyValueArchiving
archiver
.encodeWithKeyValueArchiver
in interface EOKeyValueArchiving
com.webobjects.eocontrol.EOKeyValueArchiving
archiver
- the EOKeyValueArchiverEOKeyValueArchiver
protected Vector fireAllRulesForKeyPathInContext(String keyPath, D2WContext context)
keyPath
- the key pathcontext
- instance of D2WContextjava.util.Vector
candidates(String, D2WContext)
,
fireRuleForKeyPathInContext(String, D2WContext)
,
Rule.canFireInContext(D2WContext)
,
Rule.fire(D2WContext)
protected Object fireRuleForKeyPathInContext(String keyPath, D2WContext context)
keyPath
- the key pathcontext
- instance of D2WContextfireSystemRuleForKeyPathInContext(String, D2WContext)
,
fireAllRulesForKeyPathInContext(String, D2WContext)
protected Object fireSystemRuleForKeyPathInContext(String keyPath, D2WContext context)
keyPath
- the key pathcontext
- instance of D2WContextfireRuleForKeyPathInContext(String, D2WContext)
public Hashtable inferrableKeys()
java.util.Hashtable
protected 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 pagecontext
- instance of D2WContextNullPointerException
- 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.File
addRules(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 static String nameFromFrameworkBundle(NSBundle bundle)
bundle
- instance of NSBundleprotected 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 pagejava.util.Vector
public Vector pageRuleKeysFromClientConfiguration()
java.util.Vector
clientConfiguration()
,
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.Vector
editors()
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.Vector
tasks()
protected Enumeration tasks()
java.util.Enumeration
taskVector()
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()
toString
in class Object
public final String typeForRuleKey(String key)
key
- the keypublic 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 componentNSForwardException
- if there is an error reading from or
writing to the client configuration property list fileaddRuleTrace(Rule)
,
componentDefinitions()
,
clientConfiguration()
public File userClientConfigurationFile()
java.io.File
public File userModelFile()
java.io.File
protected NSArray webAssistantRulesForSave()
|
Last updated Fri Feb 21 13:15:00 PST 2003. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |