Re: Proper place for functions in KVC paths?

2006-08-30 Thread Lachlan Deck

Hi John,

On 30/08/2006, at 7:20 AM, John Larson wrote:


Hello,

I think the api implies they all work and will have differing  
outcomes depending on what you would like to 'sum' or 'count'  
etc. e.g., Consider the keypath:  
'company.people.accounts.totalLiability'.


You can think of the keypath as a tokenized string that is  
evaluated recursively through the elements toward the end of the  
string and the @operators are looking for scalar values to iterate  
over and accumulate.  So, for company.people.account.totalLiability  
where people is the only array, then  
[EMAIL PROTECTED] would produce the sum as  
desired.  Suppose, however, that each person had multiple  
accounts.  The following would also be valid:  
[EMAIL PROTECTED]@sum.totalLiability.


The point of this was to not leave the thread with the idea that  
there can only be one @operator in a keypath.


This is the kind of thing that WOBuilder provided without thought ;-)  
I was sure it was possible but had a mental blank. Thanks.


with regards,
--

Lachlan Deck



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

This email sent to archive@mail-archive.com


Re: Proper place for functions in KVC paths?

2006-08-30 Thread Lachlan Deck

Hi there,

On 30/08/2006, at 8:05 AM, John Larson wrote:

I don't know if the Wonder project is interested, but I have a  
class that takes KVC strings and a source class (i.e.  
Customer.class) and:


... snip lots of good stuff 


interest++

with regards,
--

Lachlan Deck



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

This email sent to archive@mail-archive.com


Re: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Dev WO

Hello Fabian,


Hi Xavier,

So I tried WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, NameOfTheStringFile,  
null, null, null)
but even if it compiles fine, I just get null when the values  
are displayed in the page.
So I'm assuming WOResourceManger isn't suppose to work in a  
Framework...but I may be wrong.


Later I'll also need to pass a value for the available language,  
and I'm not sure on how to bind that in the WOToManyRelationship..


So my second guess was to create the method that got to  
the .string file directly inside my component.java file.
But this time I don't know what to put for  
anAttributeOfTheEntity in stringForKey(anAttributeOfTheEntity,  
NameOfTheStringFile, null, null, null)


I really don't know how to do this:(


Well, maybe I don't get your question, but the documentation reads:

public String stringForKey(String aKey,
   String aTableName,
   String aDefaultValue,
   String aFrameworkName,
   NSArray aLanguagesList)

aKey - attribute in the receiver's request
aTableName - the string table
aDefaultValue - returned when no value is found
aFrameworkName - name of the framework in which the resource resides
aLanguagesList - list of languages in specific order
Returns:
a localized string from the string table aTableName

http://developer.apple.com/documentation/Webobjects/Reference/API/ 
com/webobjects/appserver/WOResourceManager.html#stringForKey 
(java.lang.String,%20java.lang.String,%20java.lang.String,% 
20java.lang.String,%20com.webobjects.foundation.NSArray)


Yes, and if aLanguagesList is null, it will pick up the available key  
anyway. So this is correct and work as expected in my application,  
but when I try to use it in a framework, it seems like it doesn't get  
any value:(


If localization is somewhat important to you, you should look at  
ERXLocalizer and ERXLocalizedString in WOnder: http:// 
www.mdimension.com/~wonder/api/er/extensions/ERXLocalizer.html
I'll have a look for sure, I just want to know the built-in way to  
do it:)


Xavier

___
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


UTF8, MySQL, and JDBC

2006-08-30 Thread Matt Kime

I'm having some trouble implementing UTF8 with webobjects. I've tried
very hard to dot my i's and cross my t's in this process but I'm
apparently missing something.

The problem doesn't seem to occur on smaller varchar fields. It only
occurs in text fields. (is this leading me astray?) Using CocoaMySQL
I've verified that UTF8 data is being properly stored in this text
field. It seems that WO is having a hard time submitting and
retrieving it as utf8.  I've set the following additional keys in my
JDBC connection which should make a utf8 connection.

useUnicode=true
characterEncoding=latin5

Is there a way to verify the connection character set? The pages are
definitely being created in utf8.

Any ideas? I'm obviously very confused.

thanks,
matt
___
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: Subclass final class (Boolean) ?

2006-08-30 Thread Marcin Lukasiak

  On 29/08/2006, at 4:04 AM, Chuck Hill wrote:
 
  On Aug 27, 2006, at 7:28 AM, Ken Anderson wrote:
 
  OK, I'm a little annoyed here because I find the whole 
 concept of 
  'final' to be ridiculous.
 
  I can see the use of this concept.  For example, you may have a 
  legitimate reason for making your LicenseEvaluator class final.
  But the Java API writers have used it with wild conceit.
  Our String
  is so perfect, nobody will ever need to extend it!.
 
  Well, that and the fact that String might be a perfectly 
 good basis 
  for another class.
 
  Ok, so give me any reasonable idea. Final classes have several 
  different adventages/disadventages. The most important advantage is 
  that final methods can be easily inlined after class is loaded into 
  JVM, especially by JIT.
  Another thing is that normally good practice is to make esential 
  classes in frameworks final. That guaranteees that whenever 
 you will 
  use that class it will behave the same way. Another point 
 for making 
  String as final is that java makes many different 
 opitimizations for 
  this class which base on the internals of String and 
 assurance of it's 
  behaviour. You can always use composition instead of inheritance - 
  marking class as final forces you to do it.
 
 No, you can't always use composition instead of inheritance.  
 Many API methods take a String and your composited class 
 won't qualify.
 

