Re: Basic question - lightweight to-one relationship from entity to POJO/enum

2010-04-15 Thread Sacha Michel Mallais
t;>>> another table to figure out what that fk happens to be.  It sounds like 
>>>> you're arguing against enumeration entities now (^_^)
>>> 
>>> But said DBA will then commence whining about non-normalized data.
>>> 
>>> 
>>>> 
>>>>> 
>>>>> At least that's what I hear in my head whenever I think about it.
>>>>> 
>>>>> cue: Chuck.
>>>>> 
>>>>> Dave
>>>>> 
>>>>> 
>>>>>>> 
>>>>>>> On Apr 8, 2010, at 4:52 AM, Mark Wardle wrote:
>>>>>>> 
>>>>>>>> Hi all, please forgive a very simple question but I'd like to create a
>>>>>>>> lightweight (non-EO) to-one relationship from an EO. I make heavy use
>>>>>>>> of D2W so I want to fulfil the WO/EOF rules and use to-one
>>>>>>>> relationship components
>>>>>>>> 
>>>>>>>> I usually create a new entity and have a genuine heavyweight EOF
>>>>>>>> relationship but I have several properties for which this seems
>>>>>>>> excessive.
>>>>>>>> 
>>>>>>>> I have an entity (FormEdssFull) which can have a visual field score
>>>>>>>> for both right and left eye.
>>>>>>>> 
>>>>>>>> Can I do this with a java enum?
>>>>>>>> 
>>>>>>>> public enum VisualAcuity {
>>>>>>>> NORMAL(0, "Normal"),
>>>>>>>> SIGNS_ONLY(1, "Signs only:"),
>>>>>>>> MODERATE(2, "Moderate"),
>>>>>>>> MARKED(3, "Marked");
>>>>>>>> 
>>>>>>>> /* insert enum constructor etc... */
>>>>>>>> }
>>>>>>>> 
>>>>>>>> and then create the appropriate accessor and mutator in the entity?
>>>>>>>> 
>>>>>>>> What do other people do in these situations?
>>>>>>>> 
>>>>>>>> Many thanks,
>>>>>>>> 
>>>>>>>> Mark
>>>>>>>> 
>>>>>>>> -- 
>>>>>>>> Dr. Mark Wardle
>>>>>>>> Specialist registrar, Neurology
>>>>>>>> Cardiff, UK
>>>>>>>> ___
>>>>>>>> Do not post admin requests to the list. They will 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
>>>>>>>> 
>>>>>>>> 
>>>>>>> 
>>>>>>> ___
>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>> http://lists.apple.com/mailman/options/webobjects-dev/rgurley%40mac.com
>>>>>>> 
>>>>>>> This email sent to rgur...@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/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/mark%40wardle.org
>>> 
>>> This email sent to m...@wardle.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/mschrag%40pobox.com
>> 
>> This email sent to msch...@pobox.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/sacha%40global-village.net
> 
> This email sent to sa...@global-village.net

-- 
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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


AjaxSortableList in a AjaxModalDialog

2010-04-09 Thread Sacha Michel Mallais
Anyone know what kind of incantation will get the AjaxSortableList working 
inside an AjaxModalDialog?  It seems that I can make the AMD pop up, showing 
the list ready for sorting, but when I click and drag an item and drop it 
somewhere else, the item moves back to its original place in the list and there 
is no ajax action that hits my app.

I've tried putting the AMD contents in a separate page, tried putting a form 
around the sortable list, tried putting an update area around the sortable 
list... so far, no love

Anyone have any brilliant ideas?


sacha


PS. As an aside, sortable lists do not appear to work if they have submit-able 
form controls inside the sorting repetition.  The reason appears to be that the 
repetition inside the sortable list doesn't get the new order, causing 
subsequent submits to apply the form controls to the wrong items in the list.  
If someone has a workaround for this, then I don't need a workaround for the 
above!  :-)


-- 
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

2010-03-12 Thread Sacha Michel Mallais
On Mar 12, 2010, at 10:23 AM, Chuck Hill wrote:

> On Mar 12, 2010, at 7:23 AM, Kieran Kelleher wrote:
> 
>> Hi Chuck,
>> 
>> Resurrecting this old thread
>> 
>> What do you mean by "moderate"? For example a virtual table with 20 fields, 
>> half being numbers and half being varchar255 strings, how many virtual 
>> records would be regarded as too much?
> 
> It is highly dependent on the server configuration (modern xServe vs your old 
> Mac Mini), how many tables there how, usage frequency, etc.  I'd ballpark it 
> as 30,000 to 100,000 "fields" (rows x fields per table).  There are 5 system 
> fields that need to be included.  So 100,000 / 25 = 4,000 rows.  1,200 rows 
> if you limit it at 30K fields.
> 
> All that said, Sacha recently did a lot of optimization on this (for version 
> 4.6 IIRC).  I am not sure if these numbers include that optimization.  He is 
> away on vacation until April.

The data indicated is probably the best case scenario, performance-wise.  My 
guess would be 100,000 total fields is barely usable when querying it on modern 
hardware without optimization.  There are two aspects of _unoptimized_ 
performance to be aware of:

1) in order to query the data, all the required data needs to be faulted in
2) unoptimized queries are O(n)

This is because I cheated initially and used KVC for queries instead of 
translating the query into SQL (the optimization code in SiteMaker adds the 
ability to translate the query into SQL for most queries).  Unfortunately, the 
optimization code is actually in SiteMaker, not in the VirtualTables framework 
itself, partly because SiteMaker defines new column types which need 
optimization.

Note that the current incarnation requires all row objects to be faulted in, 
even for optimized queries, so this is a limitation of all queries.  Despite 
that, if you can manage to get the optimization code from SiteMaker into your 
app, I would expect Virtual Tables to perform well under even relatively large 
data sets.


sacha


-- 
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Time is an illusion. Lunchtime doubly so. -- Douglas Adams


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

2010-03-10 Thread Sacha Michel Mallais
Hi,

Did you ever get a response to your question?  I am interested because I'm 
about to go the other way (from integer to byte 24) and would like to know a 
way to back out if necessary.

I'm also somewhat interested as to why you are going from byte 24 to integer?

BTW, if you didn't get a response, another place to try would be the FB list...

Cheers,


sacha


On Feb 18, 2010, at 2:12 PM, Fredrik Lindgren wrote:

> Does anyone have a nice way of reverting a database of BYTE 24 primary keys 
> to Integers?
> 
> /Fredrik Lindgren ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/sacha%40global-village.net
> 
> This email sent to sa...@global-village.net

-- 
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ u...@+++()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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

2010-01-26 Thread Sacha Michel Mallais
I opted to create my own WORequest class and fix only this bug there.  
So far, it is working perfectly.


Thanks,


sacha


On Jan 25, 2010, at 1:55 PM, Mike Schrag wrote:

Once you stray outside of ERXAjax*, you definitely take on  
dependencies ... I just committed a fix that removes two  
presumptions that you are inside of an ERXApplication. I would make  
sure to run your test cases if you switch over.


ms

On Jan 25, 2010, at 4:51 PM, Sacha Michel Mallais wrote:


On Jan 25, 2010, at 1:08 PM, Mike Schrag wrote:

If you're extending ERXApp, I seem to recall that we fix this  
ourselves "the hard way," though I ran into this in 5.3 as well --  
that you'd randomly get a port stuck on when you didn't want it  
(80 or 443).


In ERXRequest:



Thanks, Mike, I think that will work... we're using ERXAjaxApp,  
which apparently doesn't use ERXRequest.


Anyone know of any gotchas if I just override _createRequest in my  
Application and return an ERXRequest (like ERXApplication does)?  
Does ERXRequest play well with ERXAjaxApplication?



sacha


--
Sacha Michel Mallais Big Kahuna
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Blessed is the WO-geek, for he shall inherit from NSEarth (Jobs 3:14)






--
Sacha Michel Mallais 800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life



 ___
Do not post admin requests to the list. They will 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: AjaxUtils.redirectTo() and IE7

2010-01-26 Thread Sacha Michel Mallais

Closing off this thread.

The issue appears to be caused by using the updateContainerID binding  
of an AjaxObserverContainer with a call to AjaxUtils.redirectTo() in  
the action method of the observer.  The solution is to not use the  
binding and instead call AjaxUpdateContainer.updateContainerWithID()  
in the cases that redirectTo() is _not_ called.


Basically: updateContainerID binding + AjaxUtils.redirectTo() = pain

A related issue that interfered with my debugging attempts was a bug  
in WO that causes ":443" to be appended to some WO-generated URLs.



sacha


On Jan 12, 2010, at 10:17 AM, Sacha Michel Mallais wrote:


Hi all,

Has anyone had any issues with using AjaxUtils.redirectTo() with  
IE7?  I'm getting this error on each page that uses redirectTo() on  
IE7 (typed by hand due to IE7 lameness, please excuse typos):

---
Line: 4176
Char: 5
Error: Object doesn't support this property or method
Code: 0
URL: 
https://test.global-village.net/apps/WebObjects/SMTest.woa/wa/218.0.9.1.1.1.1
---

... and the page doesn't redirect, it just sits there, and the rest  
of the Ajax on the page no longer works.


