Project Wonder 5.0

er.directtoweb
Class ERD2WContextDictionary

java.lang.Object
  extended by er.directtoweb.ERD2WContextDictionary

public class ERD2WContextDictionary
extends java.lang.Object

Converts given entries of a D2WContext with a specified page configuration to a dictionary and to rules again.
Very useful for debugging and testing. You can effectively dump a context for a given page configuration into a .plist file once you are content with your page, then make tons of changes to the rules and all the while test the changed value against all your stored dictionaries, which should make you more confident to make changes like *true* => componentName = "D2WString" [100]
Also, given a dictionary, you can re-create the rules for creating these entries with any given level.
Reads in your d2wclientConfiguration.plists files from every bundle and also reads in the values given in the editors and supports fields.
So be sure to keep the entries to those files up to date :)

 NSArray pageKeys = new NSArray(new Object [] {"pageWrapperName", "pageName", "headComponentName", "displayPropertyKeys"});
 NSArray componentKeys = new NSArray(new Object [] {"componentName", "customComponentName"});
 ERD2WContextDictionary dict = new ERD2WContextDictionary("CreateModuleGroup", pageKeys, componentKeys);
 String value = NSPropertyListSerialization.stringFromPropertyList(dict.dictionary());
 
RENAMEME: to something more sensible??

Author:
ak

Nested Class Summary
static class ERD2WContextDictionary.Configuration
           
 
Field Summary
protected  com.webobjects.foundation.NSMutableDictionary _allKeys
           
protected  com.webobjects.foundation.NSMutableArray _componentLevelKeys
           
protected  com.webobjects.directtoweb.D2WContext _context
           
protected  com.webobjects.foundation.NSMutableDictionary _dictionary
           
protected  java.lang.String _pageConfiguration
           
protected  com.webobjects.foundation.NSMutableArray _pageLevelKeys
           
 
Constructor Summary
ERD2WContextDictionary(java.lang.String pageConfigurationName, com.webobjects.foundation.NSArray pageKeys, com.webobjects.foundation.NSArray componentKeys)
           
ERD2WContextDictionary(java.lang.String pageConfiguration, com.webobjects.foundation.NSDictionary dictionary)
           
 
Method Summary
protected  void addPageLevelValues()
           
protected  void addPropertyKeys(com.webobjects.foundation.NSMutableDictionary componentLevelKeys, com.webobjects.foundation.NSArray array)
           
protected  void addRulesForPropertyKeys(int level, com.webobjects.foundation.NSMutableArray rules, com.webobjects.foundation.NSArray keys)
           
protected  com.webobjects.foundation.NSDictionary componentLevelValuesForKey(java.lang.String propertyKey)
          Returns the keys for the given property key.
 com.webobjects.directtoweb.D2WContext context()
           
 com.webobjects.foundation.NSDictionary dictionary()
           
 java.lang.String dictionaryString()
           
 com.webobjects.foundation.NSArray rulesForLevel(int level)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_context

protected com.webobjects.directtoweb.D2WContext _context

_pageConfiguration

protected java.lang.String _pageConfiguration

_pageLevelKeys

protected com.webobjects.foundation.NSMutableArray _pageLevelKeys

_componentLevelKeys

protected com.webobjects.foundation.NSMutableArray _componentLevelKeys

_dictionary

protected com.webobjects.foundation.NSMutableDictionary _dictionary

_allKeys

protected com.webobjects.foundation.NSMutableDictionary _allKeys
Constructor Detail

ERD2WContextDictionary

public ERD2WContextDictionary(java.lang.String pageConfigurationName,
                              com.webobjects.foundation.NSArray pageKeys,
                              com.webobjects.foundation.NSArray componentKeys)

ERD2WContextDictionary

public ERD2WContextDictionary(java.lang.String pageConfiguration,
                              com.webobjects.foundation.NSDictionary dictionary)
Method Detail

addPageLevelValues

protected void addPageLevelValues()

componentLevelValuesForKey

protected com.webobjects.foundation.NSDictionary componentLevelValuesForKey(java.lang.String propertyKey)
Returns the keys for the given property key. To find which keys are requiered, the componentName key is used to get the editors and supports.

Parameters:
propertyKey -

dictionary

public com.webobjects.foundation.NSDictionary dictionary()

addPropertyKeys

protected void addPropertyKeys(com.webobjects.foundation.NSMutableDictionary componentLevelKeys,
                               com.webobjects.foundation.NSArray array)

rulesForLevel

public com.webobjects.foundation.NSArray rulesForLevel(int level)

addRulesForPropertyKeys

protected void addRulesForPropertyKeys(int level,
                                       com.webobjects.foundation.NSMutableArray rules,
                                       com.webobjects.foundation.NSArray keys)

context

public com.webobjects.directtoweb.D2WContext context()

dictionaryString

public java.lang.String dictionaryString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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

Copyright © 2002 – 2007 Project Wonder.