[OT] The omnigroup does not like me anymore

2006-11-08 Thread Markus Ruggiero

Sorry for the OT posting.

I am subscribed to various WO/EOF/Apple related mailing list from the  
omni group. For the last couple of days I have not received one mail  
from them.


What I have done so far: Used the web interface to the listmanager to  
try and check my subscription. However as I could not remember my  
password I opted for them to mail it to me. While waiting for that  
mail my memory came back and I could log in. All my subscriptions are  
enabled and all look fine. Only after some hours I realised that the  
password reminder had not yet come. This made me really suspicious.  
So I put my mail server (Mac OS X Tiger with postfix) into postfix  
debug level log and waited what was going to show in the logs. Well,  
everything but nothing from the omni group listserver, Last desperate  
test this morning: while running tail -f /var/log/mail.log (still  
debug level) I again requested a password reminder. The web page  
tells me that the mail had been sent, but my log shows nothing.  
However all the spam as well as any other mail e.g. from  
lists.apple.com and everything else comes in nicely and shows in the  
log. Just nothing from the omni group (not even a connect attempt and  
a reject). I have sent a mail to the listmanager but have yet to  
receive an answer (and yes, I gave them an alternate reply to in case  
their mail server really hates me)


So is anyone aware of any problem?

Thanks a alot and again sorry for the OT
---markus---


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


Re: Locking and threads

2006-11-08 Thread Fabrice Pipart
On Nov 7, 2006, at 6:59 PM, Chuck Hill wrote:On Nov 7, 2006, at 4:10 AM, Fabrice Pipart wrote: Yes sure !I think I forgot to mention that my child ec was already created ;-) As you have used it, that is the parent EC!  :-)That's right ;-)And childEc = new EOEditingContext(session().defaultEditingContext()); Actually here is what I want to : create a long response page in a wizard.All the wizard pages use the same child ec (its passed through components).All I want to do is use an editing context in the long response thread that does not commit its changes to the database directly.That's why I use a child ec in the wizard pages : to be able to do a session().defaultEditingContext().revert(); And that is what is causing the deadlock I would guess.  Is your code equivalent to:Here is where the deadlock comes from (I finally understood it) :- my long task thread locks the new EOEditingContext(childEc) (which then locks the childEc and the default editing context right?)- my refreshing page does Session._awakeInContext which triggers ERXEC.lock on the default ec  deadlock ! The page does not refresh !EOEditingContext ec = new EOEditingContext(session().defaultEditingContext()); If so, that is not going to work with a long response sort of page.You are going to need two new editing contexts:EOEditingContext parent = new EOEditingContext();EOEditingContext child = new EOEditingContext(parent);The wizard can save the child, and at the end, something needs to save the parent.  You will be responsible for locking these editing contexts.So, if I understand correctly you propose to use a child ec that does not have the default ec as parent but rather a new ec.Why did not I think about it ! Thanks !What difference is there switching from child = new EOEditingContext(ession().defaultEditingContext()); to child = new EOEditingContext(parent); ???I can't see any but if the two exist...And I would have some last questions to help me make things clear with locking and specially ERXEC :- To lock correctly ec in R-R loops, I can use MultiECLockManger and lock in session's awake and sleep, but if I create my new ecs as ERXECs, do I need to do something else or will it be automagically locked and unlocked even if er.extensions.ERXEC.defaultAutomaticLockUnlock = false ?- From what I understood, it just unlocks, so it still makes sense to use the MultiECLockManger right? For example to automatically lock my childEc in the wizard pages...Thanks a lo for the help !Fabricewww.easyshadow.comInternational Corporate ConsultingPalais de la Scala1 avenue Henri DunantSuite 1155MC - 98000 MonacoSkype: fabrice.pipartTel.  +377 97 98 21 04 (direct)Fax. +377 97 70 88 07  ___
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 archive@mail-archive.com

WebPdfReports and Header

2006-11-08 Thread Ute Hoffmann

Hallo,
is there someone around who has solved this problem:
- I use WebPdfReports
- I need to have it use the right header for Download of the generated 
pdf-Files for InternetExplorer 6.x, which throws an exception with the 
default implementation (under ssl, but I suspect the ssl does not make 
the difference).