The code I use to redirect is:
---
  public WOComponent sectionRepetitionObserverAction()
  {
  if (selectedSectionAction.count() > 0)
  {
  // should only be a single key and value in the dictionary
  aSection = (Section)  
selectedSectionAction.allKeys().lastObject();
  String actionForCurrentSection = (String)  
selectedSectionAction.objectForKey(aSection);


  if ("Edit Content".equals(actionForCurrentSection))
  {
  AjaxUtils.redirectTo(editSection());
  return null;
  }
  
  [snip]
---

Where editSection() returns an initialized component.

This is under WO 5.4.3, the latest Wonder ("svn up" at 2:00pm Monday).

Anyone have any ideas why this is not working?  My client claims it  
was working a week or two ago, but I didn't touch any of this stuff,  
so I'm even more confused...



sacha



--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"In times of change learners inherit the earth; while the learned find  
themselves beautifully equipped to deal with a world that no longer  
exists."  -- Eric Hoffer



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

2010-01-25 Thread Sacha Michel Mallais

On Jan 25, 2010, at 1:08 PM, Mike Schrag wrote:

If you're extending ERXApp, I seem to recall that we fix this  
ourselves "the hard way," though I ran into this in 5.3 as well --  
that you'd randomly get a port stuck on when you didn't want it (80  
or 443).


In ERXRequest:



Thanks, Mike, I think that will work... we're using ERXAjaxApp, which  
apparently doesn't use ERXRequest.


Anyone know of any gotchas if I just override _createRequest in my  
Application and return an ERXRequest (like ERXApplication does)? Does  
ERXRequest play well with ERXAjaxApplication?



sacha


--
Sacha Michel Mallais Big Kahuna
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Blessed is the WO-geek, for he shall inherit from NSEarth (Jobs 3:14)


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

2010-01-25 Thread Sacha Michel Mallais

On Jan 25, 2010, at 12:33 PM, Sacha Michel Mallais wrote:


Hi list,

Any idea why WO is appending ":443" to some URLs?  They seem to  
appear on URLs that WO generates (URLs generated by my code seem to  
be fine), such as on a WO form action method.  The page comes in as https://domain/wo/request/url 
 but the generated form action method looks like https://domain:443/wo/request/url 
...


I've checked the archives, which indicate we need to use IP-based  
virtual hosting, which we already are.


Anyone have other ideas?



Sorry, this is under WO 5.4.3 with a recent nightly Wonder.  I'm only  
really using ERXExtensions and Ajax, though.



sacha


--
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ u...@+++()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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


Port 443 appending

2010-01-25 Thread Sacha Michel Mallais

Hi list,

Any idea why WO is appending ":443" to some URLs?  They seem to appear  
on URLs that WO generates (URLs generated by my code seem to be fine),  
such as on a WO form action method.  The page comes in as https://domain/wo/request/url 
 but the generated form action method looks like https://domain:443/wo/request/url 
...


I've checked the archives, which indicate we need to use IP-based  
virtual hosting, which we already are.


Anyone have other ideas?


sacha


--
Sacha Michel Mallais 800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life



___
Do not post admin requests to the list. They will 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: AjaxUtils.redirectTo() and IE7

2010-01-14 Thread Sacha Michel Mallais

On Jan 13, 2010, at 1:57 AM, Amedeo Mantica wrote:


I Sasha,

seem to work on IE 7.0.5730.13

I get the umich login page


Yes, the error actually occurs after the login page.  Unfortunately,  
this site is being protected by UMich's Cosign so I can't give you a  
login to try it (and our other, non-UMich test site is down at the  
moment).


It looks like the error is generated from this return Element... (at  
least, it is line 4176 in prototype.js, the Char 5 doesn't make a lot  
of sense, though):


  optionValue: function(opt) {
return Element.extend(opt).hasAttribute('value') ? opt.value :  
opt.text;

  }

Which looks like it is part of this code block:
--
Form.Element.Serializers = {
  input: function(element, value) {
switch (element.type.toLowerCase()) {
  case 'checkbox':
  case 'radio':
return Form.Element.Serializers.inputSelector(element, value);
  default:
return Form.Element.Serializers.textarea(element, value);
}
  },

  inputSelector: function(element, value) {
if (Object.isUndefined(value)) return element.checked ?  
element.value : null;

else element.checked = !!value;
  },

  textarea: function(element, value) {
if (Object.isUndefined(value)) return element.value;
else element.value = value;
  },

  select: function(element, value) {
if (Object.isUndefined(value))
  return this[element.type == 'select-one' ?
'selectOne' : 'selectMany'](element);
else {
  var opt, currentValue, single = !Object.isArray(value);
  for (var i = 0, length = element.length; i < length; i++) {
opt = element.options[i];
currentValue = this.optionValue(opt);
if (single) {
  if (currentValue == value) {
opt.selected = true;
return;
  }
}
else opt.selected = value.include(currentValue);
  }
}
  },

  selectOne: function(element) {
var index = element.selectedIndex;
return index >= 0 ? this.optionValue(element.options[index]) :  
null;

  },

  selectMany: function(element) {
var values, length = element.length;
if (!length) return null;

for (var i = 0, values = []; i < length; i++) {
  var opt = element.options[i];
  if (opt.selected) values.push(this.optionValue(opt));
}
return values;
  },

  optionValue: function(opt) {
return Element.extend(opt).hasAttribute('value') ? opt.value :  
opt.text;

  }
};
--

Unfortunately, my JS-fu is weak, so I'm not able to suss what might be  
wrong here.


Anyone have any ideas?


sacha



On 12/gen/2010, at 19.17, Sacha Michel Mallais wrote:


Hi all,

Has anyone had any issues with using AjaxUtils.redirectTo() with  
IE7?  I'm getting this error on each page that uses redirectTo() on  
IE7 (typed by hand due to IE7 lameness, please excuse typos):

---
Line: 4176
Char: 5
Error: Object doesn't support this property or method
Code: 0
URL: 
https://test.global-village.net/apps/WebObjects/SMTest.woa/wa/218.0.9.1.1.1.1
---

... and the page doesn't redirect, it just sits there, and the rest  
of the Ajax on the page no longer works.


The code I use to redirect is:
---
  public WOComponent sectionRepetitionObserverAction()
  {
  if (selectedSectionAction.count() > 0)
  {
  // should only be a single key and value in the dictionary
  aSection = (Section)  
selectedSectionAction.allKeys().lastObject();
  String actionForCurrentSection = (String)  
selectedSectionAction.objectForKey(aSection);


  if ("Edit Content".equals(actionForCurrentSection))
  {
  AjaxUtils.redirectTo(editSection());
  return null;
  }
  
  [snip]
---

Where editSection() returns an initialized component.

This is under WO 5.4.3, the latest Wonder ("svn up" at 2:00pm  
Monday).


Anyone have any ideas why this is not working?  My client claims it  
was working a week or two ago, but I didn't touch any of this  
stuff, so I'm even more confused...



sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

AjaxUtils.redirectTo() and IE7

2010-01-12 Thread Sacha Michel Mallais

Hi all,

Has anyone had any issues with using AjaxUtils.redirectTo() with IE7?   
I'm getting this error on each page that uses redirectTo() on IE7  
(typed by hand due to IE7 lameness, please excuse typos):

---
Line: 4176
Char: 5
Error: Object doesn't support this property or method
Code: 0
URL: 
https://test.global-village.net/apps/WebObjects/SMTest.woa/wa/218.0.9.1.1.1.1
---

... and the page doesn't redirect, it just sits there, and the rest of  
the Ajax on the page no longer works.


The code I use to redirect is:
---
public WOComponent sectionRepetitionObserverAction()
{
if (selectedSectionAction.count() > 0)
{
// should only be a single key and value in the dictionary
aSection = (Section)  
selectedSectionAction.allKeys().lastObject();
String actionForCurrentSection = (String)  
selectedSectionAction.objectForKey(aSection);


if ("Edit Content".equals(actionForCurrentSection))
{
AjaxUtils.redirectTo(editSection());
return null;
}

[snip]
---

Where editSection() returns an initialized component.

This is under WO 5.4.3, the latest Wonder ("svn up" at 2:00pm Monday).

Anyone have any ideas why this is not working?  My client claims it  
was working a week or two ago, but I didn't touch any of this stuff,  
so I'm even more confused...



sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

2009-12-04 Thread Sacha Michel Mallais

A must read for anyone interested in software patents:
http://www.groklaw.net/article.php?story=2009151305785


sacha


--  
Sacha Michel Mallais Senior Developer / President

Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"In times of change learners inherit the earth; while the learned find  
themselves beautifully equipped to deal with a world that no longer  
exists."  -- Eric Hoffer



___
Do not post admin requests to the list. They will 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: Getters without the "get" part

2009-03-31 Thread Sacha Michel Mallais

On Mar 31, 2009, at 1:04 PM, Mike Schrag wrote:

Heh - and while we're at it, let's replace NSArray with  
ArrayList, NSDictionary with HashMap and NSSet with  well,  
some of those gazillion java collection classes


This already should have happened. Once you get a firm grasp of  
the Java Collections API, it's design, intention and power,  
NSArray and it's company will make you want to puke. I actually  
thought that WO would move in this direction by first making  
NSArray implement List, and do all the similar stuff, then  
depreciate Foundation collections, and the finally get rid of  
them. Well, maybe that still is the intention, but it sure is slow.

Agreed. Foundation collections are an embarrassing relic.
Unfortunately, the standard Java collection classes (JCC) gloss  
over an important aspect of collection classes: mutability vs.  
immutability.  EOF requires the latter for all attributes, so  
switching to JCC in EOF would be dangerous, and, IMHO, foolish.


AFAIK, the only benefit to using standard JCC is to be more  
"standard" Java... something I'd like but am willing live without  
in order to gain the benefit of EOF.
performance ... under heavy load, the java collections classes in  
specific parts of WO/EOF perform much better.  one could make the  
case that NSDict/MutableDict should instead extend HashMap,  
though.  Unfortunately to play nicely with other API's, they still  
impl Map/List, which means that even now we lose our immutable  
API's.  Personally, I still use the NS API's even though Map/List  
is available explicitly so I get proper immutability compile time  
checks.


Fair enough: being able to choose the implementation is a Good  
Thing.  I guess I subscribe to the "make it right, then make it good,  
then make it fast" philosophy, and in that respect, the standard JCC  
-- and some of the JDK as a whole -- give me butt rash.



Furthermore, IMHO, the standard JCC are more embarrassing than the  
WO ones.  How many redesigns have the standard JCC had?  How many  
redesigns have the WO ones had?  Certainly the WO design has stood  
the test of time, and the Java ones have not.  And we still have  
Liskov-violating crap like java.util.Properties.
The Java collections' original design is abysmal.  However, I think  
the Java port of NS* would have been MUCH better served as  
interfaces instead of implementations.  Those classes fundamentally  
don't allow the design of the original Objective-C classes to carry  
over properly, and the port kind of messed things up in this  
respect.  Modern Java collections are actually pretty nice, save  
the lack of immutable API's.  The real power, to me, is that I can  
choose my implementation for List/Map.  This is particularly nice  
with something like LinkedHashMap.



Agreed, using interfaces would have been superior.  I would fully  
support a change in that direction.


The standard JCC aren't bad, but are missing a key abstraction  
(immutability)... I'd still probably choose the WO ones 95% of the  
time (Principle of Least Surprise), but they are nice to have when  
you need the performance.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A plan without a schedule is just a dream. -- Chuck Hill


___
Do not post admin requests to the list. They will 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: Getters without the "get" part

2009-03-31 Thread Sacha Michel Mallais

On Mar 31, 2009, at 12:27 PM, Hugi Thordarson wrote:

Heh - and while we're at it, let's replace NSArray with  
ArrayList, NSDictionary with HashMap and NSSet with  well,  
some of those gazillion java collection classes


This already should have happened. Once you get a firm grasp of  
the Java Collections API, it's design, intention and power,  
NSArray and it's company will make you want to puke. I actually  
thought that WO would move in this direction by first making  
NSArray implement List, and do all the similar stuff, then  
depreciate Foundation collections, and the finally get rid of  
them. Well, maybe that still is the intention, but it sure is slow.


Agreed. Foundation collections are an embarrassing relic.



Unfortunately, the standard Java collection classes (JCC) gloss over  
an important aspect of collection classes: mutability vs.  
immutability.  EOF requires the latter for all attributes, so  
switching to JCC in EOF would be dangerous, and, IMHO, foolish.


AFAIK, the only benefit to using standard JCC is to be more  
"standard" Java... something I'd like but am willing live without in  
order to gain the benefit of EOF.


Furthermore, IMHO, the standard JCC are more embarrassing than the WO  
ones.  How many redesigns have the standard JCC had?  How many  
redesigns have the WO ones had?  Certainly the WO design has stood  
the test of time, and the Java ones have not.  And we still have  
Liskov-violating crap like java.util.Properties.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"The bird of paradise alights only upon the hand that does not  
grasp."  -- John Berry



___
Do not post admin requests to the list. They will 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: About instance's integrity.

2008-11-23 Thread Sacha Michel Mallais

On Nov 23, 2008, at 4:39 AM, dododo2020 dododo2020 wrote:

1) Having caches for each instance is not efficient. Sharing cache  
is the best.



Isn't a shared cache just a DBMS?  Sure, you can RYO at great effort  
and expense -- and you will probably get better performance out of  
it, but unless you have specific hardware requirements that preclude  
using a real database, it would seem to me to be a waste of time.



sacha


--
Sacha Michel Mallais Software Poet
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
There are three types of people in this world:
those that can count, and those that can't


___
Do not post admin requests to the list. They will 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: Why no 1to1 relationships?

2008-04-02 Thread Sacha Michel Mallais

On Apr 2, 2008, at 12:02 PM, Art Isbell wrote:

I think that this agrees with relational database theory; i.e., all  
one-to-one relationships must be 1:1, not 1:0.  A 1:0 relationship  
is just a special case of a 1:many relationship.



It is definitely possible to have an optional to-one, just not one  
where the FK is also the PK.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
ObAd: read "Practical WebObjects" 
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]


Re: The EOF How-Do-I-Get-There-From-Here Diagram

2008-02-04 Thread Sacha Michel Mallais

On Feb 4, 2008, at 4:32 PM, Mike Schrag wrote:

I ALWAYS forget how to get, say, an adaptor channel when I have an  
EOModel, or a JDBCPlugIn when I have an EODatabaseContext (or  
whatever it might be), so here is the official unofficial graph of  
interesting EOF classes and how you navigate between them:



Nice work Mike.  A comment and a question:

Looks like you have two EOModel entities...

And, can I post this on our FAQ site?  Or is there going to be an  
online version I can point to?



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"I resist change even as I call for it."  -- Mason Cooley


___
Do not post admin requests to the list. They will 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: App stuck on executeStoredProcedure()

2008-01-31 Thread Sacha Michel Mallais

On Jan 31, 2008, at 1:11 PM, Timo Hoepfner wrote:


How do I get a thread dump?


http://www.gvcsitemaker.com/gvc.webobjects/ 
faq&mode=single&recordID=41413


When using Java 1.5 it's easier: Find the process id of the  
application instance (e.g. by doing "ps -auxwww | grep java") and  
the call "sudo jstack ".


Nevertheless, changing the SpawnOfWotaskd.sh script is generally a  
good idea, as it also helps in other situations, like when an app  
dosn't start properly.



FAQ updated.


sacha


--
Sacha Michel Mallais Senior Señor / El Presidente
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Any sufficiently advanced satire is indistinguishable from reality.



___
Do not post admin requests to the list. They will 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: MS SQL, EOF, Ordering Operations

2007-05-28 Thread Sacha Michel Mallais

On May 28, 2007, at 10:48 AM, Chuck Hill wrote:


On May 26, 2007, at 4:51 AM, Ruenagel, Frank wrote:

In SQL-Server 2005  there is a "WITH ( IGNORE_CONSTRAINTS )" table  
hint, but I never tried it.

http://msdn2.microsoft.com/en-us/library/ms187373.aspx


I looked at that but it seems that it is for batch operations  
only.  It also totally ignores the constraints ("this can result in  
invalid data"), rather than just deferring them.



So, I am writing a delegate.


Can't just drop the constraints altogether?

I can't believe I just suggested that... with soap>  ;-)



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
ObAd: read "Practical WebObjects" 
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]


Re: First Deployment Help

2007-05-02 Thread Sacha Michel Mallais

On May 2, 2007, at 3:59 PM, Scott Winn wrote:


On May 2, 2007, at 1:39 PM, Chuck Hill wrote:


Try

./MyApp -WOPort 2001 -WOHost 


Yea!  Well, the kludge works with -WOHost  and WOPort  
specified.  Frameworks seem Ok.  The exception I saw before was  
application related, the DB framework is intact.  Images are there  
too.  Some of the fancier CSS Javascript isn't working though, but  
I'm not really concerned with that at the moment.


Now how do I get Java Monitor to "do the right thing"?

I tried setting up localhost and  as my Java Monitor  
host.  When I configure the app, it will run, but I can't connect  
to it as before.  If I put -WOHost argument into JM's application  
setup the log says "can't find address for  using  
localhost instead".  JM still won't recognize the server if I give  
it my mywebsite.com address unless I expose port 1085 to the wide  
world.


Thanks for the continued assistance.  I am still up the creek, but  
at least now I have a rather wide stick as a paddle substitute.


Hi Scott, I haven't been following this thread very closely, but this  
problem sounds like you're not using the canonical host name in your  
configuration.  You shouldn't be using an external alias like  
"www.mydomain.com", instead you should be using  
"mycleverinternalhost.mydomain.com", especially if the external alias  
maps to a different machine, like a firewall.


What host name are you using?  On the server that runs your apps,  
what does "host" return from terminal?



sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


___
Do not post admin requests to the list. They will 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: Partially saving the object graph. How? (Jean Pierre Malrieu)

2007-03-19 Thread Sacha Michel Mallais

A couple more things that might work for you:

- modify the EOModel at runtime by removing the entity you don't want  
EOF to know about.  I doubt this will work, but it's worth trying


- more likely to work is to redesign your app so that the entity in  
question is referenced as an interface.  In the apps that need the  
entity to be an eo, then you use your eo implementation of the  
interface -- otherwise, use the non-eo implementation



sacha


--
Sacha Michel Mallais Mojo Worker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A day without sunshine is like night.


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

This email sent to archive@mail-archive.com


Re: WebObjects 5: Updating time zone data

2007-03-09 Thread Sacha Michel Mallais

On Mar 8, 2007, at 3:10 PM, Mr. Pierre Frisch wrote:

For those that have not yet changed their code for the DST change  
this week-end, Apple posted a new KBase article, WebObjects 5:  
Updating time zone data  (<http://docs.info.apple.com/article.html? 
artnum=305219>).


Thanks Pierre, better late than never.  :-)


sacha


--
Sacha Michel Mallais 800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life



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

This email sent to archive@mail-archive.com


Re: Union of two Arrays

2007-03-07 Thread Sacha Michel Mallais

On Mar 7, 2007, at 11:56 AM, David Avendasora wrote:

Is there an easy (WO or plain Java) way to derive the union of two  
NSArrays?


Here's one that's not particularly efficient, but is really easy:

NSArray union = new NSSet(arrayA).setByUnioningSet(new NSSet 
(arrayB)).allObjects()



sacha


--
Sacha Michel Mallais Mojo Worker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A day without sunshine is like night.


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

This email sent to archive@mail-archive.com


Re: Multiple WOForm's and keeping information

2007-02-26 Thread Sacha Michel Mallais

On Feb 26, 2007, at 7:16 PM, Baiss Eric Magnusson wrote:

I have 2 WOForm's on a WOComponent page, the 2nd has  set  
to "multipart/form-data", to support a file upload.


The file is selected using the sub-component   
which has a . The user data is shown on the  
screen after the file is selected, but it does not exist in the  
source of the page if you look at the HTML, which means to me that  
it is stashed in the DOM?


The problem is I have no way to keep the data that has been entered  
on the top form by the user.


That is, WOTextField's on the top form get cleared out during the  
Submit of the file upload and thus the user has to re-enter the  
information in the top form and use it's Submit button. That's bad  
and I am getting complaints.


That's a limitation of HTML, so you'll need to make them a single  
form if that the functionality you need.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Good people do not need laws to tell them to act responsibly,
while bad people will find a way around the laws." -- Plato



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

This email sent to archive@mail-archive.com


Re: WebObjects 5.3.3 released

2007-02-16 Thread Sacha Michel Mallais

On Feb 16, 2007, at 9:49 AM, Cliff Tuel wrote:


OK, I have a Premier ADC account, does that qualify me or do I have
to purchase something else?  How do I actually go about getting that
fix?  Those links you gave have nothing relevant...


ADC accounts don't qualify, because they include DTS incidents, and  
DTS only
supports WebObjects 5.3, not 5.2.  The least-expensive support  
program that
would get you the DST patch for 5.2 is OS X Server Select (which is  
not the

same as "ADC Select").


Wow.  I guess that's one way to get you're clients to upgrade.   
Lesse, I can pay $6000 US for (what amounts to) this one support  
incident or I can buy 10.4 for $500 US.


Excuse me if I'm less than ecstatic about this.


sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

This email sent to archive@mail-archive.com


Re: WebObjects 5.3.3 released

2007-02-16 Thread Sacha Michel Mallais

On Feb 16, 2007, at 8:16 AM, Cliff Tuel wrote:


Note: AppleCare Enterprise Support customers using earlier versions
of WebObjects should contact their support team for information on
patch availability.



Is there an update for those of us still running WO 5.2 on 10.3.9?


Yes, but it's only available to those with an AppleCare Enterprise  
Support

contract (Select, Preferred, Alliance, Silver, or Gold).  See
<http://apple.com/support/products/macosxserver_sw_supt.html> and
<http://apple.com/services/technicalsupport> for info on those.


OK, I have a Premier ADC account, does that qualify me or do I have  
to purchase something else?  How do I actually go about getting that  
fix?  Those links you gave have nothing relevant...



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Good people do not need laws to tell them to act responsibly,
while bad people will find a way around the laws." -- Plato



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

This email sent to archive@mail-archive.com


Re: Recording for PlaybackManager not working?

2007-02-02 Thread Sacha Michel Mallais

On Feb 1, 2007, at 1:28 PM, Chuck Hill wrote:


I am copying Sacha on this, he can tell you how to use JMeter.


Some time ago, I wrote a little primer on using JMeter with WO.  You  
can find it here:
http://en.wikibooks.org/wiki/Programming:WebObjects/Testing/ 
Load_Testing_WO_Apps_with_JMeter


Note that since it doesn't use XPath (or at least I haven't figured  
out how to make it do so), any change to your UI will likely require  
tweaks to your testing script.



sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

This email sent to archive@mail-archive.com


Re: NSTimestamp problem

2007-01-09 Thread Sacha Michel Mallais

On Jan 4, 2007, at 12:49 PM, Colin Curtin wrote:


We ran into this problem as well. Found a solution a few minutes ago.

OSX uses the same tz-link data that Java, Linux, Solaris, etc. uses.

So we symbolic linked the Java directory to the native OSX one:

#!/bin/bash
# You'll want to sudo this.
cd /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/ 
Home/lib

mv zi zi.old
ln -s /usr/share/zoneinfo ./zi


You could also copy the zoneinfo instead of linking if you're  
concerned about Java updates overwriting the tz database.


We also noticed that in WO Java Client, the client's Java timezone  
database needs to be updated as well.


This solution appears to cause problems with our apps.  We get this  
in the WO app log when starting up:


ZoneInfo: wrong magic number: UTC
ZoneInfo: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/ 
Home/lib/zi/ZoneInfoMappings (No such file or directory)


Any ideas?


sacha

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

This email sent to archive@mail-archive.com


Re: Best way to generate unique IDs that are not PKs

2007-01-02 Thread Sacha Michel Mallais

On Dec 31, 2006, at 7:11 AM, Florijan Stamenkovic wrote:

I have a need in several of my tables to generate identifying  
numbers, but relative to a certain relationship. So, if there is a  
Book, I need to generate number 6 for it if Author currently  
relates to 5 other books... I have an approach of doing this,  
please anyone tell me if there is a better way to do it!


IMHO, the better way would be to get rid of the requirement  
altogether and use normal PK generation.




My approach:

1.	Lock the working thread on a monitor that is "static final" in  
my SessionWorker class
2.	Get the next number by using aBook.valueForKeyPath 
("[EMAIL PROTECTED]");	//can not use @count in case of  
previous deletions

3.  Set the next number in aBook
4.  Save the changes of my working editing context
5.  Release the synchronization lock


This appears sound, though as you note below, this will work only if  
you have a single instance.




Questions:
Is there way to use EOF locking to lock on the database? It seems  
to me that would be more appropriate for what I am doing then the  
plain Java thread synching, and would work even if there were  
multiple application servers running, where the above approach  
would not. Any other ideas where this might flop and how to prevent  
it?


I think you're going to need to lock the entire table from any access  
during your transaction in order to guarantee no race condition (a  
read lock will not be sufficient).  You can try the  
EOFetchSpecification.locksObjects() method, but I don't think that  
will do it: I think that does a SELECT FOR UPDATE, which obtains a  
read lock.  That means that you'll need to go behind EOF's back and  
send the database-specific command yourself to lock down any access  
to that table for the length of the transaction.  This, of course,  
has performance implications.


Shaun suggested using a stored procedure, which, if you're using a  
database that has them, is a good idea -- as is a unique constraint  
on those columns.



sacha


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

This email sent to archive@mail-archive.com


Re: Instance recycle itself after a specific load point is reached

2006-12-07 Thread Sacha Michel Mallais

On Dec 7, 2006, at 4:57 PM, Tanmoy Roy wrote:


I wanted to know if there is anything available in the WebObjects that
will allow the instance to recycle itself after a specific load point
is reached.

Is something available in the monitor where in I can specify that
after an instance gets a specified number of session it will recycle
gracefully and automatically even though the scheduled down-time is
not reached.

I could not find anything that helps in the net. Any pointer would be
of great help.


You'll have to implement that one yourself, there is no built-in way  
to do that.  Shouldn't be too hard though: subclass Thread, monitor  
Application.activeSessionCount() and terminate when you hit your limit.



sacha

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

This email sent to archive@mail-archive.com


Re: Performance - the big problem

2006-10-29 Thread Sacha Michel Mallais

On Oct 29, 2006, at 1:25 PM, Baiss Eric Magnusson wrote:

I have a long-standing problem with my main WO site www.Track-Your-Finances.com>, when I ask for a lot of records, say  
(400-2000) and upwards.

This is a WO-Frontbase-MacOSXS site.

Something gets hung and I don't know what it is.
From Activity Monitor I see no sign of CPU saturation, there's  
significant memory available,  lots of disk space, and the Network  
traffic is down to near zero.


Here's what TOP, from Monitor shows me, at a moment when a page hung:

Processes:  73 total, 2 running, 71 sleeping... 452  
threads12:44:46
Load Avg:  0.07, 0.08, 0.03 CPU usage:  3.6% user, 6.4% sys,  
90.0% idle
SharedLibs: num =  178, resident = 41.1M code, 4.97M data, 8.90M  
LinkEdit
MemRegions: num =  8642, resident =  375M + 9.73M private, 74.2M  
shared
PhysMem:   101M wired,  117M active,  454M inactive,  672M used,   
351M free

VM: 6.27G +  114M   123714(0) pageins, 0(0) pageouts

  PID COMMAND  %CPU   TIME   #TH #PRTS #MREGS RPRVT  RSHRD   
RSIZE  VSIZE
24214 FrontBase0.0%  0:07.42   75557  5.25M  2.09M   
6.53M  41.7M
24158 FrontBase0.0%  0:31.16   75762  6.45M  2.09M   
7.86M  43.6M
18249 AppleSpell   0.0%  0:00.08   13231   416K  1.82M   
2.64M  37.2M
17943 java 0.0% 12:04.51  28   386   200  35.1M  17.0M   
43.6M   367M
12575 java 0.0%  2:13.77  27   388   199  34.6M  17.0M   
43.4M   367M
11098 lookupd  0.0%  0:48.43   43844   512K  1000K   
1.26M  29.6M
10403 java 0.0% 12:38.92  27   345   195  24.5M  17.0M   
32.9M   367M

...


This looks like you've asked it to sample for X seconds (top -s  
), but didn't give top enough time to do the sample.  The clue  
is the %CPU all 0.0%.  Nevertheless, the other numbers are useful.   
Definitely seems like you have enough RAM.



From my old embedded programming & real-time simulation days, it  
appears to be like a port conflict where the system just hangs for  
a very long period of time, say ten minutes.
This is my last big hurdle before I'm ready for a significant  
launch...


Do you notice an increase in disk activity?  Does the same query take  
the same length of time if you run it twice in a row?


Have you narrowed down all possibilities so that you're sure the  
delay comes between querying FB and getting a response back?


It might be the communication between FB and the app (they're on the  
same machine, so no network activity will show up).  The 2000 rows:  
what's the average length of a row?  I would expect a slowdown  
returning only 100 rows -- if those rows were 10GB blobs...



sacha



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

This email sent to archive@mail-archive.com


Re: Use of the "formatter" binding on a WOString?

2006-10-11 Thread Sacha Michel Mallais

On Oct 11, 2006, at 8:09 AM, Matt Kime wrote:


I'm terribly confused as to how to use a formatter in on a WOString in
a WOComponent. How is the "formatter" binding to be used? Must there
be code in the component? I've used the date and number formatters so
I guess I'm expecting something similar. I'd appreciate even a point
towards simple documentation. I'm confused as to how I could be so
confused over this.


The dateformat and numberformat bindings both take format strings.  
The formatter binding takes a formatter object.  So, yes, one way to  
do that would be to write a method on your component that returns a  
formatter object and bind formatter to that method.


The WOString docs are here: http://developer.apple.com/documentation/ 
WebObjects/Reference/DynamicElements/WOString/chapter_32_section_3.html


HTH,


sacha

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

This email sent to archive@mail-archive.com


Re: Detecting eo changes when they happen

2006-10-10 Thread Sacha Michel Mallais

On Oct 10, 2006, at 3:09 PM, Florijan Stamenkovic wrote:

How about overriding all takeValue...() methods? Would that be  
inadvisable?


That's one way.  You could check that the key you were getting was  
actually an attribute of the EO too if you wanted.  Also keep in mind  
that EOF uses take*Stored*Value...() when it initializes your objects  
(and at some other times too -- see next), so you might want to do  
something with that too.


Another way to do it would be to change your eogenerator (I assume  
you're using it or something similar) template to generate code like  
this:


public void setMyAttribute(Object value)
{
takeStoredValueForKey(value, "myAttribute");
didChange("myAttribute", value);
}

Of course, you'll need a common superclass that implements didChange  
however you like.



sacha


--
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ [EMAIL PROTECTED]()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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

This email sent to archive@mail-archive.com


Re: CSS Table/Row Question

2006-10-05 Thread Sacha Michel Mallais

On Oct 5, 2006, at 9:03 AM, Chip Myers wrote:

I'm trying to figure out the best way to create a CSS table to be  
referenced by one of my .wo files.  The tables I'm trying to design  
have a width which varies per column, and if possible I'd like to  
reference my CSS file only when the table is first defined with the  
 tag, rather than every time I encounter a  tag. The  
table looks like this:



||_|||_|
||_|||_|
||_|||_|
||_|||_|
||_|||_|


Is it possible to define a table in a css file which already has  
its  attributes defined, as in width and height?  Also, is  
there any way to design and reference a css file through the  
webobjects builder GUI?  I realize these are all beginner  
questions, but I'm very new to CSS design.  If anyone has any  
direct advice, or just a helpful link, I'd really appreciate it.


A CSS forum is probably the best place to get your question answered,  
but I'll do my best.


AFAIK, there is no way to specify column widths in a table tag.  I've  
never used it, but you could try using the col tag. See http:// 
www.w3.org/TR/html4/struct/tables.html.



sacha

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

This email sent to archive@mail-archive.com


Re: Oracle 10.2.0.2?

2006-09-18 Thread Sacha Michel Mallais

On Sep 18, 2006, at 7:25 AM, William Hatch wrote:

Anybody using this? I'm having issues connecting from mac clients  
using the most recent thin drivers. Thanks.


I'm using Oracle 10.1.0.3.0 with the thin driver.  No problems to  
report.



sacha


--
Sacha Michel Mallais Mojo Worker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A day without sunshine is like night.


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

This email sent to archive@mail-archive.com


Re: KVC NSArray attribute to double[] ?

2006-08-27 Thread Sacha Michel Mallais

On Aug 27, 2006, at 6:22 PM, James Cicenia wrote:


Is there a way to use KVC to:

1) Given an array of EOs
2) Get an array of attribute A1 which is a double.