I'm saying about your design - you can always use composition instead of
inheritance in your design, when class is marked as final.
Still I don't see resonable case when I would like to extend String
especially because it is immutable so what is the real need that you would
like to extend it?

 
That and the rampant use of private methods (as opposed to
  protected) mar many Java APIs.
 
  I agree with that too. I hardly ever use private, always 
 preferring 
  protected. Not being able to get at things in subclasses 
 goes against 
  the open-closed principle, which states why you would want to 
  subclass in the first place rather than use as a client. 
 And that's 
  back to Ken's original point, because final/private goes 
 against the 
  flexibility and openness of the OO paradigm. (In fact the whole 
  public, package-level, protected, private scheme cannot express 
  intricate relationships between classes where some are public, but 
  others may be support classes in one or more other packages.)
 
  That's also interesting. How can it be that final/private 
 goes against 
  the flexibility and openness of the OO paradigm? If methods 
 behavior 
  is essential for other methods in a class, changing it's behavior 
  needs also changing all the methods that use it. That's way 
 sometimes 
  it's good or even preferred to make a method private. If you really 
  have to access private methods - change you design - if you 
 still need 
  it because you are a hacker and just do that for fun - use 
 reflections 
  and change access level to public.
 
 That is conceit you are describing, not good design.  Good 
 design is thinking, I will build this clearly, and 
 encapsulate the concepts, and implement it in terms of these 
 concepts.  Private API is the conceit of a Designer 
 thinking, I know better than any Developer who will ever use 
 this class, so I will keep the dangerous parts safe from 
 their unskilled hands.  Public methods are the API for the 
 end users of the class.  Protected methods form the API for 
 extenders of the class.  Private API is just inconsiderate 
 unless it is hiding  
 some particularly brittle and nasty implementation.   What if you  
 don't need to change a private method, but only call it?  You 
 can't.   
 So if you subclass a class with many private methods, you end 
 up having to re-implement much of it rather than tweak the 
 bit you were concerned with.
 

I don't see it the same way. This is true that sometimes people overuse
final for classes that are perfectly good candidates for extending them, but
it is not the case for classes like Boolean or String. I'd also mark them
final because those classes are immutable and are simply primitive types
wrappers (like Integer and so on). 

I think other way when marking classes final: Nobody will be so stupid to
extend this class, so I will use final here to say compiler and runtime
system that this will not happen. 

Private API are for framework/library/application implementator use - you
should even know that there is any method names X when it's private. Private
API's are private because implementators want to have some internal
structure that they will be able to easily change and usually private API
changes a lot. Normally I'd like to have some parts private to do not think
each time I change internals (because of optimization or whatever) if
someone don't relay on this. 

Do you also think that private fields are something to protect from stupid
programmers? 

 ___
Do not 

Re: About some links I would like to see in objectstyle.org

2006-08-30 Thread Marc Oesch

Hello David and everyone


The link in question is this:

http://www.cs.rit.edu/~ama7461/ms/

It is a thesis, comparing .NET to WO. It seems very updated November
2005 (WO 5.2 vs ASP.NET). It is very large, very detailed, it
includes sources, ppt, reports, conclusions, etc.


I added the link to the WOCOM marketing / tool comparison page, thanks.

This is a Wiki, so anyone can add or edit pages, I just started a few
pages to hopefully get things started. You can create an account here:

http://www.objectstyle.org/jira/secure/Dashboard.jspa

This account will also work for the WOLips Wiki and bugtracking, if I
got it the info right.

PS: Thanks again to Andrus for setting the Wiki up.

Marc
___
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: UTF8, MySQL, and JDBC

2006-08-30 Thread Dev WO
Hello Matt,this has been discussed a couple times in the mailing list, the summary is:1-You need to make sure the page has a correct UTF-8 headerin Application.java	public void appendToResponse(WOResponse response, WOContext wocontext) {		super.appendToResponse(response, wocontext);		// This must be done after the page generation to override the default header created by WO during the page generation.		if (_NSUtilities.UTF8StringEncoding.equals(response.contentEncoding()))			response.setHeader("text/html; charset=UTF-8", "content-type");	}		public WOResponse createResponseInContext(WOContext wocontext) {		WOResponse woresponse = super.createResponseInContext(wocontext);		woresponse.setContentEncoding(_NSUtilities.UTF8StringEncoding);		return woresponse;	}2-You need to make sur the form will be received in UTF-8in Session.java	public void takeValuesFromRequest(WORequest aRequest, WOContext aContext){		aRequest.setDefaultFormValueEncoding(_NSUtilities.UTF8StringEncoding);		super.takeValuesFromRequest(aRequest, aContext);	}3-You need to make sure the page that contains the form declares itself in UTF-8        meta http-equiv="content-type" content="text/html;charset=utf-8"4-You need to make sure the database is UTF-8, either by having something in your my.cnf file (for newly created database)[mysqld]default-character-set=utf8character-set-server = utf8[mysql]default-character-set=utf8or by making sure it is set appropriatly5-Use the following connection dictionary (even if the unicode/utf parts are not necessary as it should already been discussing using UTF-8)useUnicode=truecharacterEncoding=UTF-8zeroDateTimeBehavior=convertToNull6-Remember that blob doesn't have a character encoding, so you shouldn't store a string in a blob but rather use mediumtext.I think you've got everything. If you still have some issue, you should be checking how to convert the text encoding on existing field in the database as they were probably not UTF-8 at the beginning...maybe try to dump the database, drop it recreate it 'making sure it's UTF-8 thanks to the my.cnf parameters).XavierI'm having some trouble implementing UTF8 with webobjects. I've triedvery hard to dot my i's and cross my t's in this process but I'mapparently missing something.The problem doesn't seem to occur on smaller varchar fields. It onlyoccurs in text fields. (is this leading me astray?) Using CocoaMySQLI've verified that UTF8 data is being properly stored in this textfield. It seems that WO is having a hard time submitting andretrieving it as utf8.  I've set the following additional keys in myJDBC connection which should make a utf8 connection.useUnicode=truecharacterEncoding=latin5Is there a way to verify the connection character set? The pages aredefinitely being created in utf8.Any ideas? I'm obviously very confused.thanks,matt___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.comThis 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: Wonder Ajax Application Example

2006-08-30 Thread Geoff Hopson
Can't address the problem directly, but I have been having some similar IE-related fun in RubyOnRails recently - IE is very poor at allowing editing of table data in the DOM. Basically you cannot modify table rows in a table using _javascript_. There are workarounds - using TBODY tags around your rows seems to help, for example.
I have no idea if this is relevant to the WONDER AJAX stuff, but it might give you a clue if your AJAX calls are returning table rows. I ended up rewriting my page using DIVs instead of tables to get round this problem (couldn't get the TBODY stuff to work the way I wanted).
Oh, and having form elements in your AJAX response causes some weirdness on IE too.Good luck, hope that helpsGeoffOn 29/08/06, 
jerry porter [EMAIL PROTECTED] wrote:
Hello,I downloaded Wonder resently and I worked through the example drag and drop list and added thefunctionality to an application I am working on.Works great, however, it appears not to work on I.E. on windows.
I did my dev work on Safari and Firefox on the mac, my app works great there.Works great on Firefox on windows but not in I.E. on windows.Basically what happens is I can drag one item from the list to the drop location.
But, in I.E. the other items in the list become locked and cannot be selected.This behaviour happens in both my app and the AjaxExample app.Anybody know of a fix for this?Jerry Porter
2200 Benjamin Franklin ParkwayAPT S1114Philadelphia, PA 19130(301) 461-3854__Do You Yahoo!?Tired of spam?Yahoo! Mail has the best spam protection around
http://mail.yahoo.com ___Do not post admin requests to the list. They will be ignored.Webobjects-dev mailing list(
Webobjects-dev@lists.apple.com)Help/Unsubscribe/Update your Subscription:http://lists.apple.com/mailman/options/webobjects-dev/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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Fabian Peters

Hi Xavier,

Am 30.08.2006 um 08:27 schrieb Dev WO:

So I tried WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, NameOfTheStringFile,  
null, null, null)


