Project Wonder 5.0

er.extensions.eof
Class ERXDummyRecord

java.lang.Object
  extended by com.webobjects.eocontrol.EOCustomObject
      extended by er.extensions.eof.ERXDummyRecord
All Implemented Interfaces:
com.webobjects.eocontrol._EOPrivateMemento, com.webobjects.eocontrol.EODeferredFaulting, com.webobjects.eocontrol.EOEnterpriseObject, com.webobjects.eocontrol.EOFaulting, com.webobjects.eocontrol.EOKeyValueCoding, com.webobjects.eocontrol.EOKeyValueCoding._BestBindingCreation._ForwardingBindingCheck, com.webobjects.eocontrol.EOKeyValueCoding._KeyBindingCreation, com.webobjects.eocontrol.EOKeyValueCodingAdditions, com.webobjects.eocontrol.EORelationshipManipulation, com.webobjects.eocontrol.EOValidation, com.webobjects.foundation.NSKeyValueCoding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation.Callback, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCodingAdditions, com.webobjects.foundation.NSValidation, java.io.Serializable

public class ERXDummyRecord
extends com.webobjects.eocontrol.EOCustomObject

Put POJOs into EOF (sort of). This class is mainly usefull when used with D2W, when you don't want to create components for non-persistent objects. Should be regarded as experimental :) Thing to watch out for:

Here's a usage example, showing how to call up an edit page for a single "object" and a list page for an array. Note that the list-inspect-edit workflow and sorting, batching etc work out of the box.

 public class Main extends WOComponent {
 
        public static class Test {
                
                public String string;
                public Number number;
                public Boolean flag;
                
                public Test(String string, Number number, Boolean flag) {
                        this.string = string;
                        this.number = number;
                        this.flag = flag;
                }
        }
        
        public Test object;
        public NSArray list;
 
        public Main(WOContext context) {
                super(context);
                ERXDummyRecord.registerDescriptionForClass(Test.class, null);
                NSMutableArray l = new NSMutableArray();
                for (int i = 0; i > 5; i++) {
                        Test o = new Test("Foo "+ i, new Integer(i^i % (i+1)), i % 2 == 0? Boolean.TRUE : Boolean.FALSE);
                        l.addObject(o);
                }
                object = (Test) l.lastObject();
                list = l.immutableClone();
        }
 
        public WOComponent editObject() {
                EOEnterpriseObject eo = ERXDummyRecord.recordForObject(session().defaultEditingContext(), object);
                WOComponent result = D2W.factory().pageForTaskAndEntityNamed("edit", eo.entityName(), session());
                result.takeValueForKey(eo, "object");
                result.takeValueForKey(context().page(), "nextPage");
                return result;
        }
 
        public WOComponent showList() {
                EOArrayDataSource ds = ERXDummyRecord.dataSourceForObjects(session().defaultEditingContext(), list);
                ds.setArray(objects);
                WOComponent result = D2W.factory().pageForTaskAndEntityNamed("list", ds.classDescriptionForObjects().entityName(), session());
                result.takeValueForKey(ds, "dataSource");
                result.takeValueForKey(context().page(), "nextPage");
                return result;
        }
 }

See Also:
Serialized Form
Author:
ak

Nested Class Summary
static class ERXDummyRecord.GlobalID
           
static class ERXDummyRecord.ProxyBinding
           
 
Nested classes/interfaces inherited from class com.webobjects.eocontrol.EOCustomObject
com.webobjects.eocontrol.EOCustomObject._BooleanFieldBinding, com.webobjects.eocontrol.EOCustomObject._FieldBinding, com.webobjects.eocontrol.EOCustomObject._LazyFieldBinding, com.webobjects.eocontrol.EOCustomObject._NumberFieldBinding
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueCodingAdditions
com.webobjects.eocontrol.EOKeyValueCodingAdditions.DefaultImplementation, com.webobjects.eocontrol.EOKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueCoding
com.webobjects.eocontrol.EOKeyValueCoding._BestBindingCreation, com.webobjects.eocontrol.EOKeyValueCoding._KeyBindingCreation, com.webobjects.eocontrol.EOKeyValueCoding._StoredForwardingBinding
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding
com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
com.webobjects.foundation.NSValidation._MethodBinding, com.webobjects.foundation.NSValidation._ValidationBinding, com.webobjects.foundation.NSValidation.ValidationException
 
Nested classes/interfaces inherited from interface com.webobjects.eocontrol._EOPrivateMemento
com.webobjects.eocontrol._EOPrivateMemento.DefaultImplementation
 
Field Summary
 
Fields inherited from class com.webobjects.eocontrol.EOCustomObject
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding
NullValue
 