So I would like to pass my headers via appendToResponse.

If I put it into the page I generate the pdf from under append to 
response and a var, which is set to true while the pdf generation takes 
place, it seems the header are not set or overwritten.


If I try to use pdfPage.appendToResonse I end up with no instance 
available in place of the pdf.


Can someone please advice?

Thanks,

Ute

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


Re: running a perl script with RunTime.Exec causes perl script to die

2006-11-08 Thread Patrick Middleton


On 7 Nov 2006, at 23:46, Johan Henselmans wrote:

I have produced a perl script to do some printing and database  
housekeeping, which is called using Runtime.Exec.


The script connects to a postgresql database, selects a parent- 
record via an argument and then prints some information from the  
children records.


When I run this script from a shell, it runs fine.

However, when I call the script from the webobjects application, I  
get an error message:

...

The java code that calls the script is:


commands[0] = /usr/bin/perl;
commands[1] = /usr/local/bin/printorder.pl;
commands[2] =  --ordernr;
commands[3] = order.orderid().toString();

	   vars[0] = PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/ 
bin;

vars[1] = LD_LIBRARY_PATH=$LD_LIBRARY_PATH;


...


Is there anybody that has experienced something similar and has  
come up with a solution?


You are setting the perl script's environment variables in a way that  
doesn't work.
If you run the perl script from a shell, the interpreter inherits a  
suitable environment.
If run from java.lang.Runtime, LD_LIBRARY_PATH will be set to  
'$LD_LIBRARY_PATH'.  The dollar expansion is something done for you  
by the shell; but there is no shell, so no substitution is done.   
Rewrite your code to initialize vars[0] and vars[1] using explicit  
values, perhaps obtained via java.lang.System.getenv().


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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


Re: WebPdfReports and Header

2006-11-08 Thread Kieran Kelleher

Hi Ute,

What you seem to be saying is that Internet Explorer has an  
error ... (not your app) when using the default implementation.


Perhaps this is related to the IE ssl file download bug which can be  
fixed one way like this:

http://homepage.mac.com/kelleherk/iblog/C463983418/E102943740/index.html

To troubleshoot headers, you can override  
WOApplication.dispatchRequest and log the response after calling  
super (or if you use Wonder, there is a logger for that if you look  
in ERXApplication.dispatchRequest.


HTH,

Kieran


On Nov 8, 2006, at 5:11 AM, Ute Hoffmann wrote:


Hallo,
is there someone around who has solved this problem:
- I use WebPdfReports
- I need to have it use the right header for Download of the  
generated pdf-Files for InternetExplorer 6.x, which throws an  
exception with the default implementation (under ssl, but I suspect  
the ssl does not make the difference).


So I would like to pass my headers via appendToResponse.

If I put it into the page I generate the pdf from under append to  
response and a var, which is set to true while the pdf generation  
takes place, it seems the header are not set or overwritten.


If I try to use pdfPage.appendToResonse I end up with no instance  
available in place of the pdf.


Can someone please advice?

Thanks,

Ute

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


This email sent to [EMAIL PROTECTED]


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


Re: running a perl script with RunTime.Exec causes perl script to die

2006-11-08 Thread Johan Henselmans


Op 8-nov-2006, om 12:18 heeft Patrick Middleton het volgende geschreven:



On 7 Nov 2006, at 23:46, Johan Henselmans wrote:



Thanks everyone for the reply. As always, the problem is in the  
spaces and commas. When I looked at the syslog of the program, I  
suddenly noticed that the ordernr was zero. As it happens, the third  
commands[] argument (--ordernr) had a space in front of it, that  
caused the perl script to run without arguments. No arguments, no sql  
query that could run, hence the error.


Logical, actually.

I have produced a perl script to do some printing and database  
housekeeping, which is called using Runtime.Exec.


The script connects to a postgresql database, selects a parent- 
record via an argument and then prints some information from the  
children records.


When I run this script from a shell, it runs fine.

However, when I call the script from the webobjects application, I  
get an error message:

...

The java code that calls the script is:


commands[0] = /usr/bin/perl;
commands[1] = /usr/local/bin/printorder.pl;
commands[2] =  --ordernr;

   ^^
Here is the order.



commands[3] = order.orderid().toString();

	   vars[0] = PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/ 
bin;

vars[1] = LD_LIBRARY_PATH=$LD_LIBRARY_PATH;




...


Is there anybody that has experienced something similar and has  
come up with a solution?


You are setting the perl script's environment variables in a way  
that doesn't work.
If you run the perl script from a shell, the interpreter inherits a  
suitable environment.
If run from java.lang.Runtime, LD_LIBRARY_PATH will be set to  
'$LD_LIBRARY_PATH'.  The dollar expansion is something done for you  
by the shell; but there is no shell, so no substitution is done.   
Rewrite your code to initialize vars[0] and vars[1] using explicit  
values, perhaps obtained via java.lang.System.getenv().




Thank s for the remark. You are right, although it did not aggravate  
the problem I had ;-)



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

