Re: Recording and looking up dates, when day-wide precision is required

2008-12-30 Thread Florijan Stamenkovic


On Dec 30, 2008, at 06:03, Lachlan Deck wrote:


Hi there,

On 30/12/2008, at 7:47 PM, Andrew Lindesay wrote:

I _think_ (correct me if I'm wrong) Florijan would like to store a  
logical date rather than a timestamp.  For example, he would like  
to store the date 2008-09-28.  The requirement being that the same  
date is applicable to all timezones because it is composited from  
year/month/day and is thus independent of timezones.


An example where this might be useful is to store birthdays.


Right - I think it was Florijan's more elaborate description that  
confused me :-) I thought he was saying he wanted the date to be  
presented according to the user's local timezone whilst at the same  
time he was talking about this need. So I wasn't clear on his aims.


Plus, perhaps you were thinking of a web-app scenario, and that's not  
what I am doing. I am working on a JC app, where dates are  
transferred to and from the client machine in raw form. So, all the  
parsing and formatting happens on the client machine, which could be  
anywhere.


For example, a birthday is 1980-08-08. If I should decide to live  
in Munich for a while (I presently live in Auckland) then the same  
birthday applies, but if I stored it as a timestamp then it would  
have shifted to another day while I live in Munich.  Hence the  
difficulty storing these things as timestamps.


Depends when you want your present ;-)

So if you're storing dates in the database (as opposed to  
timestamps) you'll have to normalise them prior to storage. For  
display you'll need a custom formatter.


As I stated before, a point in time defined with the time of 11:30  
GMT, whichever date, formats into the same date (textually) in  
virtually all timezones. However, I still have some confusion about  
this. If I look at a map of the world, virtually all places on the  
planet are in the -11 +12 offset range:


http://www.yeswatch.com/timekeeper/images/manual/time-zone-map-large.jpg

However, Java provides different results. For example, the "New  
Zealand Standard Time" is at +13. Something I do not understand at  
all (since geographically it is partly in +11, partly in +12). So,  
apparently this method does not cover 100% of the globe. Bummer. I  
guess that a custom formatter would be necessary to cover also those  
time zones (-12, +13, +14). Or I can just ignore the New Zealanders :P


F

btw, sorry for the confusion, I should have indicated that this is a  
JC scenario, and perhaps you could have seen what I was trying to say.

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

This email sent to arch...@mail-archive.com


Re: Recording and looking up dates, when day-wide precision is required

2008-12-23 Thread Florijan Stamenkovic


On Dec 23, 2008, at 18:08, Lachlan Deck wrote:

One more thing... Reading the posts that David mentioned, I notice  
there is some mentioning of java.util.Date being converted to and  
from NSTimestamp. I am not sure why this is mentioned as a  
problem. AFAIK, both Date and NSTimestamp (which inherits from  
Date) record the amount of milliseconds that passed from January  
1, 1970, 00:00:00 GMT. Conversion should be lossless, no? Or, is  
this a problem for some other reason?


NSTimestamps understand timezones *only* during construction. From  
that point on they are strictly UTC. i.e., they do not preserve the  
timezone from which they were constructed. You'll need another  
column, as mentioned above, to store that information.



I am not interested in storing time zones. I am only interested in  
the following:


1. The user inputs a date as text, which gets parsed into a  
java.util.Date

2. I want to:
a) Parse and store the date
b) Retrieve the date
	c) Represent the date across all time zones so that it always  
appears as the same date (textually) that the user put in. Note that  
dates will be transmitted to other machines using JavaClient in raw  
form, and formatted there.


As for preserving exact extra information (time zone of input, and  
the time of input), this is in this case not required.


In that sense, what I wrote before matters. If I store a date (as in  
a millisecond offset) that can be described as let's say Dec 21st,  
2008. 00:00:00 GMT+0400, this point in time might be represented to  
end users as up to 2 or 3 different date Strings (the 20th, the 21st  
and the 22nd), depending on where they are.


As for what Andrew says, that it's tricky displaying a millisecond  
offset as the same date across all time zones, yes, it is. But, as  
far as I can see at the moment, a long that represents a point in  
time that can be described as whichever date with the time of 11:30  
GMT should format into the same date String (though obviously not the  
same time) across all the time zones the users might be in. Well, at  
least that's my hypothesis, is it wrong?


F

and yes, switching to storing dates textually might be the way to go.  
A simpler way for sure, and in this case I do not need the other  
info. Still, I'm interested if the above idea works. As far as I can  
tell, it should. An argument for using Dates, as opposed to text, is  
that we might summarize information based on date, and we allow the  
users to have custom formatters for dates (stored as a preference).  
Both is easier to handle if I store Dates, and not text.

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

This email sent to arch...@mail-archive.com


Re: Recording and looking up dates, when day-wide precision is required

2008-12-23 Thread Florijan Stamenkovic

Uhm, some more thoughts... *Please* help me make sense out of this...

Setting a formatter to GMT will for any given date String produce  
this:  00:00:00 GMT. However, format the resulting Date with a  
formatter that has GMT-0400, this results in:  21:00:00  
-0400. Which means, if a user is in GMT-0400, and types in "Dec 21,  
2008" and I format it using the formatter set to GMT, then the actual  
java.util.Date produced, when formatted with a format that is set to  
GMT-0400 will get "Dec 20, 2008". Well, perhaps my numbers a shi*,  
but I think the principle of what I'm saying is valid.


What we need is a date the user provides, set in GMT, at 11:30. That  
is because timezones go from GMT-1100 to GMT+1200, so the only times  
that produce textually the same date (viewed in whichever timezone)  
are those in between of 11:00 GMT and 12:00 GMT, endpoints excluded.


In short:

Dec 21, 2008 11:30 GMT should render as "Dec 21" in all time zones.  
However add or subtract an hour, and that's not true anymore, it will  
render as a different date, in one time zone.


It seems to me that there are two solutions.
1.	Parse using GMT, and then add 11 hours and 30 minutes to the  
produced java.util.Date.
2.	Parse in the user's time zone, and normalize using the method  
provided below.


Am I correct?

Well, some additional reading suggests that "the earliest and latest  
time zones are 26 hours apart", which is something that simply does  
not make sense to me (and I don't really want it to), so let me  
rephrase the question: am I sufficiently correct to maintain the  
reliability of the software I'm working on?


F


the code I made for this (included in org.jbnd.support.JBNDUtil)


// used in the normalize(...) method
private static final Calendar GMTCalendar =
Calendar.getInstance(TimeZone.getTimeZone("GMT"));

/**
	 * Takes a Date and a TimeZone, and returns a  
normalized
	 * version of it. The returned Date that has the time of  
11:30:00
	 * GMT. It's year, month and day are same as the given originaltt> has
	 * in the given timezone. If timezone is nulltt>,

 * the local timezone is assumed to apply.
 * 
 * The returned Date will, when formatted, have the same year,
	 * month, and day as the original date has in it's timezone,  
regardless of

 * the timezone it is represented in.
 *
 * @param original The date to normalize.
	 * @param timezone The timezone in which the original is  
in, if

 *null, the local timezone is assumed to apply.
 * @return See above.
 */
public static Date normalize(Date original, TimeZone timezone){

// first, get a calendar for the original timezone
Calendar c = Calendar.getInstance(
timezone == null ? TimeZone.getDefault() : 
timezone);
c.setTime(original);

// make a date using the GMT calendar
GMTCalendar.set(
c.get(Calendar.YEAR),
c.get(Calendar.MONTH),
c.get(Calendar.DATE),
11, 30, 0);

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

This email sent to arch...@mail-archive.com


Re: Recording and looking up dates, when day-wide precision is required

2008-12-23 Thread Florijan Stamenkovic
First of all, thanks everyone for the help, I feel I am getting  
somewhere, uhm, somewhere that makes sense, more or less :)


On Dec 22, 2008, at 16:22, Lachlan Deck wrote:

It'll parse the time into whatever timezone you set to the  
formatter. If you're using SimpleDateFormat, for example, set the  
timezone to be parsed (if other than the default). You could set it  
to GMT for example .. or allow the user to select it.


Hm... If I normalize a Date so that the input and normalized version  
produce the same date, textually, in different timezones, then  
representing the normalized Date in the user's timezone might shift  
the date (textually). Which would be a mistake, at least in this  
scenario of currency rates. I think that the normalization method  
needs to be aware of the user's timezone, to either add or subtract  
time in order to reach GMT noon. To ensure that the normalized date  
formats to the same date, textually, both in the user's timezone, and  
GMT. So, I don't think that just setting a timezone on the formatter  
works... See my point?


One more thing... Reading the posts that David mentioned, I notice  
there is some mentioning of java.util.Date being converted to and  
from NSTimestamp. I am not sure why this is mentioned as a problem.  
AFAIK, both Date and NSTimestamp (which inherits from Date) record  
the amount of milliseconds that passed from January 1, 1970, 00:00:00  
GMT. Conversion should be lossless, no? Or, is this a problem for  
some other reason?




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

This email sent to arch...@mail-archive.com


Recording and looking up dates, when day-wide precision is required

2008-12-22 Thread Florijan Stamenkovic

Hi all,


I am recording daily currency conversion rates.

The problem I have is that at the moment currency information can be  
input from wherever on the planet. Now, most users will deal with  
date info only, when it comes to currency info, leaving time and  
timezone issues in Java's hands. Java seems to automatically set a  
parsed date to the time of 00:00:00 in the current timezone. What I  
am thinking of is "normalizing" dates after input. Essentially  
extracting the date (textually) from the Date that Java parsed, and  
setting it to 12:00:00 GMT, in hope that will ease qualification /  
filtering later on.


So, does anyone do this? Does anyone have a better strategy? This is  
the first time I am doing stuff with dates requires tight control of  
what's happening...


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

This email sent to arch...@mail-archive.com


Re: casting in qualifier format strings

2008-12-18 Thread Florijan Stamenkovic


On Dec 18, 2008, at 12:22, Mike Schrag wrote:

How in the world did you discover this?!? You didn't actually try  
to do it???
I can pretty much guarantee this did not come from the current  
documentation.  :-P
Um .. yeah .. Unless you consider digging through decompiled javacc- 
generated parser code "documentation" ... I mean ... it SORT of  
is.  Not that I condone decompiling, btw  and I would never do  
it . LOOK! PURPLE MOOSE!


Yeah, must have been a freak accident, the decompiler just downloaded  
itself and started decompiling WO... While you were looking at the  
moose :)


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

This email sent to arch...@mail-archive.com


Re: casting in qualifier format strings

2008-12-18 Thread Florijan Stamenkovic

Cool...

How in the world did you discover this?!? You didn't actually try to  
do it???


F

On Dec 18, 2008, at 00:12, Mike Schrag wrote:

I very rarely use qualifier format strings, but i have a special  
case where I needed one, but i needed a timestamp literal in it ...  
turns out you can cast inside of a qualifier format string:


EOQualifier q = EOQualifier.qualifierWithQualifierFormat("date =  
(NSTimestamp)'2008-10-01 05:37:01 EST'", null);


You can actually cast to ANY object here, and if it's not a known  
type, it looks like it will call a string constructor, passing it  
the value.  Fancy.


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


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


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

This email sent to arch...@mail-archive.com


Re: Two questions about latest build system

2008-11-24 Thread Florijan Stamenkovic

On Nov 23, 2008, at 06:46, Paul Hoadley wrote:

 I have an application project that depends on a framework project  
(actually, more than one).  I'm back to using the incremental build  
system for development, in which case it seems like (after running  
Project > Clean... on everything) it's sufficient to run Project >  
Build Project on the application.  Everything else builds, and the  
application runs.  Using Ant to create a WOA (or WAR) for  
deployment, though, I seem to need to run the 'install' target on  
all the dependencies (and on any of their dependencies, in the  
correct order).


I was fussing with this a while ago. The subant task was (IMO) the  
way to deal with this. I mean, you still run the 'install' target on  
all your frameworks, but it is automated from your main project's  
build.xml using something like this:











The ant.frameworks.projects includesfile contained:

WOPrototypes
DvisWOModel
WOJCKit
WOVaGen
...

Which are the names (base directories) of framework projects that my  
main project is using. Naturally, each of them contains a WOLips ant  
build file, containing the 'install' target.


The ${projects.root} variable is the Eclipse workspace in which all  
these projects are contained.




Uhm, I think it works, I can't recall exactly. But lately everything  
is always up-to-date and embedded in my main project's final build,  
so I guess it does :D


Also, I thought Mike's new hotness deals with all this (though I  
haven't switched to it, as I find myself happy enough with my current  
building setup). Well, I guess I'll have to check it out sometime  
soon...


HTH
F

p.s. - Mike, this should be easy to integrate into the existing  
WOLips ant stuff, no?

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

This email sent to [EMAIL PROTECTED]


Translator (English -> Spanish) sought...

2008-11-19 Thread Florijan Stamenkovic

Hi all,


We are localizing our software to various languages, and are in need  
of a translator that can provide translations to Spanish. We need a  
person proficient in specialized terminology (software, database,  
accounting, project management etc..). If anyone has experience with  
contracting individuals or companies for this, please let me know who  
they are. If anyone is interested in the work itself, feel free to  
contact me off-list for more details.


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

This email sent to [EMAIL PROTECTED]


Re: Cannot run any app in development

2008-11-17 Thread Florijan Stamenkovic

Hm, might this be the case:

http://dev.eclipse.org/newslists/news.eclipse.tools/msg63260.html

F

On Nov 17, 2008, at 11:48, David Holt wrote:

Continuing to try to get this to work this morning I have installed  
a new Eclipse/WOLips from scratch (same error)


I created a new user account thinking it might be permissions (same  
error)


I have had confirmation that a brand new install on a new MacBook  
with the same config I have works fine (and up until yesterday this  
was true on mine too).


If it is a permissions thing, where would I look? Could it be  
something in the Java install itself?


Short of a reinstall, I am not sure where to go next.

Does anyone have any ideas what could cause Eclipse to terminate  
the run/debug attempt like this?


David

On 16-Nov-08, at 8:53 PM, David Holt wrote:


Here's the error log in Eclipse:

java.net.SocketException: Socket closed
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.eclipse.jdi.internal.connect.SocketTransportService.accept 
(SocketTransportService.java:95)
at org.eclipse.jdi.internal.connect.SocketTransportImpl.accept 
(SocketTransportImpl.java:56)
at  
org.eclipse.jdi.internal.connect.SocketListeningConnectorImpl.accept( 
SocketListeningConnectorImpl.java:135)
at org.eclipse.jdt.internal.launching.StandardVMDebugger 
$ConnectRunnable.run(StandardVMDebugger.java:107)

at java.lang.Thread.run(Thread.java:613)


Session data:

eclipse.buildId=M20080911-1700
java.version=1.5.0_16
java.vendor=Apple Inc.
BootLoader constants: OS=macosx, ARCH=x86, WS=carbon, NL=en_US
Framework arguments:  -keyring /Users/dholt/.eclipse_keyring - 
showlocation
Command-line arguments:  -os macosx -ws carbon -arch x86 -keyring / 
Users/dholt/.eclipse_keyring -consoleLog -showlocation


On 16-Nov-08, at 8:43 PM, David Holt wrote:


Hello all,

I am running into the same problem that Riccardo ran into  
recently. 


Config:

Brand new MacBookPro: System Version: Mac OS X 10.5.5 (9F2114) /  
Eclipse 3.4.1/ nightly 3.4.5547 / WO 5.4.3 / Most recent Wonder  
from SVN


java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16- 
b06-284)

Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)


Trying to run or debug any application results in the following.  



There is nothing in the console. Above the console reads  



This was all working a couple of days ago, but today's updates  
have hosed something. Any idea what it could be?


David

___
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/ 
programmingosx%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/flor385% 
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 [EMAIL PROTECTED]


"Powered by WO" on an apple site

2008-11-14 Thread Florijan Stamenkovic

https://appleseed.apple.com/cgi-bin/WebObjects/SeedPortal

Maybe it's just me, but I've never seen a "Powered by WO" banner/tag/ 
whatever on any other Apple site. Interesting...


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

This email sent to [EMAIL PROTECTED]


Re: Lots of EOs slow down the performance