Not directly.



I was hoping to do:

double[] y = (double[])projects.valueForKeyPath 
("calculatedRewardScore");


but this throws an exception.

What am I doing wrong?


valueForKey (and valueForKeyPath) on an NSArray return an NSArray  
(unless using an aggregate function like @sum, in which case they  
return a Double IIRC).  What you want is (warning, untested code):


double[] y = (double[])((NSArray)projects.valueForKeyPath 
("calculatedRewardScore")).objects();



sacha


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

This email sent to archive@mail-archive.com


Re: EOAndQualifier on child entity property

2006-08-17 Thread Sacha Michel Mallais

On Aug 17, 2006, at 4:04 PM, Yann Bizeul wrote:

	Say an entity MyEntity, having a many-to-many relationship with a  
Tag entity, the purpose of that is tagging MyEntity with one or  
more keywords (tags)


	Now I want to get all MyEntity having "tag1" AND "tag2" as tags.  
An EOAndQualifier is nonsense in the result sql since if queries  
"tag1" = "tag1" AND "tag1" = "tag2", EOOrQualifier is not better  
since I need to match entries having *both* tags


Try "myAttribute CONTAINS %s AND myAttribute CONTAINS %s" for a  
format string, with params of "tag1" and "tag2", as in (warning,  
untested code):


