OpenBase / boolean / ERPrototypes

2009-03-07 Thread Ricardo J. Parada
Hi All,There seems to be something wrong with booleans when using OpenBase and ERPrototypes.In OpenBaseManager the column type for my column says boolean:In openisql (command line) I can query like this:select count(*) from cliente where suspendido = trueof like this:select count(*) from cliente where suspendido = 1In entity modeler, if I configure my attribute using the boolean prototype from ERPrototypes as shown below, then the queries don't return the right number of rows.  The update statements generated by EOF don't work either (even though they look right).  If I model my attribute as an integer then the queries work okay and the update statements issued by EOF work too.  By I don't like having an Integer in my accessor methods in my EO for a boolean column.  I want to use boolean.Looking at the screenshot below, does this look like the boolean prototype is setting the fields correctly for a boolean column in OpenBase? Anybody wants to guess?  Anybody using booleans in OpenBase and ERPrototypes? ___
Do not post admin requests to the list. They will 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: ERXEC EOEditingContext in background thread

2009-03-07 Thread Jeff Schmitz
It locked up again, but I have another clue.  Frontbase is outputting  
the following error message every 10 seconds.


2009-03-07 22:17:28 [13295] fssAccept: Accept failed (24): Too many  
open files


Also, the current state of the thread in top:
  PID COMMAND  %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD   
RSIZE  VSIZE
13592 java   0.0% 12:00.76  30   479293  679M 
23M   693M  1782M


And lsof -p 13592 gives a TON of these:

java13592 netBrackets  216u  IPv6 0xa5be984   0t0  TCP [:: 
127.0.0.1]:60567->[::127.0.0.1]:56748 (ESTABLISHED)


Why all the connections?

Jeff

On Mar 7, 2009, at 8:03 PM, Kieran Kelleher wrote:

IIRC, you have to do your own lock/unlock in regular background  
threads . I always do  anyway .


ec.lock();
try {
//do stuff
} catch (Exception e) {
// handle
} finally {
ec.unlock();
}













On Mar 7, 2009, at 8:04 PM, Jeff Schmitz wrote:


Hello,
   Below is my setup for executing a background thread with its own  
EOObjectStoreCoordinator and its own EOEdtingContext.  Note that  
I'm using ERXEC to create the EOEditingContext, and have the below  
properties set.  Also note that I don't do lock or unlock as I  
understand that ERXEC does this for you.  Is this correct?  Is it  
ok to use this in a thread?  The reason I ask is that I can kick  
off the thread and not touch my app in any other way, and more  
often than not the calculations will hang after about 15 minutes as  
if its deadlocked.  However I haven't been able to repeat the error  
with lock logging on yet.  Could it have something to do with the  
Session timing out during processing?  Or is there something else I  
don't have quite right?


er.extensions.ERXApplication.useEditingContextUnlocker=true
er.extensions.ERXEC.defaultAutomaticLockUnlock=true
er.extensions.ERXEC.useSharedEditingContext=false
er.extensions.ERXEC.defaultCoalesceAutoLocks=true
er 
.extensions 
.ERXEnterpriseObject.applyRestrictingQualifierOnInsert=true

er.extensions.ERXEnterpriseObject.updateInverseRelationships=true

public static void updateResults() {

   //Do lots of loops
   while (...) {
   resultsObjectStore = new EOObjectStoreCoordinator();
   resultsEC = ERXEC.newEditingContext(resultsObjectStore);

   //Do lots of processing.

   resultsEC.saveChanges();

   //Free up the memory, nothing will be reused in next loop anyway.
   resultsEC.dispose();
   resultsObjectStore.dispose();
   resultsObjectStore = new EOObjectStoreCoordinator();
   resultsEC = ERXEC.newEditingContext(resultsObjectStore);

   }
}

public static void updateResultsThread() {
   t = new Thread("updateResults") {
  public void run() {
 updateResults();
  }
   };
   t.start();
}


Thanks!
Jeff
___
Do not post admin requests to the list. They will 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 kieran_li...@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

ERXEC EOEditingContext in background thread

2009-03-07 Thread Jeff Schmitz

