Sanity check: framework Properties overriding build.properties at (Ant) build time?

2009-10-27 Thread Paul Hoadley

Hello,

This may be completely normal, but I haven't run into it before.

I have a framework with a Resources/Properties file that contains a  
particular property, say "foo=bar".  I have an app that is dependent  
on that framework.  In the app's build.properties, it happens that I  
have a coincidentally identical property name, say "foo=baz".  In my  
slightly modified build.xml (which imports the standard WOLips  
build.xml and just overrides a few things), I use that foo property,  
expecting it to have value 'baz', but it has value 'bar'.  Am I just  
imagining it, or are the properties in the framework's Resources/ 
Properties file being imported by Ant as build properties, and are  
they overriding the definitions in the app's build.properties?


It's easily fixed, I've just removed the name collision.  But if  
that's the explanation, I didn't know that was happening.



--
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 arch...@mail-archive.com


Re: Deleting All Objects in a Database

2009-10-27 Thread Cheong Hee (Gmail)
What I did was to drop the tables and create tables again with static data, 
rather than delete all the objects.  This is done all from wo.  Isn't this 
is the same :)



Hi all,

I am trying to make the life of the person doing our acceptance
testing easier by creating a utility that deletes all the objects
from our database without having to run our drop/create scripts
and restart our app every time she wants to start a test from a
clean environment.  Is there an easy way to delete all the objects
in a database in webobjects?





___
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 arch...@mail-archive.com


Re: Deleting All Objects in a Database

2009-10-27 Thread Johnny Miller

Hi,

Can you use Migrations to tear down and recreate the database while  
unit testing?  If so can you please explain how?


Thanks,

Johnny

On Oct 27, 2009, at 3:31 PM, David LeBer wrote:



On 2009-10-27, at 9:14 PM, Chuck Hill wrote:


On Oct 27, 2009, at 5:57 PM, David LeBer wrote:

On 2009-10-27, at 8:29 PM, Chuck Hill wrote:

On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:


Hi all,

I am trying to make the life of the person doing our acceptance  
testing easier by creating a utility that deletes all the  
objects from our database without having to run our drop/create  
scripts and restart our app every time she wants to start a test  
from a clean environment.  Is there an easy way to delete all  
the objects in a database in webobjects?



Not that I can think of.  In your case, it will probably be  
quicker to do what you are doing.


For our integration tests we use a combination of raw sql and  
DBUnit to setup and teardown the test db.



While the app is running?  The problem doing this while the app is  
running is mostly PK conflicts when the sequences restart.  You  
could invalidateAllObjects, but yanking the DB out from under a  
running app _can_ produce odd results.


No, they are integration tests that are run by JUnit. My mistake, I  
skimmed the OP's post, I agree he'd be best to stop, recreate/reload  
and restart.


;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




___
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/jlmiller%40kahalawai.com

This email sent to jlmil...@kahalawai.com


Johnny Miller
Kahalawai Media Corp
w: www.kahalawai.com
e: jlmil...@kahalawai.com
p: 808.661.7962

___
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 arch...@mail-archive.com


Re: Deleting All Objects in a Database

2009-10-27 Thread David LeBer


On 2009-10-27, at 9:14 PM, Chuck Hill wrote:


On Oct 27, 2009, at 5:57 PM, David LeBer wrote:

On 2009-10-27, at 8:29 PM, Chuck Hill wrote:

On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:


Hi all,

I am trying to make the life of the person doing our acceptance  
testing easier by creating a utility that deletes all the objects  
from our database without having to run our drop/create scripts  
and restart our app every time she wants to start a test from a  
clean environment.  Is there an easy way to delete all the  
objects in a database in webobjects?



Not that I can think of.  In your case, it will probably be  
quicker to do what you are doing.


For our integration tests we use a combination of raw sql and  
DBUnit to setup and teardown the test db.



While the app is running?  The problem doing this while the app is  
running is mostly PK conflicts when the sequences restart.  You  
could invalidateAllObjects, but yanking the DB out from under a  
running app _can_ produce odd results.


No, they are integration tests that are run by JUnit. My mistake, I  
skimmed the OP's post, I agree he'd be best to stop, recreate/reload  
and restart.


;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




___
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 arch...@mail-archive.com


Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Lachlan Deck

On 28/10/2009, at 12:17 PM, Lon Varscsak wrote:


Can you execute:

OrderItem.newOrderItem(ec, 1, "iMac 27\" Quad-Core 2.66GHz/1TB/4GB",  
"*0.00"

*)

and have it shipped to my house? :P


throws new EOUtilities.MoreThanOneException when attempting to fetch  
required client where location like 'my house' ;-)


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 arch...@mail-archive.com


Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Lon Varscsak
Can you execute:

OrderItem.newOrderItem(ec, 1, "iMac 27\" Quad-Core 2.66GHz/1TB/4GB", "*0.00"
*)

and have it shipped to my house? :P

-Lon


On Tue, Oct 27, 2009 at 5:51 PM, Ricardo J. Parada  wrote:

>
> The newOrder() and newOrderItem() are just convenience methods I wrote for
> creating and inserting into the editing context to test this particular EOF
> scenario.  Then I used the removeFromItems() method generated by the Wonder
> templates.  But I believe that ends up calling
> removeObjectFromBothSidesOfRelationshipWithKey().
>
> Anyways, I tested with and without calling processRecentChanges() between
> the add and remove.  And that made the difference!
>
>
> On Oct 27, 2009, at 8:46 PM, Ricardo J. Parada wrote:
>
>
> Very interesting... You are right David.  I have confirmed the same too.
>
> Adding a call to ec.processRecentChanges() between the add and the remove
> makes this work as I expected it.
>
> Here's the code:
>
> EOEditingContext ec = ERXEC.newEditingContext();
> Order order = Order.newOrder(ec);
> OrderItem anItem = OrderItem.newOrderItem(ec, 1, "iMac 27\" Quad-Core
> 2.66GHz/1TB/4GB", "1999.00");
> order.addToItemsRelationship(anItem);
> order.computeTotalAmount();
> ec.processRecentChanges(); // <--- It seems like a BUG this is needed for
> the remove below to work!!
> order.removeFromItems(anItem);
> ec.saveChanges();
>
>
>
> On Oct 27, 2009, at 8:15 PM, David LeBer wrote:
>
> On 2009-10-27, at 7:52 PM, Chuck Hill wrote:
>
>
> On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:
>
>
> Try:
>
>
> Create an Order and OrderItem and insert both into an editing context.
>
> Then add the item to the order using
> order.addObjectToBothSidesOfRelationshipWithKey(item, "items").
>
> Then call editingContext.processRecentChanges()
>
> Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to
> remove the item.
>
> Then save the editing context.
>
>
> Here is the docs on that method:
>
>
> Forces this EOEditingContext to process pending insertions, deletions, and
> updates. Normally, when objects are changed, the processing of the changes
> is deferred until the end of the current event. At that point, an
> EOEditingContext moves objects to the inserted, updated, and deleted lists,
> delete propagation is performed, undos are registered, and
> ObjectsChangedInStoreNotification and
> ObjectsChangedInEditingContextNotification are posted. You can use this
> method to explicitly force changes to be processed. An EOEditingContext
> automatically invokes this method on itself before performing certain
> operations such as saveChanges. This method does nothing in Java Client
> applications.
>
>
>
> I'm struggling with how to describe why that works. :P
>
>
> It should not work.  processRecentChanges() is called during saveChanges()
> so it should not affect the item getting deleted.  My feeling is that it not
> getting deleted after initial insertion is a bug.
>
>
> I can confirm that calling ec.processRecentChanges() in between the
> addObject... and removeObject... calls does work. Though I don't know why at
> this point.
>
>
> ___
> 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/rparada%40mac.com
>
> This email sent to rpar...@mac.com
>
>
>
>  ___
> 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/varscsak%40smarthealth.com
>
> This email sent to varsc...@smarthealth.com
>
 ___
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 arch...@mail-archive.com

Re: Deleting All Objects in a Database

2009-10-27 Thread Chuck Hill

On Oct 27, 2009, at 5:57 PM, David LeBer wrote:

On 2009-10-27, at 8:29 PM, Chuck Hill wrote:

On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:


Hi all,

I am trying to make the life of the person doing our acceptance  
testing easier by creating a utility that deletes all the objects  
from our database without having to run our drop/create scripts  
and restart our app every time she wants to start a test from a  
clean environment.  Is there an easy way to delete all the objects  
in a database in webobjects?



Not that I can think of.  In your case, it will probably be quicker  
to do what you are doing.


For our integration tests we use a combination of raw sql and DBUnit  
to setup and teardown the test db.



While the app is running?  The problem doing this while the app is  
running is mostly PK conflicts when the sequences restart.  You could  
invalidateAllObjects, but yanking the DB out from under a running app  
_can_ produce odd results.


Chuck


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects







___
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 arch...@mail-archive.com


Re: Deleting All Objects in a Database

2009-10-27 Thread David LeBer


On 2009-10-27, at 8:29 PM, Chuck Hill wrote:


Hi Joe,


On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:


Hi all,

I am trying to make the life of the person doing our acceptance  
testing easier by creating a utility that deletes all the objects  
from our database without having to run our drop/create scripts and  
restart our app every time she wants to start a test from a clean  
environment.  Is there an easy way to delete all the objects in a  
database in webobjects?



Not that I can think of.  In your case, it will probably be quicker  
to do what you are doing.


For our integration tests we use a combination of raw sql and DBUnit  
to setup and teardown the test db.


;david

--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site:   http://codeferous.com
blog:   http://davidleber.net
profile:http://www.linkedin.com/in/davidleber
twitter:http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org




___
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 arch...@mail-archive.com


Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Ricardo J. Parada


The newOrder() and newOrderItem() are just convenience methods I wrote  
for creating and inserting into the editing context to test this  
particular EOF scenario.  Then I used the removeFromItems() method  
generated by the Wonder templates.  But I believe that ends up calling  
removeObjectFromBothSidesOfRelationshipWithKey().


Anyways, I tested with and without calling processRecentChanges()  
between the add and remove.  And that made the difference!



On Oct 27, 2009, at 8:46 PM, Ricardo J. Parada wrote:



Very interesting... You are right David.  I have confirmed the same  
too.


Adding a call to ec.processRecentChanges() between the add and the  
remove makes this work as I expected it.


Here's the code:

EOEditingContext ec = ERXEC.newEditingContext();
Order order = Order.newOrder(ec);
	OrderItem anItem = OrderItem.newOrderItem(ec, 1, "iMac 27\" Quad- 
Core 2.66GHz/1TB/4GB", "1999.00");

order.addToItemsRelationship(anItem);
order.computeTotalAmount();
	ec.processRecentChanges();	// <--- It seems like a BUG this is  
needed for the remove below to work!!

order.removeFromItems(anItem);
ec.saveChanges();



On Oct 27, 2009, at 8:15 PM, David LeBer wrote:


On 2009-10-27, at 7:52 PM, Chuck Hill wrote:



On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:


Try:

Create an Order and OrderItem and insert both into an editing  
context.
Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").

Then call editingContext.processRecentChanges()
Then removeObjectFromBothSidesOfRelationshipWithKey(item,  
"items") to remove the item.

Then save the editing context.

Here is the docs on that method:

Forces this EOEditingContext to process pending insertions,  
deletions, and updates. Normally, when objects are changed, the  
processing of the changes is deferred until the end of the  
current event. At that point, an EOEditingContext moves objects  
to the inserted, updated, and deleted lists, delete propagation  
is performed, undos are registered, and  
ObjectsChangedInStoreNotification and  
ObjectsChangedInEditingContextNotification are posted. You can  
use this method to explicitly force changes to be processed. An  
EOEditingContext automatically invokes this method on itself  
before performing certain operations such as saveChanges. This  
method does nothing in Java Client applications.



I'm struggling with how to describe why that works. :P


It should not work.  processRecentChanges() is called during  
saveChanges() so it should not affect the item getting deleted.   
My feeling is that it not getting deleted after initial insertion  
is a bug.


I can confirm that calling ec.processRecentChanges() in between the  
addObject... and removeObject... calls does work. Though I don't  
know why at this point.


___
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/rparada 
%40mac.com


This email sent to rpar...@mac.com


 ___
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 arch...@mail-archive.com

Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Ricardo J. Parada


Very interesting... You are right David.  I have confirmed the same too.

Adding a call to ec.processRecentChanges() between the add and the  
remove makes this work as I expected it.


Here's the code:

EOEditingContext ec = ERXEC.newEditingContext();
Order order = Order.newOrder(ec);
	OrderItem anItem = OrderItem.newOrderItem(ec, 1, "iMac 27\" Quad-Core  
2.66GHz/1TB/4GB", "1999.00");

order.addToItemsRelationship(anItem);
order.computeTotalAmount();
	ec.processRecentChanges();	// <--- It seems like a BUG this is needed  
for the remove below to work!!

order.removeFromItems(anItem);
ec.saveChanges();



On Oct 27, 2009, at 8:15 PM, David LeBer wrote:


On 2009-10-27, at 7:52 PM, Chuck Hill wrote:



On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:


Try:

Create an Order and OrderItem and insert both into an editing  
context.
Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").

Then call editingContext.processRecentChanges()
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items")  
to remove the item.

Then save the editing context.

Here is the docs on that method:

Forces this EOEditingContext to process pending insertions,  
deletions, and updates. Normally, when objects are changed, the  
processing of the changes is deferred until the end of the current  
event. At that point, an EOEditingContext moves objects to the  
inserted, updated, and deleted lists, delete propagation is  
performed, undos are registered, and  
ObjectsChangedInStoreNotification and  
ObjectsChangedInEditingContextNotification are posted. You can use  
this method to explicitly force changes to be processed. An  
EOEditingContext automatically invokes this method on itself  
before performing certain operations such as saveChanges. This  
method does nothing in Java Client applications.



I'm struggling with how to describe why that works. :P


It should not work.  processRecentChanges() is called during  
saveChanges() so it should not affect the item getting deleted.  My  
feeling is that it not getting deleted after initial insertion is a  
bug.


I can confirm that calling ec.processRecentChanges() in between the  
addObject... and removeObject... calls does work. Though I don't  
know why at this point.


 ___
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 arch...@mail-archive.com

Re: Deleting All Objects in a Database

2009-10-27 Thread Chuck Hill

Hi Joe,


On Oct 27, 2009, at 4:34 PM, Joe Kramer wrote:


Hi all,

I am trying to make the life of the person doing our acceptance  
testing easier by creating a utility that deletes all the objects  
from our database without having to run our drop/create scripts and  
restart our app every time she wants to start a test from a clean  
environment.  Is there an easy way to delete all the objects in a  
database in webobjects?



Not that I can think of.  In your case, it will probably be quicker to  
do what you are doing.



Chuck

--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects







___
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 arch...@mail-archive.com


Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread David LeBer


On 2009-10-27, at 7:52 PM, Chuck Hill wrote:



On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:


Try:

Create an Order and OrderItem and insert both into an editing  
context.
Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").

Then call editingContext.processRecentChanges()
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items")  
to remove the item.

Then save the editing context.

Here is the docs on that method:

Forces this EOEditingContext to process pending insertions,  
deletions, and updates. Normally, when objects are changed, the  
processing of the changes is deferred until the end of the current  
event. At that point, an EOEditingContext moves objects to the  
inserted, updated, and deleted lists, delete propagation is  
performed, undos are registered, and  
ObjectsChangedInStoreNotification and  
ObjectsChangedInEditingContextNotification are posted. You can use  
this method to explicitly force changes to be processed. An  
EOEditingContext automatically invokes this method on itself before  
performing certain operations such as saveChanges. This method does  
nothing in Java Client applications.



I'm struggling with how to describe why that works. :P


It should not work.  processRecentChanges() is called during  
saveChanges() so it should not affect the item getting deleted.  My  
feeling is that it not getting deleted after initial insertion is a  
bug.


I can confirm that calling ec.processRecentChanges() in between the  
addObject... and removeObject... calls does work. Though I don't know  
why at this point.





It's been a long week and it's only Tuesday.  My understanding  
(although I'm sure Chuck will correct me) is that that delete  
you're expecting to happen doesn't actually happen until the end of  
the event loop (at which time the editingContext's  
processRecentChanges method is called).  Since you're doing two  
actions to the same relationship EOF loses the ability to know what  
the right thing to do in that situation (I can't remember the  
details as to why this is though...it made sense to me at one  
point :D).


Maybe you are thinking of needing to call processRecentChanges() so  
that the contents of relationships appear correctly in the UI before  
saveChanges is called.



There aren't many times where you're going to do what you describe  
(at least in my experience).  Generally a user is going to insert/ 
modify a record in one RR loop and then delete it in another and  
you wouldn't see what you're experiencing.  However, when the time  
arises that you need to do that (for whatever reason) calling  
processRecentChanges after my first set of changes (in your case an  
insert) will make it so that EOF will automatically do the right  
thing for the second set of changes (in your case a delete).


I'm trying to help...but wait for Chuck Hill's response before you  
commit that to memory. :P



Done. :-)

Chuck

On Tue, Oct 27, 2009 at 4:20 PM, Ricardo J. Parada  
 wrote:

Resending with some typos fixed... :-)

Hi,

Let's say you have to-many relationship between two entities:   
Order <-->> OrderItem.  The to-many relationship is called "items"  
and "Owns Desintation" is checked.


Test #1:  Create an Order and OrderItem and insert both into an  
editing context.  Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").   
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items")  
to remove the item.  Then save the editing context.


Result:   EOF attempts to save both the order and the orphan item.
Expected Result:  I thought EOF would only attempt to save the  
order but not the item removed from the "items" to-many.


Test #2: Fetch an existing order with one item from the database.   
Then order.removeObjectFromBothSidesOfRelationshipWithKey(item,  
"items").  Save the editing context.


Result:  EOF deletes the item that was removed from the "items" to- 
many.


Is this how it's supposed to work?

Thanks,
Ricardo


___
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/varscsak%40smarthealth.com

This email sent to varsc...@smarthealth.com

___
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/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village

Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Lon Varscsak
My guess it's the "array" is appropriate but the editingContext
insertedObjects is not correct.

I won't try to help anymore. :P

-Lon

On Tue, Oct 27, 2009 at 4:52 PM, Chuck Hill wrote:

>
> On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:
>
>  Try:
>>
>> Create an Order and OrderItem and insert both into an editing context.
>> Then add the item to the order using
>> order.addObjectToBothSidesOfRelationshipWithKey(item, "items").
>> Then call editingContext.processRecentChanges()
>> Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to
>> remove the item.
>> Then save the editing context.
>>
>> Here is the docs on that method:
>>
>> Forces this EOEditingContext to process pending insertions, deletions, and
>> updates. Normally, when objects are changed, the processing of the changes
>> is deferred until the end of the current event. At that point, an
>> EOEditingContext moves objects to the inserted, updated, and deleted lists,
>> delete propagation is performed, undos are registered, and
>> ObjectsChangedInStoreNotification and
>> ObjectsChangedInEditingContextNotification are posted. You can use this
>> method to explicitly force changes to be processed. An EOEditingContext
>> automatically invokes this method on itself before performing certain
>> operations such as saveChanges. This method does nothing in Java Client
>> applications.
>>
>>
>> I'm struggling with how to describe why that works. :P
>>
>
> It should not work.  processRecentChanges() is called during saveChanges()
> so it should not affect the item getting deleted.  My feeling is that it not
> getting deleted after initial insertion is a bug.
>
>
>
>   It's been a long week and it's only Tuesday.  My understanding (although
>> I'm sure Chuck will correct me) is that that delete you're expecting to
>> happen doesn't actually happen until the end of the event loop (at which
>> time the editingContext's processRecentChanges method is called).  Since
>> you're doing two actions to the same relationship EOF loses the ability to
>> know what the right thing to do in that situation (I can't remember the
>> details as to why this is though...it made sense to me at one point :D).
>>
>
> Maybe you are thinking of needing to call processRecentChanges() so that
> the contents of relationships appear correctly in the UI before saveChanges
> is called.
>
>
>
>  There aren't many times where you're going to do what you describe (at
>> least in my experience).  Generally a user is going to insert/modify a
>> record in one RR loop and then delete it in another and you wouldn't see
>> what you're experiencing.  However, when the time arises that you need to do
>> that (for whatever reason) calling processRecentChanges after my first set
>> of changes (in your case an insert) will make it so that EOF will
>> automatically do the right thing for the second set of changes (in your case
>> a delete).
>>
>> I'm trying to help...but wait for Chuck Hill's response before you commit
>> that to memory. :P
>>
>
>
> Done. :-)
>
> Chuck
>
>  On Tue, Oct 27, 2009 at 4:20 PM, Ricardo J. Parada 
>> wrote:
>> Resending with some typos fixed... :-)
>>
>> Hi,
>>
>> Let's say you have to-many relationship between two entities:  Order <-->>
>> OrderItem.  The to-many relationship is called "items" and "Owns
>> Desintation" is checked.
>>
>> Test #1:  Create an Order and OrderItem and insert both into an editing
>> context.  Then add the item to the order using
>> order.addObjectToBothSidesOfRelationshipWithKey(item, "items").  Then
>> removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to remove the
>> item.  Then save the editing context.
>>
>> Result:   EOF attempts to save both the order and the orphan item.
>> Expected Result:  I thought EOF would only attempt to save the order but
>> not the item removed from the "items" to-many.
>>
>> Test #2: Fetch an existing order with one item from the database.  Then
>> order.removeObjectFromBothSidesOfRelationshipWithKey(item, "items").  Save
>> the editing context.
>>
>> Result:  EOF deletes the item that was removed from the "items" to-many.
>>
>> Is this how it's supposed to work?
>>
>> Thanks,
>> Ricardo
>>
>>
>>  ___
>> 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/varscsak%40smarthealth.com
>>
>> This email sent to varsc...@smarthealth.com
>>
>> ___
>> 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/chill%40global-village.net
>>
>> This email sent to ch...@global-village.net
>>
>
> --
> Chuck Hill Senior Consultant / VP Developm

Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Chuck Hill


On Oct 27, 2009, at 4:40 PM, Lon Varscsak wrote:


Try:

Create an Order and OrderItem and insert both into an editing context.
Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").

Then call editingContext.processRecentChanges()
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items")  
to remove the item.

Then save the editing context.

Here is the docs on that method:

Forces this EOEditingContext to process pending insertions,  
deletions, and updates. Normally, when objects are changed, the  
processing of the changes is deferred until the end of the current  
event. At that point, an EOEditingContext moves objects to the  
inserted, updated, and deleted lists, delete propagation is  
performed, undos are registered, and  
ObjectsChangedInStoreNotification and  
ObjectsChangedInEditingContextNotification are posted. You can use  
this method to explicitly force changes to be processed. An  
EOEditingContext automatically invokes this method on itself before  
performing certain operations such as saveChanges. This method does  
nothing in Java Client applications.



I'm struggling with how to describe why that works. :P


It should not work.  processRecentChanges() is called during  
saveChanges() so it should not affect the item getting deleted.  My  
feeling is that it not getting deleted after initial insertion is a bug.



 It's been a long week and it's only Tuesday.  My understanding  
(although I'm sure Chuck will correct me) is that that delete you're  
expecting to happen doesn't actually happen until the end of the  
event loop (at which time the editingContext's processRecentChanges  
method is called).  Since you're doing two actions to the same  
relationship EOF loses the ability to know what the right thing to  
do in that situation (I can't remember the details as to why this is  
though...it made sense to me at one point :D).


Maybe you are thinking of needing to call processRecentChanges() so  
that the contents of relationships appear correctly in the UI before  
saveChanges is called.



There aren't many times where you're going to do what you describe  
(at least in my experience).  Generally a user is going to insert/ 
modify a record in one RR loop and then delete it in another and you  
wouldn't see what you're experiencing.  However, when the time  
arises that you need to do that (for whatever reason) calling  
processRecentChanges after my first set of changes (in your case an  
insert) will make it so that EOF will automatically do the right  
thing for the second set of changes (in your case a delete).


I'm trying to help...but wait for Chuck Hill's response before you  
commit that to memory. :P



Done. :-)

Chuck

On Tue, Oct 27, 2009 at 4:20 PM, Ricardo J. Parada   
wrote:

Resending with some typos fixed... :-)