2008-11-05 Thread Florijan Stamenkovic
As you say that the EO generation happens fast, maybe you should  
switch to using something else as a WOComponent to generate your CSV.  
I use ostermiller utils:


http://ostermiller.org/utils/

A more "raw" approach to generating the CSV should work faster.  
Especially in combination with raw rows, you should get decent results.


F

On Nov 05, 2008, at 05:56, Yung-Luen Lan wrote:


I checked the code, EO generating is fast. The problem is CSV
component. It's just a WORepetition with some WOString that reads the
EO's property directly.


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

This email sent to [EMAIL PROTECTED]


Re: NSSelector and Void Returned Value

2008-10-31 Thread Florijan Stamenkovic

Hey Andrew,

Have you tried java.lang.Void?

IIRC this (or something similar, or same, regarding void and  
generics) was discussed on the list a while ago. I can't remember the  
thread though, just recall that Void was mentioned. Anyone else?


HTH
F

On Oct 30, 2008, at 15:38, Andrew Lindesay wrote:


Hello;

With the constructors...

NSSelector(..)

...what is the value one might use for the generic parameter when  
the method passes no return value -- ie: void?


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/flor385% 
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 [EMAIL PROTECTED]


Re: Flattened Relationships and storedValueForkey()

2008-10-30 Thread Florijan Stamenkovic


On Oct 30, 2008, at 05:24, David Avendasora wrote:


On Oct 25, 2008, at 10:42 AM, Florijan Stamenkovic wrote:

Without knowing exactly what the problem is, I'd just suggest that  
you skip flattening in the model, and do it in Java. You'll avoid  
this problem, and you'll also have more control over value caching  
(which could be what is producing the erroneous result). While  
getting the same result.


All the reasons for putting them in the model revolve around  
convienience, not actual added functionality. Having them in the  
model gets me some added love from D2JC being able to determine the  
Class and therefor automatically pick the right UI screen for the  
result set.


Ah yes, I keep forgetting that you're using D2JC.



Also, if you're doing this on the client, I definitively recommend  
using JBND to do it, you'll get (for 5 lines of code or something):

- lazy init of the flattened value
- value caching
- automagic change detection and refreshing (when a relevant  
change on the keypath changes the cache is release and the value  
re-evaluated next time you ask for it)


You know, I've always thought that implementing JBND would mean I'd  
have to not be doing D2JC anymore. I wonder if it will work with  
D2JC as I'm already subclassing EOGenericRecord to add some things...


They should not clash, but a D2JC generated interface will not use  
the strongest points of JBND: data binding, change notification,  
filtering, the (new and unpublished) undo / redo stuff... You'd get  
some minor stuff though...


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

This email sent to [EMAIL PROTECTED]


Re: Class.this.. ?

2008-10-28 Thread Florijan Stamenkovic


On Oct 28, 2008, at 19:33, Q wrote:


NestingClass.ref


That would refer to a static variable called 'ref' on the class  
NestingClass.


LOL! Obviously! I can't believe I overlooked that 'minor' issue :)

This is a no-go. Now, as far as I understand the concept of class  
nesting as it is implemented in Java, this should work.


For inner classes there are two possible meanings for 'this', which  
is why the ClassName.this syntax exists, so that you can access  
both of them. Outside the context of an instance method on the  
inner class you cannot access the instance of the nesting class  
directly.


After all, it is simple to make a method in the inner class that  
will expose the instance of the nesting class by returning  
NestingClass.this.


This is what you will need to do.


Well, the duality of 'this' aside, being able to access easily the  
nesting class instance is quite handy, within the inner class or  
without. However, I guess the fact that obtaining it outside the  
inner class code is not required often does not warrant coming up  
with some way to formulate it syntactically, especially since there  
is such an easy way to expose it. Still, I've found it an interesting  
thought.


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

This email sent to [EMAIL PROTECTED]


Re: Class.this.. ?

2008-10-28 Thread Florijan Stamenkovic

Hi all,

Going a bit off WO topic here, but maybe it will be interesting to  
someone...


I've for the first time today found myself wishing to obtain a  
reference to the instance of a nesting class, while having a  
reference to an instance of it's inner class, but outside of the  
scope of the inner class itself... So, if I was in the scope of the  
inner class, I would simply do this:


NestingClass.this

and voila. However, since I am in a method in which I have an  
arbitrary instance of the inner class, let's call it "ref", I tried  
doing this:


NestingClass.ref

This is a no-go. Now, as far as I understand the concept of class  
nesting as it is implemented in Java, this should work. After all, it  
is simple to make a method in the inner class that will expose the  
instance of the nesting class by returning NestingClass.this. So, I  
don't think this is a deliberate attempt to enforce some  
encapsulation concept, but an overlook, or something that was seen as  
an unnecessary syntactical complication. From my experience, either  
of those is in a way understandable, in some 4 years of working with  
Java I have only today for the first time wished to do this. Peculiar.


I will google this a bit, and depending on what I find might submit a  
bug report to Sun. Any thoughts on this are welcome


F

On Sep 20, 2008, at 17:46, Florijan Stamenkovic wrote:



On Sep 20, 2008, at 16:36, Ash Mishra wrote:

I understand what it's doing (i.e. accessing the woDisplayGroup  
and setting a value in it) but I've not seen the MyListPage.this.  
reference before, where the class name is followed by 'this' and  
than a variable of the class.


Is this some special Java reference?


If I understand you well, you are asking about the syntactical  
implication of this construction:


"ClassName.this"

This type of referencing is used in inner classes to obtain the  
instance of the nesting class. In the example you used, it will  
ensure that you get a reference to the MyListPage instance, and not  
to the instance of the anonymous class that extends  
NextPageDelegate (declared in line 9).


While in the piece of code you refer to it is not necessary to do  
this, since referencing "myDisplayGroup" can be done directly, it  
would be necessary if the anonymous NextPageDelegate subclass also  
had a "myDisplayGroup" variable. In that sense I wouldn't say it's  
wrong, but just over-cautious.


F

try googling "Java inner class tutorial"
___
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/flor385% 
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 [EMAIL PROTECTED]


Re: WO Equivalent of prepared statement

2008-10-27 Thread Florijan Stamenkovic


On Oct 27, 2008, at 17:04, Randy Wigginton wrote:

I am processing millions of rows of data, and the output is very  
large tables.  I would like to use an equivalent of  
preparedstatements for my writing&updating; there is less need for  
transactional integrity and more need of raw speed.  Is there  
anything in WebObjects or Wonder to help with this?


I understand I could use raw sql, but that would involve massive  
amounts of parsing on the part of the database; a prepared  
statement handle would allow me to simply pass values and minimize  
the work needed by the database.


AFAIK, you can make a pre-compiled SQL statement on the db level,  
make a "Stored procedure" that represents it in your EOModel, and  
then tell EOF (also through the model) to use those procedures to  
perform your inserts, deletes and fetches. I believe that would give  
you exactly what you mention above, except for the updates. I've only  
read about this, so I am not sure how well it works, if there are  
problems with it.


If you are looking to perform other arbitrary operations on the data  
in the same efficient way, that's quite easy. Prepare a statement in  
your db, make a representation of it in the model (a Stored  
Procedure), and call it from your WO Java code whenever it is  
appropriate. I use this approach happily. I believe you should be  
able to use it to perform updates.


All a part of standard WO, have no idea if wonder gets into this at all.

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

This email sent to [EMAIL PROTECTED]


Re: generics and KVC.NullValue

2008-10-27 Thread Florijan Stamenkovic
Well, as far as collections are concerned, foundation could (should?)  
switch to the java.util style of allowing / using Java null values in  
NSArrays and NSDicts.


As for other parts of EOF/WO which rely on NullValue, this might work  
or it might not. Personally I remember having to explicitly use  
NullValue only once (since EOF in many places auto-converts to null),  
and even in that place I think it was possible to remake the  
frameworks to accept null as a standard. Can't remember exactly where  
that was...


Maybe there are other legitimate reasons for using the Java version  
of NullValue (except for the Obj-C legacy), but I don't know what  
they are...


F

On Oct 26, 2008, at 23:17, Lachlan Deck wrote:


Not sure there's much that can be done about this


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

This email sent to [EMAIL PROTECTED]


Re: Flattened Relationships and storedValueForkey()

2008-10-25 Thread Florijan Stamenkovic
Without knowing exactly what the problem is, I'd just suggest that  
you skip flattening in the model, and do it in Java. You'll avoid  
this problem, and you'll also have more control over value caching  
(which could be what is producing the erroneous result). While  
getting the same result.


Also, if you're doing this on the client, I definitively recommend  
using JBND to do it, you'll get (for 5 lines of code or something):

- lazy init of the flattened value
- value caching
- automagic change detection and refreshing (when a relevant change  
on the keypath changes the cache is release and the value re- 
evaluated next time you ask for it)


F

On Oct 24, 2008, at 11:01, David Avendasora wrote:


Hi all,

I am trying to flatten some relationships for connivence sake. For  
example:


Here's the structure:

RoutingComponent <<-> RoutingStep <<-> Routing <<-ManufacturingLine

I'm flattening the routingStep().routing().manufacturingLine()  
relationship on RoutingComponent into simply manufacturingLine().


Sure, I could easily write my own convenience method to do this,  
but I figured this is exactly one of the things that flattening is  
for.


The problem is:

foo.storedValueForKey("manufacturingLine") returns null,

But,

foo.valueForKeyPath("routingStep.routing.manufacturingLine")  
returns the expected ManufacturingLine.


I've made substantial changes to my Veogen templates, but I don't  
see the standard ones handling this either for flattened  
relationships.


Am I just horribly abusing flattening?

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/flor385% 
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 [EMAIL PROTECTED]


Re: eclipse debugging help

2008-10-22 Thread Florijan Stamenkovic


On Oct 22, 2008, at 14:54, james o'loughlin wrote:

it appears the app deadlocks.  my browser hangs and eclipse's debug  
window opens with the stack i've attached.  it does not appear that  
something is being computed and needs to run its course.


As far as I know Eclipse's debug will auto-open only on breakpoints  
(exception breakpoints too). Since you could not have put your own  
breakpoint in the code of NSTimestampFormatter, I assume you have a  
breakpoint exception setup (you can see that in the "Breakpoints"  
view in the debugger). If that is so, once the exception breakpoint  
is hit, you will need to click on the "Resume" button in the "Debug"  
view. That should let the exception be thrown, which should get it  
printed out in the console. That should tell you what sort of an  
exception it is.


If this is really what is happening, then it does not seem to be a  
deadlock, but Eclipse having suspended your worker thread.


yes, there is an exception being thrown but i can't find the source  
of this exception.  the only feedback i get is the stack window  
telling me the last piece of my app it talked to was the PageViewer  
component.  from there i'm at a loss.


all of the other threads are (Running).

it's reproducible every time.

the crux is i'm not sure what object is being formatted.


If indeed you are hitting a breakpoint exception, then in the  
"Variables" view in the debugger (before hitting "Resume") you should  
have all the current variables visible in the selected stack frame.  
In short, you should see the object being formatted. Click it, and  
see what it is.


in the passed, i've found the problem by removing removing HTML  
from my component until i find the section of code throwing the  
exception.  this is tedious and worse than programming cobol on a  
vax with a printer...  i eventually find the exception but i can't  
continue this debugging process with any sanity.  i'd love for  
eclipse to point me to the problem.


Yep, Eclipse goes a long way. I suggest googling for eclipse  
tutorials. I am sure there are free online tutorials out there. And I  
think I heard that Eclipse's site itself has a decent knowledgeable,  
but I've never used it so I can't vouch. Rest assured that an hour or  
two it will require of you will pay off very, very quickly.


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

This email sent to [EMAIL PROTECTED]


Re: eclipse debugging help

2008-10-22 Thread Florijan Stamenkovic

James,

A bit more info might be necessary to resolve this...

Your app hangs? As in it deadlocks? Or as in takes a seemingly  
unnecessary amount of time to compute something? How did you obtain  
the stack below, was an exception thrown, or did you manually suspend  
the worker thread and copy it? What are other threads in your app  
doing? How reproducible is this? What kind of an object is being  
formatted?


If it is a deadlock, and your worker thread stops for seemingly no  
reason at NSTimestampFormater.format(...), it could be that either  
the method or a block in it is synchronized and waiting for something  
to release the lock.


F

On Oct 21, 2008, at 14:25, james o'loughlin wrote:



i'm pulling my hair out sometime trying to find my errors.  my app  
hangs and this stack doesn't do me much good.  i see PageViewer is  
the last component my app talked to and then i can't find nuttin'...


can someone please push or shove me in the right direction to use  
eclipse to debug my apps?  most of the time eclipse will tell me  
the .java file and line # of the error.


thanks,
./james

stack:
NSTimestampFormatter.format(Object, StringBuffer, FieldPosition)  
line: 642	

NSTimestampFormatter(Format).format(Object) line: 133   
WOString.appendToResponse(WOResponse, WOContext) line: 65   
WOGenericContainer(WODynamicGroup).appendChildrenToResponse 
(WOResponse, WOContext) line: 126	

WOGenericContainer.appendToResponse(WOResponse, WOContext) line: 44 
WOGenericContainer(WODynamicGroup).appendChildrenToResponse 
(WOResponse, WOContext) line: 126	

WOGenericContainer.appendToResponse(WOResponse, WOContext) line: 44 
WOConditional(WODynamicGroup).appendChildrenToResponse(WOResponse,  
WOContext) line: 126	

WOConditional.appendToResponse(WOResponse, WOContext) line: 94  
WOConditional(WODynamicGroup).appendChildrenToResponse(WOResponse,  
WOContext) line: 126	

WOConditional.appendToResponse(WOResponse, WOContext) line: 94  
WODynamicGroup.appendChildrenToResponse(WOResponse, WOContext)  
line: 126	

WODynamicGroup.appendToResponse(WOResponse, WOContext) line: 136
PageViewer(WOComponent).appendToResponse(WOResponse, WOContext)  
line: 1122	

Session(WOSession).appendToResponse(WOResponse, WOContext) line: 1385   
WOApplication.appendToResponse(WOResponse, WOContext) line: 1794
WOComponentRequestHandler._dispatchWithPreparedPage(WOComponent,  
WOSession, WOContext, NSDictionary) line: 242	
WOComponentRequestHandler._dispatchWithPreparedSession(WOSession,  
WOContext, NSDictionary) line: 298	
WOComponentRequestHandler._dispatchWithPreparedApplication 
(WOApplication, WOContext, NSDictionary) line: 332	

WOComponentRequestHandler._handleRequest(WORequest) line: 369   
WOComponentRequestHandler.handleRequest(WORequest) line: 442
WOApplication.dispatchRequest(WORequest) line: 1687 
WOWorkerThread.runOnce() line: 144  
WOWorkerThread.run() line: 226  
Thread.run() line: 613  



-