Hello,
   Below is my setup for executing a background thread with its own  
EOObjectStoreCoordinator and its own EOEdtingContext.  Note that I'm  
using ERXEC to create the EOEditingContext, and have the below  
properties set.  Also note that I don't do lock or unlock as I  
understand that ERXEC does this for you.  Is this correct?  Is it ok  
to use this in a thread?  The reason I ask is that I can kick off the  
thread and not touch my app in any other way, and more often than not  
the calculations will hang after about 15 minutes as if its  
deadlocked.  However I haven't been able to repeat the error with lock  
logging on yet.  Could it have something to do with the Session timing  
out during processing?  Or is there something else I don't have quite  
right?


er.extensions.ERXApplication.useEditingContextUnlocker=true
er.extensions.ERXEC.defaultAutomaticLockUnlock=true
er.extensions.ERXEC.useSharedEditingContext=false
er.extensions.ERXEC.defaultCoalesceAutoLocks=true
er.extensions.ERXEnterpriseObject.applyRestrictingQualifierOnInsert=true
er.extensions.ERXEnterpriseObject.updateInverseRelationships=true

public static void updateResults() {

   //Do lots of loops
   while (...) {
   resultsObjectStore = new EOObjectStoreCoordinator();
   resultsEC = ERXEC.newEditingContext(resultsObjectStore);

   //Do lots of processing.

   resultsEC.saveChanges();

   //Free up the memory, nothing will be reused in next loop anyway.
   resultsEC.dispose();
   resultsObjectStore.dispose();
   resultsObjectStore = new EOObjectStoreCoordinator();
   resultsEC = ERXEC.newEditingContext(resultsObjectStore);

   }
}

public static void updateResultsThread() {
   t = new Thread("updateResults") {
  public void run() {
 updateResults();
  }
   };
   t.start();
}


Thanks!
Jeff
 ___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Kieran Kelleher
I have been using Role Based access control mixed with Privileges (on/ 
off canViewThis, canEditThat, etc.), but I always get the feeling  
there is better ways to do this security stuff ... anyone care to  
share their user security strategies in terms of access to pages,  
parts of pages and objects in WebObjects apps?


On Mar 7, 2009, at 12:48 PM, Mike Schrag wrote:

well, wherever ... awake possibly, or whenever your auth code runs  
to check for ACL's at the top of each request.


___
Do not post admin requests to the list. They will 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: Reference Lib JARs Not Recognized

2009-03-07 Thread Drew Thoeni

David,

This does help. I actually, normally, do it this way, but at one point  
in the past I was discussing having the right frameworks on the  
production servers (keep in mind, I'm small time compared to most  
people on this list) and someone suggested that for the less-used  
JARs, I add them to the project so they get moved as part of the  
project.


Am I misunderstanding that?

Or, is it generally considered better form to just keep the frameworks  
all current on production machines (even for the rarely used ones)?


Best,

Drew

On Mar 6, 2009, at 11:04 AM, David Avendasora wrote:


Hi Drew,

You are _really_ doing things the hard way. Adding Frameworks to  
your projects is much, much easier than adding individual .jars to  
your project's Libraries folder.


1) Download the latest Wonder Frameworks, unzip the archive and add  
all the FrameworkName.framework directories to your /Library/ 
Frameworks directory.


2) In Eclipse, right-click on your project, Select Build Path ->  
Configure Build Path...


3) Click on the Libraries tab

4) On the right side, click "Add Libraries..."

5) Select "WebObjects Frameworks", click Next

6) Go through the list and select the Frameworks you need

7) Click Finish

8) Click Okay

All those frameworks have now been added to your project and you  
don't have to add individual .jar files as they are included in the  
Frameworks you just linked.


The only thing I ever actually add to my Project's "Libraries"  
folder (then add to my build path so they show up under "Referenced  
Libraries") are stand-alone .jars for libraries *other than*  
WebObjects/WOnder frameworks.


I hope this helps!

Dave


On Mar 2, 2009, at 5:25 PM, Drew Thoeni wrote:


Screen shots. Good idea.

You can see in this screen shot ERExtensions.jar is in the  
"Referenced Libraries" having gotten there by me 1) putting the JAR  
in the file system folder "Libraries" and then adding it to the  
Java Build Path using project properties and selecting "Add JARs"  
and picking this JAR from the project's "Libraries" folder.