EOQualifier q = EOQualifier.qualifierWithQualifierFormat("myAttribute  
CONTAINS %s AND myAttribute CONTAINS %s", new NSArray(new Object[]  
{tag1, tag2}));



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
So it doesn't mess up the flow of reading.
> How come?
> > I prefer to reply inline.
> > > What do you do instead?
> > > > No.
> > > > > Do you like top-posting?



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

This email sent to archive@mail-archive.com


Re: Open source as the way some important software is developed

2006-08-17 Thread Sacha Michel Mallais

On Aug 17, 2006, at 4:22 PM, Cornelius Jaeger wrote:


On 18.08.2006, at 01:08, Sacha Michel Mallais wrote:

If we do re-implement it, why not in Ruby and ride on the buzz?   
We can call it JetStream.  :-)  And it is not Java!


way to go chuck

anyone seen this:
webobjects clone in ruby:
http://cgikit.sourceforge.jp/cgi-bin/en/index.cgi?FrontPage
eof clone in ruby:
http://www.spice-of-life.net/tapkit/index.html
simple rule engine (in ruby):
http://www.spice-of-life.net/rein/rein.html

haven't used it, been a while since i looked at it, don't know  
how far along it is. but it's there.


Hmm... 2005: "I stop developing the library because I turned to  
Python."