Hi,

Let's say you have to-many relationship between two entities:  Order  
<-->> OrderItem.  The to-many relationship is called "items" and  
"Owns Desintation" is checked.


Test #1:  Create an Order and OrderItem and insert both into an  
editing context.  Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").   
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items")  
to remove the item.  Then save the editing context.


Result:   EOF attempts to save both the order and the orphan item.
Expected Result:  I thought EOF would only attempt to save the order  
but not the item removed from the "items" to-many.


Test #2: Fetch an existing order with one item from the database.   
Then order.removeObjectFromBothSidesOfRelationshipWithKey(item,  
"items").  Save the editing context.


Result:  EOF deletes the item that was removed from the "items" to- 
many.


Is this how it's supposed to work?

Thanks,
Ricardo


 ___
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/varscsak%40smarthealth.com

This email sent to varsc...@smarthealth.com

___
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/chill%40global-village.net

This email sent to ch...@global-village.net


--
Chuck Hill Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.

http://www.global-village.net/products/practical_webobjects







___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)

Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Lon Varscsak
Try:

Create an Order and OrderItem and insert both into an editing context.
Then add the item to the order using
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").
*Then call editingContext.processRecentChanges()*
Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to remove
the item.
Then save the editing context.

Here is the docs on that method:

Forces this EOEditingContext to process pending insertions, deletions, and
updates. Normally, when objects are changed, the processing of the changes
is deferred until the end of the current event. At that point, an
EOEditingContext moves objects to the inserted, updated, and deleted lists,
delete propagation is performed, undos are registered, and
ObjectsChangedInStoreNotification and
ObjectsChangedInEditingContextNotification are posted. You can use this
method to explicitly force changes to be processed. An EOEditingContext
automatically invokes this method on itself before performing certain
operations such as saveChanges. This method does nothing in Java Client
applications.