Interestingly, the imports in other classes for org.jfree are  
working fine and I assume are referencing the JARs in the  
"Referenced Libraries" folder.


Thanks again,

Drew



On Mar 2, 2009, at 2:51 PM, Chuck Hill wrote:



On Mar 1, 2009, at 3:46 PM, Drew Thoeni wrote:

Checked that and it seems OK. Your earlier post on that was  
helpful as com.webobjects was not being resolved. Adding the  
properties file corrected that issue.


In this case, my project actually shows the JAR as part of the  
Referenced Libraries,


Not sure what you are referring to there.


if I remove it, it shows back up in "Libraries" as part of the  
project.


On the Build Path tab of the Properties?


It is, in fact in the Libraries folder and its behavior is as  
expected. But, the classes are still not resolved.


Maybe some screen shots of what you have setup might help.  If   
they are in the Libraries folder of the same project it should not  
be a path issue.



Chuck


On Mar 1, 2009, at 2:45 PM, Chuck Hill wrote:


Check the contents of

~/Library/Application\ Support/WOLips/wolips.properties


On Mar 1, 2009, at 7:53 AM, Drew Thoeni wrote:

I just did the big upgrade from Eclipse 3.3 to the 3.4.2 with  
WOLips installed fresh.


I added the WO frameworks (as com.webobjects) was not resolved  
but am still having difficulties getting JARs in my Referenced  
Libraries to resolve.


Example:

I have ERExtensions.jar in Referenced Libraries but "import  
er.extensions.localization.ERXLocalizer;" is not resolved. This  
strikes me as a path problem, but project properties point to  
the correct location.


Any help is appreciated.

Best,

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

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



--
Chuck Hill Senior Consultant / VP Development

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

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











--
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/webobjects%40avendasora.com

This email sent to webobje...@avendasora.com




__

Re: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna


On 07/mar/09, at 19:32, Chuck Hill wrote:

I used to do that nasty EC stuff as I could not see another way.   
Now that I have found ThreadLocal religion, I never use that  
malignant hack.  I think of the information stashed in the thread as  
an ExecutionContext (similar to a WOContext).  That feels like the  
"right" solution to this common need.  I've even created an object  
to aggregate the bits under one object.  This is also very useful  
for recording things like user activity (set into the thread /  
execution context by the UI component) so that you you can not only  
record who and what and when, but why as well.


ThreadLocal (ERXThreadStorage).  Good stuff!


Lucky I have you guys then... I rearranged the code a bit and it's  
working like a charm. Hail to ERXThreadStorage then... a newly digged  
out fanta-tool of this never ending source of help that was wisely  
called "Wonder". ;)


rdm

___
Do not post admin requests to the list. They will 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


[OT] Generic search component UI

2009-03-07 Thread Stamenkovic Florijan

Hi all,


I am thinking of implementing a generic search component on top of  
JBND's qualification system. However, I am having trouble visualizing  
a really good, user friendly interface for such a component. The main  
problem: AND and OR qualifiers. I am looking for good ways to handle  
their creation, manipulation, and display. This is intended for end  
users defining complex searches, so I need it both easy to use and  
powerful and flexible. So, if anyone has a pointer to some app that  
does a good job of handling those, please let me know.


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


Re: Finding eomodels in Eclipse/WOLips

2009-03-07 Thread Ricardo J. Parada
Thanks... It doesn't open in its own separate window though as it  
should because I have the preference "[ √ ] Open Entity MOdeler in  
New Window" checked.


I have to double click on the demodel directly in the Resources folder  
in the WO Explorer view in order for it to open in a separate window.


Anyways, thanks for the advise, it's definitely a lot more efficient  
than what I was doing before.


:-)


On Mar 7, 2009, at 2:08 PM, David LeBer wrote:


On 7-Mar-09, at 2:00 PM, Mike Schrag wrote:

I do Command+Shift+R in Eclipse and then type the model name and  
it doesn't find it.


