Re: WebObjects classloader fun.

2007-03-30 Thread Mike Schrag
You need to use reflection to do that so you can poke at the  
underlying dictionary directly, which isn't pretty, but it works.

Yikes ... I meant via API.  That's just evil :)

ms


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

This email sent to archive@mail-archive.com


Re: Network change

2007-03-30 Thread Kieran Kelleher
I have been using my Bonjour hostname kieranbook.local. I will try  
localhost.


Thanks, Kieran

On Mar 29, 2007, at 11:45 PM, Chuck Hill wrote:

What do you use for a host name?  I have set my wotaskd to run  
under localhost and also launch my apps with -WOHost localhost.


Chuck


On Mar 29, 2007, at 8:28 PM, Kieran Kelleher wrote:

I am sure anyone with a laptop sees the No instance available  
problem often when they move from one network to another. Whenever  
I see this after moving networks, I run the following script which  
used to work 99% of the time on my old Macbook Pro, but doing  
something similar on new Core 2 Duo MBP does not seem to work so  
well anymore and sometimes a reboot is all that works. Any  
suggestions as to additional stuff I can reset/restart or other  
variations of this that works well to get rid of the No instance  
available message when switching networks on my dev laptop?  
Anyone care to share their fix it scripts?


#!/bin/bash

if [ `whoami` != root ]; then
  echo You must be root to use this!
  exit 1
fi

echo Stopping Apache...
apachectl stop

echo Stopping WebObjects...
/System/Library/StartupItems/WebObjects/WebObjects stop

echo sleep 1 (seconds)
sleep 1

echo Starting WebObjects...
/System/Library/StartupItems/WebObjects/WebObjects start

echo Starting Apache...
apachectl start

echo Done.

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


This email sent to [EMAIL PROTECTED]



--

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

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







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

This email sent to archive@mail-archive.com


RE: Anyone have a phone number formatter?

2007-03-30 Thread David Aspinall
Message formatting is hard with Exchange WebMail (sucks) but here is a method 
we use to strip out the garbage and then submit the different parsed values for 
area code, number and extension.


/** assumes the phone number is (111)  222-     extension 444 which we 
reduce to 111222444 and then split up */
public void setFullPhoneNumer( String value )
{
if ( value != null )
{
/** remove everything except numbers */
String reduced = value.replaceAll(^1|\\D+, 
Const.EMPTY_STRING);

int len = reduced.length();
if ( len = 10 )
{
validateTakeValueForKeyPath( reduced.substring( 0, 3 ), 
phoneAreaCode );
validateTakeValueForKeyPath( 
reduced.replaceAll(^(\\d{3})(\\d{3})(\\d{4})(\\d*), $2$3), phoneNumber);

// this will insert a dash in the phone number, depends 
how you want to store the value
// 
reduced.replaceAll(^(\\d{3})(\\d{3})(\\d{4})(\\d*), $2-$3), phoneNumber);

if ( len  10 )
validateTakeValueForKeyPath( reduced.substring( 
10 ), phoneExtension );
}
else
throw new NSValidation.ValidationException( Invalid 
phone number );
}
}


-Original Message-
From: [EMAIL PROTECTED] on behalf of Chuck Hill
Sent: Thu 3/29/2007 8:09 PM
To: Kevin Windham
Cc: WebObjects Dev Apple
Subject: Re: Anyone have a phone number formatter?
 
If you just want output formatting (and not input parsing), it can be  
as simple as this:

 public StringBuffer format(Object object, StringBuffer  
stringBuffer, FieldPosition fieldPosition)
 {
 if (object instanceof Number)
 {
 stringBuffer.append(((Number)object).intValue() == 2 ?  
Y : );
 }

 return stringBuffer;
 }



 /**
  * @throw RuntimeException parseObject is not implemented
  */
 public Object parseObject(String arg0, ParsePosition arg1)
 {
 throw new RuntimeException(parseObject is not implemented);
 }