owns: java.lang.Object  (id=81) 
com.webobjects.foundation.NSTimestampFormatter.format 
(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)  
line: 642	
com.webobjects.foundation.NSTimestampFormatter 
(java.text.Format).format(java.lang.Object) line: 133	
com.webobjects.appserver._private.WOString.appendToResponse 
(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 65	
com.webobjects.appserver._private.WOGenericContainer 
(com.webobjects.appserver._private.WODynamicGroup).appendChildrenToRes 
ponse(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 126	
com.webobjects.appserver._private.WOGenericContainer.appendToResponse( 
com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 44	
com.webobjects.appserver._private.WOGenericContainer 
(com.webobjects.appserver._private.WODynamicGroup).appendChildrenToRes 
ponse(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 126	
com.webobjects.appserver._private.WOGenericContainer.appendToResponse( 
com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 44	
com.webobjects.appserver._private.WOConditional 
(com.webobjects.appserver._private.WODynamicGroup).appendChildrenToRes 
ponse(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 126	
com.webobjects.appserver._private.WOConditional.appendToResponse 
(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 94	
com.webobjects.appserver._private.WOConditional 
(com.webobjects.appserver._private.WODynamicGroup).appendChildrenToRes 
ponse(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 126	
com.webobjects.appserver._private.WOConditional.appendToResponse 
(com.webobjects.appserver.WOResponse,  
com.webobjects.appserver.WOContext) line: 94	
com.webobjects.appserver._private.WODynamicGroup.appendChildrenToRespo 
nse(com.webobjects.appserver.WOResponse,  
com.webob

Re: Having trouble with XcodeMigration

2008-10-17 Thread Florijan Stamenkovic

On Oct 17, 2008, at 11:55, Denise Howard wrote:


Yes I am 100% sure.  I don't have multiple hard drive partitions.



Hm, bizarre...

Pascal suggested a permissions problem, but I don't think that's it.  
If the Java process tries to access resources that it does not have  
privileges for a java.lang.SecurityException should be thrown.


Maybe you could try making a simple Java test app that launches a  
file chooser. Then find the same folder, select it, and log out the  
selected file. See what the path is, and how it compares to "/Users/ 
dhoward/EclipseWorkspace/WOApplicationTemplate/Components". Also, try  
invoking exists() on that File reference, see what happens.


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

This email sent to [EMAIL PROTECTED]


Re: Having trouble with XcodeMigration

2008-10-17 Thread Florijan Stamenkovic

On Oct 16, 2008, at 23:13, [EMAIL PROTECTED] wrote:

I'm finally taking the plunge to leave Xcode behind and migrate our  
frameworks and applications to Eclipse.  I've installed WOLips, and  
I've carefully followed the instructions for Pascal Robert's  
XcodeMigration tool (great visual tutorial instructions, btw).   
However, when I get to the point of running the tool, the following  
results:


Starting the importation process...
java.lang.IllegalArgumentException: /Users/dhoward/EclipseWorkspace/ 
WOApplicationTemplate/Components does not exist

at org.apache.commons.io.FileUtils.cleanDirectory(FileUtils.java:886)
	at ca.os.migrations.XCodeToEclipse.cleanupTemplates 
(XCodeToEclipse.java:174)

at ca.os.migrations.XCodeToEclipse.main(XCodeToEclipse.java:76)

However, this "Components" directory does exist in that location  
and even has two items in it, Main.api and Main.wo.  What am I  
doing wrong and how do I make it work?


Are you 100% sure of this? Do you have multiple hard drive  
partitions? Could it be possible that the code above assumes the  
wrong partition? How does the XcodeMigration process obtain that file  
reference? I checked out the source of Apache's FileUtils, and it is  
very straightforward, I don't see how it could screw up:



/**
 * Cleans a directory without deleting it.
 *
 * @param directory directory to clean
 * @throws IOException in case cleaning is unsuccessful
 */
public static void cleanDirectory(File directory) throws  
IOException {

if (!directory.exists()) {
String message = directory + " does not exist";
throw new IllegalArgumentException(message);
}

  ...


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

This email sent to [EMAIL PROTECTED]


[SOLVED] Re: Locking problem

2008-10-16 Thread Florijan Stamenkovic

This evil hack seems to do it, as far as I've tested it...

Thanks everyone for the input,
F

On Oct 16, 2008, at 11:44, Florijan Stamenkovic wrote:

I'll try making all my overridden EC's methods synchronize on the  
EODistributedObjectStore.


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

This email sent to [EMAIL PROTECTED]


Re: Locking problem

2008-10-16 Thread Florijan Stamenkovic

Peter,

Thanks for the idea!

It is not the problem, but it made me realize that there must be two  
locks in the game. Since one of the threads was waiting on the EC's  
lock (or my custom Lock, comes out the same), and the other thread  
was in a synchronized method in EODistributedObjectStore (the default  
parent object store in a JC situation), then the only conclusion was  
that the first thread was already within a synchronized block for the  
same EODistributedObjectStore instance. And indeed, it is:


Thread [AWT-EventQueue-0] (Suspended)   
Object.wait(long) line: not available [native method]   
NSRecursiveLock(Object).wait() line: 474
NSRecursiveLock.lock() line: 72 
JCEC(EOEditingContext).lock() line: 4685
JCEC.globalIDForObject(EOEnterpriseObject) line: 391
	EODistributedObjectStore._fireDeferredFault(EOEnterpriseObject,  
EORelationship) line: 1156 (this is synchronized)
	EODistributionDeferredFaultHandler.createFaultForDeferredFault 
(Object, EOEnterpriseObject) line: 20

Project(EOCustomObject).willReadRelationship(Object) line: 1302
...

I think this should get me going. I'll try making all my overridden  
EC's methods synchronize on the EODistributedObjectStore. It will be  
a PITA, but it should prevent this deadlock.


Thanks!
F

- also, to me this seems like not-too-well organized locking  
behavior. If there are two object stores (parent - child), both of  
which require synchronized access using their own locks, and their  
interaction is bidirectional, well, that's a recipe for deadlocks.  
And also the combination of using NSLocks and synchronized methods  
isn't all that grand of an idea. Not a highlight of EOF this point.


On Oct 15, 2008, at 19:10, Peter Vandoros wrote:

Try commenting out the use of the java.util.concurrent.locks.Lock  
code in you EC subclass and see if that helps. I suspect that  
somewhere under the hood your EC is being locked by directly using  
the private NSLock instance instead of calling the lock() and unlock 
() method.


Regards

Peter

On 16/10/2008, at 2:20 AM, Florijan Stamenkovic wrote:


OK, some more info, perhaps it will strike a chord with someone?

My latest attempt for solving the threading issue was to  
essentially make every method in my editing context synchronized  
(though not the old fashioned way, but using a  
java.util.concurrent.locks.Lock in ec's lock() and unlock()  
methods) to see if that helps. I've ditched autoLock and  
autoUnlock, and I simply lock() and unlock() in every overridden  
method in the ec. Well, I've stopped getting NSRecursiveLock  
exceptions, but I still get deadlocks. What is weird is that while  
AWT's event dispatch thread is waiting for the EC lock to be  
released, the other thread working with the EC is blocking on this  
line:


EODistributedObjectStore.objectsWithFetchSpecification 
(EOFetchSpecification, EOEditingContext) line: 499


Obviously, this method is called through the blocking EC, so it  
has come past the EC lock. So, I'm really wondering what's  
happening at that line. I've noticed through Eclipse's debugger  
that the method is synchronized. I am oblivious as to why that  
thread would block in such a line. If it was on Object.wait() or  
something there I could understand, but this is bizarre.


Anyone has an idea?

F

On Oct 13, 2008, at 20:14, Mike Schrag wrote:


I don't understand what you say about autoLocking being RR based.
Yep, sorry -- you're right ... Lock coalescing is the one that  
depends on the RR loop.  That said, I definitely ran into cases  
where auto-locking alone was not enough (at least on the web ...  
maybe it's less of an issue with JC).  What would happen is that  
you'd have a series of, say, 5 operations that were logically a  
single transaction, but would be 5 individual lock-unlock  
autolocks, and there would be changes to the snapshot state  
inbetween calls that would cause some weird race conditions.   
This is actually why I decided to do the lock coalescing stuff in  
Wonder, which seemed to clear up the issues.  But not having done  
JC, maybe this is less of an issue.  It only appeared under  
higher-than-"normal" load.


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/flor385% 
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/peter% 
40etechgroup.com.au


This email s

Re: Locking problem

2008-10-15 Thread Florijan Stamenkovic

OK, some more info, perhaps it will strike a chord with someone?

My latest attempt for solving the threading issue was to essentially  
make every method in my editing context synchronized (though not the  
old fashioned way, but using a java.util.concurrent.locks.Lock in  
ec's lock() and unlock() methods) to see if that helps. I've ditched  
autoLock and autoUnlock, and I simply lock() and unlock() in every  
overridden method in the ec. Well, I've stopped getting  
NSRecursiveLock exceptions, but I still get deadlocks. What is weird  
is that while AWT's event dispatch thread is waiting for the EC lock  
to be released, the other thread working with the EC is blocking on  
this line:


EODistributedObjectStore.objectsWithFetchSpecification 
(EOFetchSpecification, EOEditingContext) line: 499


Obviously, this method is called through the blocking EC, so it has  
come past the EC lock. So, I'm really wondering what's happening at  
that line. I've noticed through Eclipse's debugger that the method is  
synchronized. I am oblivious as to why that thread would block in  
such a line. If it was on Object.wait() or something there I could  
understand, but this is bizarre.


Anyone has an idea?

F

On Oct 13, 2008, at 20:14, Mike Schrag wrote:


I don't understand what you say about autoLocking being RR based.
Yep, sorry -- you're right ... Lock coalescing is the one that  
depends on the RR loop.  That said, I definitely ran into cases  
where auto-locking alone was not enough (at least on the web ...  
maybe it's less of an issue with JC).  What would happen is that  
you'd have a series of, say, 5 operations that were logically a  
single transaction, but would be 5 individual lock-unlock  
autolocks, and there would be changes to the snapshot state  
inbetween calls that would cause some weird race conditions.  This  
is actually why I decided to do the lock coalescing stuff in  
Wonder, which seemed to clear up the issues.  But not having done  
JC, maybe this is less of an issue.  It only appeared under higher- 
than-"normal" load.


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/flor385% 
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 [EMAIL PROTECTED]


Re: NSCoding

2008-10-15 Thread Florijan Stamenkovic
Huh, I've never had data loss experiences, but then again I never  
really did use it for long term storage / across Java versions etc.  
Will need to keep this in mind though. I always assumed that as long  
as the internal data structure of a class does not change, the  
serialized data will remain readable, regardless of the functional  
changes in the class. Anyway, interesting, thanks.


As for NSCoder and company, never manually used it.

F

On Oct 15, 2008, at 10:22, Oliver Scheel wrote:

It depends too much on the class signature. For temporary storage  
it's ok, but when the class definition changes (or serialVersionUID  
must be modified), the data is lost. That's my experience.

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

This email sent to [EMAIL PROTECTED]


Re: NSCoding

2008-10-15 Thread Florijan Stamenkovic

Why not use Java's serialization? Should be simpler.

F

On Oct 15, 2008, at 06:12, Oliver Scheel wrote:



I want to use NSCoding to archive data structures, but didn't find  
any examples on the net. Anyone using it?


(and I don't want to write a complete coder) ;-)

 ___
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/flor385% 
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 [EMAIL PROTECTED]


Re: Locking problem

2008-10-13 Thread Florijan Stamenkovic
So, assuming I didn't do any major screw-ups when doing this, it  
should work. However, what I'm currently doing with JC might produce  
an even "heavier" load then a web scenario. Not in terms of volumes  
for sure, but in terms of how rapidly calls from different threads  
are made to a single ec. So yeah, this might make sense. Especially  
what you say about "weird race conditions". A combination between  
Eclipse's debugging and having log4j's detailed logging turned on for  
the EC made it stop crashing, almost always. But that does not solve  
the issue...


So, bottom line, anyone knowing EOF really in-depth, is it possible  
to somehow make a generically locking EC that multiple going-wild  
Threads can't screw up? Even if it adversely affects performance  
somewhat. Or do I have to load it all to a single thread? That is  
what JC normally does, as far as I know, it is all done on AWT's  
event dispatch thread.


Also, when I first switched to the autoLocking EC I still had manual  
locking being performed for every operation I did manually on the EC.  
I got crashes regardless..


Thanks,
F

On Oct 13, 2008, at 20:14, Mike Schrag wrote:

Yep, sorry -- you're right ... Lock coalescing is the one that  
depends on the RR loop.  That said, I definitely ran into cases  
where auto-locking alone was not enough (at least on the web ...  
maybe it's less of an issue with JC).  What would happen is that  
you'd have a series of, say, 5 operations that were logically a  
single transaction, but would be 5 individual lock-unlock  
autolocks, and there would be changes to the snapshot state  
inbetween calls that would cause some weird race conditions.  This  
is actually why I decided to do the lock coalescing stuff in  
Wonder, which seemed to clear up the issues.  But not having done  
JC, maybe this is less of an issue.  It only appeared under higher- 
than-"normal" load.


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

This email sent to [EMAIL PROTECTED]


Re: Locking problem

2008-10-13 Thread Florijan Stamenkovic
Hm, yeah, to some degree. However, for any user action tens of events  
can be fired, of different types. During application startup this  
number can grow to hundreds. I am not sure what you're getting at,  
but trying to handle events globally would not work, in my opinion. I  
guess this is a part of the problem, I am trying to adapt something  
to work entirely different circumstances. Had no idea the ERXEC takes  
the RR loop into account for locking.


Thanks,
F

On Oct 13, 2008, at 19:15, Lachlan Deck wrote:

I think the equivalent for JC are events. i.e., the RR loop begins  
and ends with each event. So it's much more fine-grained than web- 
based apps.


with regards,
--

Lachlan Deck


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

This email sent to [EMAIL PROTECTED]


Re: Locking problem

2008-10-13 Thread Florijan Stamenkovic

Hey Mike,

Thanks for replying. There is no practical equivalent of the RR loop  
on the client. While there is an RR loop during which the client asks  
the server for data, the client side EOF can be doing a lot of things  
outside of it. Because of that I kicked out lock coalescing. The  
relevant method in which that boolean is used now look like this:


protected void autoUnlock(boolean wasAutoLocked) {
if (wasAutoLocked) {
if (autoLocked) {
unlock();
autoLocked = false;
}
}
}

I don't understand what you say about autoLocking being RR based. I  
thought that it was purely overriding based (since most methods call  
autoLock()). How is the RR loop influencing this process? In the  
stripped version of ERXEC I just made the assumption that useAutoLock  
is true, and left the rest as it was.


Also, I've found a reference to an "unlocker", but could not find a  
class having that in the name, nor any code reference to such a thing  
in ERXEC. Is it a class that does some locking magic ERXEC aside?  
Apparently the autolocking process is more complex then I thought. I  
expected something like:


public Object overriddenMethod(){
Object result;
try{
lock();
result = super.overridenMethod();
}finally{
unlock();
}
return result;
}

Is this to naive to work?

Thanks,
F


On Oct 13, 2008, at 16:47, Mike Schrag wrote:

I tried adapting ERXEC to a JC scenario. I stripped away the  
factory stuff, the delegate and properties (I made it always  
autoLock), as well as lock coalescing. However, it does not help.  
I get deadlocks and exceptions. There are two threads involved,  
one instance of my WorkerThread class and AWT's event dispatch  
thread (responsible for GUI painting).
Not sure how autolocking would work in Swing-land ... autolocking  
and lockcoalescing only work because of the concept of a request- 
response loop, which I'm assuming you don't have any concept of in  
JC.  For web-based, it knows it can automatically unlock all your  
EC's at the end of the loop to prevent deadlocks, but I don't know  
what that equivalent trigger point would be in JC?


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/flor385% 
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 [EMAIL PROTECTED]


Locking problem

2008-10-13 Thread Florijan Stamenkovic

Hi all,

Cross posting this to wonder and WO, as it seems appropriate on both  
lists.


I tried adapting ERXEC to a JC scenario. I stripped away the factory  
stuff, the delegate and properties (I made it always autoLock), as  
well as lock coalescing. However, it does not help. I get deadlocks  
and exceptions. There are two threads involved, one instance of my  
WorkerThread class and AWT's event dispatch thread (responsible for  
GUI painting).


Deadlocks happen this way:
- the worker thread is for some reason halted in  
EODistributeObjectStore's fetch  
(EODistributedObjectStore.objectsWithFetchSpecification 
(EOFetchSpecification, EOEditingContext) line: 499
- the event dispatch thread is getting an object for global ID, and  
is waiting for a lock release in the editing context


Exceptions happen this way:

on my WorkerThread:
java.lang.IllegalStateException: Illegal Lock usage: unlocking thread  
not owner.
	at com.webobjects.foundation.NSRecursiveLock.unlock 
(NSRecursiveLock.java:207)
	at  
com.webobjects.eodistribution.client.EODistributedObjectStore.unlock 
(EODistributedObjectStore.java:71)
	at com.webobjects.eocontrol.EOEditingContext.unlockObjectStore 
(EOEditingContext.java:4753)
	at  
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification( 
EOEditingContext.java:4118)

at org.wojc.client.JCEC.objectsWithFetchSpecification(JCEC.java:844)
	at  
com.webobjects.eocontrol.EOEditingContext.objectsWithFetchSpecification( 
EOEditingContext.java:4500)

...

or sometimes on AWT's EDT:
java.lang.IllegalStateException: Illegal Lock usage: unlocking thread  
not owner.
	at com.webobjects.foundation.NSRecursiveLock.unlock 
(NSRecursiveLock.java:207)
	at  
com.webobjects.eodistribution.client.EODistributedObjectStore.unlock 
(EODistributedObjectStore.java:71)
	at com.webobjects.eocontrol.EOEditingContext.unlockObjectStore 
(EOEditingContext.java:4753)

at org.wojc.client.JCEC.unlockObjectStore(JCEC.java:916)
	at com.webobjects.eocontrol.EOCustomObject.willReadRelationship 
(EOCustomObject.java:1304)
	at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer 
$_LazyGenericRecordBinding.valueInObject 
(_EOMutableKnownKeyDictionary.java:560)
	at com.webobjects.eocontrol.EOCustomObject.storedValueForKey 
(EOCustomObject.java:1736)

at com.havaso.dvis.client.eof.eo._Project.users(_Project.java:175)
...



Maybe I screwed up with stripping the ERXEC? I'm attaching the  
source, maybe somebody can point out the mistake?


Any help would be greatly appreciated,
Flor



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

This email sent to [EMAIL PROTECTED]

Re: WonderEntity / _WonderEntity

2008-10-13 Thread Florijan Stamenkovic
Without more info, it looks as though your eogen file is not finding  
your prototypes entity / model. This makes it unable to detect the  
class types of attributes, because that information is stored in the  
prototype.


Some questions:
1. How do you deal with prototypes (separate model, separate project,  
built framework)?
2. Does your model complain when you open it of not being able to  
load prototype information?
3. Under "referenced models" in your .eogen file, do you have the  
"Load model group" checkbox ticked?


HTH,
F

On Oct 11, 2008, at 17:12, Ricardo J. Parada wrote:



Hi,

I created a .eogen file for my eomodel.  Under the Templates  
section I left blank the Templates Folder text field.  Then for the  
Template and Subclass Template text fields I specified  
_WonderEntity.java and WonderEntity.java.  However, my _Foo.java  
has stuff like this in it:


...

public static final String LAST_NAME_KEY = "lastName";
	public static final ERXKey<$attribute.javaClassName> LAST_NAME =  
new ERXKey<$attribute.javaClassName>(LAST_NAME_KEY);



Any guess what I'm doing wrong?

Thanks,
Ricardo Parada

 ___
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/flor385% 
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 [EMAIL PROTECTED]


Re: ERPrototypes

2008-10-11 Thread Florijan Stamenkovic

yes.

On Oct 11, 2008, at 08:55, Ricardo J. Parada wrote:


Hi,

I'm looking into ERPrototypes.  What prototype do people use for  
foreign keys and primary keys based on a number?  Is it "id"?


Thanks,
Ricardo Parada

___
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/flor385% 
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 [EMAIL PROTECTED]


JC & ec locking & ERXEC

2008-10-10 Thread Florijan Stamenkovic

Hi all,


I've been separating some data processes in a JavaClient app between  
threads (client side), and consequently bumped into locking issues.  
Standard editing context operations I have control of, but next to  
that there are faults firing at times on different threads, leading  
to exceptions. I figured I'd try to adapt ERXEC to fit JC usage, but  
it's big, and it will be tedious doing it, so I'm wondering if anyone  
has some stuff in the same direction. Not necessarily JC specific,  
but a more lightweight generic locking solution?


Thx,
F

- oh, and one more thing... I assume that with some effort I should  
be able to keep all of the EREXEC locking magic while simplifying it,  
and removing it's dependencies on other wonder code. Is this a bad  
assumption?

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

This email sent to [EMAIL PROTECTED]


Re: updating WO

2008-10-04 Thread Florijan Stamenkovic
Also, if you have somewhere a copy of WOLips files (for example in an  
old Eclipse installation) you can just copy them to Eclipse's  
"plugins" folder and re-start Eclipse from the cmd line with the - 
clean parameter. Perhaps not the best thing to do in terms of  
compatibility checking, but I've successfully done it a few times.


F

On Oct 04, 2008, at 02:14, Marcus Raath wrote:


My update also failed. Where are the builds
 files?

2008/10/3 Henrique Prange <[EMAIL PROTECTED]>
Hi Theodore,

Do you mean updating WOLips? Which version of Eclipse?

I had the same problem with Eclipse 3.4.1 two days ago. I tried  
last night and it worked. The problem also happened with other plug- 
ins, so it doesn't seem to be a problem with WOLips update site.


Cheers,

Henrique

Theodore Petrosky wrote:
I can't seem to get WO to update. I am getting this error... anyone  
have an idea why?


No repository found at http://webobjects.mdimension.com/wolips/nightly

Ted


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


This email sent to [EMAIL PROTECTED]



--
Best regards
Marcus Raath
SAP Technical Consultant HR and CRM

Voice: +27 11 4674507
Fax: +27 866 828689
Cell: + 27 82 300 9607
Email: [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/flor385% 
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 [EMAIL PROTECTED]


Re: Eclipse WOLips not showing prototypes when creating a project

2008-09-28 Thread Florijan Stamenkovic

Marcus,

WOLips does not contain any prototypes. You need either your own  
prototypes model, or entity, or Wonder stuff (the ERPrototypes  
framework) in the classpath of the project, or in the project itself.


Here's more or less what you need to do, assuming you want to use  
Wonder prototypes:


1. Install Eclipse / WOLips
2. Download and install Project Wonder, or check out it's Subversion  
repository

3. Add ERPrototypes.framework to the class path of your project
4. In the Database Config of your EO model select the appropriate  
prototype

5. You're good.

Depending on other aspects of your setup (wonder, no wonder, WO  
version...) you might need to do additional work to get things running.


F

On Sep 28, 2008, at 16:41, Marcus Raath wrote:


Hi
I followed the instructions for instaling the binary distribution  
of wolips.
However when i create a d2w project i cannot select a prototype as  
their is nothing in the list.


Any help would be appreciated.
Thanks
Marcus
Johannesburg
South Africa

 ___
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/flor385% 
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 [EMAIL PROTECTED]


[Announcement] WOVaGen - WebObjects Value Generator

2008-09-25 Thread Florijan Stamenkovic

Hi all,


A simple framework that might be generally useful:

http://web.mac.com/flor385/eSwamp/software/index.html#wovagen

The page describes basic stuff... I'd just like to add that there are  
some areas that require improvements:

- logging (at the moment there is no logging at all in the framework)
- stability (I tested and tweaked it with one of my in-progress  
projects, but that was hardly exhaustive)
- internationalization (check out the ValueLists class, this could be  
organized much better)


F

if anyone has any questions, comments or whatever, please feel free.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: www.apple.com/webobjects

2008-09-23 Thread Florijan Stamenkovic


On Sep 23, 2008, at 05:19, Jaime Magiera wrote:


On Sep 22, 2008, at 6:28 PM, David den Boer wrote:

But never forget that all the 'important' (IMHO) code runs on WO,  
and that is what matters for the long run.


What exactly does that do to encourage a development base?


Assuming it is true, it implies that WO will not be dropped any time  
soon.


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

This email sent to [EMAIL PROTECTED]


Re: uniqueness constraint on an a foreign key

2008-09-22 Thread Florijan Stamenkovic


On Sep 22, 2008, at 13:07, Chuck Hill wrote:

Yeah, sounds like this might end up kicking me in the ass.  
Especially since I can't override client side class descriptions,  
so I would have a discrepancy between what EOs  and class  
descriptions see as inverse relationships. Not sure I like this  
idea, it might have unforeseeable consequences, no? More work...


Does that method exist for client side EOs?


Yep, it does. I am just afraid of meddling with it... Especially  
since EOs go through a different life-cycle in a JC situation, there  
are more variables to control (server side EOs, server side class  
descriptions, client side EOs, client side CDs and all the EOF in  
between).


But, to come back on the original idea, what do you think of  
putting a uniqueness constraint on the FK? ould that somewhere  
somehow screw the object graph up beyond repair?



I can't see how it would harm it.  If violated, the save will fail.


Thanks, seems worth trying out.

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

This email sent to [EMAIL PROTECTED]


Re: Class.this.. ?

2008-09-22 Thread Florijan Stamenkovic

Oh, sorry, I missed that... In that line it is necessary.

F

On Sep 20, 2008, at 17:50, Ash Mishra wrote:


Thanks Florijan.

would it not be needed in the Delegate's last line:

return MyListPage.this;

?


On 20-Sep-08, at 2:46 PM, Florijan Stamenkovic wrote:



On Sep 20, 2008, at 16:36, Ash Mishra wrote:

I understand what it's doing (i.e. accessing the woDisplayGroup  
and setting a value in it) but I've not seen the MyListPage.this.  
reference before, where the class name is followed by 'this' and  
than a variable of the class.


Is this some special Java reference?


If I understand you well, you are asking about the syntactical  
implication of this construction:


"ClassName.this"

This type of referencing is used in inner classes to obtain the  
instance of the nesting class. In the example you used, it will  
ensure that you get a reference to the MyListPage instance, and  
not to the instance of the anonymous class that extends  
NextPageDelegate (declared in line 9).


While in the piece of code you refer to it is not necessary to do  
this, since referencing "myDisplayGroup" can be done directly, it  
would be necessary if the anonymous NextPageDelegate subclass also  
had a "myDisplayGroup" variable. In that sense I wouldn't say it's  
wrong, but just over-cautious.




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

This email sent to [EMAIL PROTECTED]


Re: Class.this.. ?

2008-09-20 Thread Florijan Stamenkovic


On Sep 20, 2008, at 16:36, Ash Mishra wrote:

I understand what it's doing (i.e. accessing the woDisplayGroup and  
setting a value in it) but I've not seen the MyListPage.this.  
reference before, where the class name is followed by 'this' and  
than a variable of the class.


Is this some special Java reference?


If I understand you well, you are asking about the syntactical  
implication of this construction:


"ClassName.this"

This type of referencing is used in inner classes to obtain the  
instance of the nesting class. In the example you used, it will  
ensure that you get a reference to the MyListPage instance, and not  
to the instance of the anonymous class that extends NextPageDelegate  
(declared in line 9).


While in the piece of code you refer to it is not necessary to do  
this, since referencing "myDisplayGroup" can be done directly, it  
would be necessary if the anonymous NextPageDelegate subclass also  
had a "myDisplayGroup" variable. In that sense I wouldn't say it's  
wrong, but just over-cautious.


F

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

This email sent to [EMAIL PROTECTED]


Re: uniqueness constraint on an a foreign key

2008-09-20 Thread Florijan Stamenkovic


On Sep 19, 2008, at 16:20, Chuck Hill wrote:


I was thinking more of having A and B each have the other PK as a FK.


Huh... Have you ever done this? Anyone else?

Though this may irritate EOF when it tries to look up inverse  
relationships.  You can tell EOF what to do by implementing String  
inverseForRelationshipKey(String relationshipKey) on A and B.


Yeah, sounds like this might end up kicking me in the ass. Especially  
since I can't override client side class descriptions, so I would  
have a discrepancy between what EOs  and class descriptions see as  
inverse relationships. Not sure I like this idea, it might have  
unforeseeable consequences, no? More work...


But, to come back on the original idea, what do you think of putting  
a uniqueness constraint on the FK? Would that somewhere somehow screw  
the object graph up beyond repair?


F

though, after thinking about it some more, I don't really *need*  
this. I would like it though :)

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

This email sent to [EMAIL PROTECTED]


Re: uniqueness constraint on an a foreign key

2008-09-19 Thread Florijan Stamenkovic


On Sep 19, 2008, at 14:56, Chuck Hill wrote:



On Sep 19, 2008, at 11:52 AM, Florijan Stamenkovic wrote:



On Sep 19, 2008, at 13:26, Chuck Hill wrote:


If the relationship is mandatory, I'd use the PK.


As in propagate PK? That does not work in this case because there  
can be A rows that do not have any related B rows.


Or did you mean something else?


Yes, that is what I was thinking of.  If it is not really a to- 
many, why not put the PK of B into A as a FK?


That would just reverse the situation into A <<-> B, no? What I need  
to is an enforced A <-> B, and in that B -> A is mandatory, and A ->  
B as optional.


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

This email sent to [EMAIL PROTECTED]


[OT] Eclipse class search shortcut

2008-09-19 Thread Florijan Stamenkovic
Something I just discovered, if you Cmd+Shift+T in Eclipse, to search  
for classes, you can search only on capitals, for example if  
searching for "OutOfMemoryError" you can just type "OOME" in and  
Eclipse will do the right thing. Sweet.


Thought I'd share, I guess it does not fit on David's cheat sheet,  
but somebody might find it useful.


F 
___

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

This email sent to [EMAIL PROTECTED]


Re: uniqueness constraint on an a foreign key

2008-09-19 Thread Florijan Stamenkovic


On Sep 19, 2008, at 13:26, Chuck Hill wrote:


If the relationship is mandatory, I'd use the PK.


As in propagate PK? That does not work in this case because there can  
be A rows that do not have any related B rows.


Or did you mean something else?

F



On Sep 19, 2008, at 10:00 AM, Florijan Stamenkovic wrote:


Hi all,

I have a relationship A <->> B. B carries the FK for A, not  
allowed to be null.


I'd like to enforce that a single A can relate to only one B so  
I'm thinking of putting a uniqueness constraint on the FK. As far  
as I can see that will give me what I want without causing any  
trouble. Can anyone think of a reason against doing this, or is  
there a better practice to address this?


Thanks,
F
___
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]



--
Chuck Hill Senior Consultant / VP Development

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

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








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

This email sent to [EMAIL PROTECTED]


uniqueness constraint on an a foreign key

2008-09-19 Thread Florijan Stamenkovic

Hi all,

I have a relationship A <->> B. B carries the FK for A, not allowed  
to be null.


I'd like to enforce that a single A can relate to only one B so I'm  
thinking of putting a uniqueness constraint on the FK. As far as I  
can see that will give me what I want without causing any trouble.  
Can anyone think of a reason against doing this, or is there a better  
practice to address this?


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

This email sent to [EMAIL PROTECTED]


faulty documentation?

2008-09-17 Thread Florijan Stamenkovic

Hi all,

If you check out the docs for EOCustomObject's takeValueForKey and  
takeStoredValueForKey you will see that there is talk of storing the  
value in instance variables (_key or key), but there is not talk  
about storing values in a value dict, which is what most likely  
happens in the end. Some debugging shows that indeed an EO has a  
package wide variable called __dictionary, of the  
_EOMutableKnownKeyDictionary type where values are stored. Nice.  
Should not that be mentioned in the docs? I guess another entry  
should be inserted before "make a call to  
handleTakeValueForUnboundKey" that would say that if the key is a  
valid property key for that EO, the value is stored in it's dict? Why  
would this be left out?


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

This email sent to [EMAIL PROTECTED]


Re: EOGenerator Relationships

2008-09-17 Thread Florijan Stamenkovic


On Sep 17, 2008, at 12:02, Michael Kondratov wrote:

There is no setInvoiceStatus in _Invoice. Only  
setInvoiceStatusRelationship.


See what Mike was just saying...

Now, I assume that _Invoice.setInvoiceStatusRelationship gets  
called first and in turn calls Invoice.setInvoiceStatus .

Is that correct?


Yes, the stack trace would look like this:

EOCustomObject.takeStoredValueForKey(value, "invoiceStatus")
Invoice.setInvoiceStatus(value)
EOCustomObject.takeValueForKey(value, "invoiceStatus")
EOCustomObject.addObjectToBothSidesOfRelationshipWithKey(value,  
"invoiceStatus")

_Invoice.setInvoiceStatusRelationship(value)

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

This email sent to [EMAIL PROTECTED]


Re: EOGenerator Relationships

2008-09-17 Thread Florijan Stamenkovic


On Sep 17, 2008, at 11:46, Mike Schrag wrote:


Wonder's automatic inverse relationship stuff
What's that? Mind explaining briefly, or pointing out where it is  
in wonder?

On ERXGenericRecord:

 * Also, this class supports auto-updating of inverse  
relationships. You can

 * simply call eo.setFoo(other), eo.takeValueForKey(other),
 * eo.addObjectToBothSidesOfRelationshipWithKey(other, "foo")
 * or eo.addToFoos(other) and the inverse relationship  
will get

 * updated for you automagically, so that you don't need to call
 * other.addToBars(eo) or other.setBar(eo)code>. Doing
 * so doesn't hurt, though. Giving a null value of  
removing the
 * object from a to-many will result in the inverse relationship  
getting

 * cleared. 
 * If you *do* call addToBars(), you need to use
 * includeObjectIntoPropertyWithKey() in this method.
 * This feature should greatly help readability and reduce the  
number errors you
 * make when you forget to update an inverse relationship. To turn  
this feature

 * on, you must set the system default
 *  
er.extensions.ERXEnterpriseObject.updateInverseRelationships=tru 
e.


The _Wonder.java templates check for this and can function in both  
scenarios properly.  What this basically addresses are for things  
like where you bind a WOPopUpButton selection to a to-one  
relationship.  All that does is set one side of the relationship,  
which is terribly confusing for people.  This setting makes it so  
inverse relationships are always updated.  There was a great debate  
about this a few months ago, actually ... You can search the  
archives for it.


Ah OK. I don't remember the debate. I was interested in this coz JBND  
also does both sides, but since DataObject has a different API then  
EOEnterpriseObject, it is simple to implement. Especially since I  
separated attribute setting from relating (set(...) and relate(...)),  
and also have unrelate(...). I guess this could have all be handled  
by a single more complex method, but what's done is done. The end  
result is the same, any relationship operations take care of the  
inverse stuff as well.


I don't think you actually need them ... EOF will do the right  
thing in the absence of the non-XxxRelationship set methods.  That  
said, I don't actually use those templates -- I use _Wonder.java,  
but the addition of the setXxx methods I think is pretty recent (I  
think I only added them when I fixed automatic inverse relationship  
updating).


AFAIK you don't need them, but I think having them performs just a  
bit better. takeValueForKey(...) needs to do less reflection. Well,  
this is perhaps stretching it, since the KVC default implementations  
points out it is super-optimized (always wanted to see exactly what's  
going on in there), but I think I also read about this too,  
somewhere. Well, makes sense, though I have no idea what the  
performance hit of not having those methods would really be.


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

This email sent to [EMAIL PROTECTED]


Re: EOGenerator Relationships

2008-09-17 Thread Florijan Stamenkovic

 Wonder's automatic inverse relationship stuff


What's that? Mind explaining briefly, or pointing out where it is in  
wonder?



call super.setXxx


As far as I can see your _Entity (http://webobjects.mdimension.com/ 
wolips/EOGenerator/Velocity%20EOGenerator%20Templates/_Entity.java)  
does not have setXxx(...) for relationships. So, why is that?


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

This email sent to [EMAIL PROTECTED]


Re: EOGenerator Relationships

2008-09-17 Thread Florijan Stamenkovic


On Sep 17, 2008, at 10:56, Michael Kondratov wrote:


The object is in the EC.

I've tried changing Invoice method from setInvoiceStatusRelationship 
(InvoiceStatus value) to setInvoiceStatus(InvoiceStatus value)


Now setInvoiceStatus in Invoice does get exceuted, however I am not  
able to call super.setInvoiceStatusRelationship(value) because they  
start calling each other!!


That's because setInvoiceStatusRelationship(value) calls  
addObjectToBothSidesOfRelationship(...) which in turn calls  
setInvoiceStatus(value).


You need to get into how WO's key value coding works. Check out the  
documentation for EOCustomObject, specifically these methods:


addObjectToBothSidesOfRelationship
takeValueForKey
takeStoredValueForKey

As for your problem, from what I understand you are trying to  
achieve, you should override setInvoiceStatus(value) in your Invoice  
class to do the extra work. Your method should look like this:


public void setInvoiceStatus(InvoiceStatus value) {
if(value != invoiceStatus()) {
System.out.println("updating invoice status date");
this.setInvoiceStatusDate(new NSTimestamp());
takeStoredValueForKey(value, INVOICE_STATUS_KEY);
}
  }

You calling code should however use setInvoiceStatusRelationship(...)  
to reap it's benefits, which will in turn call your setInvoiceStatus 
(...) method. Also note that the first line in that method only  
applies if the two InvoiceStatus EOs are in the same EC.


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

This email sent to [EMAIL PROTECTED]

Re: EOGenerator Relationships

2008-09-17 Thread Florijan Stamenkovic


On Sep 17, 2008, at 06:18, David Avendasora wrote:

If it doesn't complain, it means that the code calling this method  
is calling the _Invoice version of the method directly somehow.


I believe it is possible to do this using reflection. It however  
should not be happening, unless you are purposely doing it.


It sounds like your inheritance tree is not what it should be  
(Invoice does not subclass _Invoice). Or the method signature differs  
(the _Invoice method takes an argument of a different type). Be sure  
to check that out first. Like Dave said, @Override is a fast way to  
address that.


Or, you are actually dealing with an instance of _Invoice, and not of  
Invoice. Which would be weird, but possible I guess. In that case all  
of the above would check out, but you'd still be calling the _Invoice  
method.


When you created the instance you are now trying to update, did you  
insert it into an editing context?


What's your point Dave? I don't see how this would influence the  
runtime binding of methods.


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

This email sent to [EMAIL PROTECTED]


Re: Read only attributes

2008-09-09 Thread Florijan Stamenkovic


On Sep 09, 2008, at 12:57, Chuck Hill wrote:

If I read you correctly, then non-saved EOs can have their read  
only attributes set. Which brings me to the core of the problem:  
do I skip read only attributes when doing automatic EO generation  
or not? I do not want to mess with pks and fks, but I am already  
dealing with class properties only, so presumably they will not be  
in.


My feeling is that you should be setting them on entites that you  
create.  These would probably be non-null and read only, so you  
might not have much choice.


Yeah. I've never used read only attributes (flagged them as such in  
the model). Now that I think about it, I can think of some places  
where setting that would be appropriate.


Note that I am at the moment defining the general behavior. It  
will be possible to override it per attribute, but only in a more  
restrictive way: if the default behavior prohibits it, the att  
won't be generated, but if it allows it, an overriding setting can  
be provided to prevent any values being set.


At the moment I do:

// some attributes need to be skipped
if(att.isReadOnly() || att.isFlattened()) continue;

Maybe that should change to:

	if(att.isDerived() || att.isFlattened() || isPK(att))  
continue;	// check for PKs just in case they are exposed


I think  that would be better.


Seems that way. Also, I'll add an isFK(att) method. That should cover  
everything.


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

This email sent to [EMAIL PROTECTED]


Re: Read only attributes

2008-09-09 Thread Florijan Stamenkovic

Chuck, Dave,

Thanks for the input...

On Sep 08, 2008, at 19:37, Chuck Hill wrote:

I am guessing that (if EOF indeed does not accept modifications of  
RO attributes) the purpose of this is to preserve existing data,  
and in situations in which data is created outside of EOF?


I think you can create new objects with these attributes assigned a  
value.  You just can't change it afterwards.


If I read you correctly, then non-saved EOs can have their read only  
attributes set. Which brings me to the core of the problem: do I skip  
read only attributes when doing automatic EO generation or not? I do  
not want to mess with pks and fks, but I am already dealing with  
class properties only, so presumably they will not be in.


Note that I am at the moment defining the general behavior. It will  
be possible to override it per attribute, but only in a more  
restrictive way: if the default behavior prohibits it, the att won't  
be generated, but if it allows it, an overriding setting can be  
provided to prevent any values being set.


At the moment I do:

// some attributes need to be skipped
if(att.isReadOnly() || att.isFlattened()) continue;

Maybe that should change to:

	if(att.isDerived() || att.isFlattened() || isPK(att)) continue;	//  
check for PKs just in case they are exposed



The situation that Dave describes would not be covered, but I guess  
one would not go about generating random values for an externally  
served, deployed db :)


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

This email sent to [EMAIL PROTECTED]


Re: Read only attributes

2008-09-08 Thread Florijan Stamenkovic

On Sep 08, 2008, at 18:48, Chuck Hill wrote:


Primary keys.


Oh yeah. That makes sense too... Hm, do you know if EOF throws a  
validation exception when trying to modify a read only attribute?  
IIRC there was talk against making primary keys class properties, one  
of the arguments being that one should never modify them. But, if  
they are read only, and EOF throws, then that would not have been  
possible, no?


You can also mark them as such in the model to have EOF verify  
there have not been any changes.


I am guessing that (if EOF indeed does not accept modifications of RO  
attributes) the purpose of this is to preserve existing data, and in  
situations in which data is created outside of EOF?


F


Chuck



On Sep 8, 2008, at 3:46 PM, Florijan Stamenkovic wrote:


Hi all,

I'm looking into EOAttribute.isReadOnly(). Docs point out that an  
attribute is read only when it is derived (makes sense), but  
mention no other circumstance. So, anyone knows any other  
situation in which an attribute is read only?


Thanks,
F
___
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]



--
Chuck Hill Senior Consultant / VP Development

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

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








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

This email sent to [EMAIL PROTECTED]


Read only attributes

2008-09-08 Thread Florijan Stamenkovic

Hi all,

I'm looking into EOAttribute.isReadOnly(). Docs point out that an  
attribute is read only when it is derived (makes sense), but mention  
no other circumstance. So, anyone knows any other situation in which  
an attribute is read only?


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

This email sent to [EMAIL PROTECTED]


Re: Cappuccino

2008-09-06 Thread Florijan Stamenkovic

On Sep 05, 2008, at 18:54, Chuck Hill wrote:


Ross is no slouch though.


Not saying he is.  Just that the lack of real world experience  
(does Apple count as real world? :-P) gave me pause.  On the other  
hand, you could point to the Java API that was designed by  
professionals with many years of experience, so that does not  
guarantee a good API either.


It's powerful though. Cappuccino does not really look powerful. Looks  
pretty. It might gather a following. And then die a quick death. But  
I guess I am far fetching. Whatever.


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

This email sent to [EMAIL PROTECTED]


Re: Cappuccino

2008-09-05 Thread Florijan Stamenkovic
Uhm, I've taken a peek at the API. Seems to have some interesting  
stuff in there. Very AppKit like. I wonder what Apple would have to  
say about that, legally. Still, 117 classes to cover everything from  
basic raw type encapsulation to high level GUI management??? Sounds  
weak and I have doubts about how extendable the low level API is, and  
how easy it would be to integrate custom stuff into it. Which is  
crucial for library development... Which is crucial for a language...  
Which is, well, just crucial.


Well, we'll see...

As for the replacement of JavaClient? Hm, I'd say it'd be more suited  
to a JSON-RPC style solution. Dave has a point in pointing out EOF  
libraries on the client. I would not count on Apple implementing  
those in Cappuccino...


F

On Sep 05, 2008, at 16:04, Guido Neitzer wrote:


On 05.09.08 13:43, "Chuck Hill" <[EMAIL PROTECTED]> wrote:


That is fine for document centric apps.  My uneducated, uninformed
guess is that using this to replace JavaClient would be a lot of
work.  It might be interesting to try.


I know. I guess, you can provide some sort of JSON data source and  
use that
in the way you had to when there was no CoreData - populate arrays  
and so

on.

Yeah, there should be something for that. Might be coming pretty  
soon ...


The framework itself looks really cool.

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/flor385% 
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 [EMAIL PROTECTED]


Re: Cappuccino

2008-09-05 Thread Florijan Stamenkovic
Interesting, seems like a whole new platform. Did anyone check out  
the whole Objective-J thing, and the API?


On Sep 05, 2008, at 11:23, Kieran Kelleher wrote:


http://cappuccino.org/
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/flor385% 
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 [EMAIL PROTECTED]


Re: Inherited Relationships using Different Destinations

2008-09-05 Thread Florijan Stamenkovic


On Sep 05, 2008, at 13:56, Chuck Hill wrote:


What you need, and want, IMHO, is a different relationship.


This was exactly what I thought when I first dived into what Dave was  
saying. Then I thought, yeah, but then he would not be able to just  
generically call somePart.lotCode() and get the right thing. Then I  
thought, if he does it generically, he looses his NSArrays being  
parameterized with the proper subclass, so what's the point in the  
first place??? Which made me conclude that Dave is overdoing the  
"model after real life" concept (it's not life, it's sw). Then I  
though, well, f*** it, I'll go do some real work and just make a  
comment on the bizarreness of this attempt.


And since you say you are more worried about setting the getting,  
well, that's easy:


public void validatePart(...){
// is this Part relatable with this LotCode? No? throw an NSVal.ValEx!
}

Or even

public void setPart(...){
	// if not the right subclass of Part, well, throw exception or  
ignore or whatever

}

I mean, I doubt you can get your GUI to recognize all the overriding  
you did in the model anyway, so at some point in the GUI you need to  
remove unacceptable choices so the user can not screw up, and if you  
do that, well, then you might as well put a hard-core stop on any  
mistake by throwing an exception. What you are doing now seems  
incredibly more complicated, and less secure really.


It was a nice thought though. Really, really out there...


You can't just willy nilly change things.


Like hell you can't... It's really quite easy too, I mean, that is  
partly the reason we sit around emailing each other, no?  :-P


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

This email sent to [EMAIL PROTECTED]


Re: Inherited Relationships using Different Destinations

2008-09-05 Thread Florijan Stamenkovic
Yeah, Dave, this sounds kind of evil. I mean, I see what you're  
trying to do, but man, it sounds fishy. And you for sure lose a lot  
of type safety. Though I *guess* if you're careful it could work.


One thing's for sure though: you have a talent for bizarre design :)

F

On Sep 05, 2008, at 11:24, Mike Schrag wrote:

Still trying to figure out how Dave actually modeled this... Had  
no idea you could "override" relationship properties (destination)  
in subentities...
Which is why I'm hesitant doing any crazy changes to EM here ...  
I'm still not sure there isn't something highly suspicious going on  
here.


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

This email sent to [EMAIL PROTECTED]


Re: Inherited Relationships using Different Destinations

2008-09-05 Thread Florijan Stamenkovic
But you can override a method that returns NSArrayManufacturedBatch> with one that returns NSArray. So, if  
done this way you could have the relationships declared in all the  
Java classes.


Still trying to figure out how Dave actually modeled this... Had no  
idea you could "override" relationship properties (destination) in  
subentities...


F

On Sep 04, 2008, at 18:01, Mike Schrag wrote:

Yes, this is because while ManufacturedBatch is a subclass of  
LotCode, unlike the case of java arrays, NSArray  
is not a "subclass" of NSArray, so you don't ACTUALLY have  
covariant return types here.  If you were returning a to-one  
relationship, this would work as expected.


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

This email sent to [EMAIL PROTECTED]


Re: clearing a toMany relationship fault in Java Client

2008-09-04 Thread Florijan Stamenkovic
I wasn't following the other thread, but off the top of my head,  
well, maybe you could do:


eo.editingContext().refreshObject(eo);

Which should cause it to get the latest stuff from the server? No?

F

On Sep 04, 2008, at 13:21, Ricardo Legorreta wrote:


Any idea what I need to do?


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

This email sent to [EMAIL PROTECTED]


Customizing random value generation

2008-09-04 Thread Florijan Stamenkovic

Hi all,


I am working on the EO data generator discussed a while ago, in  
between of other things. So, since "hints" that affect value  
generation are wired into the generation process, I need to know what  
they are to use them. Below is a list of hint types I have, if anyone  
can come up with something else that is relevant, please let me know.  
Explanations are provided in comments.


Note that a hint consists of a type and a value. The value is of the  
class that the hint type is parameterized with. A hint type is  
instantiated with an integer that is used as it's hash type, and to  
compare hint equality. The desired consequence of this is that hints  
with the same ID will override each other. For example if you first  
set an OVRD hint for a certain property, and then set a SEQ hint for  
the same property, the OVRD property will be removed from the hint  
cache.


F

If you are interested in the context in which this is used, Hint.java  
is attached:




Hint.java
Description: Binary data



/**
 * Entity level hint, determines how many EOs should be generated for
 * any particular entity.
 */
public static final Type COUNT = new Type(0);

/**
 * Determines how frequently a value will be set for a property
 * that allows null.
 */
public static final Type SPARSITY =new Type(1);

/**
 * Overrides randomized value generation and instead uses the provided
 * List to randomly choose a value from.
 */
public static final Type> OVRD =new Type>(2);

/**
 * Similar to [EMAIL PROTECTED] #OVRD}, but the values are not randomly 
chosen
 * from the List, but in sequence.
 */
public static final Type> SEQ = new Type>(2);

/**
 * Instead of using the default value generator for the class of the
 * attribute, a custom provided AttGen is used.
 */
public static final Type CUSTOM = new Type(2);

/**
 * An attribute generator for the given Class is used, and
 * then the value is converted to the type the attribute expects it in.
 */
public static final Type> CONVERT =new 
Type>(2);

/**
	 * The low boundary for randomly generated values. Different  
attribute type

 * generators will expect different value types for hints of this type:
 * 
	 * String attributes expect an Integer  
denoting the

 * minimum String length.
 * Numeric attributes expect a Number of the same type the
	 * attribute is in, denoting the minimum allowed value for the  
attribute.
	 * NSData attributes expect an Integer  
denoting the

 * minimum number of bytes used.
	 * NSData attributes that are images expect a  
Dimension

 * denoting the minimum image size in pixels.
 * 
 */
public static final Type MIN =new Type(3);

/**
	 * The high boundary for randomly generated values. Different  
attribute type

 * generators will expect different value types for hints of this type:
 * 
	 * String attributes expect an Integer  
denoting the

 * maximum String length.
 * Numeric attributes expect a Number of the same type the
	 * attribute is in, denoting the maximum allowed value for the  
attribute.
	 * NSData attributes expect an Integer  
denoting the

 * maximum number of bytes used.
	 * NSData attributes that are images expect a  
Dimension

 * denoting the maximum image size in pixels.
 * 
 */
public static final Type MAX =new Type(4);

/**
	 * Utilized only by NSData attributes, defines the  
attribute to be

 * the data of an image, the value of the hint of this type should a
 * String that defines the image format name, as expected by
 * [EMAIL PROTECTED] ImageIO#getImageWritersByFormatName(String)}.
 */
public static final Type IMAGE =  new Type(5);
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Re: EOAttribute.width()

2008-09-03 Thread Florijan Stamenkovic

Done.

ID: 6193252

On Sep 03, 2008, at 13:20, Chuck Hill wrote:


Can you file a bug report on the documentation so that it gets fixed?


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

This email sent to [EMAIL PROTECTED]


EOAttribute.width()

2008-09-03 Thread Florijan Stamenkovic

Hi all,


The documentation for the EOAttribute.width() says:

"Returns the maximum length (in bytes) for values that are mapped to  
this attribute. Returns zero for numeric and date types."


So, according to this the maximum length in characters (for textual  
attributes) would be determined by the encoding used. However, a  
simple test trying to validate a String attribute shows that the  
width is validated against the length in characters. Since neither  
Java nor the DB is encoding in 8bits. So, is this a mistake in the  
docs or am I missing something?


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

This email sent to [EMAIL PROTECTED]


Entity dependence analisys

2008-08-29 Thread Florijan Stamenkovic

Hi all,


I made a little something to analyze dependencies between entities,  
and sort entities based on them. So that the non-dependent entities  
are at a lower index in the resulting list then the ones they are  
dependent on. The current implementation only deals with  
relationships, but the analysis method is agnostic of dependency  
types. To add your own dependencies check out the comment at line  
127. It should work with any kind of a dependency constraint.


Usage:
Put into whichever app, and call the static sortedEntities() method.  
The returned value should be a list of entities in which the non- 
dependent entities are at a lower index in the resulting list then  
the ones they are dependent on. The entities are loaded from the  
default model group. If there is a circular dependency, an exception  
should be thrown.


It is not very well commented, and totally not optimized, as I am  
still working on it. I also hope to be able to fine-grain it a bit.  
Till now the only fine graining is the possibility to define non- 
mandatory dependencies, the _isDependent(...) method will use that flag.


Let me know if it works for you or not. I tested it with a fairly  
complex model (around 15 entities, 50+ relationships) successfully.  
It should be able to chew through anything though. I'd really  
appreciate if somebody with a really super-complex model group could  
give it a go.


F



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

This email sent to [EMAIL PROTECTED]

Re: Issues Deploying from WOLips

2008-08-29 Thread Florijan Stamenkovic
This looks interesting, though the WSR are not really an issue for  
me. One thing though, why not isolate certain conditions (for example  
if frameworks should be embedded or not) into build.properties?


F

On Aug 29, 2008, at 11:30, Kieran Kelleher wrote:

If you want fully embedded *AND* split-install bundles, then this  
is the better instructions:
http://wiki.objectstyle.org/confluence/display/WOL/Alternative+Ant 
+Build+Script+for+Fully+Embedded+and+Split+Install+Bundles



On Aug 29, 2008, at 12:17 AM, Chuck Hill wrote:



On Aug 28, 2008, at 9:06 PM, Owen McKerrow wrote:


Hi All,

Converting an xCode project over to WOLips. We made a new  
WOApplication project, copied acrosss all the Java files and  
components etc etc and its all working great. Until we get to  
deployment.


To make my deployment build I right clicked on the projects name,  
and then selected "Install" from the WOLips Ant Tools option,  
which made me a nice .woa file  in /Library/WebObjects/ 
Applications ( by the way is there any easy way to get this build  
to include copies of the frameworks it needs inside itself ? )


Documented and everything:
http://wiki.objectstyle.org/confluence/display/WOL/Embedding 
+WOFrameworks




Anyways so far so good. I've copied the .woa up to the server  
where Im running it against a DEV database, most of the site  
works fine however when I to some pages I get these sorts of  
errors ( note the prod version built from xCode is still on the  
same machine and its not having any issues )



12:52:21,297	 
:  
Exception occurred while handling request:
com.webobjects.foundation.NSForwardException  
[java.lang.ClassNotFoundException] Cannot find class or component  
named JSConfirmPanel in runtime or in a loadable bundle:  
parsing template for Component : 'file:/Library/WebObjects/ 
Applications/Dev/EePortfolio.woa/Contents/Resources/ 
ExistingReports.wo/':
java.lang.ClassNotFoundException: Cannot find class or component  
named JSConfirmPanel in runtime or in a loadable bundle


Closely followed by

12:52:21,299	 Throwable  
occurred: java.lang.NoClassDefFoundError: com/webobjects/ 
woextensions/WOExceptionParser
12:52:21,299	 Workerthread  
exiting due to error, respawning with ID 10005...
Exception in thread "WorkerThread5"  
com.webobjects.foundation.NSForwardException for  
java.lang.NoClassDefFoundError: com/webobjects/woextensions/ 
WOExceptionParser
	at  
edu.uow.emlab.eportfolio.ExceptionHelper.retrieveExceptionInformatio 
n(ExceptionHelper.java:128)
	at edu.uow.emlab.eportfolio.ExceptionHelper.emailException 
(ExceptionHelper.java:94)
	at edu.uow.emlab.eportfolio.Application.emailException 
(Application.java:575)
	at edu.uow.emlab.eportfolio.Application.handleException 
(Application.java:508)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler._handleR 
equest(WOComponentRequestHandler.java:379)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler.handleRe 
quest(WOComponentRequestHandler.java:435)
	at com.webobjects.appserver.WOApplication.dispatchRequest 
(WOApplication.java:1306)
	at edu.uow.emlab.eportfolio.Application.dispatchRequest 
(Application.java:469)
	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:613)


So what have I done wrong ? Any ideas as to why it can't find  
JSConfirmPanel and WOExceptionParser ? As I said the prod version  
is running just fine. Going to these same pages when its running  
from Eclipse on my machine also works fine.



Might be worth doing an opendiff on the .woa directories.

It sounds like you don't have JavaWOExtensions.framework on the  
classpath.  I don't know what you did in Eclipse to make that be  
the case when it still runs.  Make sure this is in the WebObjects  
Libraries under the project's build path.  Take a look in App.woa/ 
Contents/MacOS/MacOSClassPath.txt to see if it is missing or  
present with the wrong path.



Chuck

--
Chuck Hill Senior Consultant / VP Development

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

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






___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/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/flor385% 
40mac.com


This email sent t

Re: FrontBase reverse engineering with WOLips

2008-08-29 Thread Florijan Stamenkovic

Yeah, this is definitely the right way to do it.

F

On Aug 29, 2008, at 11:05, Mike Schrag wrote:

You can always export and import your preferences, which is 90% of  
the annoyance of starting from a new workspace.


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

This email sent to [EMAIL PROTECTED]


Re: FrontBase reverse engineering with WOLips

2008-08-29 Thread Florijan Stamenkovic


On Aug 29, 2008, at 09:39, Mike Schrag wrote:

You can install multiple copies of Eclipse on the same machine  
(note that you need Eclipse 3.4 to use nightly).


Yeah, this is super sweet. And most of the prefs are saved in the  
workspace. Makes it easier to deal with installation and upgrades.


I would choose a different workspace and not touch your 3.3/stable  
workspace.  No need to bring another machine into the mix.


In principle totally on point, I'd just like to say that I have  
shared a workspace between multiple Eclipse installations, and never  
bumped into problems. Eclipse's releases always point out potential  
workspace incompatibilities. Again, really sweet.


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

This email sent to [EMAIL PROTECTED]


Re: Issues Deploying from WOLips

2008-08-29 Thread Florijan Stamenkovic
If the frameworks are not embedded after you did that then most  
likely the relevant includes file (woproject/ 
ant.frameworks.wo.wolocalroot) in your project does not list out  
these frameworks, or they are not located in your /Library/ 
Frameworks/ folder. What are the file's contents?


F

On Aug 29, 2008, at 01:23, Owen McKerrow wrote:


Hi Chuck,

Just in relation to embedding the frameworks. I followed the  
instructions on the wikki, setting




but the frameworks still aren't copied across. Any suggestions ?

Owen McKerrow
WebMaster, emlab
Ph : +61 02 4221 5517
http://emlab.uow.edu.au

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - -


"I like the way this project has somehow, against all common sense,  
got itself made."

- Peter Jackson,  "The Lord of The Rings"


On 29/08/2008, at 2:17 PM, Chuck Hill wrote:



On Aug 28, 2008, at 9:06 PM, Owen McKerrow wrote:


Hi All,

Converting an xCode project over to WOLips. We made a new  
WOApplication project, copied acrosss all the Java files and  
components etc etc and its all working great. Until we get to  
deployment.


To make my deployment build I right clicked on the projects name,  
and then selected "Install" from the WOLips Ant Tools option,  
which made me a nice .woa file  in /Library/WebObjects/ 
Applications ( by the way is there any easy way to get this build  
to include copies of the frameworks it needs inside itself ? )


Documented and everything:
http://wiki.objectstyle.org/confluence/display/WOL/Embedding 
+WOFrameworks




Anyways so far so good. I've copied the .woa up to the server  
where Im running it against a DEV database, most of the site  
works fine however when I to some pages I get these sorts of  
errors ( note the prod version built from xCode is still on the  
same machine and its not having any issues )



12:52:21,297	 
:  
Exception occurred while handling request:
com.webobjects.foundation.NSForwardException  
[java.lang.ClassNotFoundException] Cannot find class or component  
named JSConfirmPanel in runtime or in a loadable bundle:  
parsing template for Component : 'file:/Library/WebObjects/ 
Applications/Dev/EePortfolio.woa/Contents/Resources/ 
ExistingReports.wo/':
java.lang.ClassNotFoundException: Cannot find class or component  
named JSConfirmPanel in runtime or in a loadable bundle


Closely followed by

12:52:21,299	 Throwable  
occurred: java.lang.NoClassDefFoundError: com/webobjects/ 
woextensions/WOExceptionParser
12:52:21,299	 Workerthread  
exiting due to error, respawning with ID 10005...
Exception in thread "WorkerThread5"  
com.webobjects.foundation.NSForwardException for  
java.lang.NoClassDefFoundError: com/webobjects/woextensions/ 
WOExceptionParser
	at  
edu.uow.emlab.eportfolio.ExceptionHelper.retrieveExceptionInformatio 
n(ExceptionHelper.java:128)
	at edu.uow.emlab.eportfolio.ExceptionHelper.emailException 
(ExceptionHelper.java:94)
	at edu.uow.emlab.eportfolio.Application.emailException 
(Application.java:575)
	at edu.uow.emlab.eportfolio.Application.handleException 
(Application.java:508)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler._handleR 
equest(WOComponentRequestHandler.java:379)
	at  
com.webobjects.appserver._private.WOComponentRequestHandler.handleRe 
quest(WOComponentRequestHandler.java:435)
	at com.webobjects.appserver.WOApplication.dispatchRequest 
(WOApplication.java:1306)
	at edu.uow.emlab.eportfolio.Application.dispatchRequest 
(Application.java:469)
	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:613)


So what have I done wrong ? Any ideas as to why it can't find  
JSConfirmPanel and WOExceptionParser ? As I said the prod version  
is running just fine. Going to these same pages when its running  
from Eclipse on my machine also works fine.



Might be worth doing an opendiff on the .woa directories.

It sounds like you don't have JavaWOExtensions.framework on the  
classpath.  I don't know what you did in Eclipse to make that be  
the case when it still runs.  Make sure this is in the WebObjects  
Libraries under the project's build path.  Take a look in App.woa/ 
Contents/MacOS/MacOSClassPath.txt to see if it is missing or  
present with the wrong path.



Chuck

--
Chuck Hill Senior Consultant / VP Development

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

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








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


This email s

Re: Automatic data generation

2008-08-28 Thread Florijan Stamenkovic

Georg,

You mention testing, does your app also do data generation? And what  
kind of testing exactly are you referring to?


F

On Aug 28, 2008, at 04:26, Georg Tuparev wrote:



On Aug 21, 2008, at 5:13 PM, Mike Schrag wrote:

Has anyone made this already? Skimmed through the wonder API, but  
did not see anything that struck a chord...
Wonder doesn't have one ... I think Georg has a framework that  
does this, but I believe it's proprietary.



Perhaps what Mike talks about is our app called dataPlace. It  
converts any data format (files) in any other, but mostly XML. We  
have also a WO enhancement that loads one such particular data  
format into a database. It copes with data of any complexity and  
volume (we use it for astronomical catalogues, 3D structures of  
protein, bank transactions, and mobile phone call records). And of  
course all our tests are based on it.


We are in a process of packaging dataPlace as a commercial  
application. I hope v 1.0 will be out within a month.


cheers

-- georg --

___
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/flor385% 
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 [EMAIL PROTECTED]


Re: FrontBase and write data export/import

2008-08-25 Thread Florijan Stamenkovic
Or maybe you could use the cmd line, write a little script to  
automate the export process...


F

On Aug 23, 2008, at 14:02, Guido Neitzer wrote:

I don't know how feasible that is in your situation, but if you do  
a select

in FrontBase Manager, you can copy & paste rows to a text file (tab
delimited) that you can save and easily import to another database  
with the

FrontBase Manager import tools.

cug


On 22.08.08 12:16, "William Hatch" <[EMAIL PROTECTED]> wrote:


Hi,

I found a few threads that mentioned using a write data, as  
opposed to

write all output sql92 command for FrontBase. My goal is to get a
data export of a subset of table and then imported into another
FrontBase server; I don't need the entire db. Does anybody have any
usage examples of this? sql92 help doesn't list this, and the docs
don't mention it. Worst case, I supposed I could hack the write all
output generated schema.sql script to just do the inserts I'm
interested in, but thought there might be a more efficient way.  
Thanks.


Bill



 ___
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/lists% 
40event-s.net


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/flor385% 
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 [EMAIL PROTECTED]


Re: FrontBase and write data export/import

2008-08-23 Thread Florijan Stamenkovic

William,

I just looked into some FB documentation, and I can find no  
references to "WRITE DATA". I also can not find it in a the SQL  
reference I use. So, I think you might be on a false track here...


I suggest writing to the FrontBase list, since you are not getting  
any answers here, that might provide better results.


Or, if you are doing WO, maybe you could shift the export / import  
procedure to the WO level? Though I guess that would defeat the  
purpose of "keeping things simple" :)


Best regards,
F

On Aug 22, 2008, at 14:16, William Hatch wrote:


Hi,

I found a few threads that mentioned using a write data, as opposed  
to write all output sql92 command for FrontBase. My goal is to  
get a data export of a subset of table and then imported into  
another FrontBase server; I don't need the entire db. Does anybody  
have any usage examples of this? sql92 help doesn't list this, and  
the docs don't mention it. Worst case, I supposed I could hack the  
write all output generated schema.sql script to just do the inserts  
I'm interested in, but thought there might be a more efficient way.  
Thanks.


Bill



___
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/flor385% 
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 [EMAIL PROTECTED]


Re: Use of finalize methods in WO

2008-08-21 Thread Florijan Stamenkovic
I don't think the non-existence is the point here, just the scary  
proportion. I'd say in a healthy (i.e. not so Ferenghi like) world  
the proportion would follow the Gaussian curve, so let's say 25% in  
the really good range, 25% in the really bad, 50% somewhere in the  
middle.


Care to speculate on the actual proportions?

F

On Aug 21, 2008, at 14:16, Chuck Hill wrote:

If the consulting company views their best interest as keeping the  
customer happy and getting additional projects going forward, then  
it is far more likely that the tech that they choose will be the  
best for the customer as well. This is exceedingly rare.


We exist.  I do, I really do.


Sorry to sound so bleak, but I'd say that a majority of WO  
projects out there are in-house projects where a working  
application with a minimal amount of development time is really in  
_everyone's_ best interests.



That is probably true, but there are consulting companies out there  
(I can think of several) that make a significant portion of their  
money on WO work.


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

This email sent to [EMAIL PROTECTED]


Re: Automatic data generation

2008-08-21 Thread Florijan Stamenkovic

Hi Ray,

On Aug 21, 2008, at 13:35, Ray Kiddy wrote:

I think it definitely would be fun. I have done parts of this. I  
was once working on some app that did web template editing. It was  
at some company that I have forgotten the name of. We wanted to put  
in a smarter preview mode that would, for example, use sample data.  
Needless to say, this did not see the light of day anywhere.


It would probably be best to parameterize the process in a couple  
of ways. First, a plist-ish structure could supply actual data  
values and these could either be used as-is, mixed and matched or  
combined in different ways. For example, a sample data bit could  
look like:


{ firstName = ("Bob", "Tom"); lastName = ("Smith", "Johnson"); city  
= "Chicago" }


and this could be used to generate eos that are all the  
combinations of these alternative values. For example, this would  
generate 4 eos with the names "Bob Smith", "Bob Johnson", "Tom  
Smith", "Bob Johnson".


I was thinking exactly the same thing. I was thinking of providing  
value lists could be hinted to for individual properties, or if not,  
random words, random values in general, can be used. Then a hint set  
could be used to define preferences for attributes in which random  
values are not convenient... Something like


Hints.add(Person.ENTITY_NAME, Person.NAME_FIRST_KEY, Hints.FIRST_NAME);
Hints.add(Person.ENTITY_NAME, Person.AGE_VALUE, Hints.lowBoundary(0),  
Hints.highBoundary(120));

...

And the EO creation process would use a combination of models, hints,  
value sets and random value generation to fill EOs up.


Second, you are probably going to want a rule list for constraints  
on the generated data. Numbers need to be less than some value,  
greater than some value, strings need to be less than some length  
and so on.


If you did it this way, these structures could be kept in the  
internal information of an EOModel and Wonder could be changed to  
use them in a better preview mode.


If you want help covering different databases or such, let me know.  
This kind of "EOF origami" can be loads of fun.


Well, if I ever get around to it I will contact you. My original  
thought was to define values using java properties, but plists are  
probably better. It'd definitively be good to brainstorm this through  
before making it, who knows what kind of wild usages we could come up  
with. It never occurred to me for example to integrate this into a  
model, or wonder.


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

This email sent to [EMAIL PROTECTED]


Re: Automatic data generation

2008-08-21 Thread Florijan Stamenkovic
o update attributes in certain 
situations
String className = attribute.className();
String valueType = attribute.valueType();


// Check if we should set a default value
// We don't want to stomp over any values set already
if (currentValue == null
&& !attribute.isDerived()
&& !attribute.isReadOnly() ) {
if (log.isDebugEnabled())
log.debug("Processing attribute: " + 
attribute);
if (TYPE_STRING.equals(className)) {
// String type
	String value = ERXLoremIpsumGenerator.words(1, attribute.width 
(), attribute.width());

takeValueForKey(value, key);
} else if (TYPE_DATETIME.equals(className)) {
// NSTimestamp - set the current time
takeValueForKey(new NSTimestamp(), key);
} else if (TYPE_DATA.equals(className)){
// NSData type
	String value = ERXLoremIpsumGenerator.words(10, 100,  
attribute.width());

takeValueForKey(new 
NSData(value.getBytes()), key);
} else if (TYPE_NUMBER.equals(className)){
// Number type
// Which type of number?
if ("i".equals(valueType)) {
// Integer
		takeValueForKey(ValueGenerator.sharedInstance().integerValue 
(), key);

} else if ("d".equals(valueType)){
		takeValueForKey(ValueGenerator.sharedInstance().doubleValue 
(), key);

} else if ("B".equals(valueType)){
		takeStoredValueForKey(ValueGenerator.sharedInstance 
().bigDecimalValue(), key);

} else if ("c".equals(valueType)) {
takeValueForKey(Boolean.FALSE, 
key);
} //~ if ("i".equals(valueType))
} //~ if ....


        } //~ if (currentValue == null)

} //~ for (java.util.Enumeration attributesEnumerator = ...

}

}




On Aug 21, 2008, at 10:56 AM, Florijan Stamenkovic wrote:

Not sure if this has been discussed already, but I could not find  
anything in the list archives, nor by quickly googling.


So, I'm thinking of making a framework for automated data  
generation, based on a model and some runtime settings. This  
would, obviously, be used for testing. Specifically: filling up a  
database with arbitrary numbers of nonsense rows, that are however  
legal, and proceeding from there.


Has anyone made this already? Skimmed through the wonder API, but  
did not see anything that struck a chord...


If nobody ever made it, then why not? It seems a very nice thing  
to have, and off the top of my head I can not think of any  
insurmountable obstacle to making it...


F
___
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 [EMAIL PROTECTED]


Automatic data generation

2008-08-21 Thread Florijan Stamenkovic
Not sure if this has been discussed already, but I could not find  
anything in the list archives, nor by quickly googling.


So, I'm thinking of making a framework for automated data generation,  
based on a model and some runtime settings. This would, obviously, be  
used for testing. Specifically: filling up a database with arbitrary  
numbers of nonsense rows, that are however legal, and proceeding from  
there.


Has anyone made this already? Skimmed through the wonder API, but did  
not see anything that struck a chord...


If nobody ever made it, then why not? It seems a very nice thing to  
have, and off the top of my head I can not think of any  
insurmountable obstacle to making it...


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

This email sent to [EMAIL PROTECTED]


Re: Help with triggers/FrontBase (was: sequential numbering across more instances)

2008-08-20 Thread Florijan Stamenkovic


On Aug 20, 2008, at 08:40, Ondřej Čada wrote:

CREATE TRIGGER test_insert AFTER INSERT ON TEST REFERENCING NEW x  
FOR EACH ROW BEGIN update test set ordernumber=(SELECT MAX 
(ordernumber) FROM test)+1 where oid=x.oid AND ordernumber=-1; END


Your update problem aside,

SELECT MAX(column) FROM table

will return null when there are no values yet for that column. I  
believe you need to do something like:


SELECT CASE WHEN MAX(column) IS NOT NULL THEN MAX(column) ELSE 0 END  
FROM table


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

This email sent to [EMAIL PROTECTED]


Re: Owns Destination problem

2008-08-19 Thread Florijan Stamenkovic
So, you create an MS. Then you create an SR and relate it to it. Then  
you unrelate the MS from the SR and vice-versa. What do you want to  
achieve by this? If it did work, your object graph would be at  
exactly the same state as after step 2. Or am I missing something?


F

On Aug 19, 2008, at 15:22, David Avendasora wrote:

3) Create a new ScheduledRouting, assign the new  
ManufacturingSchedule to it's manufacturingSchedule() relationship  
using: 		addObjectToBothSidesOfRelationshipWithKey(object,  
MANUFACTURING_SCHEDULE_KEY);

4) remove the ScheduledRouting from the ManufacturingSchedule using:
	removeObjectFromBothSidesOfRelationshipWithKey(object,  
SCHEDULED_ROUTINGS_KEY);


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