I'm struggling with how to describe why that works. :P  It's been a long
week and it's only Tuesday.  My understanding (although I'm sure Chuck will
correct me) is that that delete you're expecting to happen doesn't actually
happen until the end of the event loop (at which time the editingContext's
processRecentChanges method is called).  Since you're doing two actions to
the same relationship EOF loses the ability to know what the right thing to
do in that situation (I can't remember the details as to why this is
though...it made sense to me at one point :D).

There aren't many times where you're going to do what you describe (at least
in my experience).  Generally a user is going to insert/modify a record in
one RR loop and then delete it in another and you wouldn't see what you're
experiencing.  However, when the time arises that you need to do that (for
whatever reason) calling processRecentChanges after my first set of changes
(in your case an insert) will make it so that EOF will automatically do the
right thing for the second set of changes (in your case a delete).

I'm trying to help...but wait for Chuck Hill's response before you commit
that to memory. :P

-Lon

On Tue, Oct 27, 2009 at 4:20 PM, Ricardo J. Parada  wrote:

> Resending with some typos fixed... :-)
>
> Hi,
>
> Let's say you have to-many relationship between two entities:  Order <-->>
> OrderItem.  The to-many relationship is called "items" and "Owns
> Desintation" is checked.
>
> *Test #1:*  Create an Order and OrderItem and insert both into an editing
> context.  Then add the item to the order using
> order.addObjectToBothSidesOfRelationshipWithKey(item, "items").  Then
> removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to remove the
> item.  Then save the editing context.
>
> *Result*:   EOF attempts to save both the order and the orphan item.
> *Expected Result*:  I thought EOF would only attempt to save the order but
> not the item removed from the "items" to-many.
>
> *Test #2: *Fetch an *existing* order with one item from the database.
>  Then order.removeObjectFromBothSidesOfRelationshipWithKey(item, "items").
>  Save the editing context.
>
> *Result:  *EOF deletes the item that was removed from the "items" to-many.
>
> Is this how it's supposed to work?
>
> Thanks,
> Ricardo
>
>
>  ___
> 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/varscsak%40smarthealth.com
>
> This email sent to varsc...@smarthealth.com
>
 ___
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 arch...@mail-archive.com

