Re: WOPopUpButton bug 5.3 DST : SOLVED

2007-04-03 Thread Dev WO

Hello Olav,



Hi,

Just to follow up regarding the escaping problem.

It turns out using:

String aURL = context().directActionURLForActionNamed("resolve",  
queryDict());


Will return an escaped string like so:

/WebObjects/Resolver.woa/wa/resolve? 
catId=1001249&ni=y&sort=ddown


This behavior is new since 5.3 I guess.


I think it was corrected in 5.2.x I filled a bug report to get the  
"&" escaped (it's not standard compliant if they are not escaped).




And I actually want:

/WebObjects/Resolver.woa/wa/resolve?catId=1001249&ni=y&sort=ddown


Well no, it's not what you want;) you want the & escaped, this is how  
it has to be:) Try to use your application you'll see it's working  
with the &
If you look at the status bar in you web browser, you won't see the  
& pour only & and if you activate the link you'll also get an &  
in the address bar instead of the &. This is the expected  
behavior, you shouldn't have a non-escaped & in a url.


So I have to run the returned string through an unescaping routine  
to get the above uri.


Once I did that everything works fine.
Are you sure it wasn't working with the &? if it didn't it's a  
bug somewhere else, not the &



Hope this helps someone else.

Regards,

Olav


On Apr 2, 2007, at 4:53 AM, Olav Anderson wrote:




On Apr 2, 2007, at 12:00 AM, Dev WO wrote:


Hi Olav,

It's not related to DST update. I think it appears in the 5.3.x  
but I'm not completely sure.
It's a but when using the "href" binding, but I don't understand  
why you have a hyperlink in an option value, maybe it's just a  
test you made.
Anyway, search the list for "bozo ampersand" you'll find some way  
to get around this (Daniel Muller, "WebObjects 5.3.1 Redirect  
Bug" - 17th february 2006)


I'm pretty much never use the "href" binding and instead use the  
directaction bindings, but maybe someone using Wonder frameworks  
can confirm if Wonder also experience this bug.

If it's not the case, you could link to Wonder frameworks.

Xavier

PS: Thanks for not using a previous thread to post a new  
question, it's ruining the thread view;)




Hey,

I just upgraded to 5.3 DST from 5.2 and noticed a bug in the  
WOPopUpButton component.


I'm sending down a url as a value and it get double escaped like  
so:


/ 
WebObjects/Resolver.woa/wa/resolve? 
catId=1001221&ni=y&sort=ddown#1001221


Notice the two & ?

That's the first amp being escaped.


Has anyone else experienced this problem?

Thanks!




___
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/webobjects% 
40anazys.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/olava%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/webobjects% 
40anazys.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: WOPopUpButton bug 5.3 DST : SOLVED

2007-04-03 Thread Olav Anderson


Hi,

Just to follow up regarding the escaping problem.

It turns out using:

String aURL = context().directActionURLForActionNamed("resolve",  
queryDict());


Will return an escaped string like so:

/WebObjects/Resolver.woa/wa/resolve? 
catId=1001249&ni=y&sort=ddown


This behavior is new since 5.3 I guess.

And I actually want:

/WebObjects/Resolver.woa/wa/resolve?catId=1001249&ni=y&sort=ddown

So I have to run the returned string through an unescaping routine to  
get the above uri.


Once I did that everything works fine.


Hope this helps someone else.

Regards,

Olav


On Apr 2, 2007, at 4:53 AM, Olav Anderson wrote:




On Apr 2, 2007, at 12:00 AM, Dev WO wrote:


Hi Olav,

It's not related to DST update. I think it appears in the 5.3.x  
but I'm not completely sure.
It's a but when using the "href" binding, but I don't understand  
why you have a hyperlink in an option value, maybe it's just a  
test you made.
Anyway, search the list for "bozo ampersand" you'll find some way  
to get around this (Daniel Muller, "WebObjects 5.3.1 Redirect Bug"  
- 17th february 2006)


I'm pretty much never use the "href" binding and instead use the  
directaction bindings, but maybe someone using Wonder frameworks  
can confirm if Wonder also experience this bug.

If it's not the case, you could link to Wonder frameworks.

Xavier

PS: Thanks for not using a previous thread to post a new question,  
it's ruining the thread view;)




Hey,

I just upgraded to 5.3 DST from 5.2 and noticed a bug in the  
WOPopUpButton component.


I'm sending down a url as a value and it get double escaped like so:

/ 
WebObjects/Resolver.woa/wa/resolve? 
catId=1001221&ni=y&sort=ddown#1001221


Notice the two & ?

That's the first amp being escaped.


Has anyone else experienced this problem?

Thanks!




___
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/webobjects% 
40anazys.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/olava%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: WOForm Question

2007-04-03 Thread David Avendasora


On Apr 3, 2007, at 3:49 PM, Chuck Hill wrote:


Maybe post some of the HTML and WOD files.


Okay, here you go:

WOD:

BOMCFixedScrap: WOTextField {
size = 8;
value = aRequestedBillOfMaterialBillOfMaterialComponent.scrapFixed;
numberformat = "#,##0.00";
class = "small";
}

BOMCQuantity: WOTextField {
size = 8;
value = aRequestedBillOfMaterialBillOfMaterialComponent.partQuantity;
numberformat = "#,##0.00";
class = "small";
}

BOMCScrapPercent: WOTextField {
size = 6;
value = aRequestedBillOfMaterialBillOfMaterialComponent.scrapPercent;
numberformat = "#,##0.";
class = "small";
}

BillOfMaterialComponentRepetition: WORepetition {
item = aRequestedBillOfMaterialBillOfMaterialComponent;
	list =  
aRequestedBillOfMaterialRoutingStep.billOfMaterialComponentsDefaultOrder 
ing;

}

PopUpButtonBOMCParts: WOPopUpButton {
class = "small";
displayString = aRequestedBOMComponentPart.partDescription;
item = aRequestedBOMComponentPart;
list = requestedBOMComponentParts;
selection = selectedRequestedBOMComponentPart;
}

PopUpButtonBOMCUnitsOfMeasure: WOPopUpButton {
displayString = aRequestedBOMRSComponentUnitOfMeasure.uomNamePlural;
item = aRequestedBOMRSComponentUnitOfMeasure;
list = requestedBOMRSComponentUnitOfMeasure;
selection = selectedRequestedBOMRSComponentUnitOfMeasure;
}

PopUpButtonBillOfMaterialParts: WOPopUpButton {
displayString = aRequestedBillOfMaterialPart.partDescription;
item = aRequestedBillOfMaterialPart;
list = requestedBillOfMaterialParts;
selection = selectedRequestedBillOfMaterialPart;
}

PopUpButtonBillOfMaterialToolConfigurations: WOPopUpButton {
class = "small";
	displayString =  
aPossibleBillOfMaterialToolConfiguration.configurationDescription;

item = aPossibleBillOfMaterialToolConfiguration;
list = possibleBillOfMaterialToolConfigurations;
selection = selectedPossibleBillOfMaterialToolConfiguration;
}

PopUpButtonBillOfMaterialTools: WOPopUpButton {
displayString = aRequestedBillOfMaterialTool.toolName;
item = aRequestedBillOfMaterialTool;
list = requestedBillOfMaterialTools;
selection = selectedRequestedBillOfMaterialTool;
}

PopUpButtonBillOfMaterialTypes: WOPopUpButton {
displayString = aRequestedBillOfMaterialBillOfMaterialType.typeName;
item = aRequestedBillOfMaterialBillOfMaterialType;
list = requestedBillOfMaterialBillOfMaterialTypes;
selection = selectedBillOfMaterialBillOfMaterialType;
}

PopUpButtonBillOfMaterialUnitsOfMeasure: WOPopUpButton {
displayString = aRequestedBillOfMaterialUnitOfMeasure.uomNamePlural;
item = aRequestedBillOfMaterialUnitOfMeasure;
list = requestedBillOfMaterialUnitsOfMeasure;
selection = selectedRequestedBillOfMaterialUnitOfMeasure;
}

PopUpButtonRoutingStepTools: WOPopUpButton {
item = aRequestedBOMRoutingStepTool;
list = requestedBOMRoutingStepTools;
selection = selectedRequestedBOMRoutingStepTool;
displayString = aRequestedBOMRoutingStepTool.toolName;
}

RadioButtonIsActiveNo: WORadioButton {
name = "isActive";
selection = selectedRequestedBillOfMaterialIsActive;
value = zero;
}

RadioButtonIsActiveYes: WORadioButton {
name = "isActive";
selection = selectedRequestedBillOfMaterialIsActive;
value = one;
}

RadioButtonIsDefaultNo: WORadioButton {
name = "isDefault";
selection = selectedRequestedBillOfMaterialIsDefault;
value = zero;
}

RadioButtonIsDefaultYes: WORadioButton {
name = "isDefault";
selection = selectedRequestedBillOfMaterialIsDefault;
value = one;
}

Repetition1: WORepetition {
list = requestedBillOfMaterialToolConfigurations;
item = aRequestedBillOfMaterialToolConfiguration;
}

RoutingStepRepetition: WORepetition {
item = aRequestedBillOfMaterialRoutingStep;
list = requestedBillOfMaterial.routingStepsDefaultOrdering;
}

SubmitButtonApply: WOSubmitButton {
action = applyChangesToRequestedBillOfMaterial;
value = "Apply";
}

TextField2: WOTextField {
numberformat = "#,##0";
size = 3;
value = requestedBillOfMaterial.partQuantity;
}

billOfMaterialForm: WOForm {
}

billOfMaterialToolConfiguration: WOString {
	value =  
aRequestedBillOfMaterialToolConfiguration.configurationDescription;

}

cloneLink: WOHyperlink {
action = cloneBillOfMaterial;
}

lineNumber: WOTextField {
class = "small";
size = 2;
value = aRequestedBillOfMaterialBillOfMaterialComponent.lineNumber;
}

routingDescription: WOString {
value = requestedBillOfMaterial.routingDescription;
}

routingStepDescription: WOTextField {
class = "small";
size = 20;
value = aRequestedBillOf

Re: Writing IE specific code

2007-04-03 Thread Helmut Schottmüller

Hi Jean Pierre,

use -WOIncludeCommentsInResponse true with your application, The WO  
leaves the comments in the response.


Regards,
Helmut

Am 02.04.2007 um 17:55 schrieb Jean Pierre Malrieu:

I know it is not recommended, but I am trying (for the first time)  
to write specific code for IE (which has problems with Ajax).
I have tried to use comments in HTML ( 

Re: WOForm Question

2007-04-03 Thread Chuck Hill

Maybe post some of the HTML and WOD files.


On Apr 3, 2007, at 1:41 PM, David Avendasora wrote:

Yes, it is Routing <--->> RoutingStep, but the form I'm working on  
is only for editing existing and existing Routing. By it's nature,  
every (it's required in the EOModel) Routing has at least 1  
RoutingStep.


I have a form that displays everything correctly and everything  
seems to be bound properly, but when I submit the form, I get a  
nullPointerException on the aRoutingStep.setAttribute(attribute);  
call. The currentRouting.setAttribute(attribute); call works  
perfectly.


Again, the page builds properly with all the current values in the  
WOTextFields and WOPopUpButtons but when I try to submit the form,  
I get the nullPointerException.


Dave

On Apr 3, 2007, at 3:19 PM, Robert Walker wrote:


David,

What does your model look like?  Is it something like:

Routing <>> RoutingStep

With a relationship from Routing to RoutingStep named routingSteps.

Guessing here, but I suppose you have a form for entering  
information on an instance of Route:


Now your are trying to update an attribute of RoutingStep with a  
binding like:


currentRoute.routingSteps.someAttribute

If my guess is correct, well you can't do that because  
"currentRoute.routingSteps" would return "null" if there are no  
routing steps.  I'm making this assumption because I've seen  
beginners to WO try this.


There are a few options for dealing with this case.  But most  
would include creating an interface to display the array of  
routingSteps and actions to add and remove routing steps from the  
array.  You also need to properly manage the to-many relationship  
when adding and removing.  Generally using  
addObjectToBothSidesOfRelationshipWithKey.


Once you are able to iterate over your routingSteps relationship  
then you can bind your form controls to "currentRoutingStep" or  
whatever you decide to call the iterator reference.


On Apr 3, 2007, at 3:39 PM, David Avendasora wrote:

Okay, it isn't a nesting problem on the web-component side of  
things. I think it is a problem with how I'm stepping through the  
objects to update them. Simple attributes and to-one  
relationships are easy, to-many relationship updates have me  
stumped.


Can anyone give me an example of how to iterate through the  
related objects and update them with the values submitted in the  
form?


Thanks,

Dave

On Apr 3, 2007, at 2:19 PM, Chuck Hill wrote:



On Apr 3, 2007, at 12:12 PM, David Avendasora wrote:


Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level  
component) but as soon as I try to update attributes of  
destination of the to-many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding  
to be null is the aRoutingStep object that is the "item"  
binding of the WORepetition. The "list" binding of the  
WORepetition is aRouting.routingSteps.


Am I missing something?


A nesting problem?




Re: WOForm Question

2007-04-03 Thread David Avendasora
Yes, it is Routing <--->> RoutingStep, but the form I'm working on is  
only for editing existing and existing Routing. By it's nature, every  
(it's required in the EOModel) Routing has at least 1 RoutingStep.


I have a form that displays everything correctly and everything seems  
to be bound properly, but when I submit the form, I get a  
nullPointerException on the aRoutingStep.setAttribute(attribute);  
call. The currentRouting.setAttribute(attribute); call works perfectly.


Again, the page builds properly with all the current values in the  
WOTextFields and WOPopUpButtons but when I try to submit the form, I  
get the nullPointerException.


Dave

On Apr 3, 2007, at 3:19 PM, Robert Walker wrote:


David,

What does your model look like?  Is it something like:

Routing <>> RoutingStep

With a relationship from Routing to RoutingStep named routingSteps.

Guessing here, but I suppose you have a form for entering  
information on an instance of Route:


Now your are trying to update an attribute of RoutingStep with a  
binding like:


currentRoute.routingSteps.someAttribute

If my guess is correct, well you can't do that because  
"currentRoute.routingSteps" would return "null" if there are no  
routing steps.  I'm making this assumption because I've seen  
beginners to WO try this.


There are a few options for dealing with this case.  But most would  
include creating an interface to display the array of routingSteps  
and actions to add and remove routing steps from the array.  You  
also need to properly manage the to-many relationship when adding  
and removing.  Generally using  
addObjectToBothSidesOfRelationshipWithKey.


Once you are able to iterate over your routingSteps relationship  
then you can bind your form controls to "currentRoutingStep" or  
whatever you decide to call the iterator reference.


On Apr 3, 2007, at 3:39 PM, David Avendasora wrote:

Okay, it isn't a nesting problem on the web-component side of  
things. I think it is a problem with how I'm stepping through the  
objects to update them. Simple attributes and to-one relationships  
are easy, to-many relationship updates have me stumped.


Can anyone give me an example of how to iterate through the  
related objects and update them with the values submitted in the  
form?


Thanks,

Dave

On Apr 3, 2007, at 2:19 PM, Chuck Hill wrote:



On Apr 3, 2007, at 12:12 PM, David Avendasora wrote:


Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level  
component) but as soon as I try to update attributes of  
destination of the to-many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding to  
be null is the aRoutingStep object that is the "item" binding of  
the WORepetition. The "list" binding of the WORepetition is  
aRouting.routingSteps.


Am I missing something?


A nesting problem?




Re: WOForm Question

2007-04-03 Thread Robert Walker

David,

What does your model look like?  Is it something like:

Routing <>> RoutingStep

With a relationship from Routing to RoutingStep named routingSteps.

Guessing here, but I suppose you have a form for entering information  
on an instance of Route:


Now your are trying to update an attribute of RoutingStep with a  
binding like:


currentRoute.routingSteps.someAttribute

If my guess is correct, well you can't do that because  
"currentRoute.routingSteps" would return "null" if there are no  
routing steps.  I'm making this assumption because I've seen  
beginners to WO try this.


There are a few options for dealing with this case.  But most would  
include creating an interface to display the array of routingSteps  
and actions to add and remove routing steps from the array.  You also  
need to properly manage the to-many relationship when adding and  
removing.  Generally using addObjectToBothSidesOfRelationshipWithKey.


Once you are able to iterate over your routingSteps relationship then  
you can bind your form controls to "currentRoutingStep" or whatever  
you decide to call the iterator reference.


On Apr 3, 2007, at 3:39 PM, David Avendasora wrote:

Okay, it isn't a nesting problem on the web-component side of  
things. I think it is a problem with how I'm stepping through the  
objects to update them. Simple attributes and to-one relationships  
are easy, to-many relationship updates have me stumped.


Can anyone give me an example of how to iterate through the related  
objects and update them with the values submitted in the form?


Thanks,

Dave

On Apr 3, 2007, at 2:19 PM, Chuck Hill wrote:



On Apr 3, 2007, at 12:12 PM, David Avendasora wrote:


Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level  
component) but as soon as I try to update attributes of  
destination of the to-many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding to  
be null is the aRoutingStep object that is the "item" binding of  
the WORepetition. The "list" binding of the WORepetition is  
aRouting.routingSteps.


Am I missing something?


A nesting problem?




Re: Reading NSData from a file

2007-04-03 Thread Kieran Kelleher
Thanks for the insight  just shows hot important it is to read  
the API carefully!


On Apr 3, 2007, at 11:55 AM, Mike Schrag wrote:

It doesn't appear that new NSData(InputStream, int) closes the  
stream ... Curiously, new NSData(file) DOES, but that's deprecated.


 ___
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: WOForm Question

2007-04-03 Thread David Avendasora
Okay, it isn't a nesting problem on the web-component side of things.  
I think it is a problem with how I'm stepping through the objects to  
update them. Simple attributes and to-one relationships are easy, to- 
many relationship updates have me stumped.


Can anyone give me an example of how to iterate through the related  
objects and update them with the values submitted in the form?


Thanks,

Dave

On Apr 3, 2007, at 2:19 PM, Chuck Hill wrote:



On Apr 3, 2007, at 12:12 PM, David Avendasora wrote:


Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level  
component) but as soon as I try to update attributes of  
destination of the to-many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding to  
be null is the aRoutingStep object that is the "item" binding of  
the WORepetition. The "list" binding of the WORepetition is  
aRouting.routingSteps.


Am I missing something?


A nesting problem?




Re: WOForm Question

2007-04-03 Thread Chuck Hill


On Apr 3, 2007, at 12:12 PM, David Avendasora wrote:


Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level  
component) but as soon as I try to update attributes of destination  
of the to-many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding to be  
null is the aRoutingStep object that is the "item" binding of the  
WORepetition. The "list" binding of the WORepetition is  
aRouting.routingSteps.