Is there a way to configure Eclipse so that if finds my eomodels  
instead of having to hunt them down in the package explorer view  
with a zillion projects in it?  I would think there is a way.
right now, no ... the best you can do is type index.eomodeld  
probably in cmd-shift-r and go through the list to see what folder  
it's in ... eomodels are folders, and folders aren't considered  
"openable" items in Eclipse (the support that's there in wolips is  
hacked in).



Alternately, the .eomodel for any EO class will show up in it's  
related view. So searching and selecting an EO class associated with  
the .eomodel and then opening the model from the related view. An  
extra click I know but...


;david

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




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


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


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

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


Re: Finding eomodels in Eclipse/WOLips

2009-03-07 Thread David LeBer

On 7-Mar-09, at 2:00 PM, Mike Schrag wrote:

I do Command+Shift+R in Eclipse and then type the model name and it  
doesn't find it.


Is there a way to configure Eclipse so that if finds my eomodels  
instead of having to hunt them down in the package explorer view  
with a zillion projects in it?  I would think there is a way.
right now, no ... the best you can do is type index.eomodeld  
probably in cmd-shift-r and go through the list to see what folder  
it's in ... eomodels are folders, and folders aren't considered  
"openable" items in Eclipse (the support that's there in wolips is  
hacked in).



Alternately, the .eomodel for any EO class will show up in it's  
related view. So searching and selecting an EO class associated with  
the .eomodel and then opening the model from the related view. An  
extra click I know but...


;david

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




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

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


Re: Finding eomodels in Eclipse/WOLips

2009-03-07 Thread Mike Schrag
I do Command+Shift+R in Eclipse and then type the model name and it  
doesn't find it.


Is there a way to configure Eclipse so that if finds my eomodels  
instead of having to hunt them down in the package explorer view  
with a zillion projects in it?  I would think there is a way.
right now, no ... the best you can do is type index.eomodeld probably  
in cmd-shift-r and go through the list to see what folder it's in ...  
eomodels are folders, and folders aren't considered "openable" items  
in Eclipse (the support that's there in wolips is hacked in).


ms

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

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


Finding eomodels in Eclipse/WOLips

2009-03-07 Thread Ricardo J. Parada


I do Command+Shift+R in Eclipse and then type the model name and it  
doesn't find it.


Is there a way to configure Eclipse so that if finds my eomodels  
instead of having to hunt them down in the package explorer view with  
a zillion projects in it?  I would think there is a way.


:-)

Thanks

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

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


Re: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Chuck Hill


On Mar 7, 2009, at 8:34 AM, Mike Schrag wrote:

You are right there. But the value is only stored for inspection.  
Nothing depends on it and it's only to satisfy my client that  
want's to know who wrote/modified what (it's an online newspaper).  
In other words it is perfectly fine for it to be empty if I ever  
used it from outside of my webapp. If it where only for the  
timestamp I could rely on specific db features like MySQL's ability  
to auto set the timestamp. But I need the user as well.


How does ERXThreadStorage work? What can I assume to be in the same  
thread?
Whatever you put in it ... It's a ThreadLocal place to shove data,  
so you can push the current user (or current user GID) into it.  You  
really shouldn't access the Session from model classes, it's just  
bad form and eventually there's good odds you're going to regret  
it.  Also, putting the current user into ERXThreadStorage means that  
you don't have to worry about other code making new editing contexts  
where your state isn't setup.  I've seen several people subclassing  
EC's to add custom app state, but for me, it misrepresents what an  
EC's role is, and invariably leads to weird issues (like the local  
instancing into other ec's, etc).



I used to do that nasty EC stuff as I could not see another way.  Now  
that I have found ThreadLocal religion, I never use that malignant  
hack.  I think of the information stashed in the thread as an  
ExecutionContext (similar to a WOContext).  That feels like the  
"right" solution to this common need.  I've even created an object to  
aggregate the bits under one object.  This is also very useful for  
recording things like user activity (set into the thread / execution  
context by the UI component) so that you you can not only record who  
and what and when, but why as well.


ThreadLocal (ERXThreadStorage).  Good stuff!