If you refer to a Localizable.strings file in a framework named  
Backend, it should read:


String result = WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, Localizable,  
anAttributeOfTheEntity, Backend, null);


Yes, and if aLanguagesList is null, it will pick up the available  
key anyway. So this is correct and work as expected in my  
application, but when I try to use it in a framework, it seems like  
it doesn't get any value:(


Are you passing in the framework name, i.e. Backend in the example  
above?


cheers

Fabian


___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Dev WO

Hi Fabian
So I tried WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, NameOfTheStringFile,  
null, null, null)


If you refer to a Localizable.strings file in a framework named  
Backend, it should read:


String result = WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, Localizable,  
anAttributeOfTheEntity, Backend, null);


Yes, and if aLanguagesList is null, it will pick up the available  
key anyway. So this is correct and work as expected in my  
application, but when I try to use it in a framework, it seems  
like it doesn't get any value:(


Are you passing in the framework name, i.e. Backend in the  
example above?

in fact I'm trying to have this line directly in the framework.
In this case I got null value (not an exception, just null string.

If I'm putting the method in my application instead, I just don't  
know what to provide for anAttributeOfTheEntity:(


cheers

Fabian


___
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


Problem with NSTimestamp

2006-08-30 Thread Mike Bobkiewicz
Hi,
I´m in trouble with NSTimestamp. I´m using this to store the durrent
date to a database. While there is no need to edit this date I´ve
altered the acceorclass for the database object like that:

public void setBriefDatum()
NSTimeStamp value = new NSTimeStamp();
takeStoredValueForKey(value, briefDatum);
}

When you hit the new button in my form a new object briefe is
initialisied ,which includes the datafield briefDatum, I then call the
setBriefDatum method and the date shows up in the connected Formfield.
You can enter your data and hit the save button. After that an exception
occured. Funny thing, it occures when all my code is finished and the
page is displayed again. Data is saved to database, all aftersave work
of my code is executed, don´t know where error might be.

The error message:

 [2006-08-30 13:20:18 CEST] WorkerThread6
com.webobjects.appserver._private.WOComponentRequestHandler: Exception
occurred while handling request:
java.lang.ClassCastException
[2006-08-30 13:20:18 CEST] WorkerThread6 java.lang.ClassCastException
at briefe.briefDatum(briefe.java:36)
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:324)
at KeyValueCodingProtectedAccessor.methodValue
(KeyValueCodingProtectedAccessor.java:54)
at com.webobjects.foundation.NSKeyValueCoding
$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)
at com.webobjects.eocontrol.EOCustomObject.valueForKey
(EOCustomObject.java:1559)
at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey
(NSKeyValueCoding.java:498)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)
at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath
(EOCustomObject.java:1675)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)
at com.webobjects.foundation.NSKeyValueCodingAdditions
$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)
at com.webobjects.appserver.WOComponent.valueForKeyPath
(WOComponent.java:1600)
at com.webobjects.appserver._private
.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46)
at com.webobjects.appserver._private
.WOTextField._appendValueAttributeToResponse(WOTextField.java:91)
at com.webobjects.appserver._private.WOInput.appendAttributesToResponse
(WOInput.java:140)
at com.webobjects.appserver._private
.WOHTMLDynamicElement._appendOpenTagToResponse(WOHTMLDynamicElement.java:395)
at com.webobjects.appserver._private
.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:420)
at com.webobjects.appserver._private
.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)
at com.webobjects.appserver._private.WOForm.appendChildrenToResponse
(WOForm.java:124)
at com.webobjects.appserver._private
.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:424)
at 
com.webobjects.appserver._private.WOForm.appendToResponse(WOForm.java:118)
at com.webobjects.appserver._private
.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)
at com.webobjects.appserver._private.WODynamicGroup.appendToResponse
(WODynamicGroup.java:130)
at com.webobjects.appserver.WOComponent.appendToResponse
(WOComponent.java:992)
at 
com.webobjects.appserver.WOSession.appendToResponse(WOSession.java:1200)
at com.webobjects.appserver.WOApplication.appendToResponse
(WOApplication.java:1418)
at com.webobjects.appserver._private
.WOComponentRequestHandler._dispatchWithPreparedPage
(WOComponentRequestHandler.java:230)
at com.webobjects.appserver._private
.WOComponentRequestHandler._dispatchWithPreparedSession
(WOComponentRequestHandler.java:287)
at com.webobjects.appserver._private
.WOComponentRequestHandler._dispatchWithPreparedApplication
(WOComponentRequestHandler.java:322)
at com.webobjects.appserver._private
.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)
at com.webobjects.appserver._private
.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)
at com.webobjects.appserver.WOApplication.dispatchRequest
(WOApplication.java:1306)
at com.webobjects.appserver._private.WOWorkerThread.runOnce
(WOWorkerThread.java:173)
at com.webobjects.appserver._private.WOWorkerThread.run
(WOWorkerThread.java:254)
at java.lang.Thread.run(Thread.java:552)

Regards,

  Mike

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing 

Re: Subclass final class (Boolean) ?

2006-08-30 Thread Ken Anderson
There are hundreds of reasons to extend String.  Maybe you want strings to be able to archive in a special way?  Maybe you need them to be initialized from a special type?Yes, in those cases, you could use a static helper function.  Inelegant, but functional.More importantly, there are often times when the instance implementation and the static class methods must be implemented in the same class.  This is the case that I had that originally started this thread.  The problem was, an existing tool took 3 parameters:1)  The class name of the instance you want to use to represent something in a database2)  The method ON THAT CLASS that generates the representation you want for the database storage3)  The static method ON THAT CLASS that can be used to initialize a new instance from database storageThere is no way to make this work without subclassing - and that is why I don't like 'final'.Everyone - please - there are language capabilities that are good and bad depending on how you use them.  There are functions people may not understand or need, while others might.  I was complaining about 'final' in the midst of trying to accomplish something, not to start a debate.KenOn Aug 30, 2006, at 3:57 AM, Marcin Lukasiak wrote:I'm saying about your design - you can always use composition instead of inheritance in your design, when class is marked as final. Still I don't see resonable case when I would like to extend String especially because it is immutable so what is the real need that you would like to extend it?  ___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Fabian Peters