This email sent to [EMAIL PROTECTED]


Re: Owns Destination problem

2008-08-19 Thread Florijan Stamenkovic

Hi Dave,


Note these lines in the stack:

at com.webobjects.eocontrol.EOCustomObject.validateForSave 
(EOCustomObject.java:1411)
	at com.webobjects.eocontrol.EOCustomObject.validateForInsert 
(EOCustomObject.java:1473)


What exactly are you doing in your app? It looks as though your EOs  
are being treated as newly inserted EOs, instead of having deletion  
rules processed.


Also, a bit weird, I don't see a call to #processRecentChanges() in  
the stack. I thought that should always happen before any validation,  
to prepare the object graph for it...


Well, maybe it makes more sense to someone with more knowledge of  
EOF's ins and outs.


HTH
F

On Aug 19, 2008, at 10:37, David Avendasora wrote:


Hi all,

This is very confusing, and I know it should be a very simple  
thing. I have a the following relationship that is marked as Owns  
Destination,


ManufacturingSchedule <->> ScheduledRouting

When I remove the ScheduledRouting from the ManufacturingSchedule's  
scheduledRoutings() relationship by calling


removeObjectFromBothSidesOfRelationshipWithKey 
(scheduledRoutingToDelete, "scheduledRoutings");


on the ManufacturingSchedule, the ScheduledRouting is not being  
deleted when I call editingContext().saveChanges(). Instead I'm  
getting a validation error:


[2008-08-19 09:44:57 EDT]   
:  
Exception occurred while handling request:
com.webobjects.foundation.NSValidation$ValidationException: The  
manufacturingSchedule property of ScheduledRouting must have a  
ManufacturingSchedule assigned
[2008-08-19 09:44:57 EDT]   
com.webobjects.foundation.NSValidation$ValidationException: The  
manufacturingSchedule property of ScheduledRouting must have a  
ManufacturingSchedule assigned
	at com.webobjects.eoaccess.EORelationship.validateValue 
(EORelationship.java:1805)
	at  
com.webobjects.eoaccess.EOEntityClassDescription.validateValueForKey 
(EOEntityClassDescription.java:443)
	at com.webobjects.eocontrol.EOCustomObject.validateValueForKey 
(EOCustomObject.java:1339)
	at com.webobjects.eocontrol.EOCustomObject.validateForSave 
(EOCustomObject.java:1411)
	at com.webobjects.eocontrol.EOCustomObject.validateForInsert 
(EOCustomObject.java:1473)
	at com.webobjects.eocontrol.EOEditingContext.validateTable 
(EOEditingContext.java:2249)
	at com.webobjects.eocontrol.EOEditingContext.validateChangesForSave 
(EOEditingContext.java:3029)
	at com.webobjects.eocontrol.EOEditingContext._prepareForPushChanges 