I think he lost his motivation because that's when RoR really took  
off, and he didn't get any support.


Apparently he liked Python more than RoR then.


I have a theory about why Ruby is so popular: scripters are used  
to Perl!  :-P


it's pretty fun to work with actually and it was easy to learn the  
fundamentals, took about 3-4 hours setting up a log parser that  
transferred remote logs to a db backend. and i'm no speed demon.


Well colour me surprised: a scripting app that parses log files.  ;-)


sacha


--
Sacha Michel Mallais Senior Señor / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Any sufficiently advanced satire is indistinguishable from reality.


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

This email sent to archive@mail-archive.com


Re: Open source as the way some important software is developed

2006-08-17 Thread Sacha Michel Mallais

On Aug 17, 2006, at 3:38 PM, Cornelius Jaeger wrote:

On 17.08.2006, at 19:29, Chuck Hill wrote:
If we do re-implement it, why not in Ruby and ride on the buzz?   
We can call it JetStream.  :-)  And it is not Java!


way to go chuck

anyone seen this:
webobjects clone in ruby:
http://cgikit.sourceforge.jp/cgi-bin/en/index.cgi?FrontPage
eof clone in ruby:
http://www.spice-of-life.net/tapkit/index.html
simple rule engine (in ruby):
http://www.spice-of-life.net/rein/rein.html

haven't used it, been a while since i looked at it, don't know how  
far along it is. but it's there.


Hmm... 2005: "I stop developing the library because I turned to Python."

I have a theory about why Ruby is so popular: scripters are used to  
Perl!  :-P



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
So it doesn't mess up the flow of reading.
> How come?
> > I prefer to reply inline.
> > > What do you do instead?
> > > > No.
> > > > > Do you like top-posting?



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

This email sent to archive@mail-archive.com


Re: A change I noticed in Xcode 2.4

2006-08-08 Thread Sacha Michel Mallais

On Aug 8, 2006, at 5:54 PM, John Larson wrote:


I don't think that until the Script Wars get fought out


I feel a great disturbance in the parse...


sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
ObAd: read "Practical WebObjects" 
http://www.global-village.net/products/practical_webobjects


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

This email sent to archive@mail-archive.com


Re: Localization issue

2006-08-04 Thread Sacha Michel Mallais

On Aug 4, 2006, at 9:10 AM, Gilles MATHURIN wrote:

Hope you've got a great summer, as for me it's always summer in the  
caribbeans.


As they say, there are only two season in Canada: winter and two  
months of bad sledding. ;-)  Actually its been so hot these last few  
weeks, I finally broke down and bought an A/C...



I 've got an issue with localizating an testApp. I am using the  
code in the Chuck Hill and Sacha Book, and i get an IllegalState  
Exception as a result.


Can you post that stack trace?


sacha


--
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ [EMAIL PROTECTED]()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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

This email sent to archive@mail-archive.com


Re: strange EO inheritance issue

2006-08-03 Thread Sacha Michel Mallais

On Aug 3, 2006, at 2:05 PM, Patrick Robinson wrote:

I've got a rather strange EO inheritance question.  I've got a  
situation where I've set up single-table inheritance (with a
subclass "type" column) for 7 out of 8 of my subclasses; and a  
separate table (with the same "type" column) that has a bunch more  
columns for the 8th, just because I didn't want all those columns  
sitting there empty for most of the rows (i.e. for the other 7  
subclasses).  Probably false economy, but be that as it may


My structure looks like this:

A <-->> B <<--> C

C is modeled as an inheritance hierarchy using horizontal mapping,  
and B is modeled as the inheritance hierarchy described above,  
using mostly single-table mapping.  There is a different subclass  
of B for each corresponding subclass of C.


It all built just fine, but when it came time to save an object of  
my new C subclass (the one that corresponds to the B subclass with  
its own table), the primary key of the C subclass object did not  
propagate to the B subclass object -- it was left as null.  This is  
done with Oracle, so there's an Oracle sequence C_SEQ that's used  
to obtain C's primary key, and C_ID is the primary key of all C  
subclasses.  Normally, this propagates to the B subclass objects  
just fine (with all the other B subclasses, that is), but it isn't  
working with the B subclass that is set in EOModeler to use its own  
table.


Has anyone else tried to do this kind of thing, or am I just trying  
to do something idiotic?  :-)


Hi Patrick,

I've recently tried a similar thing to no success.  It appears that  
there is a WO bug WRT propagating PKs to tables that are not  
correlation tables (a correlation table is a table mapping two  
entities in a many-to-many relationship with no other attributes --  
if B had attributes B.aPK and B.cPK, and no others, it would be a  
correlation table).  What I did was to throw out propagation and  
instead use a standard integer PK.


HTH,


sacha


--
Sacha Michel Mallais Code Sculptor
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Roses are #FF, violets are #FF, all my base are belong to you.


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

This email sent to archive@mail-archive.com


Re: Newbie question about highlighting rows