Hi Xavier,

If you refer to a Localizable.strings file in a framework named  
Backend, it should read:


String result = WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, Localizable,  
anAttributeOfTheEntity, Backend, null);


Yes, and if aLanguagesList is null, it will pick up the available  
key anyway. So this is correct and work as expected in my  
application, but when I try to use it in a framework, it seems  
like it doesn't get any value:(


Are you passing in the framework name, i.e. Backend in the  
example above?

in fact I'm trying to have this line directly in the framework.
In this case I got null value (not an exception, just null string.


IMHO you'll still have to pass in the framework's name, whether the  
method is in a class in your framework or not. This is just so  
WOResourceManager knows where to look for the .strings file. Then of  
course you'll have to make sure the .strings file is well-formed and  
correctly included in your framework.


HTH

Fabian
___
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: Restore and Save Session

2006-08-30 Thread Mike Schrag
It should be in handleRequest, and make sure that you put your  
saveSession in a finally block so that it is ALWAYS called if you  
restore it.


ms

On Aug 30, 2006, at 12:49 AM, [EMAIL PROTECTED] wrote:


Hello;

I'm wondering, when one is writing a request handler, where should  
the session restore and save be located?


1) WOAction.performActionNamed(...)
2) WORequestHandler.handleRequest(...)

Anybody know where Apple does this?

cheers.

___
Andrew Lindesay
www.lindesay.co.nz



___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Dev WO

Thanks Fabian:)
it works with the name of the framework...I wasn't thinking about it  
as I was (wrongly) assuming it would know where it was.


One last thing, if I want to pass the languages NSArray from the the  
application (displayDestinationKey) to the localizedName method in  
the framework, how would I do that?


I'll have a look at wonder anyway, but I always like to know the  
built-in way:)


Thanks again,

Xavier




Hi Xavier,

If you refer to a Localizable.strings file in a framework named  
Backend, it should read:


String result = WOApplication.application().resourceManager 
().stringForKey(anAttributeOfTheEntity, Localizable,  
anAttributeOfTheEntity, Backend, null);


Yes, and if aLanguagesList is null, it will pick up the  
available key anyway. So this is correct and work as expected in  
my application, but when I try to use it in a framework, it  
seems like it doesn't get any value:(


Are you passing in the framework name, i.e. Backend in the  
example above?