Chuck


--
Chuck Hill Senior Consultant / VP Development

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

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






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

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


Re: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Mike Schrag
My question is rather about the scope of the thread. The docs speak  
of "scope of a thread handling a particular request". It dies on  
each request so you are implying that I should populate it with my  
data on a session "awake" call for example?
well, wherever ... awake possibly, or whenever your auth code runs to  
check for ACL's at the top of each request.


___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna


On 07/mar/09, at 17:34, Mike Schrag wrote:
Whatever you put in it ... It's a ThreadLocal place to shove data,  
so you can push the current user (or current user GID) into it.  You  
really shouldn't access the Session from model classes, it's just  
bad form and eventually there's good odds you're going to regret  
it.  Also, putting the current user into ERXThreadStorage means that  
you don't have to worry about other code making new editing contexts  
where your state isn't setup.  I've seen several people subclassing  
EC's to add custom app state, but for me, it misrepresents what an  
EC's role is, and invariably leads to weird issues (like the local  
instancing into other ec's, etc).


Yes I can see your point there. I can't really force every line of  
code not to use my EC. Like for instance all the mess I wrote to  
detect/climb the parentObjectStores.
BTW... don't bother to answer my question 2 on my previous msg. I  
already stumbled in the obvious. Having nested the contexts means that  
when I save, data is not propagated to the db as it sits waiting for  
the original ec to be saved as well. And that's clearly not feasible.


My question is rather about the scope of the thread. The docs speak of  
"scope of a thread handling a particular request". It dies on each  
request so you are implying that I should populate it with my data on  
a session "awake" call for example?