Am I missing something?


A nesting problem?




Re: WOForm Question

2007-04-03 Thread David Avendasora

Okay, I have one form on the page. One submit button in the form.

It will update the attributes of "Routing" (the top level component)  
but as soon as I try to update attributes of destination of the to- 
many relationship (RoutingStep) I get a  
java.lang.NullPointerException. The object that it is finding to be  
null is the aRoutingStep object that is the "item" binding of the  
WORepetition. The "list" binding of the WORepetition is  
aRouting.routingSteps.


Am I missing something?

Dave



On Mar 30, 2007, at 5:24 PM, Chuck Hill wrote:



On Mar 30, 2007, at 3:01 PM, David Avendasora wrote:

I've got a somewhat complicated form I'm working on and I'm  
running into problems. I can't find detailed documentation on  
WOForm so here's my question (please point me to any useful  
documentation other than the WOBuiler Dynamic Components Reference):


I have three entities Routing, RoutingStep and Component they are  
related as follows:


-> to-one
=> to-many

Routing => RoutingStep => Component
Component -> RoutingStep -> Routing

Ideally, I'd like to be able to edit them all-together in one  
form, but I'm not sure if it is possible or not.


It might be a large page...



This goes way beyond having multiple submit buttons.

Here's an example of the stucture:




Routing
-RoutingStep 1 of Routing
--Component 1 of RoutingStep 1
--Component 2 of RoutingStep 1
--Component 3 of RoutingStep 1
-RoutingStep 2 of Routing
--Component 1 of RoutingStep 2
--Component 2 of RoutingStep 2
--Component 3 of RoutingStep 2
-RoutingStep Etc, etc, etc.




Each entity, of course, has it's own attributes and other to-one  
relationships.


Without being able to nest WOForms inside HTML tables


You can nest them inside of HTML tables, what you can't do is to  
nest them inside of each other.



, it makes layout difficult, and I can't find documentation on if  
more than one form is allowed on one page, etc.


You can have more than one on a page, but like this:


///



///


What you can't do is this:


///

///

///



Or this


///

///

///


Not sure what your problem is beyond that.  Care to explain  further?


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


Re: Saving uploaded file data to database

2007-04-03 Thread Mike Schrag

Oh, I forgot about this:
http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/ 
Development/Thumbnailing


And you'll want to read this:
http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/ 
Development/Database_vs_Filesystem


ms

On Apr 3, 2007, at 2:22 PM, Janine Sisk wrote:

I'm back!  Setting the filePath binding fixed the problem I was  
having, but now I'm on to a new one.


My EOModel contains a String, a CLOB, two NSTimestamps and two  
BLOBs (actually the blobs are in their own model).  Each of the  
corresponding components is bound to them, like so:


Description : WOText {
value = newPanel.description;
}

ImageFile : WOFileUpload {
filePath = imageFileName;
mimeType = imageMimeType;
data = newPanelImages.big_image;
}

This works fine for everything except the BLOBs, which are tripping  
the "not null" constraint on those fields in the database.


I have code to check the length of newPanelImages.big_image and it  
is correct, but somehow it's not working.  Here's how I'm doing the  
save:


EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(newPanelImages);
ec.saveChanges();

And, just in case I'm misinterpreting something, here's the error:

com.webobjects.eoaccess.EOGeneralAdaptorException:  
EvaluateExpression failed: : Next exception:SQL State:23 subclass =  
00 -- error code: 357 -- msg: Exception condition 357. Integrity  
constraint violation (CHECK, PANELIMAGES._C07(\"bigImage\"  
IS NOT NULL)). Next exception:SQL State:23 subclass = 00 -- error  
code: 357 -- msg: Exception condition 357. Integrity constraint  
violation (CHECK, PANELIMAGES._C09(\"thumbnail\" IS NOT  
NULL)). Next exception:SQL State:40 subclass = 00 -- error code:  
363 -- msg: Exception condition 363. Transaction rollback.


It's like the data is not getting copied from the newPanelImages  
object to the database.  Is there something special one has to do  
to handle BLOBs in FrontBase?


thanks,

janine

 ___
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/mschrag% 
40mdimension.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: Saving uploaded file data to database

2007-04-03 Thread Chuck Hill


On Apr 3, 2007, at 11:22 AM, Janine Sisk wrote:

I'm back!  Setting the filePath binding fixed the problem I was  
having, but now I'm on to a new one.


My EOModel contains a String, a CLOB, two NSTimestamps and two  
BLOBs (actually the blobs are in their own model).  Each of the  
corresponding components is bound to them, like so:


Description : WOText {
value = newPanel.description;
}

ImageFile : WOFileUpload {
filePath = imageFileName;
mimeType = imageMimeType;
data = newPanelImages.big_image;
}

This works fine for everything except the BLOBs, which are tripping  
the "not null" constraint on those fields in the database.


I have code to check the length of newPanelImages.big_image and it  
is correct, but somehow it's not working.  Here's how I'm doing the  
save:


EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(newPanelImages);
ec.saveChanges();

And, just in case I'm misinterpreting something, here's the error:

com.webobjects.eoaccess.EOGeneralAdaptorException:  
EvaluateExpression failed: : Next exception:SQL State:23 subclass =  
00 -- error code: 357 -- msg: Exception condition 357. Integrity  
constraint violation (CHECK, PANELIMAGES._C07(\"bigImage\"  
IS NOT NULL)). Next exception:SQL State:23 subclass = 00 -- error  
code: 357 -- msg: Exception condition 357. Integrity constraint  
violation (CHECK, PANELIMAGES._C09(\"thumbnail\" IS NOT  
NULL)). Next exception:SQL State:40 subclass = 00 -- error code:  
363 -- msg: Exception condition 363. Transaction rollback.


It's like the data is not getting copied from the newPanelImages  
object to the database.  Is there something special one has to do  
to handle BLOBs in FrontBase?


Yes, there is.  :-)  FrontBase creates the rows and then updates the  
CLOB contents.  Make the column nullable in the database.


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


Re: Saving uploaded file data to database

2007-04-03 Thread Pascal Robert
If FrontBase works like Oracle DB for BLOB, it will first create a  
pointer for the BLOB, and enter the data after, so I guess you cannot  
put NOT NULL constraint on BLOB without problems.


I'm back!  Setting the filePath binding fixed the problem I was  
having, but now I'm on to a new one.


My EOModel contains a String, a CLOB, two NSTimestamps and two  
BLOBs (actually the blobs are in their own model).  Each of the  
corresponding components is bound to them, like so:


Description : WOText {
value = newPanel.description;
}

ImageFile : WOFileUpload {
filePath = imageFileName;
mimeType = imageMimeType;
data = newPanelImages.big_image;
}

This works fine for everything except the BLOBs, which are tripping  
the "not null" constraint on those fields in the database.


I have code to check the length of newPanelImages.big_image and it  
is correct, but somehow it's not working.  Here's how I'm doing the  
save:


EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(newPanelImages);
ec.saveChanges();

And, just in case I'm misinterpreting something, here's the error:

com.webobjects.eoaccess.EOGeneralAdaptorException:  
EvaluateExpression failed: : Next exception:SQL State:23 subclass =  
00 -- error code: 357 -- msg: Exception condition 357. Integrity  
constraint violation (CHECK, PANELIMAGES._C07(\"bigImage\"  
IS NOT NULL)). Next exception:SQL State:23 subclass = 00 -- error  
code: 357 -- msg: Exception condition 357. Integrity constraint  
violation (CHECK, PANELIMAGES._C09(\"thumbnail\" IS NOT  
NULL)). Next exception:SQL State:40 subclass = 00 -- error code:  
363 -- msg: Exception condition 363. Transaction rollback.


It's like the data is not getting copied from the newPanelImages  
object to the database.  Is there something special one has to do  
to handle BLOBs in FrontBase?


thanks,


___
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


Saving uploaded file data to database

2007-04-03 Thread Janine Sisk
I'm back!  Setting the filePath binding fixed the problem I was  
having, but now I'm on to a new one.


My EOModel contains a String, a CLOB, two NSTimestamps and two BLOBs  
(actually the blobs are in their own model).  Each of the  
corresponding components is bound to them, like so:


Description : WOText {
value = newPanel.description;
}

ImageFile : WOFileUpload {
filePath = imageFileName;
mimeType = imageMimeType;
data = newPanelImages.big_image;
}

This works fine for everything except the BLOBs, which are tripping  
the "not null" constraint on those fields in the database.


I have code to check the length of newPanelImages.big_image and it is  
correct, but somehow it's not working.  Here's how I'm doing the save:


EOEditingContext ec = session().defaultEditingContext();
ec.insertObject(newPanelImages);
ec.saveChanges();

And, just in case I'm misinterpreting something, here's the error:

com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression  
failed: : Next exception:SQL State:23 subclass = 00 -- error code:  
357 -- msg: Exception condition 357. Integrity constraint violation  
(CHECK, PANELIMAGES._C07(\"bigImage\" IS NOT NULL)). Next  
exception:SQL State:23 subclass = 00 -- error code: 357 -- msg:  
Exception condition 357. Integrity constraint violation (CHECK,  
PANELIMAGES._C09(\"thumbnail\" IS NOT NULL)). Next  
exception:SQL State:40 subclass = 00 -- error code: 363 -- msg:  
Exception condition 363. Transaction rollback.


It's like the data is not getting copied from the newPanelImages  
object to the database.  Is there something special one has to do to  
handle BLOBs in FrontBase?


thanks,

janine

 ___
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: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread David Avendasora
Overkill or not, I think this is an excellent "Best Practice" as it  
enforces something that, at least to me, sounds like is a requirement  
anyway.


On Apr 3, 2007, at 10:24 AM, John Huss wrote:


I had this problem a while back.  It might be overkill, but I modified
by eogenerator template to make the methods FINAL so that I would
never make that mistake again.


___
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: Reading NSData from a file

2007-04-03 Thread Pascal Robert


Le 07-04-03 à 00:56, Mike Schrag a écrit :

What I'm trying to do here is to read back in the results of  
having run convert on an uploaded image file and making a  
thumbnail from it.  The files are being written only for the  
convenience of convert, so if I could get out of writing them  
that would be all the better.


What are you using to convert it?  AWT is not too bad for a Java  
solution.
If by "not too bad" you mean "100x slower than native code" ... It  
all depends on your needs:


* Slow, Easy, Pure Java, Cross Platform = JAI / Java2D (JAI is not  
hardware accelerated on OS X)
* Faster, Pretty Annoying, Native, Mostly Cross Platform (portable  
c) = System call to ImageMagick
* Faster, Way Annoying, Native, Mostly Cross Platform (portable c)  
= JNI ImageMagick (this has huge memory pitfalls, don't do it)

* Really Fast, Easy, OS X Only = System call to 'sips'
* Super Fast, More Annoying, OS X Only = JNI CoreImage/ImageIO  
(Brendan posted his version of this on wocode)


Or you can use QuickTime4Java, we use it to convert pictures that  
people upload with a WOFileUpload.  It can work on Windows since  
QuickTime is available on it (you have to do a custom install on  
Windows to get QT4J).  QT4J use JNI, so I guess the speed is ok.


Sample (sorry for the French names)

import quicktime.util.*;
import quicktime.qd.*;
import quicktime.std.movies.media.*;
import quicktime.std.image.*;
import quicktime.QTSession;

public static NSData ajoutPhoto(NSData nouvellePhotoData) {
ImageDescription descOriginale;
ImageDescription descNouvelle = null;
float ratio;
int nWidth = 0;
int nHeigth = 0;
Float fWidth;
Float fHeigth;

try {
// Nous devons toujours ouvrir une session QuickTime
QTSession.open();

	QTHandleRef fileContentsHandle = new QTHandle 
(nouvellePhotoData.bytes());
	GraphicsImporter aGraphicsImporter = new GraphicsImporter(new  
DataRef(fileContentsHandle));


	// La classe ImageDescription retourne quelques informations a  
propos de l'image
	descOriginale = ImageDescription.fromGraphicsImporter 
(aGraphicsImporter);


fWidth = new Float(descOriginale.getWidth());
fHeigth = new Float(descOriginale.getHeight());
NumberFormat unDigit = NumberFormat.getInstance(Locale.US);
unDigit.setMaximumFractionDigits(1);
unDigit.setMinimumFractionDigits(1);

if (descOriginale.getWidth() > descOriginale.getHeight()) {
nWidth = 300;
ratio = fWidth.floatValue() / fHeigth.floatValue();

if (unDigit.format(ratio).equals("1.5")) {
nHeigth = 200;
} else if (unDigit.format(ratio).equals("1.3")) {
nHeigth = 225;
} else {
// C'est quoi ce ratio ??
Float dRatio = new Float(ratio);
float ratio3 = (new Float("300.00")).floatValue 
() / ratio;

nHeigth = Math.round(ratio3);
NSLog.out.appendln("Format bizarre de photo: " +  
unDigit.format(ratio));

}
}

QDRect myFinalRect = new QDRect();
myFinalRect.setWidth(nWidth);
myFinalRect.setHeight(nHeigth);
myFinalRect.setX(0);
myFinalRect.setY(0);

	QDGraphics imagesGWorld = aGraphicsImporter.getImageDescription 
().newGWorld(0);


// On ouvre le contenu du fichier original
QDGraphics myGWorld = new QDGraphics(32, myFinalRect, 0);
QTImage.decompress(new RawEncodedImage(nouvellePhotoData.bytes()),
aGraphicsImporter.getImageDescription(),
imagesGWorld,
myFinalRect,
0 /* srcCopy */);

// Et on genere la nouvelle image
RawEncodedImage encodedImage = new RawEncodedImage(120, true);

descNouvelle = QTImage.compress(imagesGWorld,  
myFinalRect, 1024,0x6A706567,  /* "JPEG" */ encodedImage);


	nouvellePhotoData = new NSData(encodedImage.getBytes(), 0,  
descNouvelle.getDataSize());


QTSession.close();
return nouvellePhotoData;

} catch (quicktime.std.StdQTException qtex) {
NSLog.out.appendln(qtex.toString());
} catch (quicktime.QTException qtex) {
NSLog.out.appendln(qtex.toString());
}
return null;

}

___
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: WOWODC (Pascal Robert)

2007-04-03 Thread Geoff Hopson

...or Wails :-P

On 03/04/07, Chuck Hill <[EMAIL PROTECTED]> wrote:

Maybe we should call our sessions Web 2.0 Objects  :-P


On Apr 3, 2007, at 10:07 AM, Pascal Robert wrote:

>
> Le 07-04-03 à 12:23, Jeremy Rosenberg a écrit :
>
>> Does anybody else remember the massive lineup for the one and only
>> WebObjects session at WWDC last year?  How do we get in touch with
>> all those people?
>
> This is the QUESTION.  All those people dissapears after the Web
> 2.0 session, they were not even in the Deployment session.
>
>> I don't suppose Apple could be persuaded to post a little
>> something on the WWDC 2007 site for us?
>>
>> Jeremy
>>
>>
>>> From: Pascal Robert <[EMAIL PROTECTED]>
>>> Date: April 3, 2007 8:50:18 AM PDT (CA)
>>> To: WebObjectsDev Apple ,
>>> WebObjects Talk <[EMAIL PROTECTED]>
>>> Subject: Fwd: WOWODC
>>>
>>>
>>> Last reminder :-)  We need more people !
>>>
 De : Pascal Robert <[EMAIL PROTECTED]>
 Date : 23 mars 2007 10:52:56 HAE
 À : WebObjectsDev Apple ,
 WebObjects Forms Forms <[EMAIL PROTECTED]>
 Cc : [EMAIL PROTECTED]
 Objet : WOWODC

 Hello fellow WO dudes,

 it's time for your WWDC planning ?  Well, it's time to think
 about a WO conference too !  We want to see if any of you is
 interessed in a WebObjects conference prior or after WWDC (the
 week-end before or after).

 Chuck has set up a page when you can tell what you would like as
 a conference :

http://www.gvcsitemaker.com/wowodc.2007/

 So signup and give feedback !  You cannot edit your entry, if
 you want to make a change, contact me so that I can delete your
 entry and you can enter it again.

 You have to signup on the page to be able to give feedback
 (please, give feedback only on the Web app, it's easier to
 manage than reading multiple email threads :-)).
>>>
>>>
>>>
>>>
>>>
>>> ___
>>> Webobjects-dev mailing list
>>> Webobjects-dev@lists.apple.com
>>> http://lists.apple.com/mailman/listinfo/webobjects-dev
>>
>> =
>> ==
>> Jeremy Rosenberg
>> Systems Consultant
>> Academic Computing Services
>> Simon Fraser University
>> Burnaby, BC, Canada V5A 1S6
>>
>> Email:  [EMAIL PROTECTED]
>>
>> "AMAINT, provisioning good times since 1994!"
>>
>>
>>
>>
>>  ___
>> 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/probert%40os.ca
>>
>> 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/chill%
> 40global-village.net
>
> This email sent to [EMAIL PROTECTED]
>

--

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/geoff.hopson%40gmail.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: WOWODC (Pascal Robert)

2007-04-03 Thread Chuck Hill

Maybe we should call our sessions Web 2.0 Objects  :-P


On Apr 3, 2007, at 10:07 AM, Pascal Robert wrote:



Le 07-04-03 à 12:23, Jeremy Rosenberg a écrit :

Does anybody else remember the massive lineup for the one and only  
WebObjects session at WWDC last year?  How do we get in touch with  
all those people?


This is the QUESTION.  All those people dissapears after the Web  
2.0 session, they were not even in the Deployment session.


I don't suppose Apple could be persuaded to post a little  
something on the WWDC 2007 site for us?


Jeremy



From: Pascal Robert <[EMAIL PROTECTED]>
Date: April 3, 2007 8:50:18 AM PDT (CA)
To: WebObjectsDev Apple ,  
WebObjects Talk <[EMAIL PROTECTED]>

Subject: Fwd: WOWODC


Last reminder :-)  We need more people !


De : Pascal Robert <[EMAIL PROTECTED]>
Date : 23 mars 2007 10:52:56 HAE
À : WebObjectsDev Apple ,  
WebObjects Forms Forms <[EMAIL PROTECTED]>

Cc : [EMAIL PROTECTED]
Objet : WOWODC

Hello fellow WO dudes,

it's time for your WWDC planning ?  Well, it's time to think  
about a WO conference too !  We want to see if any of you is  
interessed in a WebObjects conference prior or after WWDC (the  
week-end before or after).


Chuck has set up a page when you can tell what you would like as  
a conference :


http://www.gvcsitemaker.com/wowodc.2007/

So signup and give feedback !  You cannot edit your entry, if  
you want to make a change, contact me so that I can delete your  
entry and you can enter it again.


You have to signup on the page to be able to give feedback  
(please, give feedback only on the Web app, it's easier to  
manage than reading multiple email threads :-)).






___
Webobjects-dev mailing list
Webobjects-dev@lists.apple.com
http://lists.apple.com/mailman/listinfo/webobjects-dev


= 
==

Jeremy Rosenberg
Systems Consultant
Academic Computing Services
Simon Fraser University
Burnaby, BC, Canada V5A 1S6

Email:  [EMAIL PROTECTED]

"AMAINT, provisioning good times since 1994!"




 ___
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/probert%40os.ca

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


This email sent to [EMAIL PROTECTED]



--

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


Re: WOWODC (Pascal Robert)

2007-04-03 Thread Pascal Robert


Le 07-04-03 à 12:23, Jeremy Rosenberg a écrit :

Does anybody else remember the massive lineup for the one and only  
WebObjects session at WWDC last year?  How do we get in touch with  
all those people?


This is the QUESTION.  All those people dissapears after the Web 2.0  
session, they were not even in the Deployment session.


I don't suppose Apple could be persuaded to post a little something  
on the WWDC 2007 site for us?


Jeremy



From: Pascal Robert <[EMAIL PROTECTED]>
Date: April 3, 2007 8:50:18 AM PDT (CA)
To: WebObjectsDev Apple ,  
WebObjects Talk <[EMAIL PROTECTED]>

Subject: Fwd: WOWODC


Last reminder :-)  We need more people !