Deleting All Objects in a Database

2009-10-27 Thread Joe Kramer
Hi all,

I am trying to make the life of the person doing our acceptance testing
easier by creating a utility that deletes all the objects from our database
without having to run our drop/create scripts and restart our app every time
she wants to start a test from a clean environment.  Is there an easy way to
delete all the objects in a database in webobjects?

Thanks in advance,

Joe Kramer,
CyberApps, Inc.
 ___
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 arch...@mail-archive.com

Re: removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Ricardo J. Parada

Resending with some typos fixed... :-)

Hi,

Let's say you have to-many relationship between two entities:  Order  
<-->> OrderItem.  The to-many relationship is called "items" and "Owns  
Desintation" is checked.


Test #1:  Create an Order and OrderItem and insert both into an  
editing context.  Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").  Then  
removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to  
remove the item.  Then save the editing context.


Result:   EOF attempts to save both the order and the orphan item.
Expected Result:  I thought EOF would only attempt to save the order  
but not the item removed from the "items" to-many.


Test #2: Fetch an existing order with one item from the database.   
Then order.removeObjectFromBothSidesOfRelationshipWithKey(item,  
"items").  Save the editing context.


Result:  EOF deletes the item that was removed from the "items" to-many.

Is this how it's supposed to work?

Thanks,
Ricardo

 ___
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 arch...@mail-archive.com