This is an output formatter that takes a number formats this to Y  
if the value is 2 and to an empty string for all other values.  Don't  
ask, legacy data.

Chuck




On Mar 29, 2007, at 4:58 PM, Kevin Windham wrote:

 I am looking for info on how to create a formatter for phone  
 numbers. I have surmised that I am supposed to use java.text.format  
 in some fashion, but I am having trouble finding any examples.

 Does anyone have any examples they can share, or can point me to  
 some better info than the java docs on the class.

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

 This email sent to [EMAIL PROTECTED]


-- 

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





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

This email sent to [EMAIL PROTECTED]

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

This email sent to archive@mail-archive.com

snapshot does not contain value for attribute named x with snapshot key: x ?

2007-03-30 Thread Alan Zebchuk
Does anyone know what would cause the following error and what the  
solution is?


 er.extensions.ERXApplication (ERXApplication.java:904)  - Exception  
caught: rowDiffsForAttributes: snapshot in  
com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {};  
_entity = MyEntity; _newRow = {content = Some Random Content;  
myInteger = 1; oid = 336; }; _object =  
ca.protocolis.entity.MyTestEntity pk:336; _globalID =  
_EOIntegralKeyGlobalID[MyTestEntity (java.lang.Integer)336];  
_databaseOperator = EODatabaseUpdateOperator; } does not contain  
value for attribute named content with snapshot key: content



Thanks,

Alan
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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: snapshot does not contain value for attribute named x with snapshot key: x ?

2007-03-30 Thread Chuck Hill

Hi Alan,


On Mar 30, 2007, at 7:14 AM, Alan Zebchuk wrote:

Does anyone know what would cause the following error and what the  
solution is?


You are not properly locking all of the editing contexts and / or  
violating EOF Commandments (Google that term for the details).



er.extensions.ERXApplication (ERXApplication.java:904)  - Exception  
caught: rowDiffsForAttributes: snapshot in  
com.webobjects.eoaccess.EODatabaseOperation {_dbSnapshot = {};


That last bit, _dbSnapshot = {}, is the clue.  EOF has no snapshot  
for the object you are trying to update. You have trashed the EOF state.


Chuck


_entity = MyEntity; _newRow = {content = Some Random Content;  
myInteger = 1; oid = 336; }; _object =  
ca.protocolis.entity.MyTestEntity pk:336; _globalID =  
_EOIntegralKeyGlobalID[MyTestEntity (java.lang.Integer)336];  
_databaseOperator = EODatabaseUpdateOperator; } does not contain  
value for attribute named content with snapshot key: content




--

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: Network change

2007-03-30 Thread Chuck Hill

In case it is not obvious, you need to edit
/System/Library/WebObjects/JavaApplications/wotaskd.woa/Contents/ 
Resources/Properties

and add this line:
WOHost=localhost

And, of course, restart wotaskd after that.

Mike mentioned editing /etc/httpd/httpd.conf and setting
ServerName localhost

I just checked and I also have that setting.  I don't recall if it is  
required or not, but it seems like a good idea.


Chuck


On Mar 30, 2007, at 6:25 AM, Kieran Kelleher wrote:

I have been using my Bonjour hostname kieranbook.local. I will  
try localhost.


Thanks, Kieran

On Mar 29, 2007, at 11:45 PM, Chuck Hill wrote:

What do you use for a host name?  I have set my wotaskd to run  
under localhost and also launch my apps with -WOHost localhost.


Chuck


On Mar 29, 2007, at 8:28 PM, Kieran Kelleher wrote:

I am sure anyone with a laptop sees the No instance available  
problem often when they move from one network to another.  
Whenever I see this after moving networks, I run the following  
script which used to work 99% of the time on my old Macbook Pro,  
but doing something similar on new Core 2 Duo MBP does not seem  
to work so well anymore and sometimes a reboot is all that works.  
Any suggestions as to additional stuff I can reset/restart or  
other variations of this that works well to get rid of the No  
instance available message when switching networks on my dev  
laptop? Anyone care to share their fix it scripts?