De : Pascal Robert <[EMAIL PROTECTED]>
Date : 23 mars 2007 10:52:56 HAE
À : WebObjectsDev Apple ,  
WebObjects Forms Forms <[EMAIL PROTECTED]>

Cc : [EMAIL PROTECTED]
Objet : WOWODC

Hello fellow WO dudes,

it's time for your WWDC planning ?  Well, it's time to think  
about a WO conference too !  We want to see if any of you is  
interessed in a WebObjects conference prior or after WWDC (the  
week-end before or after).


Chuck has set up a page when you can tell what you would like as  
a conference :


http://www.gvcsitemaker.com/wowodc.2007/

So signup and give feedback !  You cannot edit your entry, if you  
want to make a change, contact me so that I can delete your entry  
and you can enter it again.


You have to signup on the page to be able to give feedback  
(please, give feedback only on the Web app, it's easier to manage  
than reading multiple email threads :-)).






___
Webobjects-dev mailing list
Webobjects-dev@lists.apple.com
http://lists.apple.com/mailman/listinfo/webobjects-dev


== 
=

Jeremy Rosenberg
Systems Consultant
Academic Computing Services
Simon Fraser University
Burnaby, BC, Canada V5A 1S6

Email:  [EMAIL PROTECTED]

"AMAINT, provisioning good times since 1994!"




 ___
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/probert%40os.ca

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: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread Chuck Hill


On Apr 3, 2007, at 9:33 AM, Mike Schrag wrote:

where relationship results are sent back as NSSet rather than  
NSArray which more accurately represents the unordered nature of  
the objects.
I've always wondered why most of the WO API isn't NSSet ... Almost  
everything in the API is unordered (including all the EOModel api,  
etc).


My best guess would be concerns over efficiency as NSSet has to  
enforce uniqueness.  Set make much more sense conceptually.


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


Re: No file data from WOFileUpdate

2007-04-03 Thread Janine Sisk
Thanks Chuck, and everyone else who replied.  This will be a very  
useful feature, as the only documentation I could find on  
WOFileUpload didn't list which bindings were required.


janine

On Apr 3, 2007, at 9:28 AM, Chuck Hill wrote:


Window - Preferences - WOLips - Wod Editor Preferences

Check off "Check Binding Values (Experimental)

That should point out missing required bindings IIRC.




On Apr 3, 2007, at 7:03 AM, Guido Neitzer wrote:


ImageFile : WOFileUpload {
data = imageFileData;
mimeType = imageMimeType;
}


"filePath" is a required binding.


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


Re: Strange Error ???

2007-04-03 Thread Chuck Hill


On Apr 3, 2007, at 9:30 AM, James Cicenia wrote:


The database says it is null.


That probably means that it was set in memory but the EOF state was  
scrambled and the change did not get registered for saving to the DB.



Well I figure it is an unfired fault, but why would the print  
statement after the fact cure it?


It forces firing.



Overridden any EOF methods? Like?


See the EOF Commandment and also check EC locking.


I actually have left that print statement in for now in my  
production as it cures this random problem.


Eeew.

Chuck




On Apr 3, 2007, at 10:59 AM, Chuck Hill wrote:



On Apr 2, 2007, at 3:16 PM, James Cicenia wrote:


Sorry -

It is inconsistent. In other words it takes the resource and it  
is stored while sometimes just a null is gotten.


How are you determining that it is null?

However, it is always there when the print statement is issued  
after?!


It sounds like you are looking at an unfired fault.  Have you  
overridden any EOF methods and not called super or changed how  
they work?


Chuck



On Apr 2, 2007, at 4:51 PM, Chuck Hill wrote:


Hi James,

Ah, another guessing game for us.  :-).  Uh, I'd like to buy a  
vowel?  What means this, "sometimes it doesn't"?


Chuck

On Apr 2, 2007, at 2:47 PM, James Cicenia wrote:


Ok this is messing with my head here.


I have the following line:

newPhase.setResponsiblePerson((ProjectRosterMember)msp.resources 
().objectAtIndex(0));



Sometimes the above works and sometimes it doesn't. HOWEVER if  
I put the println AFTER it it always works?!


System.out.println("PHASE RESPONSIBLE PERSON IS "+ 
(newPhase.responsiblePerson().resource().fullName()));


The array resources() is an immutableClone.

Is there some faulting issue here that post setting the  
responsible person heals itself with the println?


Thanks
James Cicenia
___
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 [EMAIL PROTECTED]



--

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










--

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










--

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


Re: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread Mike Schrag
where relationship results are sent back as NSSet rather than  
NSArray which more accurately represents the unordered nature of  
the objects.
I've always wondered why most of the WO API isn't NSSet ... Almost  
everything in the API is unordered (including all the EOModel api, etc).


ms



___
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: JavaClient & WebClient in one application

2007-04-03 Thread Robert Walker

David,

In my opinion you have already made the correct choice.  That is to  
keep them separate.  If you are having data synchronization issues  
that is separate.  You would have exactly the same data  
synchronization problems simply by running two instances of the same  
web application.


First you need to fix your data synchronization problems then you can  
happily run your web and client applications separately sharing your  
business logic framework.


I've had some experience trying to mix web and client applications  
into a single application.  IMHO it's just not worth the headaches it  
causes.


Here is a note warning just so you don't run into this problem  
yourself like I did.  DO NOT use concurrent request handing with  
JavaClient applications.  JavaClient expects synchronous handing of  
request and will break in dramatic ways if the concurrency flag is set.


On Apr 3, 2007, at 12:16 PM, David Avendasora wrote:


Hi everyone,

Does anyone have any information, or can point me to any  
information, about running both a Direct to Java Client and  
standard (NOT Direct to Web) Web Client on one instance of an  
WebObjects application? Right now I have them as two separate  
applications, both using the core framework pointing to the same  
DB. This of-course can cause problems with data-synchronization.


While running them from one application will not completely  
eliminate the issues, it should mitigate them to some extent.


Thanks,

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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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: Strange Error ???

2007-04-03 Thread James Cicenia

The database says it is null.

Well I figure it is an unfired fault, but why would the print  
statement after the fact cure it?

Overridden any EOF methods? Like?

I actually have left that print statement in for now in my production  
as it cures this random problem.


James

On Apr 3, 2007, at 10:59 AM, Chuck Hill wrote:



On Apr 2, 2007, at 3:16 PM, James Cicenia wrote:


Sorry -

It is inconsistent. In other words it takes the resource and it is  
stored while sometimes just a null is gotten.


How are you determining that it is null?

However, it is always there when the print statement is issued  
after?!


It sounds like you are looking at an unfired fault.  Have you  
overridden any EOF methods and not called super or changed how they  
work?


Chuck



On Apr 2, 2007, at 4:51 PM, Chuck Hill wrote:


Hi James,

Ah, another guessing game for us.  :-).  Uh, I'd like to buy a  
vowel?  What means this, "sometimes it doesn't"?


Chuck

On Apr 2, 2007, at 2:47 PM, James Cicenia wrote:


Ok this is messing with my head here.


I have the following line:

newPhase.setResponsiblePerson((ProjectRosterMember)msp.resources 
().objectAtIndex(0));



Sometimes the above works and sometimes it doesn't. HOWEVER if I  
put the println AFTER it it always works?!


System.out.println("PHASE RESPONSIBLE PERSON IS "+ 
(newPhase.responsiblePerson().resource().fullName()));


The array resources() is an immutableClone.

Is there some faulting issue here that post setting the  
responsible person heals itself with the println?


Thanks
James Cicenia
___
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 [EMAIL PROTECTED]



--

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