___
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/johan% 
40netsense.nl


This email sent to [EMAIL PROTECTED]


Regards,

Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6273852


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


Re: WebPdfReports and Header

2006-11-08 Thread Steve Quirk



On Wed, 8 Nov 2006, Ute Hoffmann wrote:


Hallo,
is there someone around who has solved this problem:
- I use WebPdfReports
- I need to have it use the right header for Download of the generated 
pdf-Files for InternetExplorer 6.x, which throws an exception with the 
default implementation (under ssl, but I suspect the ssl does not make the 
difference).


So I would like to pass my headers via appendToResponse.

If I put it into the page I generate the pdf from under append to response 
and a var, which is set to true while the pdf generation takes place, it 
seems the header are not set or overwritten.


If I try to use pdfPage.appendToResonse I end up with no instance available 
in place of the pdf.


Can someone please advice?


There might be a better way, but here's what I use (I don;t specifically 
use WebPdfReports, so you'll have to work that out).


private static String ERROR_MSG = 
htmlheadtitleOops/title/headbodydiv align=\center\There 
was an error creating your report.  Please try again 
later./div/body/html;



public WOResponse getResponse() {
WOResponse aResponse;
byte[] pdf;

aResponse = new WOResponse() {
// IE 6 requires that the response be cache-able so that it can
// pass the content to another program.  override WO's default
// cache-preventing behaviour here and set headers below.
public void disableClientCaching() {
/* do nothing */;
}
public boolean _isClientCachingEnabled() {
return true;
}
};
pdf = null;
try {
pdf = getReport();
} catch (Exception e) {
System.err.println(Exception generating PDF:  + e);
e.printStackTrace(System.err);
}

if (pdf != null) {
aResponse.setContent(new NSData(pdf));
aResponse.setHeader(application/pdf, Content-Type);
aResponse.setHeader(attachment; filename=\rpt- + (reportNo++) + .pdf\, 
Content-Disposition);
aResponse.setHeader(public, Cache-Control);
aResponse.setHeader(cache, Pragma);
aResponse.setHeader(Integer.toString(pdf.length), Content-Length);
aResponse.setHeader(Report PDF, Content-Description);
} else {
aResponse.setContent(ERROR_MSG);
aResponse.setHeader(text/html, content-type);
}

return aResponse;
}

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


Client side validateForDelete() workaround

2006-11-08 Thread Florijan Stamenkovic

Hi all,


Some time ago I noticed that validaetForDelete() does not work  
properly in client side EOCustomObject's implementation. It turns out  
that the bug is in EOClassDescription.validateObjectForDelete 
(EOEnterpriseObject), which does not properly check relationships  
against deletion rules. The deletion rules however are present in the  
class description, so I overrode validateForDelete() in my common EO  
superclass. I have reported this bug quite some time ago, but it  
still is not fixed. Anyway, for anyone who might fight the same  
problem, the implementation is below. My first tests show that this  
works OK. Please let me know however if you find any mistakes in it.


Cheers,
Flor