#!/bin/bash

if [ `whoami` != root ]; then
  echo You must be root to use this!
  exit 1
fi

echo Stopping Apache...
apachectl stop

echo Stopping WebObjects...
/System/Library/StartupItems/WebObjects/WebObjects stop

echo sleep 1 (seconds)
sleep 1

echo Starting WebObjects...
/System/Library/StartupItems/WebObjects/WebObjects start

echo Starting Apache...
apachectl start

echo Done.

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


This email sent to [EMAIL PROTECTED]



--

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

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










--

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

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





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

This email sent to archive@mail-archive.com


Best non-Apple platform for WO?

2007-03-30 Thread Ken Anderson
It looks like I'm going to have to deploy WO on non-Apple hardware : 
(  I'm still trying, but I want to be prepared.  Can anyone chime in  
with what they do, and how they do it?  I would still like to use  
wotaskd, and I understand that it's no problem to do that.


Any and all thoughts are appreciated...

Ken
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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


Spell checkers

2007-03-30 Thread Bjerke, Michael A.
Has anyone had experience with adding a spell checker to a WO application?  I 
have a trial version of JSpell Evolution from The Solution Café but can't get 
it to work with my application.  It comes as a WAR file.  I put the WAR file 
into my JBoss deployment directory.  When JBoss expands it, there are several 
Javascript files which are referenced by their test HTML file, which is in the 
same directory.  That test file works correctly.  The rest of the WAR file is 
the piece that actually does the spell checking.  You are just supposed to add 
the following lines to your HTML.

 

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=jspellSettings.js 
http://myserver:7080/jspellEvolution/jspellSettings.js 

CHARSET=ISO-8859-1/script

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=jspellEvolution.js 
http://myserver:7080/jspellEvolution/jspellEvolution.js 

CHARSET=ISO-8859-1/script

 

But the app doesn't seem to be able to find the Javascript files, because 
nothing happens.  So I copied these two files out of the deployment directory 
and into a directory in my area and changed the references to the following.

 

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=/home/sks/jspellSettings.js 
http://myserver:7080/jspellEvolution/jspellSettings.js 

CHARSET=ISO-8859-1/script

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=/home/sks/jspellEvolution.js 
http://myserver:7080/jspellEvolution/jspellEvolution.js 

CHARSET=ISO-8859-1/script

 

That didn't work either, so I tried referencing them as a URL.  My JBoss runs 
off port 7080, and if I enter that URL in my browser, it finds the Javascript 
file.

 

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=http://myserver:7080/jspellEvolution/jspellSettings.js;

CHARSET=ISO-8859-1/script

script LANGUAGE=JavaScript TYPE=text/javascript

SRC=http://myserver:7080/jspellEvolution/jspellEvolution.js;

CHARSET=ISO-8859-1/script

 

No luck.  If anyone has some advice on how to get this to work, or knows of 
another product that has worked with WO, I would be most appreciative.

 

Thanks.

 

Michael Bjerke

Oak Ridge National Laboratory

Networking  Computing Technologies Department

Office:(865) 574-4654

Cell:   (865) 567-8385

 

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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 non-Apple platform for WO?

2007-03-30 Thread Mike Schrag
It's pretty painless, actually ... There's a wikibook entry on doing  
the full setup w/ JavaMonitor, etc.  One of our sites is on Linux,  
actually.


Ray also posted a blog entry just recently on a stripped down  
install, though he was doing direct connect via Apache rewriting.


ms

On Mar 30, 2007, at 11:23 AM, Ken Anderson wrote:

It looks like I'm going to have to deploy WO on non-Apple hardware : 
(  I'm still trying, but I want to be prepared.  Can anyone chime  
in with what they do, and how they do it?  I would still like to  
use wotaskd, and I understand that it's no problem to do that.


Any and all thoughts are appreciated...

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


This email sent to [EMAIL PROTECTED]



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

This email sent to archive@mail-archive.com


Re: Best non-Apple platform for WO?

2007-03-30 Thread Miguel Arroz

Hi!

  Check http://en.wikibooks.org/wiki/Programming:WebObjects/ 
Web_Applications/Deployment/FreeBSD_WO5.3 for FreeBSD, http:// 
en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/ 
Deployment/Linux for Linux and http://en.wikibooks.org/wiki/ 
Programming:WebObjects/Web_Applications/Deployment/Windows for  
Windows. FeeBSD has the most updated docs, and it would be the system  
of choice for me (first, it's not Windows. Second, it's not Linux.  
Third, it's the closest to Mac OS X!).


  Yours

Miguel Arroz

On 2007/03/30, at 16:23, Ken Anderson wrote:

It looks like I'm going to have to deploy WO on non-Apple hardware : 
(  I'm still trying, but I want to be prepared.  Can anyone chime  
in with what they do, and how they do it?  I would still like to  
use wotaskd, and I understand that it's no problem to do that.


Any and all thoughts are appreciated...

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


This email sent to [EMAIL PROTECTED]



  I felt like putting a bullet between
   the eyes of every Panda that wouldn't
   scr*w to save its species.   -- Fight Club

Miguel Arroz
http://www.ipragma.com



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

This email sent to archive@mail-archive.com


Re: Best non-Apple platform for WO?

2007-03-30 Thread Steve Sharman

Ken,

I've recently deployed some of our applications across a set of Linux  
systems in a three tier config web, application server and database.  
Standard Dell hardware, and I used CentOS 4.4 as the operating  
system, with Apache 2.2 and MySQL 5. I used the instructions on the  
Wikibook for deployment onto FreeBSD, as the Linux install  
instructions only seems to cover 5.2. I used the Apache 2.2 adaptor  
from Wonder.


http://en.wikibooks.org/wiki/Programming:WebObjects/Web_Applications/ 
Deployment/FreeBSD_WO5.3


It was all surprisingly quick and painless.  The only points that  
took a little bit of time were:


- Apache 2.2 and MySQL 5.0.37 are not immediately available in the  
default packages for CentOS, but a little bit of Googling found an  
alternative source for those
- I had a few challenges with collecting the right frameworks and so  
on for the install from my development machine (OS X client) -  
probably because I have the accumulated crud of ages on there. Basing  
the install on OS X Server worked really well.


Best regards,

-- Steve

On 30 Mar 2007, at 16:23, Ken Anderson wrote:

It looks like I'm going to have to deploy WO on non-Apple hardware : 
(  I'm still trying, but I want to be prepared.  Can anyone chime  
in with what they do, and how they do it?  I would still like to  
use wotaskd, and I understand that it's no problem to do that.


Any and all thoughts are appreciated...

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


This email sent to [EMAIL PROTECTED]



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

This email sent to archive@mail-archive.com


DBUnit configuration WOLips

2007-03-30 Thread Michael Warner
I have a small xml file representing a dataset for DBUnit.   During  
the build,
I believe that I should add this file to the /Content/Resources  
directory of the .woa


Can I add an ant task to the build.xml file that will do this in a  
handy way,  then

use code like the following (obtained from Chuck Hill) in my test class:

protected IDataSet getDataSet() throws Exception {
	InputStream dataSet = NSBundle.mainBundle 
().inputStreamForResourcePath(name);

if (dataSet == null) {
throw new RuntimeException(Can't locate resource  +  
name +  in bundle  + NSBundle.mainBundle().name());

}
return new FlatXmlDataSet(dataSet);
}

What is a best-practice way to set all of this up?

Thanks,

Mike W.


 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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: DBUnit configuration WOLips

2007-03-30 Thread Chuck Hill
The same as any other resource. There is a menu option to Include as  
Resource under the WOLips context menu.  Or (safer IMHO), edit  
woproject/resources.include.patternset  and add one of these


**/small.xml
**/*.xml

The first is more specific, the second  very generic, perhaps too  
generic.


Chuck

On Mar 30, 2007, at 11:00 AM, Michael Warner wrote:

I have a small xml file representing a dataset for DBUnit.   During  
the build,
I believe that I should add this file to the /Content/Resources  
directory of the .woa


Can I add an ant task to the build.xml file that will do this in a  
handy way,  then
use code like the following (obtained from Chuck Hill) in my test  
class:


protected IDataSet getDataSet() throws Exception {
	InputStream dataSet = NSBundle.mainBundle 
().inputStreamForResourcePath(name);

if (dataSet == null) {
throw new RuntimeException(Can't locate resource  +  
name +  in bundle  + NSBundle.mainBundle().name());

}
return new FlatXmlDataSet(dataSet);
}

What is a best-practice way to set all of this up?

Thanks,

Mike W.


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


This email sent to [EMAIL PROTECTED]


--

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

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





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

This email sent to archive@mail-archive.com


Generate HTML from a WOComponent programmatically

2007-03-30 Thread Jacky Gagnon

Hi,

I want to be able to generate HTML code from a WOComponent  
programmatically and insert the response into a String (to be display  
into a parent component).


I tried something like this :

public class ParentComponent extends WOComponent {

//A WOString will display the result
public String getText()
{
while ( iNeedMoreSubcomponent )
{
String htmlFromSubComponent = 
generateHTMLOfSubcomponent();

			... code where I insert the result of the sub component into my  
text ...

}
return text;
}

	//This sub component will contain component action and the result  
will be inserted into the text...

public String generateHTMLOfSubcomponent()
{
WOComponent subComponent = pageWithName(SubComponent);
String chaineHTML = 
resultAjax.generateResponse().contentString();

return chaineHTML;
}

}

But the problem with this example is the value of context().page()  
(was ParentComponent), who is replaced by the SubComponent (in my  
case this will be a problem). If I create a new Context for the sub  
component, I will lost my session.


Is there a way to do this or I'm better to change strategy?

Thanks in advance.

Jacky ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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: Generate HTML from a WOComponent programmatically

2007-03-30 Thread Chuck Hill
This sounds like a terrible idea.  Why not use a WORepetition and  
some custom  components?  What are you trying to do that can't be  
done that way?


Chuck

On Mar 30, 2007, at 1:38 PM, Jacky Gagnon wrote:


Hi,

I want to be able to generate HTML code from a WOComponent  
programmatically and insert the response into a String (to be  
display into a parent component).


I tried something like this :

public class ParentComponent extends WOComponent {

//A WOString will display the result
public String getText()
{
while ( iNeedMoreSubcomponent )
{
String htmlFromSubComponent = 
generateHTMLOfSubcomponent();

			... code where I insert the result of the sub component into my  
text ...

}
return text;
}

	//This sub component will contain component action and the result  
will be inserted into the text...

public String generateHTMLOfSubcomponent()
{
WOComponent subComponent = pageWithName(SubComponent);
String chaineHTML = 
resultAjax.generateResponse().contentString();

return chaineHTML;
}

}

But the problem with this example is the value of context().page()  
(was ParentComponent), who is replaced by the SubComponent (in my  
case this will be a problem). If I create a new Context for the sub  
component, I will lost my session.


Is there a way to do this or I'm better to change strategy?

Thanks in advance.

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


This email sent to [EMAIL PROTECTED]


--

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

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





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

This email sent to archive@mail-archive.com


WOForm Question

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


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


- to-one
= to-many

Routing = RoutingStep = Component
Component - RoutingStep - Routing

Ideally, I'd like to be able to edit them all-together in one form,  
but I'm not sure if it is possible or not. This goes way beyond  
having multiple submit buttons.


Here's an example of the stucture:

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

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


Without being able to nest WOForms inside HTML tables, it makes  
layout difficult, and I can't find documentation on if more than one  
form is allowed on one page, etc.


How should I handle this?

Thanks,

Dave

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

This email sent to archive@mail-archive.com


Re: WOForm Question

2007-03-30 Thread Chuck Hill


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

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


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


- to-one
= to-many

Routing = RoutingStep = Component
Component - RoutingStep - Routing

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


It might be a large page...



This goes way beyond having multiple submit buttons.

Here's an example of the stucture:


form

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

/form


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


Without being able to nest WOForms inside HTML tables


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



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


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

webObject name=Form1
///
/webObject name=Form1

webObject name=Form2
///
/webObject name=Form2

What you can't do is this:

webObject name=Form1
///
webObject name=Form2
///
/webObject name=Form2
///
/webObject name=Form1


Or this

webObject name=Form1
///
webObject name=Form2
///
/webObject name=Form1
///
/webObject name=Form2

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


Chuck

--

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

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





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

This email sent to archive@mail-archive.com


Killer WO Coders Needed in New York!

2007-03-30 Thread Alex Cone
Anyone in (or wanting to be in) the NY area who wants to be paid to  
code WO?  CodeFab is hiring again!


We are looking for a couple of WO engineers to work out of our  
offices in the Hell's Kitchen area of New York City.  We'd like  
people with actual Web Objects and Java experience, with experience  
coding JavaScript / AJAX and using agile development techniques a  
plus.  We have a fun work environment, a number of exciting projects  
and an extensive in-office collection of hot sauces.  We're looking  
for bright people who love working in teams and love to write code  
that they see all the way through to deployment.
To apply for a position with CodeFab, send your resume or a link to a  
resume online with a cover letter to:


[EMAIL PROTECTED]

We look forward to hearing from you!

Alex

__alex cone
ceo  c o d e f a b  inc
[EMAIL PROTECTED]
212.465.8484 x101
http://www.codefab.com

There are people who would perhaps call me a dilettante, because it  
looks as though I'm having too much fun. I have never been convinced  
there's anything inherently wrong in having fun. -- George Plimpton



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

This email sent to archive@mail-archive.com


Re: WebObjects classloader fun.

2007-03-30 Thread Q


On 30/03/2007, at 9:43 PM, Mike Schrag wrote:

You need to use reflection to do that so you can poke at the  
underlying dictionary directly, which isn't pretty, but it works.

Yikes ... I meant via API.  That's just evil :)


If you think that's evil, I am not going to tell you what I am going  
to try doing instead. ;)



--
Seeya...Q

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


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

This email sent to archive@mail-archive.com


Re: Generate HTML from a WOComponent programmatically

2007-03-30 Thread Jacky Gagnon


On 07-03-30, at 17:13, Chuck Hill wrote:


This sounds like a terrible idea.


Yes I know ;-)

Why not use a WORepetition and some custom  components?  What are  
you trying to do that can't be done that way?


Its because I have already a Java class who can apply a complex  
transformation to my text, I just have to give tags to insert (like  
HTML, XML etc.)  and this class know how to process the text to  
present the result. I just wanted to reuse it.


But if programmatically generate the HTML of subcomponent don't seem  
a reasonable thing to do or its not easy, I will go for another  
strategy  (I have a plan B for using WORepetition and custom  
component :-)  but will need more work :-( ).


Thanks Chuck.




Chuck

On Mar 30, 2007, at 1:38 PM, Jacky Gagnon wrote:


Hi,

I want to be able to generate HTML code from a WOComponent  
programmatically and insert the response into a String (to be  
display into a parent component).


I tried something like this :

public class ParentComponent extends WOComponent {

//A WOString will display the result
public String getText()
{
while ( iNeedMoreSubcomponent )
{
String htmlFromSubComponent = 
generateHTMLOfSubcomponent();

			... code where I insert the result of the sub component into my  
text ...

}
return text;
}

	//This sub component will contain component action and the result  
will be inserted into the text...

public String generateHTMLOfSubcomponent()
{
WOComponent subComponent = pageWithName(SubComponent);
String chaineHTML = 
resultAjax.generateResponse().contentString();

return chaineHTML;
}

}

But the problem with this example is the value of context().page()  
(was ParentComponent), who is replaced by the SubComponent (in my  
case this will be a problem). If I create a new Context for the  
sub component, I will lost my session.


Is there a way to do this or I'm better to change strategy?

Thanks in advance.

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


This email sent to [EMAIL PROTECTED]


--

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

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







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

This email sent to archive@mail-archive.com


Re: Generate HTML from a WOComponent programmatically

2007-03-30 Thread Mike Schrag

override appendToResponse and do:

WOResponse newResponse = new WOResponse();
super.appendToResponse(newResponse, wocontext);
String yourChildrenAsText = newResponse.contentString();
			String transformedText = // perform your transformation on  
yourChildrenAsText

originalResponse.appendContentString(transformedText);

I have no idea what happens if you try to do this from something  
outside of appendToResponse, though.


ms

On Mar 30, 2007, at 7:43 PM, Jacky Gagnon wrote:



On 07-03-30, at 17:13, Chuck Hill wrote:


This sounds like a terrible idea.


Yes I know ;-)

Why not use a WORepetition and some custom  components?  What are  
you trying to do that can't be done that way?


Its because I have already a Java class who can apply a complex  
transformation to my text, I just have to give tags to insert (like  
HTML, XML etc.)  and this class know how to process the text to  
present the result. I just wanted to reuse it.


But if programmatically generate the HTML of subcomponent don't  
seem a reasonable thing to do or its not easy, I will go for  
another strategy  (I have a plan B for using WORepetition and  
custom component :-)  but will need more work :-( ).


Thanks Chuck.




Chuck

On Mar 30, 2007, at 1:38 PM, Jacky Gagnon wrote:


Hi,

I want to be able to generate HTML code from a WOComponent  
programmatically and insert the response into a String (to be  
display into a parent component).


I tried something like this :

public class ParentComponent extends WOComponent {

//A WOString will display the result
public String getText()
{
while ( iNeedMoreSubcomponent )
{
String htmlFromSubComponent = 
generateHTMLOfSubcomponent();

			... code where I insert the result of the sub component into  
my text ...

}
return text;
}

	//This sub component will contain component action and the  
result will be inserted into the text...

public String generateHTMLOfSubcomponent()
{
WOComponent subComponent = pageWithName(SubComponent);
			String chaineHTML = resultAjax.generateResponse().contentString 
();


return chaineHTML;
}

}

But the problem with this example is the value of context().page 
() (was ParentComponent), who is replaced by the SubComponent (in  
my case this will be a problem). If I create a new Context for  
the sub component, I will lost my session.


Is there a way to do this or I'm better to change strategy?

Thanks in advance.

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


This email sent to [EMAIL PROTECTED]


--

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

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







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


This email sent to [EMAIL PROTECTED]



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

This email sent to archive@mail-archive.com


Component rendered in java vs. via component

2007-03-30 Thread James Cicenia

Hello -

I am now using javascript with YUI and I have a need to render the  
outputted html where it is normally rendered
via one of my components. My normal component basically wraps around  
the text and creates an href that fires

a method. Now I need to render this in java to fit in my javascript.

What is the approach here?

Thanks
James Cicenia


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

This email sent to archive@mail-archive.com


Re: Anyone have a phone number formatter?

2007-03-30 Thread Kevin Windham


On Mar 29, 2007, at 6:58 PM, Kevin Windham wrote:
I am looking for info on how to create a formatter for phone  
numbers. I have surmised that I am supposed to use java.text.format  
in some fashion, but I am having trouble finding any examples.


Does anyone have any examples they can share, or can point me to  
some better info than the java docs on the class.



Just wanted to thank everyone for sending examples of how to create a  
formatter, especially to Dan whose phone formatter was very close to  
what I needed. A few minor modifications and everything worked great.  
The gist of the solution for future reference is to extend  
java.text.format and implement the parseObject method and the format  
method. The parseObject gets the data from the form field prior to it  
getting stored in the DB, and the format method is called to create  
the display string used when pulling data out of the DB.





___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@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