(EOEditingContext.java:3283)
	at com.webobjects.eocontrol.EOEditingContext.saveChanges 
(EOEditingContext.java:3213)


Why isn't it just deleting the ScheduledRouting object on save? All  
of ScheduledRouting's relationships are either Cascade or Nullify,  
so I know that it isn't being held onto because of a delete rule.


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/flor385% 
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 [EMAIL PROTECTED]


Re: permissions deployoment woes

2008-08-18 Thread Florijan Stamenkovic

Versions: 10.4.11, 5.3, no Wonder

On Aug 18, 2008, at 13:54, Chuck Hill wrote:


Does everyone have execute on the directories?


Yep.

wotaskd is starting up under root. Should I change that to  
appserver? That seems to be at least a part of the logging problem.


Yes, it should run as appserver unless you are on 10.3.


Done.

Also, could the logging / permissions mess be related to the apps  
not starting?



Yes, if it can't create the log file and write to it, the app will  
just die.


Huh, that easily could have been the cause of mischief then.  
Switching wotaskd to appserver ensured that the apps can write.  
Hopefully this will be the end of this problem.


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

This email sent to [EMAIL PROTECTED]


Re: sequential numbering across more instances

2008-08-15 Thread Florijan Stamenkovic


editingContext().globalIDForObject(on) will be an  
EOTemporaryGlobalID until the object is saved.  You can use Wonder  
to get a permanent key, but if the transaction is not committed,  
you will get gaps in the sequence (I think).


