• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting a custom EOFetchSpecification for a WODisplayGroup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting a custom EOFetchSpecification for a WODisplayGroup


  • Subject: Setting a custom EOFetchSpecification for a WODisplayGroup
  • From: Paul Hoadley <email@hidden>
  • Date: Mon, 29 Oct 2007 15:11:50 +1030

Hello,

I am very much a WO novice, just working my way through Ruzek's "WO web application construction kit".

I'm writing a very simple application.  I have a table called "task" (in a PostgreSQL database), and one of the columns is "active".  What I thought I'd do is set up two WODisplayGroups, one to collect the tasks where active == 'yes', the other for tasks where active == 'no', as I want to display them in two separate tables.

I'm using Eclipse 3.2.2, so I'm hand-editing the WOO file.  What I _thought_ I could do was replace the literal declaration of fetchSpecification for the WODisplayGroup (which I just copied over from something auto-generated from WO Builder) with a reference to a method in the component's Java class that returned an EOFetchSpecification.  That is, instead of this:

            dataSource = {
                class = EODatabaseDataSource;
                editingContext = "session.defaultEditingContext";
                fetchSpecification = {
                    class = EOFetchSpecification;
                    entityName = Task;
                    fetchLimit = 0;
                    isDeep = YES;
                };
            };

I tried this:

            dataSource = {
                class = EODatabaseDataSource;
                editingContext = "session.defaultEditingContext";
                fetchSpecification = activeFetchSpec;
            };

where activeFetchSpec() is a Java method that returns an EOFetchSpecification that I created to select the rows where active == 'yes'.  What I get, though, is an exception as the application passes through the component's Java constructor:

Error:
com.webobjects.foundation.NSForwardException [java.lang.ClassCastException] java.lang.String
Reason:
java.lang.String

[I'll append the full stack trace.]

Ignore for a moment that (I gather) people don't use WODisplayGroups, and just humour me.  :-)  Is this approach even possible?  Is this the correct idiom, or is there another way to give a WODisplayGroup a custom EOFetchSpecification?



Re-enter
SMBS

 Exception Description

Application:
SMBS
Error:
com.webobjects.foundation.NSForwardException [java.lang.ClassCastException] java.lang.String
Reason:
java.lang.String
Stack trace:
File
Line#
Method
Package


EODatabaseDataSource.java
212
decodeWithKeyValueUnarchiver
com.webobjects.eoaccess
NativeMethodAccessorImpl.java
NA
invoke0
sun.reflect
NativeMethodAccessorImpl.java
39
invoke
sun.reflect
DelegatingMethodAccessorImpl.java
25
invoke
sun.reflect
Method.java
585
invoke
java.lang.reflect
EOKeyValueUnarchiver.java
174
_objectForPropertyList
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
234
_findTypeForPropertyListDecoding
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
256
decodeObjectForKey
com.webobjects.eocontrol
WODisplayGroup.java
2648
<init>
com.webobjects.appserver
WODisplayGroup.java
2637
decodeWithKeyValueUnarchiver
com.webobjects.appserver
NativeMethodAccessorImpl.java
NA
invoke0
sun.reflect
NativeMethodAccessorImpl.java
39
invoke
sun.reflect
DelegatingMethodAccessorImpl.java
25
invoke
sun.reflect
Method.java
585
invoke
java.lang.reflect
EOKeyValueUnarchiver.java
174
_objectForPropertyList
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
234
_findTypeForPropertyListDecoding
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
218
_dictionaryForPropertyList
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
236
_findTypeForPropertyListDecoding
com.webobjects.eocontrol
EOKeyValueUnarchiver.java
256
decodeObjectForKey
com.webobjects.eocontrol
WOArchiveSupport.java
22
initializeObjectFromArchive
com.webobjects.appserver._private
WOComponentDefinition.java
605
finishInitializingComponent
com.webobjects.appserver._private
WOComponent.java
234
<init>
com.webobjects.appserver
ShowTasks.java
16
<init>
ShowTasks
NativeConstructorAccessorImpl.java
NA
newInstance0
sun.reflect
NativeConstructorAccessorImpl.java
39
newInstance
sun.reflect
DelegatingConstructorAccessorImpl.java
27
newInstance
sun.reflect
Constructor.java
494
newInstance
java.lang.reflect
_NSUtilities.java
575
instantiateObject
com.webobjects.foundation
WOComponentDefinition.java
463
_componentInstanceInContext
com.webobjects.appserver._private
WOComponentDefinition.java
573
componentInstanceInContext
com.webobjects.appserver._private
WOApplication.java
1954
pageWithName
com.webobjects.appserver
WOHyperlink.java
80
invokeAction
com.webobjects.appserver._private
WODynamicGroup.java
101
invokeChildrenAction
com.webobjects.appserver._private
WODynamicGroup.java
110
invokeAction
com.webobjects.appserver._private
WOComponent.java
945
invokeAction
com.webobjects.appserver
WOSession.java
1168
invokeAction
com.webobjects.appserver
WOApplication.java
1375
invokeAction
com.webobjects.appserver
WOComponentRequestHandler.java
196
_dispatchWithPreparedPage
com.webobjects.appserver._private
WOComponentRequestHandler.java
287
_dispatchWithPreparedSession
com.webobjects.appserver._private
WOComponentRequestHandler.java
322
_dispatchWithPreparedApplication
com.webobjects.appserver._private
WOComponentRequestHandler.java
358
_handleRequest
com.webobjects.appserver._private
WOComponentRequestHandler.java
432
handleRequest
com.webobjects.appserver._private
WOApplication.java
1306
dispatchRequest
com.webobjects.appserver
WOWorkerThread.java
173
runOnce
com.webobjects.appserver._private
WOWorkerThread.java
254
run
com.webobjects.appserver._private
Thread.java
613
run
java.lang


NA : Non applicable, JIT activated



-- 
Paul.

w  http://logicsquad.net/
h  http://paul.hoadley.name/


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Setting a custom EOFetchSpecification for a WODisplayGroup
      • From: Lachlan Deck <email@hidden>
  • Prev by Date: Re: The Official What-I-Did-To-Run-5.3-On-Leopard Post
  • Next by Date: Re: Setting a custom EOFetchSpecification for a WODisplayGroup
  • Previous by thread: Re: Documentation : call for help
  • Next by thread: Re: Setting a custom EOFetchSpecification for a WODisplayGroup
  • Index(es):
    • Date
    • Thread