Constructor Summary
protected ERXDummyRecord(java.lang.Object o)
           
 
Method Summary
 com.webobjects.foundation.NSKeyValueCoding._KeyBinding _otherStorageBinding(java.lang.String key)
           
static com.webobjects.eocontrol.EOClassDescription classDescriptionForObject(java.lang.Object object)
           
static com.webobjects.eocontrol.EOArrayDataSource dataSourceForObjects(com.webobjects.eocontrol.EOEditingContext ec, com.webobjects.foundation.NSArray list)
           
 java.lang.Object object()
           
static com.webobjects.eocontrol.EOEnterpriseObject recordForObject(com.webobjects.eocontrol.EOEditingContext ec, java.lang.Object o)
           
static void registerDescriptionForClass(java.lang.Class clazz, com.webobjects.foundation.NSArray keys)
           
 
Methods inherited from class com.webobjects.eocontrol.EOCustomObject
__classDescription, __clearPendingChanges, __editingContext, __globalID, __hasAuxillaryObservers, __hasPendingChanges, __hasPendingUpdate, __isInitialized, __isPendingDeletion, __isPendingInsertion, __isShared, __lastSnapshot, __originalSnapshot, __retainCount, __setAuxillaryObservers, __setClassDescription, __setEditingContext, __setGlobalID, __setInitialized, __setLastSnapshot, __setOriginalSnapshot, __setPendingDeletion, __setPendingInsertion, __setPendingUpdate, __setRetainCount, __setShared, _createKeyGetBindingForKey, _createKeySetBindingForKey, _createStoredKeyGetBindingForKey, _createStoredKeySetBindingForKey, _fieldKeyBinding, _forwardingBindingNeededForClass, _keyGetBindingForKey, _keySetBindingForKey, _methodKeyGetBinding, _methodKeySetBinding, _storedKeyGetBindingForKey, _storedKeySetBindingForKey, addObjectToBothSidesOfRelationshipWithKey, addObjectToPropertyWithKey, allPropertyKeys, attributeKeys, awakeFromClientUpdate, awakeFromFetch, awakeFromInsertion, canAccessFieldsDirectly, changesFromSnapshot, classDescription, classDescriptionForDestinationKey, clearFault, clearProperties, deleteRuleForRelationshipKey, editingContext, entityName, eoDescription, eoShallowDescription, equals, excludeObjectFromPropertyWithKey, faultHandler, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hashCode, includeObjectIntoPropertyWithKey, inverseForRelationshipKey, invokeRemoteMethod, isFault, isToManyKey, opaqueState, ownsDestinationObjectsForRelationshipKey, prepareValuesForClient, propagateDeleteWithEditingContext, readResolve, reapplyChangesFromDictionary, removeObjectFromBothSidesOfRelationshipWithKey, removeObjectFromPropertyWithKey, shouldUseStoredAccessors, snapshot, storedValueForKey, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, takeValuesFromDictionaryWithMapping, toManyRelationshipKeys, toOneRelationshipKeys, toString, turnIntoFault, unableToSetNullForKey, updateFromSnapshot, userPresentableDescription, usesDeferredFaultCreation, validateClientUpdate, validateForDelete, validateForInsert, validateForSave, validateForUpdate, validateTakeValueForKeyPath, validateValueForKey, valueForKey, valueForKeyPath, valuesForKeys, valuesForKeysWithMapping, willChange, willRead, willReadRelationship
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ERXDummyRecord

protected ERXDummyRecord(java.lang.Object o)
Method Detail

object

public java.lang.Object object()

_otherStorageBinding

public com.webobjects.foundation.NSKeyValueCoding._KeyBinding _otherStorageBinding(java.lang.String key)
Specified by:
_otherStorageBinding in interface com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation.Callback
Overrides:
_otherStorageBinding in class com.webobjects.eocontrol.EOCustomObject

classDescriptionForObject

public static com.webobjects.eocontrol.EOClassDescription classDescriptionForObject(java.lang.Object object)

registerDescriptionForClass

public static void registerDescriptionForClass(java.lang.Class clazz,
                                               com.webobjects.foundation.NSArray keys)

dataSourceForObjects

public static com.webobjects.eocontrol.EOArrayDataSource dataSourceForObjects(com.webobjects.eocontrol.EOEditingContext ec,
                                                                              com.webobjects.foundation.NSArray list)

recordForObject

public static com.webobjects.eocontrol.EOEnterpriseObject recordForObject(com.webobjects.eocontrol.EOEditingContext ec,
                                                                          java.lang.Object o)

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

Copyright © 2002 – 2007 Project Wonder.