Yeah, there's that. When I do this I add an if to check if the object  
is saved. I am used to not having unique IDs before stuff is saved.  
Also for IDs that are not global ID based... It's just how it is.


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

This email sent to [EMAIL PROTECTED]


Re: sequential numbering across more instances

2008-08-15 Thread Florijan Stamenkovic


On Aug 15, 2008, at 14:59, Chuck Hill wrote:



On Aug 15, 2008, at 11:45 AM, Florijan Stamenkovic wrote:

With any such value there is some probability the client will  
(next week or next year) want (a) to edit it, (b) in some special  
case, to have non-unique values.


Aah, I love being an in-house developer that can just stamp  
his foot and say no, without having to think about such a thing  
as: clients :)


That -- same as an extra UNIQUE column -- would not satisfy the  
demand that "all numbered orders make a sequence 1,2,3,4,".  
The client would prefer that the sequence is without gaps (not  
something like "1,5,6,27,").


I start to see your point. It makes it very tedious to deal with  
however. I've been in this situation. The decision (based on my  
selfless recommendations :) was not to care that 1,2,3,7,10... is  
ugly. They are unique. They identify things persistently. Sold.


As for Chuck's solution, also notice that it does not help you  
deal with the potential demand for edibility. And since it  
doesn't, you might as well use PKs (or a separate db generated  
sequence) in a two table setup in which you would still get the  
sparse but linear sequence like in Chuck's solution, but with far  
less fuss.


I think my solution would avoid gaps.  The Order and OrderNumber  
are updated in the same transaction so there should be no rolling  
back of the number after another order has used a higher one.


Was not thinking that it would not. Uhm frankly was not exactly sure  
if and how it would work :) I'm just saying that you can get the same  
thing, if I understand correctly what the end result of your code  
would be, but in an easier way by doing this in the Order:


public void assignNumber(){
	addToBothSides(EOUtilities.createAndInsert(editingContext(),  
"OrderNumber"), "orderNumber");

}

public Number number(){
OrderNumber on = orderNumber();
if(on == null) return null;

	return (Integer)((EOKeyGlobalID)editingContext().globalIDForObject 
(on)).keyValues()[0];

}

And you're done. Not every Order has to have a number, but when they  
do, they are in sequence.


Writing this in Mail, so it might not be entirely correct.

F

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

This email sent to [EMAIL PROTECTED]


Re: BigDecimal, scale, and prototypes

2008-08-15 Thread Florijan Stamenkovic

This also accounts for the zero padding. Nice.

F

On Aug 15, 2008, at 14:34, Mike Schrag wrote:


EOF sets the scale when the values are fetched.

case FB_Decimal: {
if (obj instanceof BigDecimal) {
		return ((BigDecimal) obj).setScale(eoattribute.scale(),  
BigDecimal.ROUND_HALF_UP).toString();

}

from fb plugin

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/flor385% 
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 [EMAIL PROTECTED]


Re: sequential numbering across more instances

2008-08-15 Thread Florijan Stamenkovic
With any such value there is some probability the client will (next  
week or next year) want (a) to edit it, (b) in some special case,  
to have non-unique values.


Aah, I love being an in-house developer that can just stamp his  
foot and say no, without having to think about such a thing as:  
clients :)


That -- same as an extra UNIQUE column -- would not satisfy the  
demand that "all numbered orders make a sequence 1,2,3,4,". The  
client would prefer that the sequence is without gaps (not  
something like "1,5,6,27,").


I start to see your point. It makes it very tedious to deal with  
however. I've been in this situation. The decision (based on my  
selfless recommendations :) was not to care that 1,2,3,7,10... is  
ugly. They are unique. They identify things persistently. Sold.


As for Chuck's solution, also notice that it does not help you deal  
with the potential demand for edibility. And since it doesn't, you  
might as well use PKs (or a separate db generated sequence) in a two  
table setup in which you would still get the sparse but linear  
sequence like in Chuck's solution, but with far less fuss.


I think you simply will have to make compromises.

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

This email sent to [EMAIL PROTECTED]


Re: BigDecimal, scale, and prototypes