/**
*   Overriden because the client side implementation of
	*	ttEOClassDescription.validateObjectForDelete(EOEnterpriseObject) 
/tt does not

*   perform proper checking against deletion rules.p
*
	*	This implementation first invoked the superclass' implementation  
(which might throw),
	*	and thereafter checks manually for relationship deletion rules and  
this object's

*   relationship, to verify that the object indeed is valid for 
deletion.
*
		@throws	NSValidation.ValidationException	If the object is in an  
invalid state

for deletion
*/
public void validateForDelete(){

//  exception aggregation
NSMutableArray allExceptions = null;

//  superclass implementation
try{
super.validateForDelete();
}catch(NSValidation.ValidationException ex){
allExceptions = new NSMutableArray();
allExceptions.addObject(ex);
}

//  get the relationships keys
NSArray toOneRelationshipKeys = toOneRelationshipKeys(),
toManyRelationshipKeys = toManyRelationshipKeys();

//  get the class description, needed for deletion rule 
checking
EOClassDescription cd = classDescription();

//  iterate through the to one relationship keys
for(int i = 0 ; i  toOneRelationshipKeys.count() ; i++){
String key = 
(String)toOneRelationshipKeys.objectAtIndex(i);
int deleteRule = cd.deleteRuleForRelationshipKey(key);

			//	if it is a deny delete rule for a relationship where the  
destination is

//  not null, the object is invalid for deletion
if(deleteRule == EOClassDescription.DeleteRuleDeny){
if(valueForKey(key) != null){
//  add an exception to the list
if(allExceptions == null) allExceptions 
= new NSMutableArray();
allExceptions.addObject(new 
NSValidation.ValidationException(
Can not delete a +entityName()+ 
that has a related +key,
valueForKey(key),
key));
}

			//	if it is a cascade delete rule, we need to make sure that if  
there is a

//  related object, it also is valid for deletion
}else if(deleteRule == 
EOClassDescription.DeleteRuleCascade){
Object relatedObject = valueForKey(key);
if(relatedObject != null){
try{

((EOValidation)relatedObject).validateForDelete();
}catch(NSValidation.ValidationException 
ex){
//  add an exception to the 
list
if(allExceptions == null) 
allExceptions = new NSMutableArray();
allExceptions.addObject(new 
NSValidation.ValidationException(
Can not delete a 
+entityName()+ that has a related +key+
 which isn't valid 
for deletion,
valueForKey(key),
key));
}
}
}
}// toOneRelationships loop


//  iterate through the to many relationship keys
for(int i 

Re: WebPdfReports and Header [Solved]

2006-11-08 Thread Ute Hoffmann

Hi Kieran,
thanks a lot, that was it. Using your bugfix did the trick for me and  
the download now works for IE 6.x as well.


Regards,

Ute

Am Mittwoch, 08.11.06 um 12:19 Uhr schrieb Kieran Kelleher:


Hi Ute,

What you seem to be saying is that Internet Explorer has an error  
... (not your app) when using the default implementation.


Perhaps this is related to the IE ssl file download bug which can be  
fixed one way like this:
http://homepage.mac.com/kelleherk/iblog/C463983418/E102943740/ 
index.html


To troubleshoot headers, you can override  
WOApplication.dispatchRequest and log the response after calling super  
(or if you use Wonder, there is a logger for that if you look in  
ERXApplication.dispatchRequest.


HTH,

Kieran


On Nov 8, 2006, at 5:11 AM, Ute Hoffmann wrote:


Hallo,
is there someone around who has solved this problem:
- I use WebPdfReports
- I need to have it use the right header for Download of the  
generated pdf-Files for InternetExplorer 6.x, which throws an  
exception with the default implementation (under ssl, but I suspect  
the ssl does not make the difference).


So I would like to pass my headers via appendToResponse.

If I put it into the page I generate the pdf from under append to  
response and a var, which is set to true while the pdf generation  
takes place, it seems the header are not set or overwritten.


If I try to use pdfPage.appendToResonse I end up with no instance  
available in place of the pdf.


Can someone please advice?

Thanks,

Ute

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


This email sent to [EMAIL PROTECTED]




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


Handy fault firing detection

2006-11-08 Thread Florijan Stamenkovic

Hi all,


Does anyone know an easy way to detect when a fault is fired? I would  
like to run some tests on my app to be able to better optimize fetching.


Thanks,
Flor
___
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 archive@mail-archive.com


Re: Handy fault firing detection

2006-11-08 Thread Patrick Middleton


On 8 Nov 2006, at 16:54, Florijan Stamenkovic wrote:


Hi all,


Does anyone know an easy way to detect when a fault is fired? I  
would like to run some tests on my app to be able to better  
optimize fetching.


Thanks,
Flor


How about overriding EOCustomObject.clearFault() to write a log message?

I myself am using EOEditingContext.Delegat.  
editingContextShouldFetchObjects(,) .  The qualifier in the  
EOFetchSpecification argument is usually distinctive; I have managed  
to exploit this to prevent going to the database when firing an array  
fault as a consequence of adding or removing detail objects from a to- 
many relationship.



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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


Re: Locking and threads

2006-11-08 Thread Chuck Hill

Hi Fabrice,

On Nov 8, 2006, at 1:37 AM, Fabrice Pipart wrote:

On Nov 7, 2006, at 6:59 PM, Chuck Hill wrote:

On Nov 7, 2006, at 4:10 AM, Fabrice Pipart wrote:


Yes sure !
I think I forgot to mention that my child ec was already created ;-)


As you have used it, that is the parent EC!  :-)


That's right ;-)
And childEc = new EOEditingContext(session().defaultEditingContext());



Actually here is what I want to : create a long response page in  
a wizard.
All the wizard pages use the same child ec (its passed through  
components).


All I want to do is use an editing context in the long response  
thread that does not commit its changes to the database directly.
That's why I use a child ec in the wizard pages : to be able to  
do a session().defaultEditingContext().revert();


And that is what is causing the deadlock I would guess.  Is your  
code equivalent to:


Here is where the deadlock comes from (I finally understood it) :
- my long task thread locks the new EOEditingContext(session 
().defaultEditingContext()) (which then locks the childEc and the  
default editing context right?)


Yes, locking the child locks the parent.  Please note that the  
opposite is not true: locking the parent does NOT lock the children.



- my refreshing page does Session._awakeInContext which triggers  
ERXEC.lock on the default ec  deadlock ! The page does not  
refresh !




Correct.


EOEditingContext ec = new EOEditingContext(session 
().defaultEditingContext());


If so, that is not going to work with a long response sort of page.

You are going to need two new editing contexts:

EOEditingContext parent = new EOEditingContext();
EOEditingContext child = new EOEditingContext(parent);

The wizard can save the child, and at the end, something needs to  
save the parent.  You will be responsible for locking these  
editing contexts.


So, if I understand correctly you propose to use a child ec that  
does not have the default ec as parent but rather a new ec.


Yes, correct.



Why did not I think about it ! Thanks !


It is only obvious after the first time!


What difference is there switching from child = new EOEditingContext 
(ession().defaultEditingContext()); to child = new EOEditingContext 
(parent); ???

I can't see any but if the two exist...


The difference is that session().defaultEditingContext() won't get  
locked when you lock the child or parent.



And I would have some last questions to help me make things clear  
with locking and specially ERXEC :


- To lock correctly ec in R-R loops, I can use MultiECLockManger  
and lock in session's awake and sleep, but if I create my new ecs  
as ERXECs, do I need to do something else or will it be  
automagically locked and unlocked even if  
er.extensions.ERXEC.defaultAutomaticLockUnlock = false ?
- From what I understood, it just unlocks, so it still makes sense  
to use the MultiECLockManger right? For example to automatically  
lock my childEc in the wizard pages...


Exactly.  In this case you probably don't want either ERXECs or the  
MultiECLockManger.  The long request page is running outside of the  
RR Loop.  In this case you are better off managing the locking  
yourself.  Probably just lock on creation and unlock on save/cancel/ 
error will be fine.


Chuck


--

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