in fact I'm trying to have this line directly in the framework.
In this case I got null value (not an exception, just null string.


IMHO you'll still have to pass in the framework's name, whether the  
method is in a class in your framework or not. This is just so  
WOResourceManager knows where to look for the .strings file. Then  
of course you'll have to make sure the .strings file is well-formed  
and correctly included in your framework.


HTH

Fabian
___
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: directtoweb and readOnlyEntityNames rule

2006-08-30 Thread David Avendasora
Okay, I'm going to take another stab at it. I think you're using the  
wrong class.


From the 5.3 API, EOKeyComparisionQualifier compares a named  
property of an object with a named value of another object. For  
example, to return all of the employees whose salaries are greater  
than those of their managers, you might use an expression such as  
salary  manager.salary, where salary is the left key and  
manager.salary is the right key.


I think you should be using EOKeyValueQualifier, which the API states  
that it compares a named property of an object with a supplied value,  
which I believe is what you are doing. Based on this, You should  
rewrite the rule as:


 {
   author = 50;
   class = com.webobjects.directtoweb.Rule;
   lhs = {
   class = com.webobjects.eocontrol.EOKeyValueQualifier;
   key = session.noEdits;
   selectorName = isEqualTo;
   value = 1;
   };
   rhs = {
   class = com.webobjects.directtoweb.Assignment;
   keyPath = readOnlyEntityNames;
   value = (User, Group);
   };
   }

The reason the rule you wrote is not being triggered is that there is  
no object 1 and 1 certainly doesn't have named value so the lhs  
is never True.


Again, I'm pretty new to rules writing, but I think this is correct.

Dave


On Aug 29, 2006, at 8:15 PM, Steve Quirk wrote:

   class =  
com.webobjects.eocontrol.EOKeyComparisonQualifier;


___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Fabian Peters

Hi Xavier,

One last thing, if I want to pass the languages NSArray from the  
the application (displayDestinationKey) to the localizedName method  
in the framework, how would I do that?


I can only guess that you'll want to pass in the session's languages:

http://developer.apple.com/documentation/Webobjects/Reference/API/ 
com/webobjects/appserver/WOSession.html#languages()


I'll guess your next question will be how to access the session from  
the method in your framework? WOnder lets you get it via http:// 
www.mdimension.com/~wonder/api/er/extensions/ 
ERXExtensions.html#session(). I don't know any similar API in  
standard WO that would let you access the session without passing the  
context around. Anybody?


cheers

Fabian

___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Mike Schrag
No, but Wonder just sticks it in a ThreadLocal variable, which you  
could easily do with non-Wonder-WO also.  Just make sure to clean up  
after yourself at the end of the request.


ms

On Aug 30, 2006, at 10:15 AM, Fabian Peters wrote:

I'll guess your next question will be how to access the session  
from the method in your framework? WOnder lets you get it via  
http://www.mdimension.com/~wonder/api/er/extensions/ 
ERXExtensions.html#session(). I don't know any similar API in  
standard WO that would let you access the session without passing  
the context around. Anybody?


___
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


Wonder AJAX Drag/Drop

2006-08-30 Thread Marcos Trejo Munguia

Hi List,

I found the following behavior in DragAndDropExample component:
	The method in the action binding in the AjaxDroppable is called only 
once for each AjaxDraggable that is dropped in the AjaxDroppable. For 
example if you drag and drop the draggable #1 into drop area #1 
something is printed in the console, the next time that you drag and 
drop draggable #1 into drop area #1 nothing is printed.


I don't know if this behavior is normal, maybe there is another binding 
that needs to be set to change this behavior.


If somebody know how this works please let me know.

Thanks in advanced

___
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: Problem with NSTimestamp

2006-08-30 Thread Robert Walker
I'm not sure how much it matters in this case, but it might be a good idea to call the super implementation inside awakeFromInsertion like so:- (void) awakeFromInsertion(EOEditingContext ec) {	super.awakeFromInsertion(ec);	this.setBriefDatum(new NSTimestamp());}On Aug 30, 2006, at 8:14 AM, Ken Anderson wrote:Mike,If you want to initialize a field to be a certain value, you should use the awakeAfterInsertion(EOEditingContext ec) method.  Implement it like this:- (void) awakeFromInsertion(EOEditingContext ec) {	this.setBriefDatum(new NSTimestamp());}Modifying a set method to not have the correct signature is a huge problem for KeyValueCoding (and probably many other things!)KenOn Aug 30, 2006, at 8:04 AM, Mike Bobkiewicz wrote: Hi,I´m in trouble with NSTimestamp. I´m using this to store the durrentdate to a database. While there is no need to edit this date I´vealtered the acceorclass for the database object like that:public void setBriefDatum()    NSTimeStamp value = new NSTimeStamp();    takeStoredValueForKey(value, "briefDatum");}When you hit the new button in my form a new object "briefe" isinitialisied ,which includes the datafield "briefDatum", I then call the"setBriefDatum" method and the date shows up in the connected Formfield.You can enter your data and hit the save button. After that an exceptionoccured. Funny thing, it occures when all my code is finished and thepage is displayed again. Data is saved to database, all aftersave workof my code is executed, don´t know where error might be.The error message: [2006-08-30 13:20:18 CEST] WorkerThread6com.webobjects.appserver._private.WOComponentRequestHandler: Exceptionoccurred while handling request:java.lang.ClassCastException[2006-08-30 13:20:18 CEST] WorkerThread6 java.lang.ClassCastException	at briefe.briefDatum(briefe.java:36)	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:324)	at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:54)	at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)	at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1559)	at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:498)	at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)	at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath(EOCustomObject.java:1675)	at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)	at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)	at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1600)	at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46)	at com.webobjects.appserver._private.WOTextField._appendValueAttributeToResponse(WOTextField.java:91)	at com.webobjects.appserver._private.WOInput.appendAttributesToResponse(WOInput.java:140)	at com.webobjects.appserver._private.WOHTMLDynamicElement._appendOpenTagToResponse(WOHTMLDynamicElement.java:395)	at com.webobjects.appserver._private.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:420)	at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)	at com.webobjects.appserver._private.WOForm.appendChildrenToResponse(WOForm.java:124)	at com.webobjects.appserver._private.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:424)	at com.webobjects.appserver._private.WOForm.appendToResponse(WOForm.java:118)	at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)	at com.webobjects.appserver._private.WODynamicGroup.appendToResponse(WODynamicGroup.java:130)	at com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:992)	at com.webobjects.appserver.WOSession.appendToResponse(WOSession.java:1200)	at com.webobjects.appserver.WOApplication.appendToResponse(WOApplication.java:1418)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:230)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)	at com.webobjects.appserver._private.WOComponentRequestHandler._handleRequest(WOComponentRequestHandler.java:358)	at com.webobjects.appserver._private.WOComponentRequestHandler.handleRequest(WOComponentRequestHandler.java:432)	at 

Re: Problem with NSTimestamp

2006-08-30 Thread Ken Anderson
Yikes!  Matters A LOT!Sorry about that... always call super.awakeFromInsertion(ec), otherwise, certain things won't happen (like to-many fault array initialization).kenOn Aug 30, 2006, at 10:27 AM, Robert Walker wrote:I'm not sure how much it matters in this case, but it might be a good idea to call the super implementation inside awakeFromInsertion like so:- (void) awakeFromInsertion(EOEditingContext ec) {	super.awakeFromInsertion(ec);	this.setBriefDatum(new NSTimestamp());}On Aug 30, 2006, at 8:14 AM, Ken Anderson wrote:Mike,If you want to initialize a field to be a certain value, you should use the awakeAfterInsertion(EOEditingContext ec) method.  Implement it like this:- (void) awakeFromInsertion(EOEditingContext ec) {	this.setBriefDatum(new NSTimestamp());}Modifying a set method to not have the correct signature is a huge problem for KeyValueCoding (and probably many other things!)KenOn Aug 30, 2006, at 8:04 AM, Mike Bobkiewicz wrote: Hi,I´m in trouble with NSTimestamp. I´m using this to store the durrentdate to a database. While there is no need to edit this date I´vealtered the acceorclass for the database object like that:public void setBriefDatum()    NSTimeStamp value = new NSTimeStamp();    takeStoredValueForKey(value, "briefDatum");}When you hit the new button in my form a new object "briefe" isinitialisied ,which includes the datafield "briefDatum", I then call the"setBriefDatum" method and the date shows up in the connected Formfield.You can enter your data and hit the save button. After that an exceptionoccured. Funny thing, it occures when all my code is finished and thepage is displayed again. Data is saved to database, all aftersave workof my code is executed, don´t know where error might be.The error message: [2006-08-30 13:20:18 CEST] WorkerThread6com.webobjects.appserver._private.WOComponentRequestHandler: Exceptionoccurred while handling request:java.lang.ClassCastException[2006-08-30 13:20:18 CEST] WorkerThread6 java.lang.ClassCastException	at briefe.briefDatum(briefe.java:36)	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:324)	at KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:54)	at com.webobjects.foundation.NSKeyValueCoding$_MethodBinding.valueInObject(NSKeyValueCoding.java:1160)	at com.webobjects.eocontrol.EOCustomObject.valueForKey(EOCustomObject.java:1559)	at com.webobjects.foundation.NSKeyValueCoding$Utility.valueForKey(NSKeyValueCoding.java:498)	at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:212)	at com.webobjects.eocontrol.EOCustomObject.valueForKeyPath(EOCustomObject.java:1675)	at com.webobjects.foundation.NSKeyValueCodingAdditions$Utility.valueForKeyPath(NSKeyValueCodingAdditions.java:149)	at com.webobjects.foundation.NSKeyValueCodingAdditions$DefaultImplementation.valueForKeyPath(NSKeyValueCodingAdditions.java:217)	at com.webobjects.appserver.WOComponent.valueForKeyPath(WOComponent.java:1600)	at com.webobjects.appserver._private.WOKeyValueAssociation.valueInComponent(WOKeyValueAssociation.java:46)	at com.webobjects.appserver._private.WOTextField._appendValueAttributeToResponse(WOTextField.java:91)	at com.webobjects.appserver._private.WOInput.appendAttributesToResponse(WOInput.java:140)	at com.webobjects.appserver._private.WOHTMLDynamicElement._appendOpenTagToResponse(WOHTMLDynamicElement.java:395)	at com.webobjects.appserver._private.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:420)	at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)	at com.webobjects.appserver._private.WOForm.appendChildrenToResponse(WOForm.java:124)	at com.webobjects.appserver._private.WOHTMLDynamicElement.appendToResponse(WOHTMLDynamicElement.java:424)	at com.webobjects.appserver._private.WOForm.appendToResponse(WOForm.java:118)	at com.webobjects.appserver._private.WODynamicGroup.appendChildrenToResponse(WODynamicGroup.java:121)	at com.webobjects.appserver._private.WODynamicGroup.appendToResponse(WODynamicGroup.java:130)	at com.webobjects.appserver.WOComponent.appendToResponse(WOComponent.java:992)	at com.webobjects.appserver.WOSession.appendToResponse(WOSession.java:1200)	at com.webobjects.appserver.WOApplication.appendToResponse(WOApplication.java:1418)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedPage(WOComponentRequestHandler.java:230)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedSession(WOComponentRequestHandler.java:287)	at com.webobjects.appserver._private.WOComponentRequestHandler._dispatchWithPreparedApplication(WOComponentRequestHandler.java:322)	at 