--

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


Re: No file data from WOFileUpdate

2007-04-03 Thread Chuck Hill

Window - Preferences - WOLips - Wod Editor Preferences

Check off "Check Binding Values (Experimental)

That should point out missing required bindings IIRC.




On Apr 3, 2007, at 7:03 AM, Guido Neitzer wrote:


ImageFile : WOFileUpload {
data = imageFileData;
mimeType = imageMimeType;
}


"filePath" is a required binding.


--  

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


Re: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread Robert Walker

Ray,



Of course, there are things that are awkward about this also. A lot  
of them have to do with the fact that the code for working in this  
way is very concise in Objective C. Having translated this  
mechanism to java, one has to do more casting and "grunt work" than  
seems necessary.


I would tend to agree with you on this.  Take Core Data for example,  
where relationship results are sent back as NSSet rather than NSArray  
which more accurately represents the unordered nature of the  
objects.  When binding those results to the UI you have an  
"arrangedObjects" method for binding to table views and other various  
UI controls.  These ordered lists are then arranged by a set of "sort  
descriptors."  So I believe that you are correct in your assessment  
that ordering the results should be a behavior of the view rather  
than the model.


When working with WebObjects, one thing I miss from my recent Ruby on  
Rails work is the "built-in" notion of "helper methods" for the  
view.  Rails handles this though Ruby's "Mix-in" construct, which is  
very much like categories in Objective-C.  The helper methods are  
actually "mixed into" the controller, but are nicely separated into  
separate modules since they exist solely to support view behavior.


On Apr 3, 2007, at 11:57 AM, Ray Kiddy wrote:



On Apr 3, 2007, at 7:59 AM, David Avendasora wrote:

Okay. I've given the method a new name and it is working perfectly  
now. I'm assuming that this applies to filtering the array of  
related objects as well. Yes?


BTW, did I miss something in the documentation where it tells you  
not to override these? I have several WO books as well, and while  
the examples always show using a separate method, they don't say  
it's required.




I would suggest that you have an issue with separating your data  
and your presentation. WebObjects is very much built to use Model- 
View-Controller methodologies. If you think of your sorting problem  
as a display issue, easier solutions may present themselves. I  
think that this is why the EOSortOrdering functionality is so  
abstract. It makes it easy to not sort until display time.


Of course, there are things that are awkward about this also. A lot  
of them have to do with the fact that the code for working in this  
way is very concise in Objective C. Having translated this  
mechanism to java, one has to do more casting and "grunt work" than  
seems necessary.


- ray


Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:

Use a separate method instead of overriding the existing method.   
There are assumptions made about the array returned via KVC, and  
you are breaking those assumptions by reordering an array that  
EOF thinks it owns.


___


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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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: WOWODC (Pascal Robert)

2007-04-03 Thread Jeremy Rosenberg
Does anybody else remember the massive lineup for the one and only  
WebObjects session at WWDC last year?  How do we get in touch with  
all those people?


I don't suppose Apple could be persuaded to post a little something  
on the WWDC 2007 site for us?


Jeremy



From: Pascal Robert <[EMAIL PROTECTED]>
Date: April 3, 2007 8:50:18 AM PDT (CA)
To: WebObjectsDev Apple ,  
WebObjects Talk <[EMAIL PROTECTED]>

Subject: Fwd: WOWODC


Last reminder :-)  We need more people !


De : Pascal Robert <[EMAIL PROTECTED]>
Date : 23 mars 2007 10:52:56 HAE
À : WebObjectsDev Apple ,  
WebObjects Forms Forms <[EMAIL PROTECTED]>

Cc : [EMAIL PROTECTED]
Objet : WOWODC

Hello fellow WO dudes,

it's time for your WWDC planning ?  Well, it's time to think about  
a WO conference too !  We want to see if any of you is interessed  
in a WebObjects conference prior or after WWDC (the week-end  
before or after).


Chuck has set up a page when you can tell what you would like as a  
conference :


http://www.gvcsitemaker.com/wowodc.2007/

So signup and give feedback !  You cannot edit your entry, if you  
want to make a change, contact me so that I can delete your entry  
and you can enter it again.


You have to signup on the page to be able to give feedback  
(please, give feedback only on the Web app, it's easier to manage  
than reading multiple email threads :-)).






___
Webobjects-dev mailing list
Webobjects-dev@lists.apple.com
http://lists.apple.com/mailman/listinfo/webobjects-dev


===
Jeremy Rosenberg
Systems Consultant
Academic Computing Services
Simon Fraser University
Burnaby, BC, Canada V5A 1S6

Email:  [EMAIL PROTECTED]

"AMAINT, provisioning good times since 1994!"




 ___
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

JavaClient & WebClient in one application

2007-04-03 Thread David Avendasora

Hi everyone,

Does anyone have any information, or can point me to any information,  
about running both a Direct to Java Client and standard (NOT Direct  
to Web) Web Client on one instance of an WebObjects application?  
Right now I have them as two separate applications, both using the  
core framework pointing to the same DB. This of-course can cause  
problems with data-synchronization.


While running them from one application will not completely eliminate  
the issues, it should mitigate them to some extent.


Thanks,

Dave
___
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: WebObjects classloader fun.

2007-04-03 Thread Chuck Hill

Someone has been having fun!


On Apr 3, 2007, at 2:06 AM, Q wrote:



Oh it gets even more fun.
I thought I would post this just for giggles for anyone interested.  
I don't blog, so this will do.


In order to add true groovy "scripting" support (and maybe even BSF  
if I can work out how that might work) with rapid turnaround ala  
WebScript to my WOGroovy framework I needed to work out how  
WebObjects does it's class loading. In hindsight I probably didn't  
really need to do this, because the hot class loading in eclipse is  
acceptable to some degree, but I wanted to see how it might work  
anyway. And to be honest, hot loading is not the best with classes  
as dynamic as groovy.


I started by writing a simple class loader wrapper so I could see  
what's going on. This allowed me to discover that  
com.webobjects.foundation._NSUtilities does some very funky stuff  
with partial class name resolution and class caching.



Very, profoundly funky stuff.


(Which prompted my original email asking for help understand what  
was going on)


Ok, so I asked my friend "Jad" if he knew anything about  
_NSUtilites that might be useful and with what he told me I got my  
new best friend GluonJ to watch some function calls that  
_NSUtilities makes so I could tell what was actually happening when  
my application failed to load my script code.


So with this information, and some magic fairy dust lifted directly  
from the now defunct ERXCompilerProxy, I think I have worked out  
what I needed to do to make it work, unfortunately it means I  
needed to alter some functionality of _NSUtilities and change how  
it deals with caching of ClassNotFound exceptions.


Long story short, I now have it working (I think) so that you can  
do proper rapid turnaround with groovy code.
Here's the catch.  To do rapid turnaround you need to use Java 1.5  
with a GluonJ based javaagent (included). It may be possible to get  
around this requirement by writing a custom bootstrap loader that  
adds the GroovyClassLoader before any of the WebObjects classes are  
resolved and somehow force the webobjects classes to be loaded  
higher up the loader chain rather than by the system class loader,  
but I decided it was easier to write the 3 lines of AOP code and be  
done with it.


(the updated code has been checked into subversion http:// 
code.google.com/p/wogroovy/source , if you want to check it out  
this is the only way for now)


If you have been meaning to have a look at AspectJ, JBoss AOP or  
similar AOP package for Java, do yourself a favour and look at  
GluonJ first, you need to use java 1.5, but it only needs a single  
page of documentation. :)


Thanks for that.  I have been meaning to look at GulonJ for a while  
now.  It just got moved higher on the list.





Now that I have got that off my chest I should probably do  
something useful and get back to work ;)


:-)

Chuck



On 30/03/2007, at 2:44 PM, Mike Schrag wrote:

Does anyone know much about how webobjects uses the classloader  
and how the _NSUtilities class cache is initialized and used?


[snip] it appears that _NSUtilities has a static initialiser that  
pulls in and caches classes rather than asking the current thread  
context classloader for them when needed [snip]
You are correct ... Frameworks (and your app) are loaded by  
NSBundle, which traverses all of the classpath and loads the  
reachable classes into the NSUtilities cache (so you can do things  
like looking up a component by name -- _NSUtilities.classWithName 
(..)).  You can also override these class names by calling  
_NSUtilities.setClassForName.  If the name was not in the cache,  
it will Class.forName it and then put the result into the cache.   
This behavior makes packageless WOComponent name lookups (for  
instance) very fast in exchange for some kind of weird behavior  
(like cross-your-fingers-if-you-have-two-classes-with-the-same-name).


Unfortunately, I don't know of any way to REMOVE an entry from the  
cache.  You can't setClassForName(null, "ClassName") because that  
tries to put a null key into the cache.  If you specifically know  
the class name, you can replace it yourself -- ERXPatcher is  
generally just calling setClassForName with classes it replaces.


ms

___
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/qdolan% 
40gmail.com


This email sent to [EMAIL PROTECTED]




--
Seeya...Q

Quinton Dolan - [EMAIL PROTECTED]
Gold Coast, QLD, Australia
Ph: +61 419 729 806


___
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% 
40gl

Re: Strange Error ???

2007-04-03 Thread Chuck Hill


On Apr 2, 2007, at 3:16 PM, James Cicenia wrote:


Sorry -

It is inconsistent. In other words it takes the resource and it is  
stored while sometimes just a null is gotten.


How are you determining that it is null?


However, it is always there when the print statement is issued after?!


It sounds like you are looking at an unfired fault.  Have you  
overridden any EOF methods and not called super or changed how they  
work?


Chuck



On Apr 2, 2007, at 4:51 PM, Chuck Hill wrote:


Hi James,

Ah, another guessing game for us.  :-).  Uh, I'd like to buy a  
vowel?  What means this, "sometimes it doesn't"?


Chuck

On Apr 2, 2007, at 2:47 PM, James Cicenia wrote:


Ok this is messing with my head here.


I have the following line:

newPhase.setResponsiblePerson((ProjectRosterMember)msp.resources 
().objectAtIndex(0));



Sometimes the above works and sometimes it doesn't. HOWEVER if I  
put the println AFTER it it always works?!


System.out.println("PHASE RESPONSIBLE PERSON IS "+ 
(newPhase.responsiblePerson().resource().fullName()));


The array resources() is an immutableClone.

Is there some faulting issue here that post setting the  
responsible person heals itself with the println?


Thanks
James Cicenia
___
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 [EMAIL PROTECTED]



--

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










--

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


Re: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread Ray Kiddy


On Apr 3, 2007, at 7:59 AM, David Avendasora wrote:

Okay. I've given the method a new name and it is working perfectly  
now. I'm assuming that this applies to filtering the array of  
related objects as well. Yes?


BTW, did I miss something in the documentation where it tells you  
not to override these? I have several WO books as well, and while  
the examples always show using a separate method, they don't say  
it's required.




I would suggest that you have an issue with separating your data and  
your presentation. WebObjects is very much built to use Model-View- 
Controller methodologies. If you think of your sorting problem as a  
display issue, easier solutions may present themselves. I think that  
this is why the EOSortOrdering functionality is so abstract. It makes  
it easy to not sort until display time.


Of course, there are things that are awkward about this also. A lot  
of them have to do with the fact that the code for working in this  
way is very concise in Objective C. Having translated this mechanism  
to java, one has to do more casting and "grunt work" than seems  
necessary.


- ray


Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:

Use a separate method instead of overriding the existing method.   
There are assumptions made about the array returned via KVC, and  
you are breaking those assumptions by reordering an array that EOF  
thinks it owns.


___


___
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: Reading NSData from a file

