Re: Setting a custom EOFetchSpecification for a WODisplayGroup

2007-10-30 Thread Paul Hoadley

On 29/10/2007, at 9:30 PM, Paul Lynch wrote:


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


WOWACK is a little old now, being WO 4.5; but I still like it the  
best of the entry level books.


Yes, it still seems to be usable.  Well, it was usable given I had  
worked through about half of it before upgrading to Leopard and losing  
the Apple GUI tools.  I don't know how someone would go starting from  
scratch with WOWACK now...



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;
   };



Try:

fetchSpecification = "activeFetchSpec";

for your binding, assuming that this is a method in the component  
that returns a fetch spec.


That didn't _seem_ to work (it was the method returning an  
EOFetchSpecification), but I've now changed several things since I  
asked the question, most notably upgrading to WO 5.4.  I've also  
ditched the idea of using WODisplayGroups in the application anyway.   
If I take another look at it later and work it out, I'll reply to the  
list.



--
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  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Setting a custom EOFetchSpecification for a WODisplayGroup

2007-10-29 Thread Paul Lynch


On 29 Oct 2007, at 10:04, Jean Pierre Malrieu wrote:

You have more control if you create the displayGroup in your code  
(for example in the component constructor, or in initialization for  
your component).

First create a EODatabaseDataSource, then the displayGroup.
You can then use setFetchSpecification(EOFetchSpecification  
fetchSpec) or setFetchSpecificationByName(String  
fetchSpecificationName) on your datasource object. To get the  
objects, either set "fetchOnload" or use "qualifyDataSource" on the  
displayGroup.


You don't need to create the displayGroup in code to set its fetch  
spec, although it can be interesting to do.




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


WOWACK is a little old now, being WO 4.5; but I still like it the  
best of the entry level books.



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;
};



Try:

fetchSpecification = "activeFetchSpec";

for your binding, assuming that this is a method in the component  
that returns a fetch spec.


Paul


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Setting a custom EOFetchSpecification for a WODisplayGroup

2007-10-29 Thread Jean Pierre Malrieu
You have more control if you create the displayGroup in your code (for  
example in the component constructor, or in initialization for your  
component).

First create a EODatabaseDataSource, then the displayGroup.
You can then use setFetchSpecification(EOFetchSpecification fetchSpec)  
or setFetchSpecificationByName(String fetchSpecificationName) on your  
datasource object. To get the objects, either set "fetchOnload" or use  
"qualifyDataSource" on the displayGroup.


HTH

JPM



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;
};

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Setting a custom EOFetchSpecification for a WODisplayGroup

2007-10-28 Thread Lachlan Deck

On 29/10/2007, at 3:41 PM, Paul Hoadley wrote:

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.


Latest WOLips with Eclipse 3.3.1[.1] has a graphical editor for  
display groups.


with regards,
--

Lachlan Deck



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]