2006-07-25 Thread Sacha Michel Mallais

On Jul 25, 2006, at 12:48 PM, Guido Neitzer wrote:


On 25.07.2006, at 17:54 Uhr, Sacha Michel Mallais wrote:

Then, inside the repetition, modify the  tag to be style="background: grey;"WEBOBJECT>>, where HighlightConditional is a WOConditional bound  
to a method that returns true only when the selected index equals  
the current index.


Do you really use these nested tags? I have seen that this is  
working, but I really don't like it (just because of aesthetics).


Yeah, it looks strange but is perfectly allowed (remember that WO  
tags and HTML tags are two different beasts...).  One advantage of  
doing it this way is that you still get to see the table in Preview /  
Layout mode.  Of course, if you're going to be using this UI paradigm  
in more than one or a few places, then making a reusable component is  
where its at...



sacha


--
Sacha Michel Mallais Rocker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
I've got a fever, and the only prescription is more cowbell!


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

This email sent to archive@mail-archive.com


Re: Newbie question about highlighting rows

2006-07-25 Thread Sacha Michel Mallais

On Jul 25, 2006, at 9:35 AM, Chip Myers wrote:


Sacha: you mentioned

 Then, inside the repetition, modify the tag to be
 NAME=HighlightConditional>style="background: grey;">,
 where HighlightConditional is a WOConditional bound to a  
method that
 returns true only when the selected index equals the  
current index.


How do I call this method to check for when the selected index  
equals the current index?  Should I place a WOGenericElement which  
calls the method inside my row, so that the check can be performed  
on each iteration of the repetition?  I have a feeling that there  
are more efficient ways, I just don't know them yet.


That's what the WOConditional is for.  The WOConditional is inside  
the WORepetition, so it will get evaluated once each time through the  
repetition.  Most rows, the condition will evaluate to false, and  
therefore the style="background: grey;" will not show up; on the row  
that the selected index == the repetition index, the WOConditional  
will evaluate to true and that particular row will have  
style="background: grey;".


So the WOConditional should have its condition binding set to, say,  
isSelected().  In isSelected(), simply return repetitionIndex ==  
selectedIndex; where repetitionIndex is an ivar bound to the  
WORepetition's index binding and selectedIndex gets set by your  
SELECT action method.


Does that make more sense?


sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
So it doesn't mess up the flow of reading.
> How come?
> > I prefer to reply inline.
> > > What do you do instead?
> > > > No.
> > > > > Do you like top-posting?



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

This email sent to archive@mail-archive.com


Re: Newbie question about highlighting rows

2006-07-25 Thread Sacha Michel Mallais

On Jul 25, 2006, at 7:13 AM, Chip Myers wrote:

I'm currently generating a series of rows within a WORepetition.   
The best way to show the structure is as follows:


SELECT PERSON ACITY ASTATE A


SELECT PERSON BCITY BSTATE B


SELECT PERSON CCITY CSTATE C

Upon clicking the 'select' hyperlink, I'd like to highlight this  
entire row, and only this row.  Unfortunately, I end up  
highlighting the entire table when the page refreshes itself.  I  
should add that I have an alternating white and gray row pattern  
which is generated from a few session variables.  Since this occurs  
in the session, I've also tried creating a session flag called  
boolThisRowSelected, to determine when the highlight should occur,  
but it just hasn't worked yet.


Is there an easy way to highlight just one row within a  
WORepetition without having to create more session variables?


You can't highlight a row only using WORepetition, nor should you be  
using the session to store temporary (page-based) information.


I would do the following (note that this assumes you are alright with  
the page reloading in order to accomplish the row highlight): first,  
add an index binding to the repetition.  Then, inside the repetition,  
modify the  tag to be NAME=HighlightConditional>style="background: grey;">,  
where HighlightConditional is a WOConditional bound to a method that  
returns true only when the selected index equals the current index.   
Finally, modify the action method that the SELECT hyperlink is bound  
to so that it sets the selected index when it is clicked.


HTH,


sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais


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

This email sent to archive@mail-archive.com


Re: Newbie question about WORepetitions and WORadioButtons

2006-07-19 Thread Sacha Michel Mallais

On Jul 19, 2006, at 8:38 AM, Chip Myers wrote:

I'm currently displaying a list of objects in a WORepetition, with  
each object having a WORadioButton displayed beside it.  Once the  
list finishes generating, I display 2 hyperlinks, edit and delete,  
whose operations can then be performed on any one object in the  
list.  Within the WORepetition, I've created two variables  
ObjectList for list and ObjectItem for item.



o Object 1
o Object 2
 .
 .
 .
o Object n

editdelete


TI'd like to perform an edit on one selected objectItem.  Once the  
edit and delete buttons are generated, however, the objectItem has  
been populated with a value of null.  How, is it possible to  
capture the objectItem that has been selected with the radiobutton?


Hyperlinks don't post forms: you have to use submit buttons instead.   
(Actually, I'm sure you can make a hyperlink act like a submit button  
-- probably using JavaScript -- but I'm guessing you didn't do  
that.)  Also don't forget to make your form's Multiple Submit = true.


Note that if you put the edit and delete button _in_ the repetition,  
you would be able to know which one the user clicked by using the  
object bound to the repetition's item binding.



sacha


--
Sacha Michel Mallais 800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life



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

This email sent to archive@mail-archive.com


Re: horizontal inheritance oddity

2006-05-25 Thread Sacha Michel Mallais

On May 24, 2006, at 9:55 PM, Mike Schrag wrote:

The moral?  If you ever do cross-model inheritance, be damn sure  
your connection dictionaries are EXACTLY equal.  I'm tempted to add  
a check into Project Wonder that if two models have the same URL  
and User but the full connection dictionaries are not .equals=true,  
then it should throw an exception by default.  I suspect 99% of the  
time this scenario is undesirable and will just result in strange  
problems like I had the pleasure of enjoying.


One way to avoid this is to programmatically set the connection  
dictionary at launch.  This is pretty much required anyway if you  
have reusable frameworks with EOModels.



sacha


--
Sacha Michel Mallais Senior Señor / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Any sufficiently advanced satire is indistinguishable from reality.


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

This email sent to archive@mail-archive.com


Re: EOModeler SQL generation

2006-05-03 Thread Sacha Michel Mallais

On May 3, 2006, at 9:25 PM, Dave Elsner wrote:

After speaking with our Oracle DBA they would like columns name for  
each table to be created in order of their significants when the  
create table statements are ran.


i.e The Primary Key(s) should be first, the candidate keys then  
foreign keys, then every thing else.


However the default in EOModeler is to order them alphabetically is  
there any way around this? So I can customize the order on a per  
table basis ?


Yes, there is a way around this: get a new DBA.  That is a seriously  
silly requirement.




I would prefer not to write the SQL by hand.


If the insanity persists, hand-coding is probably your best bet.   
EOModeler's output is rather limited anyway, so its nice to be able  
to replicate all the tweaks that you may have to do in a single file.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Good people do not need laws to tell them to act responsibly,
while bad people will find a way around the laws." -- Plato



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

This email sent to archive@mail-archive.com


Re: How to selectively save EO

2006-04-21 Thread Sacha Michel Mallais
On Apr 21, 2006, at 11:32 AM, [EMAIL PROTECTED]  
wrote:



I would like to save newly created EO immediately but there could be
other objects in the default EditingContext which I do not want to
commit to the database immediately.

My first attempt was to create a new short term EditignContext,
insert my newly created EO in it and call saveChanges.

However  because this object has a relationsip to another one in the
defaultEditingContext, it cause an error about being unable to obtain
globalId

Any suggestions how to acheive this ?


You're doing the right thing by creating it's own EC (Editing  
Context), but you have a relationship to an object in another EC.   
This is one of the rules that you must never violate, on pain of  
ridiculously unhelpful exception messages and a bruised forehead.   
Fault the related object into your newly created EC and save, all  
will be good.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"I resist change even as I call for it."  -- Mason Cooley


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

This email sent to archive@mail-archive.com


Re: Best Design Practice

2006-04-12 Thread Sacha Michel Mallais

On Apr 12, 2006, at 4:09 PM, Owen McKerrow wrote:

I have been using the first method but after talking with a college  
yesterday Im wondering if the second way may be quicker.
The in-memory will stil require a trip( or several to the DB ) to  
get the position sets, and then have to do the sort in memory once  
they get back. But if I have set the relationships Batch Faulting  
size,  would these objects not already be in memory and thus we  
then cut down on the trip to the DB ?


It really is dependant on the state of your object store.  If you  
have to go to the database to get the data, sorting at the database  
will almost always be preferable, particularly if you have an index  
on the sorted column (which turns sorting from O(nlogn) to O(1)).   
However, if your objects are already in memory, sorting in memory  
will almost always be preferable, simply because going to the  
database is expensive.  With a large dataset (10s of 1000s of rows at  
least) in which you only intend to show the first few rows, you're  
almost always better off going to the database because sorting time  
will overshadow communication time with the database...


HTH,


sacha


--
Sacha Michel Mallais800 kg gorilla
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
1. Never tell everything at once.
-- Ken Venturi, Ken Venturi's Two Great Rules of Life



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

This email sent to archive@mail-archive.com


Re: URGENT issues with CLOSE_WAIT states

2006-04-03 Thread Sacha Michel Mallais

On Apr 2, 2006, at 5:03 PM, Corin Lawson wrote:

I would like to know what kinds of limits there are for load on WO.  
How many instances of an application could I run, has anyone much  
experience with high loads, say 1000's of requests in the space of  
a few minutes? Java Monitor seems cumbersome with 100 instances.


The most important thing is to have enough memory to hold the number  
of instances you want.  With 2GB of RAM, that likely means less than  
20 or 30.  100 is probably right out unless they are very small  
apps.  How does your machine respond under 100 instances?  How often  
is it swapping?



PS. I like the FAQ (not very pretty but). It would be nice to see  
some categories if it keeps getting bigger.