2007-04-03 Thread Mike Schrag
public static NSData nsDataFromFile( String filePath ) throws  
FileNotFoundException, IOException {

File theFile = new File( filePath );
return new NSData( new FileInputStream( theFile ), (int) 
theFile.length() );

}
It doesn't appear that new NSData(InputStream, int) closes the  
stream ... Curiously, new NSData(file) DOES, but that's deprecated.


You may want to make this:

File theFile = new File(filePath);
FileInputStream theFileStream = new FileInputStream(theFile);
try {
return new NSData(theFileStream, (int)theFile.length());
}
finally {
theFileStream.close();
}

ms ___
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

Fwd: WOWODC

2007-04-03 Thread Pascal Robert

Last reminder :-)  We need more people !


De : Pascal Robert <[EMAIL PROTECTED]>
Date : 23 mars 2007 10:52:56 HAE
À : WebObjectsDev Apple ,  
WebObjects Forms Forms <[EMAIL PROTECTED]>

Cc : [EMAIL PROTECTED]
Objet : WOWODC

Hello fellow WO dudes,

it's time for your WWDC planning ?  Well, it's time to think about  
a WO conference too !  We want to see if any of you is interessed  
in a WebObjects conference prior or after WWDC (the week-end before  
or after).


Chuck has set up a page when you can tell what you would like as a  
conference :


http://www.gvcsitemaker.com/wowodc.2007/

So signup and give feedback !  You cannot edit your entry, if you  
want to make a change, contact me so that I can delete your entry  
and you can enter it again.


You have to signup on the page to be able to give feedback (please,  
give feedback only on the Web app, it's easier to manage than  
reading multiple email threads :-)).


___
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: No file data from WOFileUpdate

2007-04-03 Thread Kieran Kelleher

Janine,

FYI, there is a bunch of File upload and streaming examples included  
with the Developer docs at:

/Developer/Examples/JavaWebObjects/FileUpload

HTH, Kieran

On Apr 3, 2007, at 10:03 AM, Guido Neitzer wrote:


On 03.04.2007, at 00:24, Janine Sisk wrote:

I know I've been staring at this for too long;  hopefully the  
answer isn't *too* obvious.


Here's what I have:

.wod

MainForm : WOForm {
enctype = "multipart/form-data";
}

ImageFile : WOFileUpload {
data = imageFileData;
mimeType = imageMimeType;
}


"filePath" is a required binding.

cug
___
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: Reading NSData from a file

2007-04-03 Thread Kieran Kelleher
Not sure what's wrong with your code, but I use this utility method  
all the time:


public static NSData nsDataFromFile( String filePath ) throws  
FileNotFoundException, IOException {

File theFile = new File( filePath );
return new NSData( new FileInputStream( theFile ), (int) 
theFile.length() );

}


I use sips for making thumbnails fast and easy.




On Apr 3, 2007, at 12:13 AM, Janine Sisk wrote:

I'm trying to read a file into a variable of type NSData.   
According to the docs on NSData I should be able to use this:


public NSData(InputStream inputStream, int chunkSize)
   throws IOException

FileInputStream is a subclass of InputStream, so I tried this:

   		FileInputStream fileInputStream = new FileInputStream("/tmp/ 
WOtmpfile");

NSData imageThumbData = NSData(fileInputStream, 1000);

(values just for mucking around purposes)

But it doesn't take it - says the method NSData 
(FileInputStream,int) is undefined.


What I'm trying to do here is to read back in the results of having  
run convert on an uploaded image file and making a thumbnail from  
it.  The files are being written only for the convenience of  
convert, so if I could get out of writing them that would be all  
the better.


Any suggestions?

thanks,

janine

 ___
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: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread John Huss

I had this problem a while back.  It might be overkill, but I modified
by eogenerator template to make the methods FINAL so that I would
never make that mistake again.

John

On 4/3/07, Robert Walker <[EMAIL PROTECTED]> wrote:


Okay. I've given the method a new name and it is working perfectly now. I'm
assuming that this applies to filtering the array of related objects as
well. Yes?Yes.


BTW, did I miss something in the documentation where it tells you not to
override these? I have several WO books as well, and while the examples
always show using a separate method, they don't say it's required.

If you were to look deeper at the array return by the relationship methods
you would find that they are not simple immutable arrays like the return
type indicates.  They are treated internally as something like
XXCheapCopyMutableArray or some such beast (I can't remember the exact class
name).  Then the reference to that gets returned to you cast to a basic
NSArray.  Maybe that has something to do with the problems of overriding
those methods in a subclass.  I'm not really sure of the internal mechanics
of EOF.  I just know not to override those methods, but rather use the
technique give in the previous response of providing a new method that makes
use of the original method.


On Apr 3, 2007, at 10:59 AM, David Avendasora wrote:

Okay. I've given the method a new name and it is working perfectly now. I'm
assuming that this applies to filtering the array of related objects as
well. Yes?

BTW, did I miss something in the documentation where it tells you not to
override these? I have several WO books as well, and while the examples
always show using a separate method, they don't say it's required.

Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:


Use a separate method instead of overriding the existing method.  There are
assumptions made about the array returned via KVC, and you are breaking
those assumptions by reordering an array that EOF thinks it owns.

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

This email sent to [EMAIL PROTECTED]

--
Robert Walker
[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/johnthuss%40gmail.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: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread Robert Walker
Okay. I've given the method a new name and it is working perfectly  
now. I'm assuming that this applies to filtering the array of  
related objects as well. Yes?

Yes.

BTW, did I miss something in the documentation where it tells you  
not to override these? I have several WO books as well, and while  
the examples always show using a separate method, they don't say  
it's required.


If you were to look deeper at the array return by the relationship  
methods you would find that they are not simple immutable arrays like  
the return type indicates.  They are treated internally as something  
like XXCheapCopyMutableArray or some such beast (I can't remember the  
exact class name).  Then the reference to that gets returned to you  
cast to a basic NSArray.  Maybe that has something to do with the  
problems of overriding those methods in a subclass.  I'm not really  
sure of the internal mechanics of EOF.  I just know not to override  
those methods, but rather use the technique give in the previous  
response of providing a new method that makes use of the original  
method.


On Apr 3, 2007, at 10:59 AM, David Avendasora wrote:

Okay. I've given the method a new name and it is working perfectly  
now. I'm assuming that this applies to filtering the array of  
related objects as well. Yes?


BTW, did I miss something in the documentation where it tells you  
not to override these? I have several WO books as well, and while  
the examples always show using a separate method, they don't say  
it's required.


Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:

Use a separate method instead of overriding the existing method.   
There are assumptions made about the array returned via KVC, and  
you are breaking those assumptions by reordering an array that EOF  
thinks it owns.


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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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: EditingContext/Sorting Problem SOLVED

2007-04-03 Thread David Avendasora
Okay. I've given the method a new name and it is working perfectly  
now. I'm assuming that this applies to filtering the array of related  
objects as well. Yes?


BTW, did I miss something in the documentation where it tells you not  
to override these? I have several WO books as well, and while the  
examples always show using a separate method, they don't say it's  
required.


Thanks again for the help everyone!

On Apr 3, 2007, at 9:51 AM, Ken Anderson wrote:

Use a separate method instead of overriding the existing method.   
There are assumptions made about the array returned via KVC, and  
you are breaking those assumptions by reordering an array that EOF  
thinks it owns.


___
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: EditingContext/Sorting Problem

2007-04-03 Thread Ken Anderson
Use a separate method instead of overriding the existing method.   
There are assumptions made about the array returned via KVC, and you  
are breaking those assumptions by reordering an array that EOF thinks  
it owns.


On Apr 3, 2007, at 10:17 AM, David Avendasora wrote:


Hi all,

I have what is probably a really basic WO problem, but I have been  
trying to figure it out for the last couple days with no luck.


I have a superclass for my entity (_ManufacturingSchedule) that is  
generated by EOGenerator. It has the following method to return all  
the related objects in a to-many relationship:


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}

I am overriding this method in the subclass (ManufacturingSchedule)  
with:


public NSArray scheduledRoutings() {
NSArray sortedArray;
NSMutableArray sortOrderings = new NSMutableArray();
	EOSortOrdering productionSequenceSort = new EOSortOrdering 
("productionSequence",EOSortOrdering.CompareAscending);
	EOSortOrdering toolSort = new EOSortOrdering 
("routing.tool.toolName",EOSortOrdering.CompareAscending);

sortOrderings.addObject(toolSort);
sortOrderings.addObject(productionSequenceSort);
	sortedArray = EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(),sortOrderings);

return sortedArray; 
}

All I am trying to do is sort the results a certain way any time  
the related objects are requested. The problem is that when I use  
this method, any objects added to the relationship during the  
current session (one EditingContext per session right now) don't  
show up. If I save the EditingContext to the DB, then kill the  
session and call the relationship again, the objects I added show up.


If I simply remove the overriding method in the subclass,  
everything shows up as expected, just not sorted of course.


Why aren't new objects returned when sorted as above?

Dave

___
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/kenlists% 
40anderhome.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: EditingContext/Sorting Problem

2007-04-03 Thread David Avendasora
In almost every case I want it ordered, but I guess having an  
separate ordered method isn't a huge chore.


Other than not needing to do it the way I am doing it, is there any  
problem with the code? Does it somehow conflict with the EditingContext?


Dave

On Apr 3, 2007, at 9:31 AM, Robert Walker wrote:


David,


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}


If you simple want the array returned in a different order I would  
suggest creating another method instead of overriding the super- 
classes method.


public NSArray scheduledRoutingsOrdered() {
	return EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(), this.defaultSortOrderings());

}

public NSArray defaultSortOrderings() {
// return your desired sort orderings here
}

This is what I do and don't recall ever having a problem with it.   
One other nice benefit of this is that you can choose to bind to  
either the unordered or ordered array.  If you have a case where  
the order is not important, calling the unordered list can be more  
efficient.


On Apr 3, 2007, at 10:17 AM, David Avendasora wrote:


Hi all,

I have what is probably a really basic WO problem, but I have been  
trying to figure it out for the last couple days with no luck.


I have a superclass for my entity (_ManufacturingSchedule) that is  
generated by EOGenerator. It has the following method to return  
all the related objects in a to-many relationship:


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}

I am overriding this method in the subclass  
(ManufacturingSchedule) with:


public NSArray scheduledRoutings() {
NSArray sortedArray;
NSMutableArray sortOrderings = new NSMutableArray();
	EOSortOrdering productionSequenceSort = new EOSortOrdering 
("productionSequence",EOSortOrdering.CompareAscending);
	EOSortOrdering toolSort = new EOSortOrdering 
("routing.tool.toolName",EOSortOrdering.CompareAscending);

sortOrderings.addObject(toolSort);
sortOrderings.addObject(productionSequenceSort);
	sortedArray = EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(),sortOrderings);

return sortedArray; 
}

All I am trying to do is sort the results a certain way any time  
the related objects are requested. The problem is that when I use  
this method, any objects added to the relationship during the  
current session (one EditingContext per session right now) don't  
show up. If I save the EditingContext to the DB, then kill the  
session and call the relationship again, the objects I added show up.


If I simply remove the overriding method in the subclass,  
everything shows up as expected, just not sorted of course.


Why aren't new objects returned when sorted as above?

Dave

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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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/webobjects% 
40avendasora.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: EditingContext/Sorting Problem

2007-04-03 Thread Robert Walker

David,


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}


If you simple want the array returned in a different order I would  
suggest creating another method instead of overriding the super- 
classes method.


public NSArray scheduledRoutingsOrdered() {
	return EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(), this.defaultSortOrderings());

}

public NSArray defaultSortOrderings() {
// return your desired sort orderings here
}