web.xml.template and %WOClasspath%

2006-08-30 Thread David Avendasora

Hi all,

How is the %WOClasspath% defined? It isn't generating properly for me  
when I build. It is missing the path to the .jar of my client-side  
classes.


It contains the path for the server-side classes (WEBINFROOT/ERP.woa/ 
Contents/Resources/Java/erp.jar) but not the client-side path  
(WEBINFROOT/ERP.woa/Contents/WebServerResources/Java/erp.jar)


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: directtoweb and readOnlyEntityNames rule

2006-08-30 Thread David Avendasora

I am glad I could help!

This type of problem seems to be VERY typical of D2W and D2JC (and  
likely D2WS as well). The documentation is often either incomplete or  
just pain wrong. Digging through the API and examples of things that  
do work is about the only way to get by. With that said, once you  
figure out the correct way to do things, it is absolutely amazing  
what can be done without writing a bunch of Java code.


If there is a place in any of the documentation that led you astray,  
please point it out. I'm on a crusade to make D2JC (and D2W) much  
more friendly and less mysterious and therefor used more widely.


Dave

On Aug 30, 2006, at 10:34 AM, Steve Quirk wrote:



Holy crap!  That worked!  It also fixed it in the original bloated  
project as well.


The rule I created was done with RuleEditor and based on  
documentation from BugTracker in Wonder (though I could never find  
the rule mentioned in the docs).  I don't take back any of the  
nasty cusses I muttered about D2W.


Thanks a whole lot for your help!

Steve

On Wed, 30 Aug 2006, David Avendasora wrote:

Okay, I'm going to take another stab at it. I think you're using  
the wrong class.


From the 5.3 API, EOKeyComparisionQualifier compares a named  
property of an object with a named value of another object. For  
example, to return all of the employees whose salaries are greater  
than those of their managers, you might use an expression such as  
salary  manager.salary, where salary is the left key and  
manager.salary is the right key.


I think you should be using EOKeyValueQualifier, which the API  
states that it compares a named property of an object with a  
supplied value, which I believe is what you are doing. Based on  
this, You should rewrite the rule as:


   {
 author = 50;
 class = com.webobjects.directtoweb.Rule;
 lhs = {
 class = com.webobjects.eocontrol.EOKeyValueQualifier;
 key = session.noEdits;
 selectorName = isEqualTo;
 value = 1;
 };
 rhs = {
 class = com.webobjects.directtoweb.Assignment;
 keyPath = readOnlyEntityNames;
 value = (User, Group);
 };
 }

The reason the rule you wrote is not being triggered is that there  
is no object 1 and 1 certainly doesn't have named value so the  
lhs is never True.


Again, I'm pretty new to rules writing, but I think this is correct.

Dave


On Aug 29, 2006, at 8:15 PM, Steve Quirk wrote:

  class =  
com.webobjects.eocontrol.EOKeyComparisonQualifier;







___
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: custom display for WOToManyRelationship destinationDisplayKey

2006-08-30 Thread Dev WO

OK, so I have to go for wonder;)

Thanks all for taking the time:)

Xavier



No, but Wonder just sticks it in a ThreadLocal variable, which you  
could easily do with non-Wonder-WO also.  Just make sure to clean  
up after yourself at the end of the request.


ms

On Aug 30, 2006, at 10:15 AM, Fabian Peters wrote:

I'll guess your next question will be how to access the session  
from the method in your framework? WOnder lets you get it via  
http://www.mdimension.com/~wonder/api/er/extensions/ 
ERXExtensions.html#session(). I don't know any similar API in  
standard WO that would let you access the session without passing  
the context around. Anybody?


___
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


out of memory (wo 5.3)

2006-08-30 Thread Marc Respass

Hi All,

I'm getting out of memory exceptions in my app. I do need to go  
through it and see if there is anything I can do to manage memory  
better, but until then, I tried increasing the memory of the JVM. I  
did it by adding


-Xmx256M -Xms128m to the Additional Arguments section of the apps  
configuration in Monitor. When I check the running processes using


ps axwww | grep Xmx

I see my app but it has two occurrences as you can see below.

java -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory=/System - 
DWOLocalRootDirectory= -DWOUserDirectory=/System/Library/WebObjects/ 
JavaApplications/wotaskd.woa -DWOEnvClassPath= - 
DWOApplicationClass=gov.maine.oit.BailMonitor.Application - 
DWOPlatform=MacOS -Dcom.webobjects.pid=9181 - 
DNSDebugLevel=NSLog.DebugLevelCritical -Xmx256M -Xms128m


I'm questioning which of those is taken. I would think that the  
arguments are checked as they are encountered and that the last one  
is the one used but I don't know any way to be sure.


Can anyone confirm that the Additional Arguments section in Monitor  
is the right place to put that and that it is the last argument that  
takes effect?


Thanks
Marc
___
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: out of memory (wo 5.3)

2006-08-30 Thread Mike Schrag
The second one should win, though you can print Runtime.getRuntime 
().maxMemory() in your app startup to be sure.  You can also edit  
your woa startup script and remove the first -Xmx (which is probably  
where that is coming from).


ms