Yeah, needs some work.  As it gets bigger/more useful I'll spend some  
time on it to make it look nice.  Right now I just can't be  
bothered.  :-)



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
ObAd: read "Practical WebObjects" 
http://www.global-village.net/products/practical_webobjects


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

This email sent to archive@mail-archive.com


Re: URGENT issues with CLOSE_WAIT states

2006-03-29 Thread Sacha Michel Mallais

On Mar 28, 2006, at 7:23 PM, Corin Lawson wrote:

Recently I have found that under a increased load there is a large  
number of tcp connections in CLOSE_WAIT state. When there is enough  
of them the adapter to no longer able to find any app (including  
the JavaMonitor) and the whole system grinds to a halt...


I have confirmed that WODeployment 5.2.3 is installed on Mac OSX 10.3.

Please help! How can I get rid of the CLOSE_WAIT states?


The cause is a bug in wotaskd in WO 5.2.2 and 5.2.3.  The only real  
solution is to upgrade to WO 5.2.4.


If that is not possible, a workaround is to simply kill wotaskd once  
a night.  It may also be possible to write a script to detect this  
condition and kill wotaskd.



sacha


PS. I've added this to Chuck and my mini-WO FAQ at http://www.global- 
village.net/gvc.webobjects/faq.  If anyone has anything to add to  
this FAQ, please let me know -- I can give privileges to add/modify  
too...


--
Sacha Michel Mallais 400 kg chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"Choke on that, causality!"  -- the Professor, "Futurama"


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

This email sent to archive@mail-archive.com


Re: Help. Error from jam ??

2006-03-27 Thread Sacha Michel Mallais

On Mar 26, 2006, at 3:34 PM, Owen McKerrow wrote:


What is jam ?


jam is the build system used by Xcode.  It is analogous to make and ant.



And any ideas on how I could fix this problem ?


Did you post the complete context of the error?  I can't see any  
reason for it to have failed.  It could be that you need to de- and  
re-install...



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"I resist change even as I call for it."  -- Mason Cooley


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

This email sent to archive@mail-archive.com


Re: triggeering an event

2006-03-27 Thread Sacha Michel Mallais

On Mar 27, 2006, at 1:19 AM, Amedeo Mantica wrote:


Hello, Is possible to trigger an event to be run one time at week?


You could set something up in your application, but the easiest (and  
arguably best) way to do this would be to set up a cron job (do a  
"man crontab" in Terminal or get a GUI app like CronniX) that hits a  
Direct Action in your WO app.


Does that make sense?


sacha


--
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ [EMAIL PROTECTED]()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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

This email sent to archive@mail-archive.com


Re: OutOfMemoryError during compile

2006-03-20 Thread Sacha Michel Mallais

On Mar 20, 2006, at 1:12 PM, Doug Andrews wrote:


We use XCode to develop our WebObjects application.
Recently, we've gotten the following error when trying to compile.

The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError
...failed JavaCompile.default _WOServerCircWeb.tmp ...

I can't figure this out.
When i try to compile with the command line using javac, i get the  
same error.


What are you doing, compiling MSWindows?  ;-)


Doing some research, i've found that if i add "-J-mx512m" as a  
command line option to javac, i don't get the memory error.

Is there any way i can configure XCode to use this option?


Double click on the App Server target in Xcode and click on the  
Expert View of the Settings group.  The option is called  
JAVA_COMPILER_FLAGS.



sacha


--
Sacha Michel Mallais Mojo Worker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
A day without sunshine is like night.


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

This email sent to archive@mail-archive.com


Re: Hiding session id in the URL

2006-03-07 Thread Sacha Michel Mallais

On Mar 7, 2006, at 12:35 PM, Tanmoy Roy wrote:


I have an application which does quite a lot of form submissions. My
application is a secured application and if the Session id is exposed
then any user can copy the URL and paste the same in his/her browser
then he/she will be able to view the same page as that of the other
user. This has to be protected so that whenever he/she does that
he/she will be presented with a new login page.


You can tell WO to use cookies to store the session IDs.  Check out  
WOSession.setStoresIDsInCookies().



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais


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

This email sent to archive@mail-archive.com


Re: appserver -> root after 10.3.9 upgrade

2006-03-07 Thread Sacha Michel Mallais

[huge top-post snipped]


On Mar 6, 2006, at 7:34 PM, Kieran Kelleher wrote:

Since I upgraded our WO app server from 10.3.7 to 10.3.9 lsof  
shows that wotaskd, and consequently all the WO apps, are being  
launched as root instead of appserver.


Checking current permissions on wotasd.woa contents shows wotaskd  
itself is owned by appserver as shown here:


XApp:/System/Library/WebObjects/JavaApplications/wotaskd.woa admin 
$ ls -al

total 80
drwxr-xr-x   6 root  wheel   204 25 Nov  2003 .
drwxr-xr-x   4 root  wheel   136 25 Nov  2003 ..
drwxr-xr-x  10 root  wheel   340 25 Nov  2003 Contents
-rw-r--r--   1 root  wheel  6464 13 Sep  2003  
WOBootstrap.jar

-rwsr-xr-x   1 appserve  appserve  11051 13 Sep  2003 wotaskd
-rwxr-xr-x   1 root  wheel 16594 13 Sep  2003 wotaskd.cmd

How can I get wotaskd to launch as appserver again like it used  
to and not root?


This one has me stumped -- with a setuid like that, it should  
definitely be starting as appserverusr.  Try rebooting?  :-)  Maybe  
run a disk check with Disk Util...



sacha


--
Coming in 2006 - an introduction to web applications using WebObjects  
and Xcode http://www.global-village.net/wointro


Practical WebObjects - for developers who want to increase their  
overall knowledge of WebObjects or who are trying to solve specific  
problems.http://www.global-village.net/products/practical_webobjects






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

This email sent to archive@mail-archive.com


Re: Out of order SQL statements?

2006-02-23 Thread Sacha Michel Mallais

On Feb 23, 2006, at 1:21 PM, Dov Rosenberg wrote:

The DEFERRABLE clause is Oracle specific. SQL Server does not seem  
to have
an equivalent piece of functionality (which has given us some  
problems)


FYI, it also exists on FrontBase (no I don't work for them :-).   
AFAIK, it is part of the SQL 92 standard (which, of course, doesn't  
mean any particular db has to implement it...).



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/


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

This email sent to archive@mail-archive.com


Re: Out of order SQL statements?

2006-02-23 Thread Sacha Michel Mallais

On Feb 23, 2006, at 1:06 PM, John Huss wrote:

I've got a Master-Detail edit page where the user can add and  
delete detail records.  One of the detail fields has a UNIQUE  
constraint on it.


If I delete a detail record and then add a new one with the same  
unique key and save, it causes a constraint violation in the  
database.  Looking at the generated SQL, it is executing the INSERT  
before the DELETE, even though the delete happened first.  Why is  
this happening?


What database are you using?  Some databases can defer asserting the  
constraints until commit.  That's probably what you want.   
Alternatively, there is a WO api that allows you to manually order  
the SQL operations.



sacha


--
Sacha Michel Mallais Knowledge Broker
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS d- s++:++ a C++()$ [EMAIL PROTECTED]()$ P-(---) L+(-) E>++
W++(+++) N+ o? K? w(---) O M++ V-(--) PS+++ PE(-) Y+ PGP++ t+
5+ X+ R+>+++ tv+ b+ DI+++ D++ G e++ h(+) r* y+(*)
--END GEEK CODE BLOCK--



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

This email sent to archive@mail-archive.com


Re: Moving XCode Projects between Macs

2006-02-16 Thread Sacha Michel Mallais

On Feb 16, 2006, at 11:08 AM, Jonathan Miller wrote:

I'm moving a WO Project (using X-Code) from one mac to another and  
I was wondering if anyone knew where the default setting was for  
registering the new file system with the project. i.e. When you go  
to build the project it cannot find the source files b/c it is  
still looking for them in the old file structure.


I think you simply need to rebuild the index, which you can do by  
selecting Get Info on the root node of the project.


If that doesn't work, delete the damn build directory and restart  
Xcode...



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
"I resist change even as I call for it."  -- Mason Cooley




PGP.sig
Description: This is a digitally signed message part
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Re: SQL?

2006-02-09 Thread Sacha Michel Mallais

On Feb 8, 2006, at 10:36 PM, Guido Neitzer wrote:


On 09.02.2006, at 1:45 Uhr, Sacha Michel Mallais wrote:

If you _must_ use SQL (usually only necessary for optimization),  
then you'll have to do something like this:


Isn't this unnecessary complex? Why not just use  
EOUtilities.rawRowsForSQL?


True.  You only need the full thing for arbitrary SQL (e.g. if you  
want aggregates or PK generation).



sacha


--
Sacha Michel Mallais Big Kahuna
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Blessed is the WO-geek, for he shall inherit from NSEarth (Jobs 3:14)


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

This email sent to archive@mail-archive.com


Re: SQL?

2006-02-08 Thread Sacha Michel Mallais

On Feb 8, 2006, at 4:33 PM, Jim Wong wrote:

Can I use SQL statements in WO to extract certain rows in my  
entity? Basically I want to filter my entity object for certain  
rows of data. how to do this?


Yes you can, but you generally don't want to.  Take a look at the  
documentation for EOFetchSpecification.
http://developer.apple.com/documentation/WebObjects/Reference/API/com/ 
webobjects/eocontrol/EOFetchSpecification.html


If you _must_ use SQL (usually only necessary for optimization), then  
you'll have to do something like this:


EOModel model = entity.model();
EOSQLExpressionFactory expressionFactory = new  
EOSQLExpressionFactory(EOAdaptor.adaptorWithModel(model));


EOAdaptorChannel channel = (dbCtxt.availableChannel 
()).adaptorChannel();

EOAdaptorContext adaptorContext = channel.adaptorContext();

adaptorContext.beginTransaction();

EOSQLExpression expression =  
expressionFactory.expressionForString("**SQL STATEMENT  
HERE***");
NSArray results = (NSArray) 
EOAdaptorChannelAdditions.resultOfEvaluatingSQLExpression(channel,  
expression);


adaptorContext.commitTransaction();

Of course, you can also JDBC directly if you don't need both your  
feet...



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
ObAd: read "Practical WebObjects" 
http://www.global-village.net/products/practical_webobjects


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

This email sent to archive@mail-archive.com


Re: More newbie questions

2005-11-15 Thread Sacha Michel Mallais

On Nov 15, 2005, at 3:48 PM, Randy Becker wrote:


On Nov 15, 2005, at 6:21 PM, Sacha Michel Mallais wrote:


On Nov 15, 2005, at 2:46 PM, Randy Becker wrote:


Right now I've got:
String format = "title caseInsensitiveLike %s";
NSArray args = new NSArray(searchQuery);
return EOUtilities.objectsWithQualifierFormat( session 
().defaultEditingContext(), "Item", format, args);


but I'd like to do something like
String format = "(title caseInsensitiveLike %s) OR (title  
caseInsensitiveLike %s)";


That exact format string will work.  The only difference is you'll  
need to include a second argument for the second %s.


D'oh! :)

by the way, there must be a better way of doing this than the  
following:

NSMutableArray arguments = new NSMutableArray();
arguments.addObject(searchQueryWithWildcard);
arguments.addObject(searchQueryWithWildcard);
NSArray args = new NSArray(arguments);


Well, you never need the last line, since NSMutableArray is a  
subclass of NSArray.  You can do the first three lines in one line:
NSArray arguments = new NSArray(new Object[]  
{searchQueryWithWildcard, searchQueryWithWildcard});

OR
NSMutableArray arguments = new NSMutableArray(new Object[]  
{searchQueryWithWildcard, searchQueryWithWildcard});


I'm not sure if that's better or worse than three lines...


Secondly, how can I display data from an object related to one  
that is displayed in a WORepetition. Right now, I'm only able to  
access the attributes of a particular object I'm outputting, and  
the information I'd like to display is located in a related object.


Through the magic of Key Value Coding.  If you have two objects a  
and b, where a relates to b, and where both have a "name"  
attribute, then all the following will work:


key path  gives

a the object a
a.namea's name
a.name.length a's name's length
a.b   the b that is related to a
a.b.name  the name of the b that is related to a


Actually, the two objects I'm dealing with in particular do not  
have the same attributes - I want to find the address of a person  
who owns an item, but an item can be owned and posessed by  
different people, thusly, I'm trying to do something like  
item.owner.address - but item also is related to a person by the  
item.possessor attribute...


The fact that they have the same attributes is irrelevant, sorry if I  
gave you that impression from my harebrained example.


So, if you have an "item", then
item.owner.address  key path to owner's address
item.possessor.address  key path to possessor's address
item.possessor.myAttribute  key path to possessor's myAttribute
item.owner.yourAttributekey path to owner's yourAttribute

HTH,


sacha


--
Sacha Michel Mallais 400 lb. chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Choke on that, causality!  -- the Professor, "Futurama"





PGP.sig
Description: This is a digitally signed message part
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Re: More newbie questions

2005-11-15 Thread Sacha Michel Mallais

On Nov 15, 2005, at 2:46 PM, Randy Becker wrote:

Firstly, is there an EOUtilities function to return objects that  
match multiple criteria? Or do I have to use lower level methods?


Yes, you're using it below: objectsWithQualifierFormat()...



Right now I've got:
String format = "title caseInsensitiveLike %s";
NSArray args = new NSArray(searchQuery);
return EOUtilities.objectsWithQualifierFormat( session 
().defaultEditingContext(), "Item", format, args);


but I'd like to do something like
String format = "(title caseInsensitiveLike %s) OR (title  
caseInsensitiveLike %s)";