This is what I do and don't recall ever having a problem with it.   
One other nice benefit of this is that you can choose to bind to  
either the unordered or ordered array.  If you have a case where the  
order is not important, calling the unordered list can be more  
efficient.


On Apr 3, 2007, at 10:17 AM, David Avendasora wrote:


Hi all,

I have what is probably a really basic WO problem, but I have been  
trying to figure it out for the last couple days with no luck.


I have a superclass for my entity (_ManufacturingSchedule) that is  
generated by EOGenerator. It has the following method to return all  
the related objects in a to-many relationship:


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}

I am overriding this method in the subclass (ManufacturingSchedule)  
with:


public NSArray scheduledRoutings() {
NSArray sortedArray;
NSMutableArray sortOrderings = new NSMutableArray();
	EOSortOrdering productionSequenceSort = new EOSortOrdering 
("productionSequence",EOSortOrdering.CompareAscending);
	EOSortOrdering toolSort = new EOSortOrdering 
("routing.tool.toolName",EOSortOrdering.CompareAscending);

sortOrderings.addObject(toolSort);
sortOrderings.addObject(productionSequenceSort);
	sortedArray = EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(),sortOrderings);

return sortedArray; 
}

All I am trying to do is sort the results a certain way any time  
the related objects are requested. The problem is that when I use  
this method, any objects added to the relationship during the  
current session (one EditingContext per session right now) don't  
show up. If I save the EditingContext to the DB, then kill the  
session and call the relationship again, the objects I added show up.


If I simply remove the overriding method in the subclass,  
everything shows up as expected, just not sorted of course.


Why aren't new objects returned when sorted as above?

Dave

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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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

EditingContext/Sorting Problem

2007-04-03 Thread David Avendasora

Hi all,

I have what is probably a really basic WO problem, but I have been  
trying to figure it out for the last couple days with no luck.


I have a superclass for my entity (_ManufacturingSchedule) that is  
generated by EOGenerator. It has the following method to return all  
the related objects in a to-many relationship:


public NSArray scheduledRoutings() {
return (NSArray)storedValueForKey("scheduledRoutings");
}

I am overriding this method in the subclass (ManufacturingSchedule)  
with:


public NSArray scheduledRoutings() {
NSArray sortedArray;
NSMutableArray sortOrderings = new NSMutableArray();
	EOSortOrdering productionSequenceSort = new EOSortOrdering 
("productionSequence",EOSortOrdering.CompareAscending);
	EOSortOrdering toolSort = new EOSortOrdering 
("routing.tool.toolName",EOSortOrdering.CompareAscending);

sortOrderings.addObject(toolSort);
sortOrderings.addObject(productionSequenceSort);
	sortedArray = EOSortOrdering.sortedArrayUsingKeyOrderArray 
(super.scheduledRoutings(),sortOrderings);

return sortedArray; 
}

All I am trying to do is sort the results a certain way any time the  
related objects are requested. The problem is that when I use this  
method, any objects added to the relationship during the current  
session (one EditingContext per session right now) don't show up. If  
I save the EditingContext to the DB, then kill the session and call  
the relationship again, the objects I added show up.


If I simply remove the overriding method in the subclass, everything  
shows up as expected, just not sorted of course.


Why aren't new objects returned when sorted as above?

Dave

___
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: No file data from WOFileUpdate

2007-04-03 Thread Guido Neitzer

On 03.04.2007, at 00:24, Janine Sisk wrote:

I know I've been staring at this for too long;  hopefully the  
answer isn't *too* obvious.


Here's what I have:

.wod

MainForm : WOForm {
enctype = "multipart/form-data";
}

ImageFile : WOFileUpload {
data = imageFileData;
mimeType = imageMimeType;
}


"filePath" is a required binding.

cug
___
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: No file data from WOFileUpdate

2007-04-03 Thread Robert Walker
I've seen this problem when the filePath binding is not set.  You  
need to bind this value even if just to a string in your controller  
class.


On Apr 3, 2007, at 2:24 AM, Janine Sisk wrote:

I know I've been staring at this for too long;  hopefully the  
answer isn't *too* obvious.


Here's what I have:

.wod

MainForm : WOForm {
enctype = "multipart/form-data";
}

ImageFile : WOFileUpload {
data = imageFileData;
mimeType = imageMimeType;
}

SubmitButton : WOSubmitButton {
action = saveChanges;
value = "Save Changes";
}

.java

in saveChanges():

if (imageFileData == null || imageFileData.length() == 0) {
		System.out.println("exiting because there is no file data  
from the upload");

return null;
   }

Consistently, imageMimetype is set (correctly) but imageFileData is  
null  (I have confirmed that it is actually null, not zero  
length).  I haven't been able to find much documentation on this,  
but what I do have seems to indicate that I'm doing this right, and  
it seems too simple to screw up anyway.  However :)


The file I'm uploading is only 152KB so I don't think it's a size  
problem, unless the file is so small WO can't find it. :)


Suggestions welcome!

thanks,

janine

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


This email sent to [EMAIL PROTECTED]