On Aug 30, 2006, at 12:53 PM, Marc Respass wrote:


Hi All,

I'm getting out of memory exceptions in my app. I do need to go  
through it and see if there is anything I can do to manage memory  
better, but until then, I tried increasing the memory of the JVM. I  
did it by adding


-Xmx256M -Xms128m to the Additional Arguments section of the apps  
configuration in Monitor. When I check the running processes using


ps axwww | grep Xmx

I see my app but it has two occurrences as you can see below.

java -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory=/System - 
DWOLocalRootDirectory= -DWOUserDirectory=/System/Library/WebObjects/ 
JavaApplications/wotaskd.woa -DWOEnvClassPath= - 
DWOApplicationClass=gov.maine.oit.BailMonitor.Application - 
DWOPlatform=MacOS -Dcom.webobjects.pid=9181 - 
DNSDebugLevel=NSLog.DebugLevelCritical -Xmx256M -Xms128m


I'm questioning which of those is taken. I would think that the  
arguments are checked as they are encountered and that the last one  
is the one used but I don't know any way to be sure.


Can anyone confirm that the Additional Arguments section in Monitor  
is the right place to put that and that it is the last argument  
that takes effect?


Thanks
Marc
___
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: out of memory (wo 5.3)

2006-08-30 Thread Chuck Hill


On Aug 30, 2006, at 9:53 AM, Marc Respass wrote:


Hi All,

I'm getting out of memory exceptions in my app. I do need to go  
through it and see if there is anything I can do to manage memory  
better, but until then, I tried increasing the memory of the JVM. I  
did it by adding


-Xmx256M


Lower case em:  -Xmx256m


-Xms128m to the Additional Arguments section of the apps  
configuration in Monitor. When I check the running processes using


ps axwww | grep Xmx

I see my app but it has two occurrences as you can see below.

java -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory=/System - 
DWOLocalRootDirectory= -DWOUserDirectory=/System/Library/WebObjects/ 
JavaApplications/wotaskd.woa -DWOEnvClassPath= - 
DWOApplicationClass=gov.maine.oit.BailMonitor.Application - 
DWOPlatform=MacOS -Dcom.webobjects.pid=9181 - 
DNSDebugLevel=NSLog.DebugLevelCritical -Xmx256M -Xms128m


I'm questioning which of those is taken. I would think that the  
arguments are checked as they are encountered and that the last one  
is the one used but I don't know any way to be sure.


Can anyone confirm that the Additional Arguments section in Monitor  
is the right place to put that and that it is the last argument  
that takes effect?


All I can tell you is that is what we do and it works for us.

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: Restore and Save Session

2006-08-30 Thread Chuck Hill


On Aug 29, 2006, at 9:49 PM, [EMAIL PROTECTED] wrote:


Hello;

I'm wondering, when one is writing a request handler, where should  
the session restore and save be located?


1) WOAction.performActionNamed(...)
2) WORequestHandler.handleRequest(...)

Anybody know where Apple does this?


The second one.  See page 167.  ;-)

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: out of memory (wo 5.3)

2006-08-30 Thread Thomas Pelaia II

Marc,

If you display dynamic images (e.g. from generated from a database)  
then I would recommend looking there for the source of the memory  
leak.  Under certain circumstances the resource manager fails to free  
up the resources.  I no longer use WOImage and WOActiveImage.   
Instead I created a custom image element starting from code someone  
on this site donated.  That fixed the memory leak for my application.


-tom




On Aug 30, 2006, at 1:00 PM, [EMAIL PROTECTED]  
wrote:



Date: Wed, 30 Aug 2006 12:53:46 -0400
From: Marc Respass [EMAIL PROTECTED]
Subject: out of memory (wo 5.3)
To: WebObjects-Dev Apple webobjects-dev@lists.apple.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hi All,

I'm getting out of memory exceptions in my app. I do need to go
through it and see if there is anything I can do to manage memory
better, but until then, I tried increasing the memory of the JVM. I
did it by adding

-Xmx256M -Xms128m to the Additional Arguments section of the apps
configuration in Monitor. When I check the running processes using

ps axwww | grep Xmx

I see my app but it has two occurrences as you can see below.

java -XX:NewSize=2m -Xmx64m -Xms32m -DWORootDirectory=/System -
DWOLocalRootDirectory= -DWOUserDirectory=/System/Library/WebObjects/
JavaApplications/wotaskd.woa -DWOEnvClassPath= -
DWOApplicationClass=gov.maine.oit.BailMonitor.Application -
DWOPlatform=MacOS -Dcom.webobjects.pid=9181 -
DNSDebugLevel=NSLog.DebugLevelCritical -Xmx256M -Xms128m

I'm questioning which of those is taken. I would think that the
arguments are checked as they are encountered and that the last one
is the one used but I don't know any way to be sure.

Can anyone confirm that the Additional Arguments section in Monitor
is the right place to put that and that it is the last argument that
takes effect?

Thanks
Marc


___
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: Wonder Ajax Application Example

2006-08-30 Thread John Larson
I also had to rewrite my tables using divs to get it to work right.  Don't forget that in the div's css style values display:table, display:table-row, and display:table-cell all work to help ease the transition from tables to div built tables (as opposed to float and clear).JohnOn Aug 30, 2006, at 5:14 AM, Geoff Hopson wrote:Can't address the problem directly, but I have been having some similar IE-related fun in RubyOnRails recently - IE is very poor at allowing editing of table data in the DOM. Basically you cannot modify table rows in a table using _javascript_. There are workarounds - using TBODY tags around your rows seems to help, for example. I have no idea if this is relevant to the WONDER AJAX stuff, but it might give you a clue if your AJAX calls are returning table rows. I ended up rewriting my page using DIVs instead of tables to get round this problem (couldn't get the TBODY stuff to work the way I wanted). Oh, and having form elements in your AJAX response causes some weirdness on IE too.Good luck, hope that helpsGeoffOn 29/08/06,  jerry porter [EMAIL PROTECTED] wrote: Hello,I downloaded Wonder resently and I worked through the example drag and drop list and added thefunctionality to an application I am working on.Works great, however, it appears not to work on I.E. on windows. I did my dev work on Safari and Firefox on the mac, my app works great there.Works great on Firefox on windows but not in I.E. on windows.Basically what happens is I can drag one item from the list to the drop location. But, in I.E. the other items in the list become "locked" and cannot be selected.This behaviour happens in both my app and the AjaxExample app.Anybody know of a fix for this?Jerry Porter 2200 Benjamin Franklin ParkwayAPT S1114Philadelphia, PA 19130(301) 461-3854__Do You Yahoo!?Tired of spam?  Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___Do not post admin requests to the list. They will be ignored.Webobjects-dev mailing list  ( Webobjects-dev@lists.apple.com)Help/Unsubscribe/Update your Subscription:http://lists.apple.com/mailman/options/webobjects-dev/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/the_larsons%40mac.comThis 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: UTF8, MySQL, and JDBC