That exact format string will work.  The only difference is you'll  
need to include a second argument for the second %s.



Secondly, how can I display data from an object related to one that  
is displayed in a WORepetition. Right now, I'm only able to access  
the attributes of a particular object I'm outputting, and the  
information I'd like to display is located in a related object.


Through the magic of Key Value Coding.  If you have two objects a and  
b, where a relates to b, and where both have a "name" attribute, then  
all the following will work:


key path  gives

a the object a
a.namea's name
a.name.length a's name's length
a.b   the b that is related to a
a.b.name  the name of the b that is related to a


And finally, how can I do something like the WOExamples  
WXCheckBoxList - I tried importing some of the frameworks in the  
examples project, but couldn't get it to work - what I want to do  
is present a list of checkboxes with a single submit button that  
will perform an action on all of the objects represented by the  
selected boxes.


Hmm, probably easiest just to do this yourself in the submit action  
method.



sacha


--
Sacha Michel Mallais 400 lb. chimp
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Choke on that, causality!  -- the Professor, "Futurama"





PGP.sig
Description: This is a digitally signed message part
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Re: [OT] What line break to use?

2005-10-31 Thread Sacha Michel Mallais

On Oct 31, 2005, at 3:22 PM, Baiss Eric Magnusson wrote:
  I produce a letter which is emailed out that is a short multi- 
line reminder notice, on some Windows email readers the <\r> which  
I use as a line break gets ignored and the lines run together, what  
character(s) should I use as a line break?


\r is carriage return
\n is line feed

There are three standards for line endings:
carriage return (Mac OS 9)
line feed (Unix)
carriage return followed by line feed (DOS, Windows)

Since Mac OS X apps are usually good at handling all three types of  
line endings, you probably want \r\n, but a simple \n will usually  
suffice as well.  You should probably never use \r, as that is  
basically a legacy of Mac OS 9 only.



sacha

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

This email sent to archive@mail-archive.com


Re: connection dictionary error?

2005-10-26 Thread Sacha Michel Mallais

On Oct 26, 2005, at 6:29 AM, Jeremy Matthews wrote:

When attempting to insert values into the database, I receive this  
WO error:


java.lang.IllegalStateException: _obtainOpenChannel --  
com.webobjects.eoaccess.EODatabaseContext  
[EMAIL PROTECTED]: failed to open  
database channel. Check your connection dictionary, and ensure your  
database is correctly configured.


I've tested the DB, and connection, and they are fine. It's just  
that WO doesn't like them. I can generate SQL from EOM as well.


Can you browse data from within EOModeler?  That's really the only  
test that matters when it comes to testing connectivity.



I've heard of the "index.eomodeld" file being corrupted, and that  
it may not have entries, or those entries may need to be rewritten.  
Right now this file is 99% blank, so I'm thinking this may be it.


What do you mean, "99% blank"?  There is 99 blank lines and 1 non- 
blank line?



I'd appreciate any advice or the text of what is supposed to be  
included in that file.


Here is an example:

{
EOModelVersion = "2.1";
adaptorName = JDBC;
connectionDictionary = {
URL = "";
driver = "";
password = "";
plugin = "";
username = "";
};
entities = (
{
className = "SomeClass";
name = SomeClass;
}
);
internalInfo = {};
userInfo = {
history = {
created = "2000-10-24 04:05:17 + by sacha";
lastSaved = "2000-10-24 04:05:17 + by sacha";
};
modificationDate = "2000-10-24 04:07:34 +";
    };
}


Obviously, the URL, driver (optional), password, plugin (optional)  
and username need to be something other than the empty string.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/





PGP.sig
Description: This is a digitally signed message part
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to archive@mail-archive.com

Re: Escape character question

2005-10-24 Thread Sacha Michel Mallais

On Oct 24, 2005, at 12:00 PM, Ismael Perdido wrote:


I am having trouble sending a 'like' operator query
from WO5.2.3 to Postgresql8 (also installed project
wonder).  It apparently bombs on the escape character
being used by default ('\').

Is there a way to modify this character or work around
it WITHOUT  having to use the EOAdaptorChannel to send
the SQL directly to the server?  Below is the error.
Any advice would be greatly appreciated.

com.webobjects.jdbcadaptor.JDBCAdaptorException:
EvaluateExpression failed:
:
Next exception:SQL State:42601 -- error code: 0 --
msg: ERROR: unterminated quoted string at or near
"'\'"


I'm not a Postgres expert, but it looks to me like it is not properly  
quoting the column names, which causes problems when you have column  
names that are the same as keywords, for example "password".  One way  
that I use to debug stuff like this is to copy and paste that SQL  
directly into the SQL interpreter.  Then you can quickly try various  
permutations and see what's actually happening.


On a separate issue, it looks like you're using caseInsensitiveLike,  
and it also looks like that ends up using UPPER.  That will work but  
it cannot use the index, so your query will be slower than you might  
otherwise suspect.



sacha


--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais



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

This email sent to archive@mail-archive.com


Re: Advice on datetime manipulation

2005-10-24 Thread Sacha Michel Mallais

On Oct 24, 2005, at 10:24 AM, Dev WO wrote:


Hi list,
usually I do something stupid and then ask for your help;) so this  
time I though it would be wise to ask before doing something "not  
good":)
So I have to handle poneys and horses (yes it's funny), and they  
have something very specific:

These "items" aren't 1 year old when they have 12 month!
In fact they get 1 year old when they cross their first "new year",  
so if it has born on december 29th it will be 1 year old only 3  
days after...


And I have to manage "categories" depending of their "age".

So my question is regarding the clever way to handle that.

I've got their date of birth in database. I don't think I can  
handle something like their "official age" directly in the EOModel  
(but I may be wrong), so I think I have to handle that directly in  
code.


Quite some items are already in the database, but maybe it would be  
good to handle this when they insert the item like having another  
attribute "official date of birth" which will be set to the  
previous new year and so doing the "regular" calculation on this  
attribute and not on the "real" date of birth.


Or handling all this when generating the list only.

Any advice on this is greatly appreciated, or pointer to specific  
method that would be of help:)


Sounds like the "age" is a calculated field, based on date of birth.   
Your best bet is probably to create a method "age" on your EO that  
returns the age, calculated from the date of birth.


HTH,


sacha

--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc.   http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/



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

This email sent to archive@mail-archive.com