removeObjectFromBothSidesOfRelationshipWithKey() question

2009-10-27 Thread Ricardo J. Parada


Hi,

Let's say you have to-many relationship between two entities:  Order  
<-->> OrderItem.  The to-many relationship is called "items".
The items to-many is flagged to indicate that the Order owns the  
destination OrderItem.


Test #1:  Create an Order and OrderItem and insert both into an  
editing context.  Then add the item to the order using  
order.addObjectToBothSidesOfRelationshipWithKey(item, "items").  Then  
IremoveObjectFromBothSidesOfRelationshipWithKey(item, "items") to  
remove the item.  Then save the editing context.


Result:   EOF attempts to save the orphan item.
Expected Result:  EOF will not attempt to save the orphan item because  
it was removed from a to-many where the parent owns the destination.


Test #2: Fetch an existing order with one item from the database.   
Then order.removeObjectFromBothSidesOfRelationshipWithKey(item,  
"items".  Save the editing context.


Result:  EOF will delete the orphan item from the database.

Is this how it's supposed to work?

Thanks,
Ricardo


 ___
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 arch...@mail-archive.com

Re: 2009 Survey Results

2009-10-27 Thread Lars Sonchocky-Helldorf


Am 27.10.2009 um 05:35 schrieb Tavis McDevitt:

Thanks to all who responded. My linked list was going to store  
workflows for a document processing application. I can certainly  
store it in a set of records with integer attributes for ordering,  
but will of course have to write the functionality of inserting and  
deleting steps.


To try and help the next newbie out, I wrote a wiki page to  
introduce WO and order all of the reference documents I have used  
so far to learn WebObjects clean (with no knowledge of v5.3 or  
prior). It is parked at http://wiki.objectstyle.org/confluence/ 
display/WOL/Learning+WebObjects.


All those links in the wiki to Apple's website scare me: They contain  
the evil word "legacy" …


I know, I know and I stop right now.


Lars ___
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 arch...@mail-archive.com


Re: displaying an integer list

2009-10-27 Thread Alex Johnson


Just to summarize, the problem was that:

new NSArray( new int [] { ... } )

translates to the single-object NSArray constructor:  
NSArray( Object ), whereas:


new NSArray( new Integer [] { ... } )

translates to the object-array constructor: NSArray( Object [] ),  
because an int [] is not a subtype of Object [] (unlike an Integer  
[]), and I don't think Java will auto-box an int [] into an Integer [].


This has been mentioned on the list before, but using Java's auto- 
boxing -- especially without using generics -- causes a lot of these  
head-scratcher bugs. My advice is to disable it, by telling the  
compiler to treat boxing and unboxing as errors.



Alex Johnson
アレックス ジャンサン



Hi!
You don't have to do new Integer(x) for all the integers. I have  
this on

my code and it works:
private NSArray monthList = new NSArray( new  
Integer[]

{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } );



Try disabling 'Boxing and unboxing conversions:'  in Preferences ->  
Java -> Compiler -> Errors/Warnings -> Potential programming problems




I have a wo popup button

YearPopUpButton: WOPopUpButton {

item = intSelection;

list = YearList;

selection = anAppliedClass.appliedYear;

}

and the relevant code is

public NSArray YearList = new NSArray(new int[]{2000, 2001, 2002,

2003, 2004, 2005, 2006, 2007, 2008, 2009});

public int intSelection;

appliedYear is an Integer.

When run, I get:

While trying to set the field "intSelection" on an object of type

edu.stanford.ee.classmgmt.apply.ui.AppliedClassPage we expected  
a int


but received a [I with a value of [...@70d9cbcb. This often  
happens if


you forget to use a formatter.

Setting a formatter doesn't seem to help. I'm guessing I need some

indirection to setting the appliedYear value, but it seems the  
error


is more due to the fact that its not liking the NSArray. Do I  
need to


generate a list of new Integer(2000), new Integer(2001).. etc?




smime.p7s
Description: S/MIME cryptographic signature
 ___
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 arch...@mail-archive.com

Re: displaying an integer list

2009-10-27 Thread Jeffrey Simpson
Just a performance hint.  You don't want to use "new Integer(2000)".
Use "Integer.valueOf(2000)".  Integer.valueOf allows for the cacheing
of values.

appliedYear is an Integer.

I've added a formatter = "", but not help. I tried #1 but it
requires a "new Integer(2000)" etc for each. That should work, but I'm
just curious why its not handling the int to Integer conversion well.
Just something that I expected. I guess I'll do it the ugly way.


Jeffrey Simpson
Senior Software Engineer
Telephone: 240.235.2144
Fax: 240.235.2174
jsimp...@yfu.org

Youth For Understanding (YFU) prepares young people for their responsibilities 
and opportunities in a changing, interdependent world.
 ___
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 arch...@mail-archive.com


Re: 2009 Survey Results

2009-10-27 Thread Bojan Volcansek

Dear Theodore,
thank you very much - I have updated the link. I hope Tavis will not  
have anything against me helping him.


sincerely yours
Bojan

On 27-Oct-09, at 11:14 AM, Theodore Petrosky wrote:


check the links on the page...

Message: 9
|Date: Mon, 26 Oct 2009 21:35:47 -0700 (PDT)
|From: Tavis McDevitt 
|Subject: Re: 2009 Survey Results
|To: webobjects-dev@lists.apple.com
|Message-ID: <349667.24031...@web58101.mail.re3.yahoo.com>
|Content-Type: text/plain; charset="iso-8859-1"

|To try and help the next newbie out, I wrote a wiki page to  
introduce WO |and order all of the reference documents I have used  
so far to learn |WebObjects clean (with no knowledge of v5.3 or  
prior). It is parked at |http://wiki.objectstyle.org/confluence/display/WOL/Learning+WebObjects 
. I |haven't linked to it though, if someone smarter than me could  
proof read |it and link it to the WOProject homepage I think it  
could be helpful.


this link doesn't work for me..

http://web.me.com/pccdonl/tutorials   (Don Linsay's tutorial)

this worked:

http://web.me.com/pccdonl/




___
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/bigboki%40phototraveldiary.com

This email sent to bigb...@phototraveldiary.com


___
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 arch...@mail-archive.com


Re: 2009 Survey Results

2009-10-27 Thread Theodore Petrosky
check the links on the page...

Message: 9
|Date: Mon, 26 Oct 2009 21:35:47 -0700 (PDT)
|From: Tavis McDevitt 
|Subject: Re: 2009 Survey Results
|To: webobjects-dev@lists.apple.com
|Message-ID: <349667.24031...@web58101.mail.re3.yahoo.com>
|Content-Type: text/plain; charset="iso-8859-1"

|To try and help the next newbie out, I wrote a wiki page to introduce WO |and 
order all of the reference documents I have used so far to learn |WebObjects 
clean (with no knowledge of v5.3 or prior). It is parked at 
|http://wiki.objectstyle.org/confluence/display/WOL/Learning+WebObjects. I 
|haven't linked to it though, if someone smarter than me could proof read |it 
and link it to the WOProject homepage I think it could be helpful.

this link doesn't work for me..

http://web.me.com/pccdonl/tutorials   (Don Linsay's tutorial)

this worked:

http://web.me.com/pccdonl/  



  
 ___
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 arch...@mail-archive.com


Issue with AjaxModalDialog and AjaxSubmitButton

2009-10-27 Thread Pierre Schambacher
Hi everyone,

I've got a strange behavior and I think it could be a bug.

Here is the situation, I've got a component, that we will name MyComponent,
like this:





In an other component, i've got this





Until there, no problem but I need to create MyComponent programmatically,
so this become:



and in the java file:
public WOActionResults createModal() {
MyComponent c = (MyComponent) pageWithName(MyComponent.class.getName());

c.setVariable1(variable1Value);
c.setVariable2(variable2Value);
// some initialization of instance variables

return c;
}

The problem is that with this kind of creation, the AjaxSubmitButton does
not work...
I've got a breakpoint at the first instruction of it's action on the server
side and nothing appends, despite it correctly works when not created
programmatically.
Did I forgot something in the creation/initialization or is this an
unexpected feature ?

Thank you for your help.
 ___
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 arch...@mail-archive.com

Re: Error with deleting object in WebObjects and Microsoft SQLServer 2005

2009-10-27 Thread Freddie Tilley
> The cascade is working but the ordering is wrong.  SQL Server can't handle
> deferred constraints.  The easiest solution is to drop the FK constraint.
>  The other solution is to order the delete operations and that is NOT easily
> done.

Thx, the easy way worked.

You were right about SQLServer 2005 and WebObjects being a PITA,
or as we Dutch would say a "Pijn in de Aars" :)

Freddie
 ___
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 arch...@mail-archive.com


Re: [OT] Pre-selecting a printer?

2009-10-27 Thread Johan Henselmans

On 26 okt 2009, at 02:09, Pascal Robert wrote:

> We have an app that use CUPS to print labels. The framework use JIPSI :
> 
> http://www.lohndirekt.de/software/jipsi_quickstart_drucksoftware.html
> 
> Disclaimer : I didn't setup the CUPS server and didn't work on the app, I 
> just know that we have an app that use it :-) You should look at the IPP 
> stuff in LEWOStuff from Andrew.
> 
>> No, that would be crazy, even for me (^_^)
>> 
>> I was just wondering if it were possible to set up a client Mac to  
>> print automatically to a specific printer based on characteristics of 
>> 
>> the print job.  So, let's say I have a color inkjet printer, a black 
>> 
>> and white laser printer, and a star receipt printer.  If I print out a
>> 
>> picture, I want the picture to go to the color printer.  If I'm  
>> printing a black and white, text only document, then I want that to go
>> 
>> to the laser, and if I have a print job that is 7cm wide, it should go
>> 
>> to the receipt printer.  Automatically... or at the very least, pre- 
>> selected in the print dialog so that all I have to do is hit the enter
>> 
>> key to print.  It seems the only options I really have is to select a 
>> 
>> specific printer, or default to the last printer used. I'm wondering 

You could do it via the command Line: 

see: http://www.cups.org/documentation.php/options.html

"
The actual options supported are defined in the printer's PPD file in the 
PageSize, InputSlot, and MediaType options. You can list them using 
thelpoptions(1) command:

lpoptions -p printer -l
"

so:
lpstat -a | awk  '{print "echo; echo "$1"; echo; lpoptions -p "$1" -l"}'| sh

would give you a rude way to find out which printer support which options. 

Here is some of the output I messed with to find out the supported pageSizes.

sh-3.2# lpstat -a | awk  '{print "echo Printer "$1"; lpoptions -p "$1" -l"}'| 
sh | grep -E "Printer|PageSize" 
Printer BOCA_SYSTEMS_44_200
PageSize/Media Size: w144h144 w144h234 w144h288 w153h234 w153h288 w162h234 
w162h288 w180h144 w180h234 w180h288 w198h144 w216h144 w216h234 w216h288 
w243h153 w252h144 w288h144 w288h180 w288h234 w288h288 w306h153 w324h144 
w360h144 w360h153 w360h180 w360h234 w360h288 w396h144 w396h153 w396h180 
w396h198 w396h234 w396h288 w405h144 w432h144 w432h153 w432h180 w432h198 
w432h234 w432h288 w441h184 w459h96 w468h144 w468h234 w468h288 w504h144 w504h234 
w504h288 w531h234 w531h288 w576h72 w576h96 w576h144 *w576h234 w576h288 w648h234 
w648h288 w720h234 w720h288 w792h72 w792h96 w792h234 w792h288 w864h234 w864h288 
w936h234 w1152h72 w1152h96 w1152h144 w1152h153 w1152h180 w1152h184 w1152h198 
w1152h234 w1152h288 Letter Legal A4 Custom
Printer Canon_iP3000___Soundmini
PageSize/Media Size: iso-a5 iso-a4 jis-b5 *na-letter na-legal 
na-number-10-envelope iso-designated-long-envelope DMSIZE_4X6 DMSIZE_5X7 
DMSIZE_DISCTRAY3 DMSIZE_CREDITCARD DMSIZE_MINUS_A4 DMSIZE_MINUS_LETTER 
DMSIZE_MINUS_4X6 DMSIZE_MINUS_5X7 DMSIZE_MINUS_CREDITCARD Custom
Printer DYMO_LabelWriter_320
PageSize/Media Size: *30256_Shipping 30252_Address 30253_Address_(2_up) 
30258_Diskette 30277_File_Folder_(2_up) 30299_Jewelry_Label_(2_up) 
30320_Address 30321_Large_Address 30323_Shipping 30324_Diskette 
30325_Video_Spine 30326_Video_Top 30327_File_Folder 30330_Return_Address 
30332_1_in_x_1_in 30333_1_2_in_x_1_in_(2_up) 30334_2-1_4_in_x_1-1_4_in 
30335_1_2_in_x_1_2_in_(4_up) 30336_1_in_x_2-1_8_in 30337_Audio_Cassette 
30339_8mm_Video_(2_up) 30345_3_4_in_x_2-1_2_in 30346_1_2_in_x_1-7_8_in 
30347_1_in_x_1-1_2_in 30348_9_10_in_x_1-1_4_in 30364_Name_Badge_Label 
30365_Name_Badge_Card 30370_Zip_Disk 30373_Price_Tag_Label 
30374_Appointment_Card 30376_Hanging_File_Insert 30383_PC_Postage_3-Part 
30384_PC_Postage_2-Part 30387_PC_Postage_EPS 99010_Standard_Address 
99012_Large_Address 99014_Name_Badge_Label 99014_Shipping 99015_Diskette 
99016_Video_Spine 99016_Video_Top 99017_Suspension_File 99018_Small_Lever_Arch 
99019_Large_Lever_Arch 11351_Jewelry_Label 11352_Return_Address_Int 
11353_Multi-Purpose 11354_Multi-Purpose 11355_Multi-Purpose 
11356_White_Name_Badge 30854_CD_Label 30886_CD_Label Continuous_Narrow 
Continuous_Wide
Printer Phaser_8550DP__00_00_aa_a1_21_60_
PageSize/Media Size: *Letter Legal Executive IndexCard Statement 
FanFoldGermanLegal Env6x9 Env10 EnvMonarch EnvA7 Env5Half EnvPersonal A4 A5 A6 
ISOB5 B5 EnvDL EnvC5 EnvChou3 EnvChou4 Custom



have fun!

>> 
>> if it is possible to select the "most appropriate" printer based on  
>> characteristics of the print job.
>> 
>> CUPS looked pretty neat.  I imagined there might be some hidden  
>> configuration magic in it, so I thought I would ask the list to see if
>> 
>> anyone know of any. (^_^)
>> 
>> Ramsey
>> 
>> On Oct 25, 2009, at 6:39 PM, Andrew Lindesay wrote:
>> 
>>> Hi Ramsey;
>>> 
>>> Do you mean that you would like to change the default printer on a 
>> 
>>> users' machine from a web page?
>>> 
>>> cheers.
>>> 
> Are you able to just print directly to the printer from the