2006-08-30 Thread Matt Kime

I think this problem is a bit weirder than I originally suspected.

I'm occasionally getting the following error. Removing UTF8 characters
seems to prevent it, but sometimes it'll save a multi-be character
anyway.

Its complaining that the column isn't long enough but its definitely
long enough. Its a text field which should be able to store some 65k
characters.

Any ideas? I'm stumped.

thanks,
matt

[2006-08-30 14:29:51 EDT] WorkerThread0  evaluateExpression:
com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression: UPDATE
abExhibition SET description = ? WHERE _rowID = ? withBindings:
1:Nicole Klagsbrun Gal...
of American Art.

(descriptionLong), 2:1230(rowid)
[2006-08-30 14:29:51 EDT] WorkerThread0
com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
failed: com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression:
UPDATE abExhibition SET description = ? WHERE _rowID = ?
withBindings: 1:Nicole Klagsbrun Gal...
of American Art.

(descriptionLong), 2:1230(rowid):
   Next exception:SQL Warning:01004 -- error code: 0 -- msg: Data
truncation: Data too long for column 'description' at row 1
at 
com.webobjects.eoaccess.EODatabaseContext._exceptionWithDatabaseContextInformationAdded(EODatabaseContext.java:4685)
at 
com.webobjects.eoaccess.EODatabaseContext.performChanges(EODatabaseContext.java:6393)
at 
com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:415)
at 
com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3226)
at exhibitionSubmitForm.saveChanges(exhibitionSubmitForm.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.Nat[2006-08-30 14:29:51 EDT] WorkerThread0  ===
Rollback Internal Transaction
[2006-08-30 14:29:51 EDT] WorkerThread0
com.webobjects.appserver._private.WOComponentRequestHandler:
Exception occurred while handling request:
com.webobjects.eoaccess.EOGeneralAdaptorException: EvaluateExpression
failed: com.webobjects.jdbcadaptor.MySQLPlugIn$MySQLExpression:
UPDATE abExhibition SET description = ? WHERE _rowID = ?
withBindings: 1:Nicole Klagsbrun Gal...
of American Art.

(descriptionLong), 2:1230(rowid):
   Next exception:SQL Warning:01004 -- error code: 0 -- msg: Data
truncation: Data too long for column 'description' at row 1
iveMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at 
KeyValueCodingProtectedAccessor.methodValue(KeyValueCodingProtectedAccessor.java:54)
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 
com.webobjects.appserver._private.WOSubmitButton.invokeAction(WOSubmitButton.java:59)




I think you've got everything. If you still have some issue, you should be
checking how to convert the text encoding on existing field in the database
as they were probably not UTF-8 at the beginning...maybe try to dump the
database, drop it recreate it 'making sure it's UTF-8 thanks to the my.cnf
parameters).

Xavier

___
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


Javascript in a framework

2006-08-30 Thread David Holt

Hello all,

I am calling a javascript that resides in a new framework that I have  
just created.


CalendarPopupJavaScript: WOJavaScript {
scriptSource = calendar.js;
hideInComment = true;
}

The html generated reads:

SCRIPT language=JavaScript src=/cgi-bin/WebObjects/ 
FrameworkTest.woa/wr? 
wodata=ERROR_NOT_FOUND_framework_*null*_filename_calendar.js/SCRIPT


Can you call a javascript file that resides in a framework using  
WOJavaScript?

___
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: Javascript in a framework

2006-08-30 Thread Chuck Hill

No, surprisingly this is not supported.  File a bug.

In the meantime, you can implement your own.  :-)

Chuck


On Aug 30, 2006, at 11:49 AM, David Holt wrote:


Hello all,

I am calling a javascript that resides in a new framework that I  
have just created.


CalendarPopupJavaScript: WOJavaScript {
scriptSource = calendar.js;
hideInComment = true;
}

The html generated reads:

SCRIPT language=JavaScript src=/cgi-bin/WebObjects/ 
FrameworkTest.woa/wr? 
wodata=ERROR_NOT_FOUND_framework_*null*_filename_calendar.js/ 
SCRIPT


Can you call a javascript file that resides in a framework using  
WOJavaScript?

___
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


[OT] World of Ends

2006-08-30 Thread Chuck Hill

Somewhat interesting read.

http://worldofends.com/


--  

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


Working example of EOModel and OpenDirectory

2006-08-30 Thread Jaime Magiera

Hello,

I'm revisiting the idea of adding LDAP to my WO application. However,  
I'm unable to get things working based on the Developer example. Can  
anyone share a working example of getting EOModel to talk to  
OpenDirectory?


thanks,

Jaime
___
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: Restore and Save Session

2006-08-30 Thread apl

Hello Chuck;

I am a little confused here as at (2) there is no context in which to  
restore/save the session.  I assume in the case of the component  
request handler, the context is actually created at (2), but I am  
creating a system that uses 'WOAction' so I assume the context must  
be being created at (1) and thus I think the session restore and save  
must be done at that point as well?


cheers.

I'm wondering, when one is writing a request handler, where should  
the session restore and save be located?


1) WOAction.performActionNamed(...)
2) WORequestHandler.handleRequest(...)

Anybody know where Apple does this?


The second one.  See page 167.  ;-)


___
Andrew Lindesay
www.lindesay.co.nz



___
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


EOModeler not bringing any data

2006-08-30 Thread Xia, Wen
Title: EOModeler not bringing any data



Hi all,

Something really weird happens: I use EOModeler to browse data from a view in SQL 2000, and it shows no data. But if queried through DBVisualizer or Enterprise Manager, I can see data. 

Following is the adapter setting, and there is no complaint about it by the EOModeler:
URL - 
jdbc:microsoft:sqlserver://serverName:1433;DatabaseName=PDSDevel;selectMethod=cursor
Driver -
com.microsoft.jdbc.sqlserver.SQLServerDriver

Also, with the same adaptor setting, Im able to retrieve data from other views or tables in the same database. I wonder what might be the problem. Please advise. 

Thanks a lot!
Wen



 ___
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