rdm
___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Mike Schrag
You are right there. But the value is only stored for inspection.  
Nothing depends on it and it's only to satisfy my client that want's  
to know who wrote/modified what (it's an online newspaper). In other  
words it is perfectly fine for it to be empty if I ever used it from  
outside of my webapp. If it where only for the timestamp I could  
rely on specific db features like MySQL's ability to auto set the  
timestamp. But I need the user as well.


How does ERXThreadStorage work? What can I assume to be in the same  
thread?
Whatever you put in it ... It's a ThreadLocal place to shove data, so  
you can push the current user (or current user GID) into it.  You  
really shouldn't access the Session from model classes, it's just bad  
form and eventually there's good odds you're going to regret it.   
Also, putting the current user into ERXThreadStorage means that you  
don't have to worry about other code making new editing contexts where  
your state isn't setup.  I've seen several people subclassing EC's to  
add custom app state, but for me, it misrepresents what an EC's role  
is, and invariably leads to weird issues (like the local instancing  
into other ec's, etc).


ms

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

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


Re: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Chuck Hill


On Mar 7, 2009, at 5:02 AM, Mike Schrag wrote:


ERXThreadStorage in Wonder is an option


+1

This is my preferred method of passing around such information.

Chuck


... you don't want to tie your model to your WO layer -- if you ever  
want to use your model outside of a web app, it's going to be a huge  
pain


On Mar 7, 2009, at 7:52 AM, Riccardo De Menna wrote:


Also...

What's the best place to add the code for the update of the  
timestamp?


I'm not supposed to change anything about an EO in  
validateForOperation methods so that rules out validateForSave().


I can use validateTimestamp()... but that means that the object is  
always saved even if nothing has changed since the timestamp is  
always different.


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

This email sent to msch...@mdimension.com



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

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



--
Chuck Hill Senior Consultant / VP Development

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

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






___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Jérémy DE ROYER

We use it without problems since 2 years

But we neither use D2W nor Wonder (except for Ajax) nor nested  
context (as far as I know).


We only use adaptated Chuck's ValidatingEditingContext and  
EOStateTransition that rocks.


Jérémy

P.S. : many thanks to Chuck's book.

Le 7 mars 09 à 17:09, Riccardo De Menna a écrit :

Ok... as suggested by Jérémy I injected my own editing context  
using wonder's factory.
I now have a nice place to store my session object directly into  
the context.


Question 1: Can you foresee any problems in my editing context  
holding a reference to the session? Could it cause garbage  
collection delays or stuff like that?


... let's go on I have another question coming :)

Now I placed all this in my code and I still don't get the desired  
result. That's because my objects are being fumbled by Wonder D2W  
pages. And as I find out, at the time of pressing the "edit" or  
"inspect" button, wonder makes his own context and pulls a local  
instance of the edited object in it.
So hey... if the guys wrote it like that there must be a good  
reason. The following comment from Anjo made me laugh:


//CHECKME ak: I don't remember why we would use a local instance  
when we just want to inspect...


Anyway... skipping over the Inspect stuff, when it comes to the  
Edit, scrolling through the code I found that there was a binding I  
could stick in my rules file to force wonder to at least nest his  
new context into mine. So I added "useNestedEditingContext" and  
"useExistingEditingContext" in my rules and changed my code to  
climb the hierarchy of the parentObjectStore() and it now works.


Question 2: What are the implications of having turned on the  
nested contexts? Am I going to face some weird undetectable issue  
in the near future that will make me regret this choice?


thx,
rdm


On 07/mar/09, at 14:04, Jérémy DE ROYER wrote:


Hi,

We do superclass the EOEditingContext according to Chuck's method  
with his ValidatingEditingContext.

When créating the "new" editing context, we pass our Session.
So it's easy to get the session from a enterprise object :  
this.editingContext().getSession().


public Session() {
super();
setDefaultEditingContext(new ValidatingEditingContext(this));
}

Jérémy


Jérémy DE ROYER, tél 02 38 43 45 86

--

INGENCYS, Conseil & Ingénierie en Systèmes d'Information

- e-Commerce & Internet,
- Cartographie & Géolocalisation
- CRM & Gestion de la Relation Client
- Processus, Documents & Qualité

ORLEANS - CHARTRES - LE MANS

http://www.ingencys.net/


___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna
Ok... as suggested by Jérémy I injected my own editing context using  
wonder's factory.
I now have a nice place to store my session object directly into the  
context.


Question 1: Can you foresee any problems in my editing context holding  
a reference to the session? Could it cause garbage collection delays  
or stuff like that?


... let's go on I have another question coming :)

Now I placed all this in my code and I still don't get the desired  
result. That's because my objects are being fumbled by Wonder D2W  
pages. And as I find out, at the time of pressing the "edit" or  
"inspect" button, wonder makes his own context and pulls a local  
instance of the edited object in it.
So hey... if the guys wrote it like that there must be a good reason.  
The following comment from Anjo made me laugh:


//CHECKME ak: I don't remember why we would use a local instance  
when we just want to inspect...


Anyway... skipping over the Inspect stuff, when it comes to the Edit,  
scrolling through the code I found that there was a binding I could  
stick in my rules file to force wonder to at least nest his new  
context into mine. So I added "useNestedEditingContext" and  
"useExistingEditingContext" in my rules and changed my code to climb  
the hierarchy of the parentObjectStore() and it now works.


Question 2: What are the implications of having turned on the nested  
contexts? Am I going to face some weird undetectable issue in the near  
future that will make me regret this choice?


thx,
rdm


On 07/mar/09, at 14:04, Jérémy DE ROYER wrote:


Hi,

We do superclass the EOEditingContext according to Chuck's method  
with his ValidatingEditingContext.

When créating the "new" editing context, we pass our Session.
So it's easy to get the session from a enterprise object :  
this.editingContext().getSession().


public Session() {
super();
setDefaultEditingContext(new ValidatingEditingContext(this));
}

Jérémy

___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Johann Werner
The best place for that sort of modification tracking is willUpdate in  
ERXGenericRecord if you are using Wonder (and you should ;-)


jw

Am 07.03.2009 um 13:52 schrieb Riccardo De Menna:


Also...

What's the best place to add the code for the update of the timestamp?

I'm not supposed to change anything about an EO in  
validateForOperation methods so that rules out validateForSave().


I can use validateTimestamp()... but that means that the object is  
always saved even if nothing has changed since the timestamp is  
always different.


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

This email sent to j...@oyosys.de





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

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

Re: WebObjects Installer CD for Windows

2009-03-07 Thread Frank Stock
This is working now, but only installs 5.3.3. Is there a way to change  
this 5.4.3.



Op 6-mrt-09, om 22:38 heeft John Ours het volgende geschreven:



On Mar 6, 2009, at 4:26 PM, Q wrote:



I think the problem you are having is that you cannot use -cp and - 
jar at the same time.




Q is correct.  You want to use something like this (which works for  
me):


java -cp wo.jar;woinst.jar run

That is "start java with wo and woinst on the class path, and  
execute the class called run"


Have fun!

John



___
Do not post admin requests to the list. They will 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: WebObjects Installer CD for Windows

2009-03-07 Thread Frank Stock
I did a test and this is working, not the first time, but the seond  
time I've tried.


Thanks
Op 6-mrt-09, om 22:26 heeft Q het volgende geschreven:



I think the problem you are having is that you cannot use -cp and - 
jar at the same time.


If all you are trying to do is install the WO runtime on windows,  
just use WOInstall from wonder (attached) and do this:


java -jar WOInstall.jar 5.4.3 C:\Apple

You will then want to set the following system environment variables  
(In My Computer::Properties I think)


NEXT_ROOT=C:\Apple
NEXT_LOCAL_ROOT=C:\Apple\Local
NEXT_SYSTEM_ROOT=C:\Apple

Then install and run eclipse+wolips



On 07/03/2009, at 12:45 AM, Markus Ruggiero wrote:

First, you have the arguments in the wrong order. But then it does  
not work anyway. I am in the very same boat as you. All my WO  
development is on MacOSX but I am also teaching. My (Java-) class  
could pick a topic for a special week in April - and they wanted to  
do some Web-App with a DB. They pick the subject - but I pick the  
tools! Now I have to get WO/WOlips up and running on Windows XP and  
Vista. I also tried the installer and got a bit further. The wizard  
starts but after all questions have been answered instead of doing  
its job it crashes. See the attached screenshot. I already asked  
Don but have not yet received an answer to this particular issue.


---markus---




On 05.03.2009, at 20:37, Frank Stock wrote:


Hi,

I am testing the install for my students who are working on  
Windows, but  after


 java -jar ./wo.jar -cp ./woinst.jar


 I get:

The wizard cannot continue because of the following error: Invalid  
command line option: cp is not supported (1001) (403)


I am not used to work on Windows (Happy Mac-user), but I need a  
simple install to teach my students WO.

At school we work on Mac.


Tahnks,
Frank


Hello;

All you needed was ant.jar.  I have included this in the woinst.jar.
Redownload the file and the install should run.   I have modified  
the

text in the installer for Eclipse to read 3.4 but did not compile or
upload it.

Thanks

Don
On Mar 2, 2009, at 6:52 AM, Markus Ruggiero wrote:


Oops, forgot the screenshot


On 26.02.2009, at 20:45, Don Lindsay wrote:


Hello;

I have updated the installer to pull the Eclipse version 3.4.  It
looks like WOInstaller.jar may be broken which would break this
installer until it is remedied.

To run the installer get the file wo.jar and woinst.jar from 
http://web.me.com/pccdonl/woinst.jar
and web.me.com/pccdonl/wo.jar

at a command prompt type in:

java -jar ./wo.jar -cp ./woinst.jar

Follow the instructions to install the software.

Thanks

Don

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

This email sent to mar...@ruggiero.ch


Markus Ruggiero
rucotec consulting and technologiesemail 
mailto:markus.ruggi...@rucotec.ch
rucotec GmbH   web   http:// 
www.rucotec.ch

Steinentorstrasse 8
4051 Basel Mobile+41 (0)79 508 4701
SwitzerlandPhone/Fax +41 (0)61 271 4990


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

This email sent to qdo...@gmail.com




--
Seeya...Q

Quinton Dolan - qdo...@gmail.com
Gold Coast, QLD, Australia (GMT+10)
Ph: +61 419 729 806





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

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

Re: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna


On 07/mar/09, at 14:02, Mike Schrag wrote:

ERXThreadStorage in Wonder is an option ... you don't want to tie  
your model to your WO layer -- if you ever want to use your model  
outside of a web app, it's going to be a huge pain


You are right there. But the value is only stored for inspection.  
Nothing depends on it and it's only to satisfy my client that want's  
to know who wrote/modified what (it's an online newspaper). In other  
words it is perfectly fine for it to be empty if I ever used it from  
outside of my webapp. If it where only for the timestamp I could rely  
on specific db features like MySQL's ability to auto set the  
timestamp. But I need the user as well.


How does ERXThreadStorage work? What can I assume to be in the same  
thread?


rdm
___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Jérémy DE ROYER

Hi,

We do superclass the EOEditingContext according to Chuck's method  
with his ValidatingEditingContext.


When créating the "new" editing context, we pass our Session.

So it's easy to get the session from a enterprise object :  
this.editingContext().getSession().



public Session()
{
super();

setDefaultEditingContext(new ValidatingEditingContext(this));
}

Jérémy

Le 7 mars 09 à 13:37, Riccardo De Menna a écrit :


Hi folks,

I've encountered this issue (or similar ones) very often now and  
I'd love to know how others tackle the problem.


I have implemented a standard way of adding a special timestamp to  
all my records in my TGenericRecord (subclass of EOGenericRecord,  
superclass of all my eo). The timestamp holds information on when a  
record was last modified as well as who did it.
To do this I need to query my session for something like a  
"currentUser" method inside the validateTimestamp method of my eo...


Is there a way to climb up to the Session from an EO?

One possible (failed) attempt:

One first clumsy attempt of mine was to override  
defaultEditingContext() in my Session object and setting the ec  
delegate object to the session itself before returning it. Then  
from the eo I would ask for the ec.delegate() and get the session  
back.
Should work in theory, even though I dislike the fact that I use  
the delegate() that's meant for other things. In practice it  
doesn't...
When I factor in my D2W pages my eo don't have the same ec I passed  
in at factory creation time and so there's no session there.


Am I blind? Is there a fast an easy way to do it?

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


This email sent to jeremy.dero...@ingencys.net



___
Do not post admin requests to the list. They will 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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Mike Schrag
ERXThreadStorage in Wonder is an option ... you don't want to tie your  
model to your WO layer -- if you ever want to use your model outside  
of a web app, it's going to be a huge pain


On Mar 7, 2009, at 7:52 AM, Riccardo De Menna wrote:


Also...

What's the best place to add the code for the update of the timestamp?

I'm not supposed to change anything about an EO in  
validateForOperation methods so that rules out validateForSave().


I can use validateTimestamp()... but that means that the object is  
always saved even if nothing has changed since the timestamp is  
always different.


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

This email sent to msch...@mdimension.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: Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna

Also...

What's the best place to add the code for the update of the timestamp?

I'm not supposed to change anything about an EO in  
validateForOperation methods so that rules out validateForSave().


I can use validateTimestamp()... but that means that the object is  
always saved even if nothing has changed since the timestamp is always  
different.


rdm
___
Do not post admin requests to the list. They will 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


Digging up a Session object from an EOGenericRecord

2009-03-07 Thread Riccardo De Menna

Hi folks,

I've encountered this issue (or similar ones) very often now and I'd  
love to know how others tackle the problem.


I have implemented a standard way of adding a special timestamp to all  
my records in my TGenericRecord (subclass of EOGenericRecord,  
superclass of all my eo). The timestamp holds information on when a  
record was last modified as well as who did it.
To do this I need to query my session for something like a  
"currentUser" method inside the validateTimestamp method of my eo...


Is there a way to climb up to the Session from an EO?

One possible (failed) attempt:

One first clumsy attempt of mine was to override  
defaultEditingContext() in my Session object and setting the ec  
delegate object to the session itself before returning it. Then from  
the eo I would ask for the ec.delegate() and get the session back.
Should work in theory, even though I dislike the fact that I use the  
delegate() that's meant for other things. In practice it doesn't...
When I factor in my D2W pages my eo don't have the same ec I passed in  
at factory creation time and so there's no session there.


Am I blind? Is there a fast an easy way to do it?

rdm
___
Do not post admin requests to the list. They will 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