2008-08-15 Thread Florijan Stamenkovic


On Aug 15, 2008, at 11:45, T Worman wrote:


Florijan:

I have found that setting the scale in the model did not result in  
properly setting the scale of the attributes in my EO's. I am using  
OpenBase. There could be a number of reasons for this and I didn't  
investigate real hard.


The scale of attributes in Java *should* directly reflect the scale  
set in the database, due to the way BigDecimal's constructors work,  
even if EOF does not intervene.


Wanting to be sure what is happening, I just made a test application  
(WO5.3, FrontBase, 10.4.11, wonder currencyAmount prototype). In  
short, the database respects the scale of the model. Java respects  
the scale too. The scale of fetched BigDecimals is fixed, if not all  
of it is used they are zero padded. Who exactly is responsible for  
this I am not sure, but it is a pleasantly consistent behavior.


As for the input of BigDecimals that have a scale greater then what  
is allowed are rounded (HALF_UP), no exceptions raised. This is a bit  
mysterious. From what you guys are saying, it could be concluded that  
EOF does not deal with this. If that is so, then it also does not  
raise an exception when there is more digits then the model allows.  
This does not sound OK, on it's part. If EOF does deal with this  
(coercion), Dave should not have received an exception on the db  
level, and things should have worked fine for Timothy. Uhm, weird.


What I did was override the getters for those attributes in the  
java classes.


Yeah, I was thinking of doing that, but we might be handling high  
volumes of this kind of data, the less extra BigDecimal operations I  
do, the better.


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

This email sent to [EMAIL PROTECTED]


Re: BigDecimal, scale, and prototypes

2008-08-15 Thread Florijan Stamenkovic


On Aug 15, 2008, at 12:00, David Avendasora wrote:

How currency-centric of you. If you are selling widgets that are  
really small, or you have a very strong currency, you may want to  
keep track of a cost that is < .01 for calculations, even if the  
value presented to the customer ends up getting rounded to 2  
decimal points. With some currencies you don't even need decimal  
points. Colombian Peso, USD, etc.


I guess that's a good point, increasing the scale when things are  
being calculated, reducing it when it is being displayed.


However, I am not sure I should actually store the extra precision.  
In our situation, we would store the value in some currency *as it is  
on the invoice*, and then at runtime possibly calculate it into other  
currencies, but would not store the result. So, unless there are  
currencies that per se require more then 2 precision digits, we gain  
nothing by extra precision on the db layer. See my point?


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

This email sent to [EMAIL PROTECTED]


BigDecimal, scale, and prototypes

2008-08-15 Thread Florijan Stamenkovic

Hi all,

I am using BigDecimal in combination with WO for the first time, and  
have some questions, perhaps someone with experience could explain.


1. Is the scale of the resulting BigDecimal based on the scale of the  
property as defined in the model?
2. Why does the currencyAmount wonder prototype has the scale of 4,  
instead of 2? Easy to deal with, I am just wondering if there is a  
specific reason for that...


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

This email sent to [EMAIL PROTECTED]


Re: sequential numbering across more instances

2008-08-15 Thread Florijan Stamenkovic
I regret to say I have a very strong feeling against using PK's for  
anything but PK and relationships, ever.


May I ask why? I've found them quite useful when it comes to having  
immutable row / EO identifiers, have not bumped into problems with  
this yet. Except that for some reason in FrontBase they start with  
something like 11, which I have yet to deal with. But, that's a  
point of aesthetics.


so I am guessing that is not what you need. So, could you  
elaborate on this a bit?


Anyway, even if I wanted to use them, it would not do, for there  
are items which have no numbers... Ha, thanks! Seems you just have  
led me to one reason I haven't realised originally why UNIQUE would  
not work quite well :) (Unless put into a table of its own,  
dedicated for this task, which I at the moment have alas completely  
no idea whether it's worth that or not... I think rather not?)


This can be worked around, with a boolean control property, let's  
call it hasOrderNumber:


public Number orderNumber(){
if(hasOrderNumber)
return sequenceNumber();
else
return null;
}

Without knowing why you do not want to use PKs for this, I'd use PKs  
in combination with this. But you can use any other sequence as well.  
As for the generation of the sequence itself, please see below.


What kind of a sequence is it? Do the users need to provide  
values, or can they be auto generated? In short, what are you  
trying to do?


There's an entity, say, Order, one of whose attributes is an  
integer orderNumber.


Some of created orders have no number (test ones, etc.). Those  
which have a number need to be numbered in a global sequence. In  
pseudo-code, I need a method


class Order:EOGenericRecord { ... ... ...

void assignOrderNumber() {
  // precondition: orderNumber()==null
  ...
  ...
  // postcondition: orderNumber() is unique, so that all numbered  
orders make a sequence 1,2,3,4,

}

so that this method works properly from any number of application  
instances.


From what I know of this problem, it is virtually impossible to  
ensure uniqueness of data in a WO setup in your Java code. For a  
recent discussion on this, in which I was trying something similar,  
check out the "DB uniqueness constraints and dealing with them" (July  
this year). So, after some valuable advice, I decided not to try to  
address this in Java. I guess that in your situation a combination  
between a database generated sequence and a uniqueness restraint  
would do what you need. Some database I believe can generate this for  
you. In others you might need to use a stored procedure to do it.


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

This email sent to [EMAIL PROTECTED]


Re: sequential numbering across more instances

2008-08-15 Thread Florijan Stamenkovic


On Aug 15, 2008, at 09:55, Ondřej Čada wrote:


Hi all,

I've just bumped into a need to maintain a sequential numbering of  
database rows, which are created by more concurrent WO application  
instances.


If you just need a unique identifier for a row, you could use the  
primary key value easily, so I am guessing that is not what you need.  
So, could you elaborate on this a bit? What kind of a sequence is it?  
Do the users need to provide values, or can they be auto generated?  
In short, what are you trying to do?


Whilst I can think of a number of possible solutions, I'd like to  
ask for your experience before implementing one? Strangely enough I  
haven't done this yet, and thus can't well estimate the advantages  
and disadvantages of different possible approaches (locking, UNIQUE  
column, etc...) and their respective gotchas.


Thanks,
---
Ondra Čada
OCSoftware: [EMAIL PROTECTED]   http://www.ocs.cz
private [EMAIL PROTECTED] http://www.ocs.cz/oc



___
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/flor385% 
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 [EMAIL PROTECTED]


Re: Client-Side Logging on Leopard

2008-08-14 Thread Florijan Stamenkovic
Don't have a solution, but I do have client and server side logging  
in Leop.


F

On Aug 14, 2008, at 10:08, David Avendasora wrote:


Hi all,

This is slightly off-topic, but when I run my project within  
Eclipse I'm having problems getting logging for _anything_ to show  
up in the console - which is where the client-side app logging  
shows up.


If I I copy the project over to my Tiger machine and run it there,  
then I get logging in the console with no problem.


Basically all I get on Leopard is the ouput of the launch script,  
then nothing else. No NPEs no NSLog output, nothing.


All the settings in the Java Preferences utility are identical (as  
possible) between the two machines.


Any ideas why the same logging would behave differently on Leopard  
than on Tiger?


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/flor385% 
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 [EMAIL PROTECTED]


Re: Drawing thin stroked lines don't keep stroke on window resize

2008-08-12 Thread Florijan Stamenkovic
I know this bug. I always thought that it isn't necessarily caused by  
bad antialiasing, but rendering of everything except for the  
background and overlaying it. Thereby effectively drawing over the  
existing rendering, and since the overlay is not entirely opaque  
(there are some partially transparent pixels) we end up seeing  
something that looks like bad antialiasing.


I don't really have much to support this theory, except the fact that  
it really could produce what we are seeing, maybe it is a total  
misconception of the problem. Any thoughts? I'd really like to get  
rid of this, it is annoying.


On Aug 12, 2008, at 08:59, Ken Orr wrote:

I know exactly the artifacts that your referencing, and it shows up  
in more than just line drawing. Look at the following text, drawn  
first at rest, then after a slight resize:


good text (right after startup):


bad text (after resize):




I originally had thought that the problem was with button opacity  
(that is, maybe it was claiming to be opaque, but really wasn't) -  
that wasn't the issue.


Have you done any tests to come to this conclusion?

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

This email sent to [EMAIL PROTECTED]


Re: Which WOLips???

2008-08-11 Thread Florijan Stamenkovic
OK, could be it was one of my screw ups, but I could swear when I  
first went to update, it only showed WOLips in the Standard Install  
group. When I went back to make you a nice pict of it for you,  
everything else was there... Ouch...


I don't feel for reverting to Eclipse 3.3, though I don't really care  
about Maclipse. Bug reporting it shall be :)


Thanks all, and sorry for my (perpetual) confusion
F

On Aug 11, 2008, at 14:32, Mike Schrag wrote:

Personally I haven't upgraded to Eclipse 3.4 yet, but I heard from  
one of the developers in the office that the current WOLips won't  
work with Eclipse 3.4.  :(

If you get it up and running please let me know.

1) Not sure what this means, 2) where's my bug report?

Stable does NOT work with 3.4.  Nightly does NOT work with 3.3.  So  
if you're saying that stable does not run on Eclipse 3.4, I say  
"correct."  If you're saying nightly doesn't work on Eclipse 3.4,  
then I need a bug report.


_silent suffering does not fix bugs_ (well, unless it's MY silent  
suffering :) )

But the nightly build
only contained the WOLips core component. No Maven, profiling,
whatever. I still used that. But now I don't have Entity Modeler, nor
project templates, which I thought I would have. Uhm, so what ought I
do?

Not sure what you're seeing, but I just ran the updater in 3.4:




I am considering running the stable build update over the nightly,
and asking it to only installed components that are not up to date?
Will that work, or will I be forever cursed?
I always recommend that people stay on stable unless you know what  
you're getting yourself into.  DO NOT try to do that funnybusiness  
with mixing stable and nightly. it WILL NOT work and will cause  
terrible problems.  I don't know if it will even let you, but if it  
does, don't try it.


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/flor385% 
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 [EMAIL PROTECTED]


Which WOLips???

2008-08-11 Thread Florijan Stamenkovic

Hi all,

I am trying to get the latest WOLips. I have Eclipse 3.4 installed.  
The WOLips site archives are broken, as Mike pointed out. So I tried  
updating from Eclipse directly. The stable build in the repository  
contains WOLips 3.3.x. So I turned to nightly. 3.4.x, believing that  
I need WOLips 3.4 to work with Eclipse 3.4. But the nightly build  
only contained the WOLips core component. No Maven, profiling,  
whatever. I still used that. But now I don't have Entity Modeler, nor  
project templates, which I thought I would have. Uhm, so what ought I  
do?


I am considering running the stable build update over the nightly,  
and asking it to only installed components that are not up to date?  
Will that work, or will I be forever cursed?


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

This email sent to [EMAIL PROTECTED]


Re: [OT] FrontBase problem when copying databases

2008-08-11 Thread Florijan Stamenkovic
I asked them about the architecture independence point actually...  
Here's the reply they gave:


"We did look into making the database and backup files binary  
compatible across different endian platforms a while back.
We concluded that the implementation would be "very" non-trivial and  
introduce a performance hit on one platform due
to a large amount of byte swapping. But since the PPC platform is  
dead the advantage gained by this feature will diminish.
Therefore putting the required manpower into this does not make much  
since."


F

On Aug 10, 2008, at 23:15, Mike Schrag wrote:


1. The resulting script.sql uses absolute pathnames for data files
This one drives me crazy, though a perl -pi -e can fix it pretty  
easily.



2. If anything relevant already exists in the db the script will fail

Both can be worked around, but it makes the process more tedious  
then just reverting to a backup. I will keep the points you make  
in mind though.
.. and also I THINK that the ascii dump is not transaction-safe  
like "write backup" is.  I've never understood why FB doesn't  
either write an architecture independent backup format or at the  
very least support reading in both architectures in the event that  
writing architecture independent is too expensive.  I would LOVE to  
just have a mysql-style SQL script dump format (that is transaction  
safe).  I'm sure they have good reasons why they didn't but it  
would be really nice.


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/flor385% 
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 [EMAIL PROTECTED]


Re: [OT] FrontBase problem when copying databases

2008-08-10 Thread Florijan Stamenkovic
I see what you're saying, but I don't like the sql ascii dump for the  
following reasons:


1. The resulting script.sql uses absolute pathnames for data files
2. If anything relevant already exists in the db the script will fail

Both can be worked around, but it makes the process more tedious then  
just reverting to a backup. I will keep the points you make in mind  
though.


Thanks,
Flor

On Aug 09, 2008, at 16:28, Hugi Thordarson wrote:

Just a note: If you like your backups to be permanent, you might  
want to consider using "write all output" for all your FB backups  
rather than "write data". As Dave, in his widely acknowledged  
infinite wisdom, points out, write data has endian issues - and it  
also has version issues. For example, I recently had to dig out a  
G4 machine and install FrontBase 3 to restore an old backup created  
using "write data" (and even though using legacy hardware to  
restore old backups is fun in a nerdish kind of way, I'm too lazy  
to do it again, so I switched :-).


- hugi




On 9.8.2008, at 15:13, Florijan Stamenkovic wrote:


Yup, testing seems to confirm it, it is an endian issue.

Thanks David for the pointer,

F

On Aug 09, 2008, at 09:58, David Holt wrote:


Hi Flor,

This may be too obvious, but are you copying from PowerPC to  
Intel by any chance? If so, you need to do the backup as a "WRITE  
ALL OUTPUT ..." and restore on the other machine by running the  
script. Because of endian issues you cannot go between  
architectures using backup.


David

On 9-Aug-08, at 6:46 AM, Florijan Stamenkovic wrote:


Hi all,


I apologize for the off topic post, but neither google nor the  
FrontBase mailing list helped with this, so I figured I'd ask  
here, maybe somebody will be able to advise.


I am trying to port database from one computer to another. I am  
trying to do that by exporting backups, copying the backup to  
another computer, and restoring from that computer. However, I  
get a message:


Wrong magic number - not a backup file
Failed to restore...

Could someone point out to what "magic number" refers to, and  
how to work around this?


Or, if there is a better way to copy databases to and fro? An  
ASCII SQL dump is a pain, for multiple reasons.


Thanks,
Flor
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ 
programmingosx%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/hugi% 
40karlmenn.is


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 [EMAIL PROTECTED]


Re: [OT] FrontBase problem when copying databases

2008-08-09 Thread Florijan Stamenkovic

Yup, testing seems to confirm it, it is an endian issue.

Thanks David for the pointer,

F

On Aug 09, 2008, at 09:58, David Holt wrote:


Hi Flor,

This may be too obvious, but are you copying from PowerPC to Intel  
by any chance? If so, you need to do the backup as a "WRITE ALL  
OUTPUT ..." and restore on the other machine by running the script.  
Because of endian issues you cannot go between architectures using  
backup.


David

On 9-Aug-08, at 6:46 AM, Florijan Stamenkovic wrote:


Hi all,


I apologize for the off topic post, but neither google nor the  
FrontBase mailing list helped with this, so I figured I'd ask  
here, maybe somebody will be able to advise.


I am trying to port database from one computer to another. I am  
trying to do that by exporting backups, copying the backup to  
another computer, and restoring from that computer. However, I get  
a message:


Wrong magic number - not a backup file
Failed to restore...

Could someone point out to what "magic number" refers to, and how  
to work around this?


Or, if there is a better way to copy databases to and fro? An  
ASCII SQL dump is a pain, for multiple reasons.


Thanks,
Flor
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ 
programmingosx%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 [EMAIL PROTECTED]


[OT] FrontBase problem when copying databases

2008-08-09 Thread Florijan Stamenkovic

Hi all,


I apologize for the off topic post, but neither google nor the  
FrontBase mailing list helped with this, so I figured I'd ask here,  
maybe somebody will be able to advise.


I am trying to port database from one computer to another. I am  
trying to do that by exporting backups, copying the backup to another  
computer, and restoring from that computer. However, I get a message:


Wrong magic number - not a backup file
Failed to restore...

Could someone point out to what "magic number" refers to, and how to  
work around this?


Or, if there is a better way to copy databases to and fro? An ASCII  
SQL dump is a pain, for multiple reasons.


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

This email sent to [EMAIL PROTECTED]


  1   2   3   4   >