--
Robert Walker
[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: strange error

2007-04-03 Thread Mike Schrag
Actually the other way around in this case ... the snapshot cache is  
expecting to contain NSMutableArrays, but you've somehow managed to  
get an NSArray in there.  Are you doing something weird like manually  
replacing the array in a to-many relationship or something?


On Apr 3, 2007, at 6:32 AM, Dev WO wrote:


Hello Daniele,
I'm sure someone will come with more help, but just in case, are  
your sure you're getting a NSArray?
Usually a ClassCastException is thrown if you get something else  
than the class that was defined. You're not passing NSMutableArray  
instead?


Xavier




Hi list,
I've an error witch I don't understand how I should cause it:

WARN  NSLog  -  
:  
Exception occurred while handling request:

java.lang.ClassCastException : com.webobjects.foundation.NSArray
[2007-04-03 10:56:25 CEST]   
java.lang.ClassCastException: com.webobjects.foundation.NSArray
at  
com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID  
(EODatabaseContext.java:4049)
at  
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlo 
balID(EOObjectStoreCoordinator.java:682)
at  
com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID  
(EOEditingContext.java:3965)

at er.extensions.ERXEC.objectsForSourceGlobalID(ERXEC.java:1036)
at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault 
(EODatabaseContext.java:4427)
at  
com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializat 
ionOfObject (EOAccessArrayFaultHandler.java:70)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead 
(_EOCheapCopyMutableArray.java:38)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.count 
(_EOCheapCopyMutableArray.java:92)
at com.webobjects.eocontrol._EOCheapCopyArray._setArray 
(_EOCheapCopyArray.java:33)
at  
com.webobjects.eoaccess._EOCheapCopyHandler.completeInitializationOfO 
bject(EOAccessArrayFaultHandler.java:151)
at com.webobjects.eocontrol._EOCheapCopyArray.willRead 
(_EOCheapCopyArray.java:126)
at com.webobjects.eocontrol._EOCheapCopyArray.objectsNoCopy 
(_EOCheapCopyArray.java:95)

at com.webobjects.foundation.NSArray.( NSArray.java:395)
at com.webobjects.foundation.NSMutableArray. 
(NSMutableArray.java:60)
at  
com.webobjects.foundation._NSArrayUtilities.arrayExcludingObjectsFrom 
Array(_NSArrayUtilities.java:197)
at  
com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingConte 
xt(EODatabaseContext.java:6109)
at  
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditin 
gContext(EOObjectStoreCoordinator.java :412)
at com.webobjects.eocontrol.EOEditingContext.saveChanges 
(EOEditingContext.java:3226)

at er.extensions.ERXEC._saveChanges(ERXEC.java:947)
at er.extensions.ERXEC.saveChanges(ERXEC.java:870)
at  
support.gestweb.component.WXLocalizedComponent._saveChangesAndFixObje 
cts(WXLocalizedComponent.java:119)
at support.gestweb.component.insert.GWSAddDiscount.create 
(GWSAddDiscount.java:167)

at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke (Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor 
$1.methodValue(NSKeyValueCoding.java:684)
at com.webobjects.foundation.NSKeyValueCoding 
$_MethodBinding.valueInObject(NSKeyValueCoding.java :1160)
at com.webobjects.foundation.NSKeyValueCoding 
$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at com.webobjects.appserver.WOComponent.valueForKey 
(WOComponent.java:1539)
at com.webobjects.foundation.NSKeyValueCoding 
$Utility.valueForKey (NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions 
$DefaultImplementation.valueForKeyPath 
(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath  
(WOComponent.java:1600)
at  
com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompon 
ent(WOKeyValueAssociation.java:46)

at er.ajax.AjaxUtils.valueForBinding(AjaxUtils.java:243)
at er.ajax.AjaxDynamicElement.valueForBinding  
(AjaxDynamicElement.java:34)
at er.ajax.AjaxSubmitButton.handleRequest 
(AjaxSubmitButton.java:214)
at er.ajax.AjaxSubmitButton.invokeAction(AjaxSubmitButton.java: 
205)
at  
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction 
 (WODynamicGroup.java:101)
at  
com.webobjects.appserver._private.WODynamicGroup.invokeAction 
(WODynamicGroup.java:110)

at er.extensions.ERXWOForm.invokeAction(ERXWOForm.java:127)
at com.webobjects.appserver.WOComponent.invokeAction  
(WOComponent.java:945)
at  
com.webobjects.appserver._private.WOComponentReference.invokeAction 
(WOComponentReference.java:104)
at  
com.webobjects.appserver._private.WOSwitchComponent.invokeAction 
(

Re: strange error

2007-04-03 Thread Dev WO

Hello Daniele,
I'm sure someone will come with more help, but just in case, are your  
sure you're getting a NSArray?
Usually a ClassCastException is thrown if you get something else than  
the class that was defined. You're not passing NSMutableArray instead?


Xavier




Hi list,
I've an error witch I don't understand how I should cause it:

WARN  NSLog  -  
:  
Exception occurred while handling request:

java.lang.ClassCastException : com.webobjects.foundation.NSArray
[2007-04-03 10:56:25 CEST]   
java.lang.ClassCastException: com.webobjects.foundation.NSArray
at  
com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID  
(EODatabaseContext.java:4049)
at  
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlob 
alID(EOObjectStoreCoordinator.java:682)
at  
com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID  
(EOEditingContext.java:3965)

at er.extensions.ERXEC.objectsForSourceGlobalID(ERXEC.java:1036)
at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault 
(EODatabaseContext.java:4427)
at  
com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializati 
onOfObject (EOAccessArrayFaultHandler.java:70)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead 
(_EOCheapCopyMutableArray.java:38)
at com.webobjects.eocontrol._EOCheapCopyMutableArray.count 
(_EOCheapCopyMutableArray.java:92)
at com.webobjects.eocontrol._EOCheapCopyArray._setArray 
(_EOCheapCopyArray.java:33)
at  
com.webobjects.eoaccess._EOCheapCopyHandler.completeInitializationOfOb 
ject(EOAccessArrayFaultHandler.java:151)
at com.webobjects.eocontrol._EOCheapCopyArray.willRead 
(_EOCheapCopyArray.java:126)
at com.webobjects.eocontrol._EOCheapCopyArray.objectsNoCopy 
(_EOCheapCopyArray.java:95)

at com.webobjects.foundation.NSArray.( NSArray.java:395)
at com.webobjects.foundation.NSMutableArray. 
(NSMutableArray.java:60)
at  
com.webobjects.foundation._NSArrayUtilities.arrayExcludingObjectsFromA 
rray(_NSArrayUtilities.java:197)
at  
com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContex 
t(EODatabaseContext.java:6109)
at  
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditing 
Context(EOObjectStoreCoordinator.java :412)
at com.webobjects.eocontrol.EOEditingContext.saveChanges 
(EOEditingContext.java:3226)

at er.extensions.ERXEC._saveChanges(ERXEC.java:947)
at er.extensions.ERXEC.saveChanges(ERXEC.java:870)
at  
support.gestweb.component.WXLocalizedComponent._saveChangesAndFixObjec 
ts(WXLocalizedComponent.java:119)
at support.gestweb.component.insert.GWSAddDiscount.create 
(GWSAddDiscount.java:167)

at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke 
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke (Method.java:585)
at com.webobjects.foundation.NSKeyValueCoding$ValueAccessor 
$1.methodValue(NSKeyValueCoding.java:684)
at com.webobjects.foundation.NSKeyValueCoding 
$_MethodBinding.valueInObject(NSKeyValueCoding.java :1160)
at com.webobjects.foundation.NSKeyValueCoding 
$DefaultImplementation.valueForKey(NSKeyValueCoding.java:1268)
at com.webobjects.appserver.WOComponent.valueForKey 
(WOComponent.java:1539)
at com.webobjects.foundation.NSKeyValueCoding 
$Utility.valueForKey (NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions 
$DefaultImplementation.valueForKeyPath 
(NSKeyValueCodingAdditions.java:212)
at com.webobjects.appserver.WOComponent.valueForKeyPath  
(WOComponent.java:1600)
at  
com.webobjects.appserver._private.WOKeyValueAssociation.valueInCompone 
nt(WOKeyValueAssociation.java:46)

at er.ajax.AjaxUtils.valueForBinding(AjaxUtils.java:243)
at er.ajax.AjaxDynamicElement.valueForBinding  
(AjaxDynamicElement.java:34)
at er.ajax.AjaxSubmitButton.handleRequest(AjaxSubmitButton.java: 
214)
at er.ajax.AjaxSubmitButton.invokeAction(AjaxSubmitButton.java: 
205)
at  
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction  
(WODynamicGroup.java:101)
at com.webobjects.appserver._private.WODynamicGroup.invokeAction 
(WODynamicGroup.java:110)

at er.extensions.ERXWOForm.invokeAction(ERXWOForm.java:127)
at com.webobjects.appserver.WOComponent.invokeAction  
(WOComponent.java:945)
at  
com.webobjects.appserver._private.WOComponentReference.invokeAction 
(WOComponentReference.java:104)
at  
com.webobjects.appserver._private.WOSwitchComponent.invokeAction 
(WOSwitchComponent.java :171)
at com.webobjects.appserver.WOComponent.invokeAction 
(WOComponent.java:945)
at  
com.webobjects.appserver._private.WOComponentReference.invokeAction 
(WOComponentReference.java:104)
at  
com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction  
(WODynamicGroup.java:

strange error

2007-04-03 Thread Daniele Corti

Hi list,
I've an error witch I don't understand how I should cause it:

WARN  NSLog  - :
Exception occurred while handling request:
java.lang.ClassCastException : com.webobjects.foundation.NSArray
[2007-04-03 10:56:25 CEST]  java.lang.ClassCastException:
com.webobjects.foundation.NSArray
   at com.webobjects.eoaccess.EODatabaseContext.objectsForSourceGlobalID (
EODatabaseContext.java:4049)
   at
com.webobjects.eocontrol.EOObjectStoreCoordinator.objectsForSourceGlobalID(
EOObjectStoreCoordinator.java:682)
   at com.webobjects.eocontrol.EOEditingContext.objectsForSourceGlobalID (
EOEditingContext.java:3965)
   at er.extensions.ERXEC.objectsForSourceGlobalID(ERXEC.java:1036)
   at com.webobjects.eoaccess.EODatabaseContext._fireArrayFault(
EODatabaseContext.java:4427)
   at
com.webobjects.eoaccess.EOAccessArrayFaultHandler.completeInitializationOfObject(
EOAccessArrayFaultHandler.java:70)
   at com.webobjects.eocontrol._EOCheapCopyMutableArray.willRead
(_EOCheapCopyMutableArray.java:38)
   at 
com.webobjects.eocontrol._EOCheapCopyMutableArray.count(_EOCheapCopyMutableArray.java:92)

   at com.webobjects.eocontrol._EOCheapCopyArray._setArray
(_EOCheapCopyArray.java:33)
   at
com.webobjects.eoaccess._EOCheapCopyHandler.completeInitializationOfObject(
EOAccessArrayFaultHandler.java:151)
   at com.webobjects.eocontrol._EOCheapCopyArray.willRead
(_EOCheapCopyArray.java:126)
   at com.webobjects.eocontrol._EOCheapCopyArray.objectsNoCopy
(_EOCheapCopyArray.java:95)
   at com.webobjects.foundation.NSArray.( NSArray.java:395)
   at com.webobjects.foundation.NSMutableArray.(NSMutableArray.java
:60)
   at
com.webobjects.foundation._NSArrayUtilities.arrayExcludingObjectsFromArray
(_NSArrayUtilities.java:197)
   at
com.webobjects.eoaccess.EODatabaseContext.recordChangesInEditingContext(
EODatabaseContext.java:6109)
   at
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext
(EOObjectStoreCoordinator.java :412)
   at com.webobjects.eocontrol.EOEditingContext.saveChanges(
EOEditingContext.java:3226)
   at er.extensions.ERXEC._saveChanges(ERXEC.java:947)
   at er.extensions.ERXEC.saveChanges(ERXEC.java:870)
   at
support.gestweb.component.WXLocalizedComponent._saveChangesAndFixObjects(
WXLocalizedComponent.java:119)
   at support.gestweb.component.insert.GWSAddDiscount.create(
GWSAddDiscount.java:167)
   at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke (Method.java:585)
   at
com.webobjects.foundation.NSKeyValueCoding$ValueAccessor$1.methodValue(
NSKeyValueCoding.java:684)
   at
com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(
NSKeyValueCoding.java :1160)
   at
com.webobjects.foundation.NSKeyValueCoding$DefaultImplementation.valueForKey
(NSKeyValueCoding.java:1268)
   at com.webobjects.appserver.WOComponent.valueForKey(WOComponent.java
:1539)
   at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey (
NSKeyValueCoding.java:498)
   at
com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath
(NSKeyValueCodingAdditions.java:212)
   at com.webobjects.appserver.WOComponent.valueForKeyPath (
WOComponent.java:1600)
   at
com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(
WOKeyValueAssociation.java:46)
   at er.ajax.AjaxUtils.valueForBinding(AjaxUtils.java:243)
   at er.ajax.AjaxDynamicElement.valueForBinding (AjaxDynamicElement.java
:34)
   at er.ajax.AjaxSubmitButton.handleRequest(AjaxSubmitButton.java:214)
   at er.ajax.AjaxSubmitButton.invokeAction(AjaxSubmitButton.java:205)
   at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
   at com.webobjects.appserver._private.WODynamicGroup.invokeAction(
WODynamicGroup.java:110)
   at er.extensions.ERXWOForm.invokeAction(ERXWOForm.java:127)
   at com.webobjects.appserver.WOComponent.invokeAction (WOComponent.java
:945)
   at com.webobjects.appserver._private.WOComponentReference.invokeAction(
WOComponentReference.java:104)
   at com.webobjects.appserver._private.WOSwitchComponent.invokeAction(
WOSwitchComponent.java :171)
   at com.webobjects.appserver.WOComponent.invokeAction(WOComponent.java
:945)
   at com.webobjects.appserver._private.WOComponentReference.invokeAction(
WOComponentReference.java:104)
   at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
   at com.webobjects.appserver._private.WODynamicGroup.invokeAction(
WODynamicGroup.java:110)
   at er.ajax.AjaxDynamicElement.invokeAction(AjaxDynamicElement.java:83)
   at com.webobjects.appserver._private.WODynamicGroup.invokeChildrenAction(
WODynamicGroup.java:101)
   at com.webobjects.appserver._private.WODynamicGroup.invokeAction(
WODynamicGroup.java:110)
   at com.webobjects.appserver.WOComponen

Re: WebObjects classloader fun.

2007-04-03 Thread Q


Oh it gets even more fun.
I thought I would post this just for giggles for anyone interested. I  
don't blog, so this will do.


In order to add true groovy "scripting" support (and maybe even BSF  
if I can work out how that might work) with rapid turnaround ala  
WebScript to my WOGroovy framework I needed to work out how  
WebObjects does it's class loading. In hindsight I probably didn't  
really need to do this, because the hot class loading in eclipse is  
acceptable to some degree, but I wanted to see how it might work  
anyway. And to be honest, hot loading is not the best with classes as  
dynamic as groovy.


I started by writing a simple class loader wrapper so I could see  
what's going on. This allowed me to discover that  
com.webobjects.foundation._NSUtilities does some very funky stuff  
with partial class name resolution and class caching. (Which prompted  
my original email asking for help understand what was going on)


Ok, so I asked my friend "Jad" if he knew anything about _NSUtilites  
that might be useful and with what he told me I got my new best  
friend GluonJ to watch some function calls that _NSUtilities makes so  
I could tell what was actually happening when my application failed  
to load my script code.


So with this information, and some magic fairy dust lifted directly  
from the now defunct ERXCompilerProxy, I think I have worked out what  
I needed to do to make it work, unfortunately it means I needed to  
alter some functionality of _NSUtilities and change how it deals with  
caching of ClassNotFound exceptions.


Long story short, I now have it working (I think) so that you can do  
proper rapid turnaround with groovy code.
Here's the catch.  To do rapid turnaround you need to use Java 1.5  
with a GluonJ based javaagent (included). It may be possible to get  
around this requirement by writing a custom bootstrap loader that  
adds the GroovyClassLoader before any of the WebObjects classes are  
resolved and somehow force the webobjects classes to be loaded higher  
up the loader chain rather than by the system class loader, but I  
decided it was easier to write the 3 lines of AOP code and be done  
with it.


(the updated code has been checked into subversion http:// 
code.google.com/p/wogroovy/source , if you want to check it out this  
is the only way for now)


If you have been meaning to have a look at AspectJ, JBoss AOP or  
similar AOP package for Java, do yourself a favour and look at GluonJ  
first, you need to use java 1.5, but it only needs a single page of  
documentation. :)


Now that I have got that off my chest I should probably do something  
useful and get back to work ;)


Seeya...Q

On 30/03/2007, at 2:44 PM, Mike Schrag wrote:

Does anyone know much about how webobjects uses the classloader  
and how the _NSUtilities class cache is initialized and used?


[snip] it appears that _NSUtilities has a static initialiser that  
pulls in and caches classes rather than asking the current thread  
context classloader for them when needed [snip]
You are correct ... Frameworks (and your app) are loaded by  
NSBundle, which traverses all of the classpath and loads the  
reachable classes into the NSUtilities cache (so you can do things  
like looking up a component by name -- _NSUtilities.classWithName 
(..)).  You can also override these class names by calling  
_NSUtilities.setClassForName.  If the name was not in the cache, it  
will Class.forName it and then put the result into the cache.  This  
behavior makes packageless WOComponent name lookups (for instance)  
very fast in exchange for some kind of weird behavior (like cross- 
your-fingers-if-you-have-two-classes-with-the-same-name).


Unfortunately, I don't know of any way to REMOVE an entry from the  
cache.  You can't setClassForName(null, "ClassName") because that  
tries to put a null key into the cache.  If you specifically know  
the class name, you can replace it yourself -- ERXPatcher is  
generally just calling setClassForName with classes it replaces.


ms

___
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/qdolan% 
40gmail.com


This email sent to [EMAIL PROTECTED]




--
Seeya...Q

Quinton Dolan - [EMAIL PROTECTED]
Gold Coast, QLD, Australia
Ph: +61 419 729 806


___
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