Re: WOAdaptor build and test

2016-04-12 Thread Patrick Middleton


On 12/04/2016 12:48, 
"webobjects-dev-bounces+pmiddleton=onestep.co...@lists.apple.com on behalf of 
Paul Yu"  wrote:

>Chuck
>
>If I have Apache 2.4 running and I can access it, and I can access JavaMonitor 
>and I can access WOTaskd, and when I tick ON in JavaMonitor I can tail -f 
>App-1 and see the app initializing then can I assume that mod_WebObjects is 
>working?
>
>The app is dying at Migration but that’s not what I’m testing right now…
>
>Paul

I suggest you would be better off using the techniques documented in the 
administrator's notes in the apache.conf file in the project for the adaptor 
you've built and installed; 

"Note: To enable logging, touch '/tmp/logWebObjects' as the administrator user 
(usually root)."

and also the stuff about the WOAdaptorInfo page.  The WOAdaptorInfo page is 
generally not helpful when it's getting its configuration by polling wotaskd 
and you don't have any apps running cleanly, but, being able to see it at all 
is a hint that mod_WebObjects is working.  (mod_WebObjects is nothing to do 
with launching or managing application instances; it's about being able to 
connect to them indirectly via Apache.)



One of my techniques for deployment is to get my app instances configured and 
running, use Monitor to get the XMLConfigDoc, save that to disk, then 
reconfigure the WOAdaptor to use that ('File Configuration') instead of polling 
wotaskd ('Host List Configuration'), because then access to my applications is 
not lost if/when wotaskd hangs.

-- Patrick


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

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

WebObjects and Apache 2.4 on El Capitan

2016-03-12 Thread Patrick Middleton
Hi folks,


mod_WebObjects?  Since people are still discussing how to build the Apache 
adaptors on contemporary OSX, maybe I should add some more commentary.


If you need an Apache module that isn't supplied prebuilt for you, either as 
part of Apache or as part of what your vendor supplies, always be ready to 
build your own.  Never go looking to download what someone else has already 
built.  It's too likely that the pre-built one won't work for you.


If you compile something in Java ... you get bytecode, and the class format is 
defined.  Your bytecode can be expected to run in somebody else's JVM.  Also, 
if your code subclassed a class, and the class you subclassed is somehow 
different, has more member fields, it will all still work just fine.


In C, by comparison ... Apache is implemented in C.  It is structures and 
pointers and offsets.  How big are short, int and long?  How does the compiler 
align these to word boundaries? The size of a structure can be very different 
if compiled with different compilers or different compilation options, 
especially compilation options to do with optimization, even if the C source 
code declaring the structure is the same.  The compiler knows the addresses of 
fields within a structure by computing offsets from the structure's address; 
this can cause something in Objective-C 1 called 'fragile base class syndrome' 
where adding an instance variable to a class breks all subclasses of that class 
that have instance variables so, avoid all this.  Build your own!


Apache provides a way round these problems.  Apache modules are supposed to be 
built via a tool /usr/sbin/apxs ["APache eXtension System"] which is a 
/usr/bin/perl script to compile and link your source code using the same 
compiler options as was used to build Apache.


>From memory, we can start by downloading some ProjectWonder source code, and 
>this includes source code for mod_WebObjects, and someone's already added a 
>makefile for building for Apache 2.4 (it's more or less the same as building 
>for Apache 2.2).  I tried this on OSX 10.11 ('El Capitan') mostly to see how 
>it would fail.


Firstly, the build fails because the Makefiles specify building the FastCGI 
adaptor and by defautl we're missing some headers.  We can fix that in 
make.config by setting

ADAPTORS = CGI Apache2.4


Secondly, Apache 2.4 was built for El Capitan by cross-compilation on Yosemite 
(10.10).  There are some references to this which we need to deal with.  
Reading /usr/sbin/apxs (on OSX) we find it has a variable installbuilddir = 
/usr/share/httpd/build and some configuration variables in a file 
config_vars.mk in that directory.


There are references to 
/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.11.xctoolchain , 
you might have that if you are on Yosemite and have the El Capitan SDK 
installed.  There are references to 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.Internal.sdk
 .  We fix these by making softlinks that refere to what we do have.  For me, 
this was (as root):


cd /Applications/Xcode.app/Contents/Developer/Toolchains

pwd

ls -l

ln -s XcodeDefault.xctoolchain OSX10.11.xctoolchain

ls -l

cd 
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

pwd

ls -l

ln -s MacOSX10.11.sdk MacOSX10.11.Internal.sdk

ls -l


I also encountered an error about not being able to find httpd.h.  There's this 
in make.config:

APACHEINCLUDE_DIR = /usr/include/apache2


which doesn't work on modern OSX because Apple appears to have decided not to 
do /usr/include any more.  We need to use the platform SDKs.  I added some 
stuff to make.config to work out which release of OSX the build was happening 
on, what the SDK path should be, and using the SDK path when setting 
APACHEINCLUDE_DIR.


Next up: there was a linker flag "-macosx_version_min 10.5" which we don't want 
on OSX 10.8 and later.  I changed this to be a variable which is empty unless 
on 10.4, 10.5, 10.6 or 10.7.


And that's enough to get the Adaptors project to compile and link.  I've 
provided both a patch file of my changes, and a .tar.gz file of the files I 
changed, which some may find easier to read.  Submitting a patch file to this 
list is not the approved way of proposing changes to Project Wonder, but I'm 
not expecting my changes to make it in anyway.


[There is another gotcha which no longer applies to building on OSX.  Nowadays, 
whatever Apple-supplied C or C++ compiler you ask for, you'll get a compiler 
based on LLVM, which outputs compact omtimised code and ignores optimisation 
flags.  The makefiles for the mod_WebObjects adaptors refer to gcc and -O2.  If 
somebody built Apache using -Os (and Apple used to do that) then there is a 
risk of structure size mismatch problems.]


-- Patrick




changed.tar.gz
Description: changed.tar.gz
diff -Naur Adaptors/Apache2/Makefile Adaptors-prm/Apache2/Makefile
--- 

Re: Use case for a "case insensitive equals" qualifier

2016-02-25 Thread Patrick Middleton

Hi folks,


my experiences of this are with a release of Sybase where case-insensitive 
prefix searching of indexed columns caused table-scanning of a very big table, 
and assorted releases of MySQL with case-insensitive collation sequences.  I 
used to use the EOEditingContext delegate API to spot that a fetch was about to 
occur, and possibly reconstruct the qualifier.  The SQL my custom qualifier 
code was generating (WO451 + Sybase, about 6 years ago ... today, WO451 + 
MySQL) would have looked something like this:


((emailAddress >= 'P' AND emailAddress < 'Q') OR (emailAddress >= 'p' AND 
emailAddress < 'q'))
AND
(lower(emailAddress) = 'pa...@logicsquad.net')


and it worked very well for us because the query plans used indexes as 
intended, but, noting the comments elsewhere on this thread about collation 
sequences for alphabetic characters with diacritics.


-- Patrick




From: webobjects-dev-bounces+pmiddleton=onestep.co...@lists.apple.com 
 on behalf of 
Morris, Mark 
Sent: Thursday, February 25, 2016 3:16 PM
To: Lon Varscsak
Cc: WebObjects Development
Subject: Re: Use case for a "case insensitive equals" qualifier

Hi Lon,

We run into this a lot, and I have a rather complex solution for a "case 
insensitive begins with" qualifier that actually works well, at least with 
Oracle and its indexing. My method returning this qualifier is actually about 
60 lines, but most of that is optimizations for special cases. (We have 
terabytes of data, so every little bit helps!)

The basic idea, though, is that it only takes a couple of characters to hit on 
an index and make a huge difference in performance. So...

Trying to case-insensitive-equals match 
"pa...@logicsquad.net" with the search term 
"pa...@logicsquad.net", you would build this sort 
of qualifier:

(emailAddress like 'PA*' OR emailAddress like 'Pa*' OR emailAddress like 'pA*' 
OR emailAddress like 'pa*') AND UPPER(emailAddress) = 
UPPER('pa...@logicsquad.net')

Hope this helps!

Regards,
Mark

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

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

Re: El Capitan Apache Seg Fault

2015-11-30 Thread Patrick Middleton
Another choice is to install JavaMonitor as a regular application, with a 
single instance, always running.  JavaMonitor has its own password protection, 
but use Apache access permissions to further lock down access to it.


-- Patrick







On 29/11/2015 20:09,  Tim Worman wrote:

>Jeff:
>
>Even if it were not El Capitan, I would not open that port to outside traffic. 
>Instead, use ssh to tunnel that traffic to localhost, like:
>
>ssh -L 8080:localhost:56789 @
>
>Then you can connect your browser to: http://localhost:8080 to interact w 
>JavaMonitor on the remote host. You can also put the above command in your 
>.alias file so you can use a shortcut to start it up.
>
>Tim
>UCLA GSE
>
>> On Nov 29, 2015, at 10:24 AM, Jeff Schmitz  wrote:
>> 
>> One last annoyance with the El Capitan machine, I can’t seem to open port 
>> 56789 for accessing javamonitor remotely.  
>> 
>> I tried the steps outlined at the link below, but according to Network 
>> Utility port scan it’s still not open.  Also, I have the firewall completely 
>> turned off under Security & Privacy Settings.


>

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

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

Re: port 80 refused

2015-06-19 Thread Patrick Middleton
Everything I can see that is working is using an IPv6 address  
(Robert, that includes the SMTP headers where you send your emails to  
the list) while everything that isn't working seems to involve using  
an IPv4 address.


May we see the output from '/sbin/ipconfig -a' too please, and the  
contents of the file '/private/etc/hosts' ?


I continue to speculate that IPv4 support is turned off or  
misconfigured in /Applications/System\ Preferences.app .
localhost ought to be reachable via the software loopback interface,  
and the addresses ought to work even if the router is turned off.

Could we also have a comparison of the output from:
telnet localhost 80
telnet ::1 80
telnet 127.0.0.01 80


On 18 Jun 2015, at 23:20, Robert B. Hanviriyapunt wrote:


Hey Robert and Patrick,

sudo lsof -P -i tcp:80
Password:
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
httpd   7397 root5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7398  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7399  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7400  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7401  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7402  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)
httpd   7527  edc5u  IPv6 0xf141290e6dd33f95  0t0  TCP *:80  
(LISTEN)


and

edc@edcs-mbp:~/usr/bin/host localhost
localhost.attlocal.net has address 127.0.0.1
edc@edcs-mbp:~/usr/bin/dig a localhost

;  DiG 9.8.3-P1  a localhost
;; global options: +cmd
;; Got answer:
;; -HEADER- opcode: QUERY, status: NOERROR, id: 34501
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0,  
ADDITIONAL: 0


;; QUESTION SECTION:
;localhost. IN  A

;; ANSWER SECTION:
localhost.  0   IN  A   127.0.0.1

;; Query time: 7 msec
;; SERVER: 192.168.1.254#53(192.168.1.254)
;; WHEN: Thu Jun 18 17:18:20 2015
;; MSG SIZE  rcvd: 43

Could it be my WIFI router?

--
Robert B. Hanviriyapunt


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

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

Re: port 80 refused

2015-06-17 Thread Patrick Middleton
I'd guess that IPv4 is disabled but IPv6 is enabled.  Never seen that  
before.
Check your Apache access log.  You may find the address ::1 appearing  
everywhere.
What do ' /usr/bin/host localhost ' and '/usr/bin/dig a localhost'  
report?



On 17 Jun 2015, at 08:19, Robert B. Hanviriyapunt wrote:


Anybody have an idea why ...

telnet localhost 80

works, but ...

telnet 127.0.0.1 80
and
telnet {my-ip-address} 80

are both REFUSED!!!?


I am on 10.9.5, firewall off, apache2 (under AMPPS).

Anything to do with Ruby?

Also I am only on WIFI.


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

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

Re: Precompiled WOAdaptor for apache 2.4

2014-11-05 Thread Patrick Middleton


On 4 Nov 2014, at 20:40, Benjamin Chew wrote:

...


If you want to see how I got things to work, read on...

...


Other things that I had to do after I built the adaptor:

- I then created the directory /System/Library/WebObjects/Adaptors/ 
Apache2.4/ and moved the adaptor there


- Copied the apache.conf file from
/System/Library/WebObjects/Adaptors/Apache2.2
to
/System/Library/WebObjects/Adaptors/Apache2.4

- Change the path in the 2nd line of apache.conf to:
LoadModule WebObjects_module/System/Library/WebObjects/ 
Adaptors/Apache2.4/mod_WebObjects.so

...

In an ideal world, by convention you would be placing this stuff in / 
Library/ , not /System/Library/ .  You can put it anywhere you like,  
provided Apache can find it.






- I did find it a little weird that this was already in my  
httpd.conf (maybe it wasn't stock after all?), but if you don't  
have it, you need to add it:

IfModule alias_module
  ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$) /Library/ 
WebServer/CGI-Executables/$1 --- ADD THIS LINE

/IfModule


Mmm?
Head to http://httpd.apache.org/ , find and download  
httpd-2.4.10.tar.gz , search the source code for the word webobjects  
-- you won't find it.
Head to http://www.opensource.apple.com/release/os-x-1010/ , find and  
download apache-793 [ http://www.opensource.apple.com/tarballs/apache/ 
apache-793.tar.gz ], search the source code for the word webobjects  
-- you will find it in patches/PR-5432464.diff_httpd.conf , which  
looks like this:


=-=-=-=-=-=-=-=-=
--- docs/conf/httpd.conf.in.orig2012-11-07 19:05:38.0 -0800
+++ docs/conf/httpd.conf.in 2013-11-11 14:30:00.0 -0800
@@ -246,7 +246,7 @@
 # client.  The same rules about trailing / apply to ScriptAlias
 # directives as to Alias.
 #
-ScriptAlias /cgi-bin/ @exp_cgidir@/
+ScriptAliasMatch ^/cgi-bin/((?!(?i:webobjects)).*$)  
@exp_cgidir@/$1


 /IfModule
=-=-=-=-=-=-=-=-=


ie, Apple's stock build of Apache 2.4.9 (and 2.2.x, if you care to  
repeat the exercise for OSX 10.9.x and earlier) does indeed have a  
default configuration that is tweaked so that requests for URLs /cgi- 
bin/WebObjects are not processed by the CGI handler.



Still reading?  OSX 10.10 ships with Apache 2.4.9, the SSL module  
uses OpenSSL and the libraries shipped are OpenSSL 0.9.8za .  The  
current release of Apache is 2.4.10, and OpenSSL is 0.9.8zc or  
1.0.1j. If you are deploying on OSX, and care, or are obliged to  
care, about running fully-patched software with no known  
vulnerabilties or exploits, what Apple ships will no longer do.  When  
Apple ships security updates, any Apache or OpenSSL included will be  
newer, but rarely new enough.  Learning to build your own Apache 2.x  
and OpenSSL is something I recommend.


-- Patrick

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

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

Re: Precompiled WOAdaptor for apache 2.4

2014-10-28 Thread Patrick Middleton

I am puzzled by this entire thread.

The other day, at home, at my Mac running Yosemite with the newest  
shiniest Xcode tools installed,

I did something like this...

cd /tmp/
svn co https://github.com/wocommunity/wonder.git/trunk/Utilities/ 
Adaptors

cd /tmp/Adaptors
gnumake
gnumake Apache2.4

and that built me the module; copying stuff by hand was not onerous.

There were some gotchas.  On OSX, the project is set up to build the  
WO adaptor internals (this works), the CGI adaptor (this works), the  
FastCGI adaptor (does not work, missing headers) and the Apache2.2  
adaptor (never got there because of FastCGI; didn't care).  The  
project will build the Apache 2.4 adaptor, provided the WO adaptor  
internals have been built.


/usr/sbin/apxs will not work as-is: it tries to use a compiler  
toolchain that doesn't exist, referring to IIRC /Applications/ 
Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain/usr/bin/ 
cc .  apxs is your friend; it's there to let you build Apache modules  
with the same compiler and flags (especially optimisation flags) as  
was used to build Apache.


So we do something like (from memory)

cd /Applications/Xcode.app/Contents/Developer/Toolchains/ 
OSX10.10.xctoolchain/

sudo ln -s XcodeDefault.xctoolchain OSX10.10.xctoolchain

and if I have that right, we can now use Xcode tools via the same  
filenames as were used by whoever at Apple built Apache 2.4 for  
Yosemite.  Have a read of the /usr/sbin/apxs script.  Even if (like  
me) you don't code in perl, you should find yourself looking at /usr/ 
share/httpd/build/config_vars.mk next, which will have the reference  
to /Applications/Xcode.app/Contents/Developer/Toolchains/ 
OSX10.10.xctoolchain/usr/bin/cc , and you will also see no  
optimisation flags listed in CFLAGS -- personally, here I would  
remove -O2 from CFLAGS in all the Makefiles that build any code  
loaded by Apache.


In an ideal world, those of us interested in Apache only would rework  
this project to avoid invoking the compiler or linker directly, we'd  
have apxs do it for us, noting we can still get at some settings as  
'apxs -q CFLAGS', 'apxs -q CC' etc.



You will also likely need to remove any '-macosx_version_min 10.5'  
compiler/linker arguments because the recent OSX C compilers don't  
appear to support that any more.



-- Patrick

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

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

Re: Yosemite

2014-08-05 Thread Patrick Middleton

I anticipate that's not a biggie.

You're building via APXS, APXS tries to use the same compiler and  
compiler flags to make sure the ABI matches.


Because of how the compiler tools are installed in recent OSX  
releases, the compiler is not /usr/bin/cc, it's ... something inside  
an Xcode toolchain, something like the path in the error message.


That path /Applications/Xcode.app/Contents/Developer/Toolchains/ 
OSX10.10.xctoolchain/usr/bin/cc is probably hardcoded into /usr/sbin/ 
apxs.  That is the APXS tool being used, not the one your build has  
created and which will later be installed by 'make install'


The path of the default Xcode toolchain provided by whichever Xcode  
you are using is different; create OSX10.10.xctoolchain as a symlink  
using /bin/ln to an Xcode toolchain you do have.


Or fiddle with the hardcoded path in /usr/sbin/apxs.

When 'make install' completes, the new /usr/sbin/apxs will be  
installed, using the now-correct full path to the compiler via the  
Xcode toolchain ... neatly setting you up to encounter this problem  
again when you install a different Xcode with a default Xcode  
toolchain with a different name.



On 5 Aug 2014, at 17:08, Mark Wardle wrote:


Yosemite upgrades Apache from 2.2 and 2.4.

I’ve tried recompiling the apache adaptor but compilation files  
despite entering a magic incantation:


make ADAPTORS=Apache2.4 LTFLAGS='--tag CC’


/usr/share/apr-1/build-1/libtool: line 8962: /Applications/ 
Xcode.app/Contents/Developer/Toolchains/OSX10.10.xctoolchain/usr/ 
bin/cc: No such file or directory

apxs:Error: Command failed with rc=8323072

It looks like it may be a problem with the new yosemite Xcode but  
I’m not sure.


Has anyone either downgraded gracefully to apache 2.2 or got a  
binary apache 2.4 mac os x yosemite adapter. For the latter, we  
then have to do battle with the updated configuration files which  
look like they’re more restrictive than before.


If this doesn’t work, then I might have to face the horror of  
remembering how to do development in direct connect mode and  
somehow dynamically switch SSL on or off depending on whether in  
development!


Mark
--



This email, including any attachments, is confidential and intended solely
for the person or organisation to whom it is addressed. If you are not the
intended recipient you must not disseminate, distribute or copy any part 
of this email nor take any action in reliance on it.


If you have received this in error please notify the sender immediately by
email or phone +44 (0)1702 426400 and delete this email and any attachments
from your system.

Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses. The sender therefore does not
accept liability for any errors or omissions in the contents of this
message which arise as a result of email transmission. If verification
is required please request a hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration
number OC337173 and has its registered office at 44 The Pantiles, Tunbridge
Wells, Kent, TN2 5TN.

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

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

Re: PrimaryKey generation takes a lot of time

2014-05-06 Thread Patrick Middleton

We encountered this recently against MySQL 5.6.12.
(Not using Project Wonder)
The default primary key generation was invoking a stored procedure  
once per row.  Once per second, some sort of garbage collection would  
occur inside the RDBMS and the stored procedure would take about 0.2s  
to complete instead of about 0.005s.


The fix is to create and cache all your new primary keys at once in  
advance using something like
er.extensions.jdbc.ERXJDBCAdaptor.Channel.primaryKeysForNewRowsWithEntit 
y(int cnt, com.webobjects.eoaccess.EOEntity entity)


then use something like
databaseContextNewPrimaryKey(EODatabaseContext dbCtxt, Object object,  
EOEntity entity)
http://wocommunity.org/documents/javadoc/WebObjects/5.4.2/com/ 
webobjects/eoaccess/EODatabaseContext.Delegate.html?is-external=true


to fetch a candidate new key from your cache rather than make a  
database round-trip to make one.


On 6 May 2014, at 08:20, Tobias Janz wrote:


I forgott to replay to the list.

the database is close to the server. I did not find the way to copy  
the Database from Mac OS Frontbase to CentOS Frontbase or the other  
way. I tryed to recover me lokal Database with a Backup created  
with CentOS-Frontbase, but it fails.


So I think the best way for me will be the WRITE ALL export.

I will take a look at this.

Thanks

Tobias


2014-05-06 7:58 GMT+02:00 Chuck Hill ch...@global-village.net:
 Hi Tobias,

I missed the Frontbase in the cloud on centOS” before.  Is the app  
server not “close” to the database server?  With latency like this,  
you are going to face production issues, too.  That would be my  
first concern.


Some ideas to consider:
Import it locally, do a  WRITE ALL export and import on the server
Change to the binary UUID primary keys that are generated in the  
application

ERXLongPrimaryKeyFactory
Chuck


On 2014-05-05, 10:28 PM, Tobias Janz wrote:

Hi Chuck,

thanks for your advice, but this approch i have allready tryed. I  
create a new editing context for each 100. Also i've tryed multiple  
threads with relevant success.


When i do the import on my lokal database its much much faster. I  
think it's because of the latency. Is there a way to savely create  
primary key with multiple DB-connections in multiple Threads? And  
how do i get multiple database connections?


regards Tobias


2014-05-06 1:32 GMT+02:00 Chuck Hill ch...@global-village.net:
Are you creating the objects and saving them all at once?  If so,  
that is your problem.  Save them in batches of 500 or 1000 and it  
will go much quicker.  You might want to try making a new editing  
context for each batch.



Chuck


On 2014-05-05, 4:29 PM, Tobias Janz wrote:

Hi all,

i need to import a csv-file with about 58.000 Lines und 60 Columns.  
I have 8 Entitys where the values will be stored. The conversion of  
a line to entitys takes almost no time. But the full prozess, from  
conversion until saveChanges is done, takes several hours (5-6h).  
After profiling it points me to the generating of primary keys.  
This part uses half of the time.


I need to do the import several times.
Do you see a way to improve the speed?
I'm using WebObject 5.4.3 (with Wonder). My Development is on Mac.  
Database is a Frontbase in the cloud on centOS.


Thanks for any advice.

Tobias


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


This email sent to patr...@onestep.co.uk



This email, including any attachments, is confidential and intended solely
for the person or organisation to whom it is addressed. If you are not the
intended recipient you must not disseminate, distribute or copy any part 
of this email nor take any action in reliance on it.


If you have received this in error please notify the sender immediately by
email or phone +44 (0)1702 426400 and delete this email and any attachments
from your system.

Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses. The sender therefore does not
accept liability for any errors or omissions in the contents of this
message which arise as a result of email transmission. If verification
is required please request a hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration
number OC337173 and has its registered office at 44 The Pantiles, Tunbridge
Wells, Kent, TN2 5TN.

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

This email sent to 

Re: Am I hallucinating...

2014-03-26 Thread Patrick Middleton
I was amazed to discover that, on MacOSX, if I look up the word  
'gullible' by highlighting it with the mouse and hitting cmd-ctrl-D,  
it comes up with a concise definition, but does not insert a default  
iChat image of myself.  After all, on NX3.3, that's more or less what  
Webster.app used to do, using your Mail account picture.


Are we properly off-topic yet?

On 26 Mar 2014, at 12:11, David Avendasora wrote:


True! It’s not actually a word.

On Mar 26, 2014, at 6:42 AM, Paul Yu p...@mac.com wrote:


Really?

On Mar 25, 2014, at 11:29 PM, Aaron Rosenzweig  
aa...@chatnbike.com wrote:



Hi Michelle,

Did you realize the word “gullible” can’t be found in the Merriam  
Webster dictionary?

AARON ROSENZWEIG / Chat 'n Bike




This email, including any attachments, is confidential and intended solely
for the person or organisation to whom it is addressed. If you are not the
intended recipient you must not disseminate, distribute or copy any part 
of this email nor take any action in reliance on it.


If you have received this in error please notify the sender immediately by
email or phone +44 (0)1702 426400 and delete this email and any attachments
from your system.

Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses. The sender therefore does not
accept liability for any errors or omissions in the contents of this
message which arise as a result of email transmission. If verification
is required please request a hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration
number OC337173 and has its registered office at 44 The Pantiles, Tunbridge
Wells, Kent, TN2 5TN.

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

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

test, please ignore

2012-12-13 Thread Patrick Middleton

test, please ignore

This email, including any attachments, is confidential and intended solely
for the person or organisation to whom it is addressed. If you are not the
intended recipient you must not disseminate, distribute or copy any part 
of this email nor take any action in reliance on it.


If you have received this in error please notify the sender immediately by
email or phone +44 (0)1702 426400 and delete this email and any attachments
from your system.

Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses. The sender therefore does not
accept liability for any errors or omissions in the contents of this
message which arise as a result of email transmission. If verification
is required please request a hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration
number OC337173 and has its registered office at 44 The Pantiles, Tunbridge
Wells, Kent, TN2 5TN.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Sanity check: Redirection URL in Load Balancing and Adaptor Settings

2012-11-07 Thread Patrick Middleton

Yes, that used to puzzle me.

How are you deploying?  My deployments are seriously old-skool, 4.x- 
style, with Apache and mod_WebObjects.  mod_WebObjects can be  
configured in three ways to know what applications and instances are  
available (see the matching apache.conf).  One is to poll the local  
wotaskd over HTTP (default), another is to read an XML file, and the  
third is to listen to multicast broadcasts from wotaskd running on  
multiple hosts.


I've never used the multicast option but I expect it suffers from the  
same problem the HTTP option does: no information is returned  
describing applications for which there are no running instances; so,  
if there are no running instances and you want the redirection URL,  
the redirection URL is not available.


In my deployments I use the the XML file option.  An easy way of  
generating suitable XML is to wait until all instances are running  
and do '/usr/bin/curl http://localhost:1085/WebObjects/wotaskd.woa/wa/ 
woconfig' .  A good place to put such XML is /Library/WebObjects/ 
Configuration/WOConfig.xml , and you will need to edit  
mod_WebObjects's apache.conf file.


Of course in the 5.4.x era everything could be completely different

On 7 Nov 2012, at 07:37, Paul Hoadley wrote:


Hello,

I'm looking to implement a simple downtime page for an application 
—if all instances are off, the user should see this page.  For a  
moment, I thought the Redirection URL in the application's  
settings would handle this for me, but it doesn't seem to.  The  
semantics there seem to be quite specific, with an instance fails  
to respond to a direct request entailing that there exists an  
instance at all.  Certainly, testing shows that No instance  
available is returned instead of the redirection URL in the case  
where there are zero instances running.


So how do people handle this?  Looks like I would need to manually  
create an Apache redirect/rewrite and bounce Apache, which seems  
labour intensive.



--
Paul Hoadley
http://logicsquad.net/




---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk

This email, including any attachments, is confidential and intended solely
for the person or organisation to whom it is addressed. If you are not the
intended recipient you must not disseminate, distribute or copy any part 
of this email nor take any action in reliance on it.


If you have received this in error please notify the sender immediately by
email or phone +44 (0)1702 426400 and delete this email and any attachments
from your system.

Email transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive
late or incomplete, or contain viruses. The sender therefore does not
accept liability for any errors or omissions in the contents of this
message which arise as a result of email transmission. If verification
is required please request a hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration
number OC337173 and has its registered office at 44 The Pantiles, Tunbridge
Wells, Kent, TN2 5TN.

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

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

Re: Renaming Components [damaged Subversion metadata]

2011-06-08 Thread Patrick Middleton

SVN?

Yes, the tendency of some applications, even those notionally  
Subversion-aware like Xcode, to not preserve Subversion's working  
copy administration area directories .svn , is well known.  It should  
not be beyond the wit of man to write a script to back these up after  
a fresh svn checkout or commit...




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.


wcaa.sh
Description: application/applefile


wcaa.sh
Description: Binary data



Our experiences here are mostly that Subversion will initially report  
files managed via a missing .svn directory as obstructed (~), then  
subsequently reconstruct that .svn directory's contents, but  
reconstruct it wrongly.  Once this has happened, it can be difficult  
to establish which directories have been damaged, and which haven't.   
If you need to resort to repair damaged Subversion metadata in a  
working copy, a sensible procedure might be:


check out another entirely separate copy
run wcaa.sh against that new copy (or a better script you have  
written to do the same job) to generate a backup of all .svn directories
wipe out all .svn directories in your working copy: find . -name .svn  
-type d -print -prune -exec rm -rf {} \;
use the backup made against the new copy to regenerate the .svn  
directories and contents


At this point, you will have all the managed files in your working  
copy, untouched, with any any additions, deletions and modifications  
preserved
Any uncommitted changes such as marking a file as added or deleted  
will have been lost and will need to be done again

But the 'hosed' condition will have gone away.

On 8 Jun 2011, at 05:12, Q wrote:



On 08/06/2011, at 9:09 AM, David Avendasora wrote:


Hi,

I just renamed a component's .wo directory in the Mac OS X Finder,  
and Eclipse renamed all the component files inside while I watched  
in the Finder! Wow! When did that happen? Very cool.


I added this a few years ago. :)

I've always used Wolips' Refactor - Rename WOComponent  
function which is now broken because the files are getting  
renamed automatically while the refactor is trying to do the same.


Hmm, if it doesn't work then it hasn't worked for a very long time.  
I will have a look at it and if it it's not a simple fix I might  
just remove the refactor menu item because a regular eclipse  
Rename... should just work.



I like the finder rename feature better!


Cool hey :)  But don't do that if you are using SVN or you will  
screw up your svn metadata... but you worked that out already  
didn't you. Git on the other hand... ;)


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
 ___
Do not post admin requests to the list. They will 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 

Re: Employing mod_deflate Apache module

2011-02-15 Thread Patrick Middleton


On 14 Feb 2011, at 18:27, Gennady Kushnir wrote:


It is not Wonder app.
Why make such tricks whereas Apache should do that already?


Because you might be using WebObjects without Apache.

Is this a module load order problem?  Which version of Apache have  
you got?  Is mod_deflate.so loaded before mod_WebObjects.so, or after?




2011/2/14 Timo Hoepfner th-...@onlinehome.de:

If it's a Wonder app, add this to you Properties and you're done:

er.extensions.ERXApplication.responseCompressionEnabled=true

Timo

Am 14.02.2011 um 09:59 schrieb Gennady Kushnir:


Hello list!
I've just tried to compress traffic produced by my WOApp but I only
succeeded in compressing static resources (css and js).
Here is my configuration fragment.

IfModule mod_deflate.c
  AddOutputFilterByType DEFLATE text/html application/xhtml+xml
text/plain text/xml \
  text/css text/javascript application/x-javascript
application/javascript
/IfModule

Does anybody know what should be written to Apache mod_deflate
configuration so that it also compress WO-generated pages?

Regards,
Gennady




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: Employing mod_deflate Apache module

2011-02-15 Thread Patrick Middleton


On 15 Feb 2011, at 09:54, Patrick Middleton wrote:



On 14 Feb 2011, at 18:27, Gennady Kushnir wrote:


...


Is this a module load order problem?  Which version of Apache have  
you got?  Is mod_deflate.so loaded before mod_WebObjects.so, or after?


Further research reveals that while module load order was very  
significant for Apache 1.3 (mod_rewrite et al), it's not significant  
for Apache 2.2, where modules can specify their own hook ordering  
preferences.  The easiest way of seeing what's going on is to enable  
mod_info.  After doing that, I saw that many modules in their  
configuration stanzas had this:

SetOutputFilter DEFLATE
while mod_WebObjects (for me, configured via /Library/WebObjects/ 
Adaptors/Apache2.2/apache.conf) did not.  After adding it, deflate  
now works for me with WO-generated content.






2011/2/14 Timo Hoepfner th-...@onlinehome.de:

If it's a Wonder app, add this to you Properties and you're done:

er.extensions.ERXApplication.responseCompressionEnabled=true

Timo

Am 14.02.2011 um 09:59 schrieb Gennady Kushnir:


Hello list!
I've just tried to compress traffic produced by my WOApp but I only
succeeded in compressing static resources (css and js).
Here is my configuration fragment.

IfModule mod_deflate.c
  AddOutputFilterByType DEFLATE text/html application/xhtml+xml
text/plain text/xml \
  text/css text/javascript application/x-javascript
application/javascript
/IfModule

Does anybody know what should be written to Apache mod_deflate
configuration so that it also compress WO-generated pages?

Regards,
Gennady




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: what am i doing wrong with this qualifier

2011-01-26 Thread Patrick Middleton

So which version of PostgreSQL have you got?

http://www.postgresql.org/docs/8.0/static/datatype-datetime.html

That says: Note: Prior to PostgreSQL 7.3, writing just timestamp was  
equivalent to timestamp with time zone. This was changed for SQL  
compliance.


And later it gives examples of valid time zone input.  The form 'XYZ'  
appears to be supported, but not 'Abc/XYZ'.


On 26 Jan 2011, at 11:47, Theodore Petrosky wrote:


So I stopped guessing (or maybe bad guessing). Here is what I saw:

1. from my nslog:

qualifier=(invoiceBookedDate =

(com.webobjects.foundation.NSTimestamp)'2010-12-06 00:00:00
Etc/GMT'),


I know this date is good. I was querying the postgresql db from  
psql with a select using that datestamp and I got rows of data. So  
i looked at the postgresql logs and I notice that the actual date  
passing into the query is:


'2010-12-05 00:00:00 Etc/GMT'

WT_???

So i didn't change anything but selected the next day in my app (in  
this case '2010-07-01..' and voila it worked as expected (I got  
good data and no error). And the date passed in the postgresql logs  
said the 6th.


so why was I doing this:
theDate = theDate.timestampByAddingGregorianUnits(0, 0, 0, -5, 0, 0);

I did that because I kept seeing:

'2010-12-06 05:00:00 Etc/GMT'   in my logs and I knew I was only  
interested in the date (without timestamp) but I never figured out  
how to only pass around dates without timestamps and everything was  
working. I was subtracting the 5 hours and I didn't need to. (and  
it was biting me in the backend.)


Postgresql supports dates without timestamp, I wish I knew how to  
do this in webobject java. (But still call them dates so I can do  
date math.)


So the error has nothing to do with my WOD. I am picking up the  
JasperReports example from the WOWODC 2010 videos. I guess the  
example has problems with a query returning no rows.


Now if I can only figure out how to pass an array from a previous  
query to JasperReports I would be happier.


I have to go back to re-reading this plethora of documentation.

Thanks for your timely help.

Ted


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk





This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: x-webobjects-request-id lacking uniqueness?

2010-12-07 Thread Patrick Middleton


On 6 Dec 2010, at 15:27, Mark Ritchie wrote:

...

Patches welcome!

...

On 7 Dec 2010, at 11:30, Patrick Middleton wrote:

[3] adequate uniqueness could instead be created by ensuring that  
when httpd forks, the child process resets uniqueID_str.



Here's a patch.  The changes work for me with Apache 1.3.41.  While I  
was working against a fairly old source tree, I have verified that  
the files of interest have not changed significantly compared to the  
newest source tree at which I have been looking, which was shipped  
with WebObjects 5.4.3.  What this patch does not include is the  
equivalent modification to the Apache 2.2 adaptor; it should be the  
same one-line change in WebObjects_child_init() in Apache2.2/ 
mod_WebObjects.c as in in Apache/mod_WebObjects.c .





This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
diff -crB Adaptors-mine/Adaptor/transaction.c Adaptors-std/Adaptor/transaction.c
*** Adaptors-mine/Adaptor/transaction.c Tue Dec  7 14:17:17 2010
--- Adaptors-std/Adaptor/transaction.c  Tue Dec  7 14:22:28 2010
***
*** 103,122 
 return tr_lock == NULL;
  }
  
- void transaction_init_again()
- {
-int currentTime = time(NULL);
- #ifndef WIN32
-int pid = getpid();
- #else
-int pid = GetCurrentProcessId();
- #endif
-WA_lock(tr_lock);
-sprintf(uniqueID_str, %8.8x%8.8x, currentTime, pid);
-WA_unlock(tr_lock);
- }
- 
- 
  #define haveTriedInstance(appreq, handle) 
(appreq-attemptedInstances[(handle)8]  (1((handle)7)))
  #define markTriedInstance(appreq, handle) 
(appreq-attemptedInstances[(handle)8] |= (1((handle)7)))
  /*
--- 103,108 
diff -crB Adaptors-mine/Adaptor/transaction.h Adaptors-std/Adaptor/transaction.h
*** Adaptors-mine/Adaptor/transaction.h Tue Dec  7 14:17:37 2010
--- Adaptors-std/Adaptor/transaction.h  Tue Dec  7 14:22:28 2010
***
*** 37,44 
  /* Returns zero on success, nonzero if initialization fails. */
  int transaction_init();
  
- void transaction_init_again();
- 
  /*
   *Code common to all adaptors.  The server-specific portion is responsible
   *for collecting the request  related information.  The URL must be
--- 37,42 
diff -crB Adaptors-mine/Apache/mod_WebObjects.c 
Adaptors-std/Apache/mod_WebObjects.c
*** Adaptors-mine/Apache/mod_WebObjects.c   Tue Dec  7 14:24:27 2010
--- Adaptors-std/Apache/mod_WebObjects.cTue Dec  7 14:22:28 2010
***
*** 183,191 
  * anything else?
  *ac_readConfiguration();  force the configs to be checked
  */
- 
-transaction_init_again();
- 
 return;
  }
  
--- 183,188 



-- Patrick




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
 ___
Do not post admin requests to the list. They will 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

x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton
I have an app doing something superficially like web services which  
is sessionless and accessed via DirectActions.  Because of other  
activity in the database sometimes, database i/o can block for  
several minutes.  When this happens the Apache WebObjects adaptor's  
loadbalancing features come into play, and redirect the request it  
sent to an apparently unresponsive instance to a different instance,  
which may in turn block on database i/o.  The caller's browser waits  
several minutes and then receives an no instance available page.   
When the other activity in the database clears an, if the request  
caused a database update, that update can be applied multiple times  
because of each instance attempting to process the request.  If the  
first update changes the database in a way that prevents the other  
updates from succeeding, they might report update failed, and if  
the database i/o hold up was only a few minutes, that page can be  
returned to the caller -- a page saying that the update failed, when  
in fact the update succeeded but the caller won't get to see that page.


What I thought about doing, and have largely done, is announce and  
listen for activity via multicast datagrams.  If an instance receives  
a request via a direct action and I don't want it to be redirected  
via the load balancer, enough information is broadcast such that  
other instances waiting for requests will be able to tell that  
another instance should already be processing it, and then generate a  
response (without blocking on database i/o) to the effect that  
database congestion may be in progress, that their request is being  
processed, any database updates may or may not be committed but will  
be committed at most once.


But what constitutes enough information?  The WebObjects adaptor  
adds a header x-webobjects-request-id (aka REQUEST_ID_HEADER, in  
config.h) to a received request before writing it to an instance  
(this header is not leaked back to the client) and this appears to  
be unique: 24 chars long corresponding to three hexstrings of 32-bit  
numbers, being the time at which some initialization code was called  
in the process (httpd), the process identifier (of httpd), and a  
unique sequence counter defended by a lock.  The point at which this  
header is added means that a redirected request will have the same x- 
webobjects-request-id header.


And so to the subject line of this message: x-webobjects-request-id  
lacking uniqueness?  Of those 24 chars, the first 16 are effectively  
fixed whenever httpd starts, and I appear to be seeing values being  
reused for the last 8.  I'd guess that either the shared memory or  
the locking isn't working as expected.


Anybody else seeing this?

---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 13:52, r...@synapticstorm.com wrote:


Hi Patrick,

Couldn't you just use WOLongResponse so that it keeps the first  
connection alive until it responds?


Regards,

Rob.


Without going into too much detail -- no.

---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 14:20, Simon wrote:


i was thinking the same - alternatively:

- do whatever is you are doing in a background thread
- switch on concurrent request handling, as i presume that it is  
actually the request that is blocking, not the DB as unless your  
are using something like m$ access (eeek!) then i would imagine  
your DB can actually do more than one thing at once
- if you are using m$ access, change it if you can, or resign if  
you can't
- re-work locking strategy to force an optimistic locking failure  
if more than one update goes through - even if that involves  
sticking a dummy attribute in that just increments with each  
transaction


what you are suggesting feels a bit like sticking some pedals on a  
car because the engine keeps stalling - probably best to fix the  
engine :-)


simon



What I am doing is reporting a bug in the WebObjects API adaptor,  
with the circumstances as how how I encountered it.  It might be  
possible to deduce, for example, that the application list etc (see  
config.c in the Adaptors project) is in shared memory, while  
uniqueID_counter (see transaction.c) is not in shared memory, but  
should be, if we cared.


Anybody reading this list who is interested in the adaptor?


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: x-webobjects-request-id lacking uniqueness?

2010-12-06 Thread Patrick Middleton


On 6 Dec 2010, at 15:27, Mark Ritchie wrote:


Good Morning,

On 6/Dec/2010, at 5:09 AM, Patrick Middleton wrote:
If an instance receives a request via a direct action and I don't  
want it to be redirected via the load balancer, enough information  
is broadcast such that other instances waiting for requests will  
be able to tell that another instance should already be processing  
it,
'Should' is a strong word here. I don't think that I'd be relying  
on it.  Perhaps I'm pessimistic?


Or, perhaps, there was more information that was not provided as it  
was not relevant to the problem at hand (x-webobjects-request-id  
values not as unique as expected) and yet which my MD might deem  
confidential intellectual property.  This approach is adequately  
sound for me.




and then generate a response (without blocking on database i/o) to  
the effect that database congestion may be in progress, that their  
request is being processed, any database updates may or may not be  
committed but will be committed at most once.
Given that you've put rather bluntly that long request  
configuration won't work for you,


Bluntly?  Well yes I suppose, but  you should have seen the  
drafts I discarded!



I'm not sure how you expect to achieve this across multiple  
instances without building the infrastructure yourself.


Which is what I did ... multicast datagram socket.




On 6/Dec/2010, at 7:06 AM, Patrick Middleton wrote:
What I am doing is reporting a bug in the WebObjects API adaptor,  
with the circumstances as how how I encountered it.  It might be  
possible to deduce, for example, that the application list etc  
(see config.c in the Adaptors project) is in shared memory, while  
uniqueID_counter (see transaction.c) is not in shared memory, but  
should be, if we cared.

Anybody reading this list who is interested in the adaptor?


Patches welcome!


Cough.  Yes.  I dare say they are.

-- Patrick



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: Snow Leopard Deployment

2010-11-24 Thread Patrick Middleton


On 24 Nov 2010, at 17:16, Mark Ritchie wrote:


Hey,

On 24/Nov/2010, at 8:33 AM, Ron Lift wrote:
...
When I use http://servernamecgi-bin/WebObjects/appname I get a  
404 error.

The webserver log has
“script not found or unable to stat: /Library/WebServer/CGI- 
Executables/WebObjects”
First off, how did '.../cgi-bin/...'  become '.../CGI- 
Executables/...' ?
I've tried messing with my apache2 settings but I can't reproduce  
your error.
Also, you mentioned apache.conf below so that leads me to wonder  
what version of apache you're using?


That looks to me like the WebObjects DSO (mod_WebObjects.so) is not  
being loaded and the CGI adaptor is being used instead; URLs .../cgi- 
bin/WebObjects map to a CGI script WebObjects, and Apache on MacOSX  
will find those by default in /Library/WebServer/CGI-Executables .   
Older deployment documentation should have a recipe for diagnosing  
whether the API adaptor (good) or the CGI adaptor (bad) is handling  
requests.


Walk through your Apache main configuration file.  At some point I  
would expect it to be doing something like


# Including WebObjects Configs
Include /Library/WebObjects/Adaptors/Apache2.2/apache.conf

(the apache.conf file you referred to) which might include some  
LoadModule and AddModule directives.  Are those directives present?   
Is Apache actually reading your adaptor's config file?


Also Apache is traditionally sensitive to the order in which modules  
are loaded ... you might see the CGI adaptor handling requests if  
mod_cgi loaded after mod_WebObjects. I usually comment out the  
LoadModule and AddModule directives in apache.conf and add  
equivalents in exactly the location I want in the main Apache conf file.


Also: are you loading the module you think you are?  On Snow Leopard,  
Apache should be an i386/x86_64 universal binary, and unless you have  
a really weedy ancient Mac (three year old MacMini, maybe) it'll be  
running the x86_64 code, and that means all the modules (including  
any you built) need ideally to be universal, or at a pinch the  
architecture being run (most likely x86_64), and I have seen people  
get this wrong and ignore the warnings from 'apachectl configtest'.





this is some lines from the apache.conf file
WebObjectsDocumentRoot /Library/WebServer/Documents
WebObjectsAlias /cgi-bin/WebObjects
WebObjectsConfig http://localhost:1085 10
I can get to the wotaskd http://servername:1085  and using  
localhost:1085

That's a good sign!

I cannot get to http://servername/cgi-bin/WebObjects/ 
WOAdaptorInfo I get a 404 error. I saw a post with this

“but the WOAdaptorInfo page was reporting nothing ... bingo”
I just need to know what “bingo” is. I know when I find out I am  
going to say “dah, I should have known that”
I doubt that you can get to WOAdaptorInfo until you've resolved the  
path issue above.

And you're going to need to enable it with a directive like:
WebObjectsAdminUsername public
(Note: this is the open to all version.  There is an alternative of  
user and password if you want to be more secure once you get things  
working.)

M.


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH. ___
Do not post admin requests to the list. They will 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


WebObjects and HTML injection

2010-07-22 Thread Patrick Middleton

Hi folks!

Some of our customers are commissioning penetration testing reports,  
which are flagging vulnerabilities in our WebObjects applications.   
The problem reported is with URLs such as .../wa/MyDirectAction? 
wosid=XYZ%22%3E%3Cscript%3Ealert%28123%29%3C%2Fscript%3E , direct  
actions that preserve the session ID, where the session ID can be  
manipulated (at the cost of no longer being a valid session ID) to  
enable injecting some executable JavaScript onto a webpage.  In  
principle this is a vulnerability for various attacks such as XSS,  
SQL injection and so on.  In practice, I'm confident there are no  
exploits in the apps for which I am responsible because any useful  
work is done via component actions; no valid session ID equals  
nothing useful served, and a valid session ID means you can get at  
what the app is supposed to let you be able to get at.


But I'd like to tighten things up so that the penetration testing  
automated scanners find nothing because there's nothing to find.  I  
myself am still (don't laugh) working with WO4.5.1.  What are things  
like in 5.4.x?  It seems to me that I ought to subclassing (or adding  
to existing subclasses) to override these:


com.webobjects.appserver.WODirectAction
public String getSessionIDForRequest(WORequest aRequest)
public void takeFormValueArraysForKeyArray(NSArray aKeyArray)
public void takeFormValuesForKeyArray(NSArray aKeyArray)
public void takeValueForKey(Object value, String key)

com.webobjects.appserver.WOComponent
public void takeValuesFromRequest(WORequest aRequest, WOContext  
aContext)

public void takeValueForKey(Object value, String key)

in order to sanitize inputs -- mostly by removing anything containing  
the likes of 'script'.  What do you think?


---
Regards Patrick
OneStep Solutions Plc
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: WebObjects and HTML injection

2010-07-22 Thread Patrick Middleton


On 22 Jul 2010, at 12:49, Anjo Krank wrote:


Why would you preserve the session id when it's no longer valid?

Cheers, Anjo



Am 22.07.2010 um 13:28 schrieb Patrick Middleton:

in order to sanitize inputs -- mostly by removing anything  
containing the likes of 'script'.  What do you think?



Preserve the session id when it's no longer valid?  Anjo, are you  
saying my application should have sanitised its inputs?


When I wrote the app I considered how a session ID might not be  
valid, and what the app would do:

timed out: give a 'timed out' response page
ought to exist, but the instance has crashed and restarted: give a  
'timed out' response page
redirected to the wrong instance by the load balancer: give a 'timed  
out' response page

and so on.

I didn't explicitly preserve the session ID.  What I did not consider  
was someone cooking up an interesting bogus sessionID and then  
finding a page accessible by a direct action that had some component  
action URLs on it, so that in the event of the session ID not being  
valid, I would need to takes steps to ensure it did not appear in the  
response.


Moreover, while the sessionID is an excellent place to start for  
anybody probing for security vulnerabilities in a WO app, it's not  
the only place -- I think every form value, cookie and CGI argument  
needs to be sanitised.



---
Regards Patrick
OneStep Solutions Plc
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: bizarre session time-outs

2010-06-03 Thread Patrick Middleton


On 3 Jun 2010, at 11:28, Simon wrote:


hi all -

we've got a session time-out issue that is affecting just 1  
specific client. all other users of the app are happy - it's just  
not working for this one company.


basically, as users form this one company click around the app they  
randomly get instant session time-out's. no browser hanging -  
instant back to login page. we are not seeing any instance failures  
- the original instance the user was talking to is just sitting  
there happily waiting for requests.


as the time out is instantaneous i thought maybe it's just that  
monitor for some reason is randomly reporting that the instance  
they are talking to is no longer there. but i'm suspicious of the  
fact that only one specific client is affected.


i'm wondering if it's something to do the connectivity between the  
client and the apps (yes, yes, i'm clutching at straws, i know!)  
but can't think of any logical reason how or why it would affect  
things. the only thing remotely strange about the client's set up  
is that all the users internet traffic (users are in the UK) is  
routed through their parent companies proxy in munich. is there any  
possibility that the requests are somehow getting mangled by the  
proxy ?


any hints appreciated!

thanks, simon


I've seen something very much like this in the past.  Web clients  
behind a stupidly-aggressive proxy cache server, which cached the  
login page, and the HTML of the page as cached referred to a session  
that no longer exists -- or cached an id/password not recognised  
response, which any user would subsequently receive from cache  
whether they provided valid credentials or not.  Adding HTTP headers  
to responses to hint do no cache this to the the proxy did not  
help.  In the end we used mod_rewrite to redirect all requests  
received from HTTP to HTTPS.


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Solutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: Browser handling a URL having .123. in the breadcrumb trail as a Lotus file

2010-03-18 Thread Patrick Middleton

Reorderering module loading did not help.

I have LoadModule/AddModule directives corresponding to  
mod_WebObjects.so at the ends of the principal blocks of these  
directives in the Apache 1.3 httpd.conf file, with the euqivalent  
directives in /WebObjects/Adaptors/Apache/apache.conf commented  
out, so's I can use mod_rewrite and not get config warnings from  
httpd about module already loaded.  Moving the equivalent directives  
for mod_mime to be after the directives for mod_WebObjects and  
restarting httpd did not change the behaviour.


Commenting out the entry for filetype 123 from /private/etc/httpd/ 
mime.types did change the behaviour, and that is the workaround I  
shall probably be using for the time being.


I belatedly managed to get Apache/2.2.13 set up and running on 10.5.8  
with an Apache2.2 adaptor based on source from WebObjects 5.4.x,  
configured to serve woapp generated content from the 10.4/WO451/ 
Apache1.3 application server.  This did not exhibit the problem; I  
believe the problem is in one or more of Apache 1.3 and the matching  
mod_WebObjects and mod_mime, and in none of Apache 2.2 and the  
matching mod_WebObjects and mod_mime.


I cannot induce the problem with CGI scripts and no-parse-headers CGI  
scripts on 10.4/WO451/Apache1.3 .


I would guess that mod_mime needs to do (url.contains(.123.) or  
url.endsWith(.123)) because of eg varied-by-language content, see  
the AddLanguage directive associated with mod_mime.  There is some  
discussion in the Apache2 documentation http://httpd.apache.org/docs/ 
2.2/mod/mod_mime.html of files with multiple extensions.


I also note in the Apache 1.3 .../manual/misc/API.html,
Note that the Content-type header value cannot be set by module  
content-handlers using the ap_table_*() routines. Rather, it is set  
by pointing the content_type field in the request_rec structure to  
an appropriate string. E.g.,

  r-content_type = text/html;



On 17 Mar 2010, at 17:50, Chuck Hill wrote:


Hi Patrick,

On Mar 17, 2010, at 10:30 AM, Patrick Middleton wrote:


Anybody else seen this before?
I'm supporting WO451 on MacOSX 10.4.11 with Apache 1.3.41.

A sample URL generated is
http://host/cgi-bin/WebObjects/app.woa/instance/wo/ 
s3VxGNjQd5pK3HI1TuI1TEs8h2j/5.0.1.8.1.3.23.3.3.123.1.1


Packet burglary with tcpflow on port 80 and on the woapp's port  
shows that the instance is generating a response including a  
header 'content-type: text/html' and that the response returned to  
the browser by Apache has a header 'content-type: application/ 
vnd.lotus-1-2-3'.


Apache 1.3.41 is set up in a normal way, including:
IfModule mod_mime.c
   TypesConfig /private/etc/httpd/mime.types
/IfModule

and /private/etc/httpd/mime.types declares:
application/vnd.lotus-1-2-3 123



I'm guessing this counts as a bug in mod_WebObjects.so; if it's  
picking up a content type value from the instance response, it  
should be handling it in a way that it doesn't then get overridden  
by mod_mime.


My guess would be a bug in mod_mime that is doing the equivalent of  
url.contains(.123) rather than url.endsWith(.123).  Can you re- 
arrange the order the modules are loaded and added?  If you move  
mod_mime _after_ mod_webobjects, that might avoid the issue.


Chuck

--
Chuck Hill Senior Consultant / VP Development

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

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




This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Soutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: Browser handling a URL having .123. in the breadcrumb trail as a Lotus file

2010-03-18 Thread Patrick Middleton

I think I have it.

I modified this function in mod_WebObjects.c , adding the call to  
WOLog() and subsequently commenting out one term in the if-statement.


=-=-=-=-=-=
static void gethdr(const char *key, const char *value, void *req) {
   request_rec *r = (request_rec *)req;

WOLog(WO_DBG, %s:%d %s r-unparsed_uri:%s key:%s value:%s r- 
content_type:%s,

__FILE__, __LINE__, __PRETTY_FUNCTION__,
(r-unparsed_uri ? r-unparsed_uri : null),
(key ? key : null),
(value ? value : null),
(r-content_type ? r-content_type : null));

   if ( /* (r-content_type == NULL)  */ (strcasecmp 
(CONTENT_TYPE,key) == 0)) {

  r-content_type = (char *)ap_pstrdup(r-pool, value);
   } else {
  ap_table_add(r-headers_out, key, value);
   }
}
=-=-=-=-=-=



Once I enabled logging, I got the output below.  My application was  
attempting to set a content-type header, and the adaptor had special- 
case code for that header, but the code wasn't being called as  
something else, presumably mod_mime, had already set a value for that  
header.

=-=-=-=-=-=
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:date value:Thu, 18 Mar 2010 16:35:05  
GMT r-content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:expires value:Thu, 18 Mar 2010  
16:35:05 GMT r-content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:pragma value:no-cache r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:content-type value:text/html r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:cache-control value:private r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:cache-control value:no-cache r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:cache-control value:no-store r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:cache-control value:must-revalidate r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:cache-control value:max-age=0 r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:connection value:close r- 
content_type:application/vnd.lotus-1-2-3
Debug: mod_WebObjects.c:437 gethdr r-unparsed_uri:/cgi-bin/ 
WebObjects/MyApp.woa/64/wo/y3mg8PShGpKS3OCKmH49s4fCrTK/ 
7.0.1.8.1.3.23.3.3.123.1.1 key:content-length value:34327 r- 
content_type:application/vnd.lotus-1-2-3

=-=-=-=-=-=


On 18 Mar 2010, at 12:42, Patrick Middleton wrote:


Reorderering module loading did not help.


...


I also note in the Apache 1.3 .../manual/misc/API.html,
Note that the Content-type header value cannot be set by module  
content-handlers using the ap_table_*() routines. Rather, it is  
set by pointing the content_type field in the request_rec  
structure to an appropriate string. E.g.,

  r-content_type = text/html;



On 17 Mar 2010, at 17:50, Chuck Hill wrote:


Hi Patrick,


...
I'm guessing this counts as a bug in mod_WebObjects.so; if it's  
picking up a content type value from the instance response, it  
should be handling it in a way that it doesn't then get  
overridden by mod_mime.


My guess would be a bug in mod_mime that is doing the equivalent  
of url.contains(.123) rather than url.endsWith(.123).  Can you  
re-arrange the order the modules are loaded and added?  If you  
move mod_mime _after_ mod_webobjects, that might avoid the issue.


Chuck

--
Chuck Hill Senior Consultant / VP Development

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

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


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person

Browser handling a URL having .123. in the breadcrumb trail as a Lotus file

2010-03-17 Thread Patrick Middleton

Anybody else seen this before?
I'm supporting WO451 on MacOSX 10.4.11 with Apache 1.3.41.

A sample URL generated is
http://host/cgi-bin/WebObjects/app.woa/instance/wo/ 
s3VxGNjQd5pK3HI1TuI1TEs8h2j/5.0.1.8.1.3.23.3.3.123.1.1


Packet burglary with tcpflow on port 80 and on the woapp's port shows  
that the instance is generating a response including a header  
'content-type: text/html' and that the response returned to the  
browser by Apache has a header 'content-type: application/ 
vnd.lotus-1-2-3'.


Apache 1.3.41 is set up in a normal way, including:
IfModule mod_mime.c
TypesConfig /private/etc/httpd/mime.types
/IfModule

and /private/etc/httpd/mime.types declares:
application/vnd.lotus-1-2-3 123



I'm guessing this counts as a bug in mod_WebObjects.so; if it's  
picking up a content type value from the instance response, it should  
be handling it in a way that it doesn't then get overridden by mod_mime.


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.uk



This email, including any attachments, is confidential and intended solely for 
the person or organisation to whom it is addressed. If you are not the intended 
recipient you must not disseminate, distribute or copy any part of this email 
nor take any action in reliance on it.

If you have received this in error please notify the sender immediately by 
email or phone +44 (0)1702 426400 and delete this email and any attachments 
from your system.

Email transmission cannot be guaranteed to be secure or error-free as 
information could be intercepted, corrupted, lost, destroyed, arrive late or 
incomplete, or contain viruses. The sender therefore does not accept liability 
for any errors or omissions in the contents of this message which arise as a 
result of email transmission. If verification is required please request a 
hard-copy version.

OneStep Soutions LLP is registered in England and Wales under registration 
number OC337173 and has its registered office at 457 Southchurch Road, 
Southend-on-Sea, Essex SS1 2PH.
___
Do not post admin requests to the list. They will 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: [SOLVED] how to insert records in database in the order of insertion to EC

2009-11-02 Thread Patrick Middleton


On 1 Nov 2009, at 12:40, Shravan Kumar. M wrote:

Thanks Kieran for your solution. But unfortunately, we don't extend  
ERXGenericRecord, so we cannot get benefits of this!!! I have  
actually read about your this solution in a similar kind of issue  
posted and responded by you here: http://www.mail-archive.com/ 
webobjects-dev@lists.apple.com/msg25975.html


From: Kieran Kelleher kieran_li...@mac.com
To: Shravan Kumar. M mshravan_...@yahoo.com
Cc: Chuck Hill ch...@global-village.net; WO Dev Group webobjects- 
d...@lists.apple.com

Sent: Sun, November 1, 2009 5:55:25 PM
Subject: Re: how to insert records in database in the order of  
insertion to EC


Or if you want the order of the PKs to be the same order as your  
insertion into the EC, you can try calling


eo.primaryKeyInTransaction(or sth like that)

which is provided by ERXGenericRecord subclass.

That method assigned the PK ... do it in each iteration. Then  
the items are saved the the PK order the same as insertion order.


Regards, Kieran


I'm still working with WO451, so I'm not going to post my code.  I  
encountered a problem very much like this one: primary keys were also  
being used as audit sequence IDs, and this made ensuring that the  
order of insertion into an editing context and ascending order of  
primary keys be the same essential.


The fix I chose was broadly as follows (and as far as I can tell  
should work in 5.x, and I'm looking at the 5.3 Javadocs that I have  
to hand.)
I created an instance of a helper object class; one member variable  
is the editing context of interest.

The editing context at this point has no unsaved changes.
The helper implements EOObserving, and on cue -- startWatching() --  
registers itself as an observer with an EOObserverCenter.
When the helper receives objectWillChange(Object object), it tests  
object to see if [1] its editing context is the helper's editing  
context [2] its EOGlobalID returns true for isTemporary() and [3]  
whether the object is already in an array/vector/whatever other  
ordered collection is being maintained by the helper -- if not, it  
adds it.
At some point -- stopWatching() -- we then unregister the helper from  
the EOObserverCenter, and ask the helper for its collection.


We can then examine the collection to see what primary keys we need  
to generate, generate them, and cache them somewhere -- I have a  
singleton class to be the default delegate for all EODatabaseContexts  
which implements databaseContextNewPrimaryKey(EODatabaseContext  
dbCtxt, Object object, EOEntity entity).


When I call save() on the editingContext, EOF will insert objects  
into the database as normal, except the pre-created primary keys will  
be assigned to the intended objects and in the correct order.


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: get confirmation of a payment from other website via a direct action, how to get back to a shopping session?

2009-05-28 Thread Patrick Middleton


On 28 May 2009, at 13:57, Anjo Krank wrote:

Just to add some caution: be sure to run either multi-threaded or  
see that you don't have long requests that may block the app for a  
longer time.


Otherwise the adaptor will happily redirect you callback to another  
instance - where the session most likely will not be known...


Cheers, Anjo


+1.

I've dealt with this myself; 3DSecure payment authentication,  
Verified by VISA, and so on.  Tedious as it may seem, I found the way  
forward was to store as much state in the database as possible, so  
that rendezvous with the existing session is not necessary, and that  
the callback can be handled via a direct action.


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: compacting html, whitespaces

2009-05-21 Thread Patrick Middleton
Back in the WO451 days I overrode Application.handleRequest to do  
some very simple HTML parsing to remove excess whitespace while  
remaining aware of comments, pre tags and the like.  We used it for  
some years but abandoned it; it ate CPU, and in terms of the time for  
a request/response cycle to complete all the back to the user's  
browser, it didn't save any time.  It did make for smaller response  
message bodies though, which was good for applications targeted at  
mobile devices.


These days if I want smaller response message bodies, I enable  
mod_gzip.  Depends what you're trying to achieve of course.


On 20 May 2009, at 19:08, Hugi Thordarson wrote:


If you're really adventurous, you can try something like this:

public WOResponse dispatchRequest( WORequest request ) {
WOResponse response = super.dispatchRequest( request );

String contentString = response.contentString();
contentString = contentString.replace( \n,  );
contentString = contentString.replace( \t,  );
response.setContent( contentString );

return response;
}

Be careful, though. It will work, but it will mess up stuff in pre- 
tags and within textareas.


Cheers,
- Hugi



On 20.5.2009, at 16:29, Amedeo Mantica wrote:


Hello,

Anyone knows if there is a Property or something similar in order  
to get a compact html output with withespaces stripped?


Thanks, Regards
Amedeo


---
Regards Patrick
OneStep Solutions (Research) LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: Pound symbol Solved...

2009-03-20 Thread Patrick Middleton
I'm still really a WO451 programmer, so what do I know, but   
doesn't Xplode allow you to set a default encoding for your text  
(source) files?  One might expect String s = £; to cause the  
creation of a UTF8 string literal.  Suppose your source code default  
encoding was ISO 8859-1 ... what byte sequence would javac emit?


If on the other hand Xplode's default encoding for text files was  
UTF8, this problem shouldn't crop up -- unless you introduce it with  
eg an external component editor.


Mixing encodings is definitely storing up trouble for the future --  
been there, done that, don't want to do it again.


Where possible I use pound; or even #163; , but those choices  
aren't always available -- list values for popups count here.


On 20 Mar 2009, at 12:01, Ricardo J. Parada wrote:



In my case I ended up recreating the project.  I created a new  
Wonder app project, then I dragged my java classes, my WO  
components, my web server resources into the new project.


And now it works.  How weird huh?  I got really close to solving it  
but I was wasting too much time on that.  I just hope it doesn't  
start happening again.  :-)


---
Regards Patrick
OneStep Solutions LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: My provider moved my server and now...

2009-03-02 Thread Patrick Middleton


On 2 Mar 2009, at 14:07, James Cicenia wrote:


Hmmm,, that is empty.
But the IP is the SAME ??


On Mar 2, 2009, at 8:00 AM, Pascal Robert wrote:

Check if you have a backup copy of SiteConfig.xml in /Library/ 
WebObjects/Configuration/, and if not, check the content of the  
active SiteConfig.xml file to check for any reference for the old IP.


Or indeed, to the old hostname.  If the box can resolve itself and  
its name via local DNS has changed, javawotaskd could be seeing  
config for what it thinks is a different machine.


If you can get in via SSH or ARD, see what /bin/hostname says, and  
think about stopping WO services, editing SiteConfig.xml to use the  
new hostname for all internal references, then restarting WO services.




---
Regards Patrick
OneStep Solutions LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: SSL Troubleshotting

2009-02-05 Thread Patrick Middleton
Without even looking, I'd guess that ERXRequest.remoteHostAddress()  
is looking for an HTTP header REMOTE_ADDR (this is not really an HTTP  
header, it's a CGI environment variable, but WebObjects presents it  
as a header).


I have under some circumstances that I can't remember found that  
sometimes REMOTE_ADDR was not the right thing to look for; with the  
systems I have to hand running Apache 1.3.41 and Apache 2.2.6 on  
10.5.x, REMOTE_ADDR.


If possible, enable /cgi-bin/printenv on the server where this is a  
problem and make an HTTPS call to discover the name of the CGI  
environment variable containing the address for which you are  
looking; then, in your code, if ERXRequest.remoteHostAddress()  
returns 127.0.0.1, use the API for getting at HTTP headers to look  
for that name instead.


On 5 Feb 2009, at 10:11, Amedeo Mantica wrote:


No one know anything about??
:-(

On 04/feb/09, at 12:49, Amedeo Mantica wrote:


Hi,

To prevent session hijacking i generally use the sender ip  
verification ( ERXRequest.remoteHostAddress() ) and works fine for  
http requests, but when we ae il SSL mode, WebObjects see all  
requests coming from 127.0.0.1 (and tecnically is right)


Now how to get the real ip address of the client ?

Regards
Amedeo


---
Regards Patrick
OneStep Solutions LLP
www.onestep.co.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/archive%40mail-archive.com

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


Re: PDF generator/converter

2008-12-10 Thread Patrick Middleton


On 9 Dec 2008, at 15:31, Sherry Tirko wrote:



Hi All,

I'm wondering if anyone knows if there is a pdf generator out there  
for WO sites or even a converter for WO Components. I'd like to  
take a form and make a pdf version for printing.


Thanks,
Sherry


Or on MacOSX 10.3 and later, you can compose some Postscript and  
shell out to /usr/bin/sips .


---
Regards Patrick
OneStep Solutions LLP
www.onestep.co.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Instance ID wrong?

2008-12-02 Thread Patrick Middleton


On 2 Dec 2008, at 10:47, Andrew Lindesay wrote:


Hello Anjo;

Yes this can be quite annoying -- the user gets a session timeout.   
I guess the problem is that beyond the instance number in the path,  
the adaptor doesn't know there is or is not a session.


cheers.

before proceeding. Now, the problem is that there may several  
reasons for 20 not to reply, but now instance 10 has no way of  
knowing that the session that doesn't exist in it's own session  
store didn't really expire but comes from a temporarily  
unavailable instance 20. Does anyone have enough inisght into the  
adaptors to say why the request is rewritten? It looks pretty dumb  
to me, but maybe there is a good reason... I think if should store  
the old request add at least a header to indicate that this is not  
the intended instance.


___
Andrew Lindesay
www.lindesay.co.nz


I too have encountered the problem where a stateful request is  
redirected to a different instance because the requested instance did  
not respond, and I would strongly welcome an HTTP header or headers  
being added to indicate to instance the instances which have already  
not responded to this request.


The requested instance (or instances) usually doesn't respond because  
it's doing a very big database fetch; enabling concurrent request  
handling usually won't help much as other sessions will likely block  
waiting for access to the database.  lifeabeat interaction with  
wotaskd should continue unimpeded.


How would an instance receiving a stateful request whose URL  
indicates it should be sent to a different instance make use of some  
X-WOInstanceDidNotRespond header then?  How would the instance know  
whether the other instance(s) are busy but not dysfunctional, have  
hung, or have crashed?


If we really wanted to sort this out, we might be looking at  
persistent session state shared over all instances, so that any  
instance could respond to any request, whether stateless or  
stateful.  I would not welcome being asked to implement that myself.


---
Regards Patrick
OneStep Solutions Plc
www.onestep.co.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/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: WOLongResponesePage Problem

2008-05-21 Thread Patrick Middleton


On 21 May 2008, at 10:59, santoshg wrote:


Hi All,
  I am using WOLongResponsePage Component in my project.
  But in the run time, it is showing the error message:

  Session.context() evaluates to null. You may be trying to  
get the context object
  from an archived session object. there is no context  
object outside of the

  request-response  loop.

 The component is unable to generate response.
 I would like to know how to access the Session context in   
WOLongResponsePage  performAction()  method.


Please help in solving the above situation, if possible  
with some code snippet.


Thanks and Regards,
gsk.



You can't, and you shouldn't try.
A request is received and processed and a response is generated, and  
this all happens in one thread, and it needs to be quick.  While this  
is happening you have access to the Session and the WOContext in that  
thread.
What you need to do is get all the properties you need from the  
Session or WOContext before you start the thread that does the long  
response thing, and store them in instance variables in your  
component, so that when the secondary thread is running it can use  
those instead.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2008-05-20 Thread Patrick Middleton


On 20 May 2008, at 04:45, Don Lindsay wrote:


hello;

People actually create their entire page layout using tables?  That  
would be a nightmare, althought I guess I can see it if the  
application was created for IE 3, which really did not have a way  
to position elements well.


Don


IE3 -- or OmniWeb[34].

When I started, HTML was not a page description language (and as far  
as I'm concerned, it still isn't).  If I'd wanted PostScript, I knew  
where to find it.
Using tables for layout was never that bad; I still find this  
approach far easier to understand than, say, heavy reliance on CSS2.   
NS4 was a problem because  it supported nesting tables to a depth of  
only 3, but it was a reasonable assumption that if you needed more  
than that, you were doing it wrong.


One huge reason for using DIVs and CSS instead of HTML tables is  
accessibility.  Not all web user agents are browsers.  It is seen as  
hugely advantageous for users of assistive technologies like screen  
readers is to lay out your HTML in the order that you want the screen  
reader to read it, then style it with CSS to appear where you want  
when rendered on screen.  This means you might have a classic three  
column layout with a header and a footer:


AA
BD
BD
BD
EE

but the first HTML encountered is the 'C' block.  Needless to say I  
have never found a satisfactory way of achieving this.  It is also  
true that the row and cell tags of an HTML table break up the content  
flow in such a way that can make the text incomprehensible when read  
aloud sequentially.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2008-05-19 Thread Patrick Middleton


On 19 May 2008, at 09:01, Daniele Corti wrote:


Hi list,

   I've made a Direct Action that make authentication, but I need  
that the communication between the client-server is secure, under SSL.

   Is there a way to check if the request was sent under SSL?

   Thank you for any help!
--
Daniele Corti
AIM: S0CR4TE5
Messenger: [EMAIL PROTECTED]


Yes -- look for an HTTP header named 'HTTPS' with a value of 'on'.   
This would normally be an environment variable set by mod_cgi, but is  
available in WO apps as an HTTP header, via WOComponent.context 
().request(), using API in WOMessage (WORequest's superclass).


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

This email sent to [EMAIL PROTECTED]


Re: Help with Double Action Method

2008-03-05 Thread Patrick Middleton


On 5 Mar 2008, at 13:59, Gino Pacitti wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi All

I have a component actton method that is calling a second component
(not nested) and the result is the action method being called twice
in the first component and also appendToResponse twice

...


Although the PDF is appearing it seems to call downloadPDF twice?

Has anyone an explanation or link to find out why this is  
happening


This is Tiger 5.3 WO and safari...

GIno


What's the HTML content like defined in the component template for  
AttractionVoucher?
What happens if, in your AttractionVoucher.appendToResponse(,) , you  
call super.appendToResponse(r, c) before doing the other stuff to set  
the response's content to the PDF?


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

___
Do not post admin requests to the list. They will 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: A little bit of Ajax in a 5.3 app?

2008-02-26 Thread Patrick Middleton


On 26 Feb 2008, at 15:18, Ken Anderson wrote:


Everyone,

I have a 5.3 app using stable WOLips that has hundreds of  
components and does not currently use Wonder.  I have a few sub- 
components that have multiple dependent pop-ups, and I do a submit 
(); onChange on those pop-ups to refresh the page.


Unfortunately, the pages have gotten pretty big, and the constant  
refresh is getting tedious.  I was wondering if anyone has a road- 
map where I can use a tiny bit of Ajax in a single sub-component to  
improve the user experience (it's a maintenance app...so  
User==Me).  I don't have a ton of time, and can't really risk  
moving to 5.4 or reworking the entire app.


Any thoughts?

Thanks,
Ken


Use a DirectAction.
Work it up from first principles after reading http:// 
developer.apple.com/internet/webcontent/xmlhttpreq.html .

Simplify the example by removing XML namespaces.
Use the '![CDATA[ ... ]]' construct to wrap any HTML content  
returned in your response to prevent XMLHttpRequest and friends from  
trying to parse it as XML.


WO 5.3?  I got this working without too much trouble in WO 4.5.1 .

Hope this helps!


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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


array fault firing from addObjectToBothSidesOfRelationshipWithKey(, )

2008-01-17 Thread Patrick Middleton

Hi,

	periodically people post to this list with problems where adding or  
removing objects from a one-to-many relationship using  
addObjectToBothSidesOfRelationshipWithKey(,) or  
removeObjectFromBothSidesOfRelationshipWithKey(,) causes the an array  
fault to fire in the owning object, fetching perhaps thousands of  
objects unnecessarily.  Believe it or not I'm still working in ObjC;  
on 19 Apr 2007 I posted some code to this list, an EOF/ObjC  
workaround for this which had a few limitations -- the one most  
likely to cause problems being that it won't work with database  
inheritance.  Did anybody ever try porting that to EOF 5, or devise  
another workaround for WO5.x?


In essence, what the code did was provide a small number of classes;  
where the developer encounters some code where he knows that an  
object is to be added or removed and that the owning object's to-many  
relationship might be an unfired array fault and that firing the  
fault normally could be undesirable, then the developer users one of  
the classes, which temporarily sets itself as the owning object's  
editing context's delegate; this object analyses  
EOFetchSpecifications, and in the case of a fetch specification to  
fetch the objects to clear the fault, it instead returns an array  
containing the detail object of interest, and records that it has  
done so.  Subsequently, the developer can obtain a list of objects  
that have had their relationships tweaked and which should be  
refaulted, and tell the helper object to restore the owning object's  
editing context's previous delegate.




Patrick

--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)


___
Do not post admin requests to the list. They will 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: Fat relationships: i.e. user --- transactions

2007-12-05 Thread Patrick Middleton


On 5 Dec 2007, at 17:17, Pierce T. Wetter III wrote:



...

 addToBothSidesOfRelationship

...





It turns out to be almost never the case that you want to fetch  
all Open Tasks.  It tends to be the case for us that you almost  
always want to have additional qualifiers on those searches,  
which ends up that you fault a HUGE (many thousands) of EO's in  
just to turn back around and filter them down in memory.   
Instead, I can remove that relationship completely and provide  
just the variant of the to-many that takes a qualifier.


Of course not and I agree 100%. But the example was user - 
transactions which *I* would not fetch manually unless I had  
problems with multiple instances.


And the case above would normally be in an SEC which would have no  
outgoing relations anyway.


  Well, it was my example, so I'll chime in (and change the subject)

...


  The _admin_ side often does. So I'm glad to hear there's a fix  
for the NSArray O(N^2) issue, that was in old Obj-C EOF as well.


  So removing the inverse relationship from a fat to-many isn't  
always an option if you need one in one place, and another in a  
different place.


  A pure EOF solution would be to dynamically define the to many  
side of
 user -transactions relationship at runtime, based on the  
particular application's needs.


  That was one of the nice things about Obj-C categories...I could  
load certain code in only certain places.

...

Suddenly I am reminded of some ObjC code I posted to this list on Apr  
19 (Re: AddObjectToBothSidesOfRelationshipWithkey) -- how to  
manipulate relationships in a clean(ish) fully EOF 4.5.1 way that  
avoids unnecessary firing of array faults.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

___
Do not post admin requests to the list. They will 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: Editing Contexts and Autorelease Pools in 4.5.1

2007-11-08 Thread Patrick Middleton


On 7 Nov 2007, at 17:29, Dana Kashubeck wrote:

Remember way back when WebObjects supported Objective-C /and/  
Java?  Well, travel back with me if you are able.


I'm working with an Objective-C port of the MultiECLockManager.  I  
ran into a really nasty situation because when you lock an editing  
context, it creates an autorelease pool that is subsequently  
released on unlock.  Since autorelease pools work in stacks and I  
was locking/unlocking an array of editing contexts, pools were  
being released before I wanted them to.  I did end up solving this  
issue by going /backwards/ through the array of editing contexts  
when unlocking.


However, I'm wondering if there is a way to avoid this situation  
altogether.  It is a long-shot that anyone here will be able to  
help (as you've all been writing Java apps for so long!), but I  
thought it couldn't hurt to ask:


Does anyone have experience working with peer editing contexts in  
Objective-C WO?


My dealings with multiple ECs in WO4.5.1 were -- indeed, are --  
mostly to do with either nested ECs or ECs being worked in separate  
threads.  I found when doing something time consuming, it was  
necessary to do it in a separate thread, and it was best to use a  
separate EC which I could lock and unlock as needed to avoid risking  
have the session's default EC be locked by a detached thread at a  
time when the session wanted to lock it because of servicing a page  
request.


Yes, locking the EC will cause it to create a new NSAutoreleasePool,  
and yes, there are various things you can do such as -reset that will  
cuase the EC to lock itself.  NSAutoreleasePools are stacked, so  
there is lots of scope to be bitten, and the best solution I can see  
is unlock the peer ECs in the reverse order to which they were  
locked, as described.


NSAutoreleasePools are stacked per thread (and it says so in the  
class reference documentation).  If you had each EC in a different  
thread, then you wouldn't encounter the problem you have -- rather, a  
whole bunch of different problems instead.  I found that getting  
editing contexts to deallocate cleanly was a severe pain, because EOF  
hacks -dealloc for objects managed by ECs, and I was frequently  
hitting problems where something that was doing a pretend-to- 
deallocate-now-but-really-deallocate-later because of EOF was causing  
crashes when it actually did deallocate, because it had references to  
other parts of the EOF object graph which had already genuinely  
deallocated.


Although I can't find the bit of documentation that says so (ie, it's  
not in the class reference documentation), it's my understanding that  
when an NSAutoreleasePool is released, any child NSAutoreleasePools  
-- necessarily stacked -- will also be released, and this would be a  
severe nuisance.


Having reviewed Jonathan's original code, if we are working solely  
with peer ECs, do we really need MultiECLockManager?  If all I needed  
was some convenience for ensuring that when I was finished, all ECs  
of interest were sent the right number of -unlock messages, I'd  
refactor this (or write something else) so that each editing context  
had its own lock count, and I could lock or unlock any managed EC (or  
query its lock count) via my manager object.  That way, I could  
unlock ECs when they no longer needed to be locked ... except if I  
lock A then lock B, I cannot let the lock count for A fall to 0 until  
the lock count for B has fallen to 0 because of the stacked  
NSAutoreleasePool problem.  Hmmm.  This whole matter would be much  
simpler if one could refactor one's code to ensure that a maximum of  
1 peer editing contexts was ever concurrently locked.


-- Patrick

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

2007-06-14 Thread Patrick Middleton


On 14 Jun 2007, at 14:53, Oliver Scheel wrote:


What's up with wocode.com? Godaddy.com complains about renewal of
wocode.com...

Any ideas?

Oliver



localhost whois wocode.com

Whois Server Version 2.0

Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http:// 
www.internic.net

for detailed information.


   Domain Name: WOCODE.COM
   Registrar: GO DADDY SOFTWARE, INC.
   Whois Server: whois.godaddy.com
   Referral URL: http://registrar.godaddy.com
   Name Server: NS45.DOMAINCONTROL.COM
   Name Server: NS46.DOMAINCONTROL.COM
   Status: clientDeleteProhibited
   Status: clientRenewProhibited
   Status: clientTransferProhibited
   Status: clientUpdateProhibited
   Updated Date: 10-jun-2007
   Creation Date: 05-jun-2001
   Expiration Date: 05-jun-2008

 Last update of whois database: Thu, 14 Jun 2007 14:02:05 UTC 

NOTICE: The expiration date displayed in this record is the date the
registrar's sponsorship of the domain name registration in the  
registry is
currently set to expire. This date does not necessarily reflect the  
expiration

date of the domain name registrant's agreement with the sponsoring
registrar.  Users may consult the sponsoring registrar's Whois  
database to
view the registrar's reported date of expiration for this  
registration.


TERMS OF USE: 

Registrant:
   The Primax Group
   650 NORTHLAND BLVD
   CINCINNATI, Ohio 45240-3242
   United States

   Registered through: GoDaddy.com, Inc. (http://www.godaddy.com)
   Domain Name: WOCODE.COM
  Created on: 05-Jun-01
  Expires on: 05-Jun-07
  Last Updated on: 22-May-05

   Administrative Contact:
  ,   [EMAIL PROTECTED]
  The Primax Group
  650 NORTHLAND BLVD
  CINCINNATI, Ohio 45240-3242
  United States
  513.772.1223  Fax -- 513.772.1223

   Technical Contact:
  ,   [EMAIL PROTECTED]

  ,

Fax --

   Domain servers in listed order:
  NS45.DOMAINCONTROL.COM
  NS46.DOMAINCONTROL.COM

localhost


___
Do not post admin requests to the list. They will 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: Interrupting a fetch that is taking too long

2007-05-16 Thread Patrick Middleton


On 15 May 2007, at 21:34, Ricardo Parada wrote:

Hi All,

Let's say I have a GUI that lets users build queries to be used for  
a report.   Then another process generates a report by applying  
this user defined query.  However, if the query takes too long I  
would like to interrupt the query and then flag query for special  
handling.


Has anybody figured out a way to interrupt a fetch in EOF?



On 16 May 2007, at 00:23, Art Isbell wrote:


On May 15, 2007, at 12:04 PM, John Huss wrote:


Actually terminating a query in progress is database-specific, so
there is no EOF way to do it.


	EOAdaptor's cancelFetch() should do what the method name implies.   
Each database plugin includes an EOAdaptor subclass that overrides  
cancelFetch() to do the database-specific mojo necessary to cancel  
a fetch in progress.


	You'd probably need to write your own fetchRow() loop checking at  
each iteration whether to cancel the fetch.  But doing so isn't as  
easy in a WO app with its very long event loop compared with the  
desktop environment with its short event loop.  Maybe you could  
have a timer running in one thread set a cancelFetch variable to  
true while the fetch loop in a different thread could check the  
value of cancelFetch during each iteration.  But then you'd need  
to turn this array of fetched dictionaries into EO's in an editing  
context in the same way as using an editing context to fetch which  
isn't something that I'd like to mimic.


Aloha,
Art


My experience of EOAdaptor's cancelFetch() began with an AppKit app  
using EOF 2.x.
GUI app Ricardo?  Want kind of GUI app?  Critically, are you doing  
doing something like an isql client (one user, one database  
connection, two-tier architecture) or classic WebObjects application  
(many users, one pooled database connection, three-tier architecture)?


Whichever -- and I'm sure you're already on top of this -- you will  
need to have the fetch build+execute run in one thread, and some sort  
of monitoring facility with a cancel button available to the user in  
another thread.  EOF either uses locking or assumes locking will be  
used on its behalf to ensure that database i/o will be threadsafe.   
You cannot call EOAdaptor's cancelFetch() from another thread.   
Instead, use EOAdaptorChannel delegate API so that the build/fetch  
thread can tell whether or not it should continue fetching (because  
your cancel button leads to a flag being changed somewhere; this is  
much as Art suggests, except that there are hooks available to do  
what he suggests with a reduced need for rewriting or subclassing).   
If your app is an application server, this approach works well with  
WOLongResponse page.


Moreover: when I last used the JavaJDBCAdaptor to do something like  
this with Sybase, EOAdaptor's cancelFetch() did not work.  There were  
reasons why it did not work.  If you cancelled a fetch after x rows  
and there were x+y rows to be returned, the adaptor would clear the  
reuslts set by fetching the other y rows, and so cancelling the fetch  
wouldn't help because it doesn't reduce the amount of database i/o  
that occurs.  I found a workaround; if the problem is still present,  
you should be able to exploit the workaround I found.


http://www.wodeveloper.com/omniLists/ webobjects-dev/2003/July/ 
msg00300.html
http://www.wodeveloper.com/omniLists/ webobjects-dev/2003/July/ 
msg00470.html



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

___
Do not post admin requests to the list. They will 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: Multiple clients in single DB

2007-04-26 Thread Patrick Middleton


On 26 Apr 2007, at 02:33, Dave Elsner wrote:


Hi,

I have an WO5.3 application I want to deploy to five different  
clients, all have the same DB (Oracle) schema but different data. I  
would like to use a shared database with a new column in each table  
client that has the client ID. Then override awakeFromInsertion  
for all EOEntities to set the client ID and also add to the  
Application constructor a loop that sets an EOQualifier on each  
entity in the model limiting objects to the current client.


Questions:

* Is this the correct approach to solve this problem? (i.e not  
wanting to update X number of identical DB schemas every-time a  
change is made, keeping the data in the one location for reporting)


* I tried EOEntity.setRestrictingQualifierbut that overrides  
any single table inheritance setup in the model. Is there away to  
merge two EOQualifiers?




Cheers
Dave


My solution to this was to add a new entity Client, and make this  
reachable from at least one other entity bearing useful data in your  
schema.  Via keypaths and joins, this entity should then now  
reachable from any entity other interesting entity.  You then use  
EOEditingContext delegate API http://developer.apple.com/ 
documentation/WebObjects/Reference/API/com/webobjects/eocontrol/ 
EOEditingContext.Delegate.html#editingContextShouldFetchObjects 
(com.webobjects.eocontrol.EOEditingContext,% 
20com.webobjects.eocontrol.EOFetchSpecification to examine the  
EOEntity for any fetch about to be carried out and to selectively  
amend the fetch specification's quailfier to add another  
EOKeyValueQualifier to achieve the required restriction.  If your  
code carries out custom fetches which need to bypass this restriction  
mechanism, pass yourself a flag in the EOFetchSpecification's  
userInfo dictionary.


This has worked very well for me in a number of apps since 1999, you  
don't need to tinker with EOF (everything is as per the EOModel) and  
all the required client ID stuff resides in a single table.



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2007-04-19 Thread Patrick Middleton


On 19 Apr 2007, at 13:37, Ken Anderson wrote:


Frank,

There must be a large number of objects in the relationship you're  
adding to.  In that case, you might want to just add it to the  
other side.  Is it a relationship that you use often?  If so, you  
might want to consider changing how it works so that there's not  
such a large group of objects being returned.


In other words, if you have a to many with an opposite to-one:

A -- B

If you set B's to-one relationship to A (not using the both sides  
method), you won't trigger the to-many fault.  Of course, if the to- 
many fault has already been triggered, you're going to have an  
inaccurate object graph.  A hokey solution might be to test whether  
to to-many relationship from A to B is a fault or a real array, and  
then add in that direction if necessary.


Bottom line - I would change my relationships.  Do you absolutely  
need this to-many relationship?  Could it be handled with a fetch  
instead for a once in a while situation?  A common misconception  
that people have is that they should model both directions of every  
relationship.  Only model what you need...


Ken

On Apr 19, 2007, at 7:41 AM, Frank Stock wrote:


HI,

I did test it with addTorelationsShipName and that just gives me  
the same result!



...


On 19-Apr-07, at 4:50 PM, [EMAIL PROTECTED]  
wrote:





From: Frank Stock [EMAIL PROTECTED]
Date: 19 April 2007 4:50:08 PM GMT+05:30
To: webobjects-dev@lists.apple.com
Subject: AddObjectToBothSidesOfRelationshipWithkey


Hi,


When  I do this:


...
	This will take 90 seconds to complete (will all the rest of the  
code)



I can see in the debugger that every time I do a  
AddObjectToBothSidesOfRelationshipWithkey WO will perform a  
select-statement,
the relations have a lot of records (2000). I have to to that a  
lot of time and all I need is just to make a relation between  
the objects.

Why is WO performing a select every time and can I avoid that?



Frank Stock



Yes.  I've seen this problem often enough myself, and changing the  
eomodel was not an option for me.  Apart from anything else, I do  
need the inverse relationship.  I've seen people manipulate  
relationships directly using public accessors rather than let  
addObjectToBothSidesOfRelationshipWithKey(,) or  
removeObjectFromBothSidesOfRelationshipWithKey(,) make those changes,  
and while I have seen this approach working, I think it is prone to  
error.


I've got a solution I like for this, but, as some of you will have  
heard ad nauseam, I'm still working with WO451/ObjC .




OSPArrayFaultSuppressor.h
Description: Binary data


OSPArrayFaultSuppressor.m
Description: Binary data


OSPArrayFaultSuppressorRecord.h
Description: Binary data


OSPArrayFaultSuppressorRecord.m
Description: Binary data


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2007-04-19 Thread Patrick Middleton


On 19 Apr 2007, at 14:57, Frank Stock wrote:


Ken,


what I don't understand is why all the relation-rows are fetched,  
not just the selection thats needed?


A --- B

A has an array fault; if you touch it, EOF will go to the database to  
get all B belonging to A.
If you do a.addObjectToBothSidesOfRelationshipWithKey(newB, toB) ,  
then EOF will look at toB to see if newA is already in it, and this  
will cause the fault to fire and all the objects will be fetched.   
Similarly, when doing a.removeObjectFromBothSidesOfRelationshipWithKey 
(oldB, toB) EOF will look at toB to remove oldB from it.  This sort  
of thing happens even without a back-pointing relationship.


If you were writing SQL yourself and managing the relationships  
yourself, you would be able to insert newB or delete oldB, and make  
the SQL, and you would know that you didn't need to fetch the objects  
for toB.  EOF cannot be quite that clever.  EOF knows some rows are  
to be fetched, but not why, so cannot do something special and  
different and efficient.


That's where the ObjC code I posted came in.  I can be that that  
clever, so I know that if, inside a bit of my code using an  
editingContext, EOF asks for a particular fetch to be made, I can  
intercept that, and instead of returning an array of objects from the  
database, I can return an array of objects already in the  
editingContext without any fetching.


Look at http://developer.apple.com/documentation/WebObjects/Reference/ 
API/com/webobjects/eocontrol/ 
EOEditingContext.Delegate.html#editingContextShouldFetchObjects 
(com.webobjects.eocontrol.EOEditingContext,% 
20com.webobjects.eocontrol.EOFetchSpecification) .


I'm not rewriting that ObjC code as Java until I need to!

-- Patrick

___
Do not post admin requests to the list. They will 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: how to make 'redirect url' work [WAS: nice error messages]

2007-03-21 Thread Patrick Middleton


On 21 Mar 2007, at 11:53, Mike Schrag wrote:

What is the proper way to make Requested application not found  
redirect to a URL?  This error seems to not be controlled by  
monitor's redirect url setting.


ms


It is controlled like that.  Have a good read of the WebObjects  
Deployment Guide documentation, especially HTTP Adaptors and then  
have a good think!


In the dynamic configurations (multicast, host-list), the application/ 
instance information is maintained by wotaskd, and is based on what  
wotaskd read from its configuration file combined with the  
application instances about which wotaskd knows because of received  
lifebeats.  If there aren't any instances of the application known to  
wotaskd, then it can't describe the application in its XML response,  
and it's the application .../application part which specifies the  
redirect URL.


If you go for the static configuration (HTTP Adaptor Configuration  
File) choice, then the adaptor is being told what applications/ 
instances you say ought to be available, and not what applications/ 
instances wotaskd thinks exist.


I first encountered this on WO451 some years ago.  The default  
configuration was host-list from http://localhost:1085, and on some  
subnets something used to happen from time to time that crippled  
wotaskd, and all the woapp instances would become unavailable.   
Having read the documentation thoroughly enough to use file  
configuration instead, I was able to see the 'redirect url' setting  
working for the first time.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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


building mod_WebObjects.so universal [was: Is Xcode Tools 2.4.1 missing the WebObjects adaptor source code?]

2007-03-20 Thread Patrick Middleton


On 11 Jan 2007, at 11:48, Patrick Middleton wrote:

http://developer.apple.com/documentation/WebObjects/Deployment/ 
Deploying_Applications/Installation/chapter_3_section_3.html says  
(amonst other things) that This section discusses building HTTP  
adaptors from the source code in /Developer/Examples/WebObjects/ 
Source/Adaptors.  Reviewing the contents of packages provided  
installed via Xcode Tools 2.4.1, it's clear from  
WebObjectsExamples.pkg that /Developer/Examples/WebObjects has  
become  /Developer/Examples/WebObjects/Source , but no package  
appears to include the adaptor source code any more.


We're using our own adaptor which is derived from the stock Apache  
1.3.x mod_WebObjects.so. I would like to review the current  
makefiles so that I don't have to figure out myself how to change  
what I already have in order to be able to build a universal or  
i386-only binary on my ppc developer system.


Is the adaptor source still supplied but I haven't found it, or is  
it missing; and if it's missing, is this by accident or design?


The adaptor sources are still missing, and I have filed a request to  
have them restored.  In the meantime, getting the project to build  
universal turned out to be easier than I thought.  Sneaking some  
extra flags into CFLAGS and LDFLAGS for MacOSX worked well but caused  
apxs to trip up; wrapping the definition of my extra flags in double  
quotes helped, and wrapping the values passed to apxs via -Wc and -Wl  
in double quotes helped some more.



diff -r Adaptors/Apache/Makefile Adaptors-older/Apache/Makefile
13,14c13,14
 CFLAGS += ${OSP_ARCH}
 LDFLAGS +=${OPENSSL_LIB_FLAGS} ${OSP_ARCH}
---

 LDFLAGS +=${OPENSSL_LIB_FLAGS}
36,39d35
 ifeq MACOS ${OS}
 APXSFLAGS = -c -S CC=${CC} -Wc,${CFLAGS} -Wl,${LDFLAGS}
 endif

diff -r Adaptors/CGI/Makefile Adaptors-older/CGI/Makefile
7,10d6
 ifeq MACOS $(OS)
 CFLAGS += ${OSP_ARCH}
 endif

diff -r Adaptors/make.config Adaptors-older/make.config
8d7
 OSP_ARCH=
25d23
 OSP_ARCH=-arch ppc -arch i386 -mmacosx-version-min=10.4 -isysroot / 
Developer/SDKs/MacOSX10.4u.sdk



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)


___
Do not post admin requests to the list. They will 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: Easiest way to integrate Quartz drawing into WO apps?

2007-03-14 Thread Patrick Middleton


On 14 Mar 2007, at 16:56, Ken Tabb wrote:


Hi again folks,

I have some Objective-C code that draws pretty graphs using Quartz.  
All looks lovely in Cocoa apps. I'd like to re-use this same code  
(or at least the pretty Quartz technology within it) in a  
WebObjects component, so that these same graphs appear in a web  
page (as a JPEG).


What's the best way to get to Cocoa/Obj-C code from WO/Java apps?  
First one to say Cocoa/Java bridge gets a slap :)


I'm thinking the options are:

[1] Cocoa app turns into web service, and somehow get at that from  
the WO app. I'm new to web services (although it's something I'll  
be needing to get into at some point, albeit not specifically from  
a Cocoa angle), both in terms of publishing and consuming them.


[2] Run Cocoa app as-is on the server (same Mac OS X Server as the  
WO app) and get some sort of inter-process communication going -  
suggestions for the best route welcome (it's been some years since  
I did any Java IPC stuff so I'm sure it's all changed). Bearing in  
mind it's all running on the same server though, I could at the  
worst send data from WO - Cocoa via XML file / stream, and get  
Cocoa app to save the image (with session ID etc. preceding  
filename) in a known subdirectory of the web server - the session  
could then remove all images whose filename begins with the  
session's sessionID, at the time the session is destroyed. I guess  
that would work (even though it gets zero for elegance / scalability!)


[3] Re-write the Quartz code in a Python / Ruby script - I don't  
know Python or Ruby yet, but wouldn't be against learning this if  
it was necessary; I believe both have routes to Quartz. I still  
have the issue of needing to call it from, and send data back to,  
the WO app - all suggestions welcome!


And secondly, how long is a piece of string?

Thanks in advance for any tips you can give,
Ken



As a WO 4.5.1 programmer, this reminds me thoroughly of all the  
things you couldn't do in a production WO app on a server because  
there would be no logged-in user and so all sorts of interesting and  
very necessary GUI services would not be available to your GUI code.   
Worked well enough in development when you ran your app through  
ProjectBuilderWO though  oh, and all GUI code needed to be  
executed on the same thread, which was difficult to achieve, but  
possible.  Quartz isn't the AppKit; but I'd still expect both  
problems to bite you.  [Mmm.  /usr/bin/sips works when headless, so  
you might get lucky.]  Having somebody logged in via Apple Remote  
Desktop might help; if it does, and if you are deploying on a Xserve  
without a real video card, performance might be disappointing.


These problems don't exist in WO5, where (1) you don't get access to  
goodies like Quartz and (2) one can define a property - 
Djava.awt.headless=true to run GUI code when headless.



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2007-02-27 Thread Patrick Middleton


On 27 Feb 2007, at 16:15, James Cicenia wrote:


Hello -

I just can't figure this out. Maybe I am doing something wrong with  
this server.


My javamonitor refuses to restart applications at night..  
intermittently. And then
it will show something like the following (not the real url) until  
I kill javamonitor.
However, today my apps are still functioning but will surely stop  
responding

if I don't kill things again.

Failed to contact www.xyz.com-1085


This never happens on my two other servers that restart flawlessly  
at night.


Any ideas whatsoever?

These are just read only apps too!

Should I replace the url with an ip?

help

James Cicenia


Can your application server resolve itself via DNS?  I bet the two  
that work can, and the third that can't doesn't.
In my experience replacing names with ip addresses just makes wotaskd  
and JavaMonitor even less cooperative.
If this is the problem and you can't get a name/address publlshed by  
(probably internal) DNS in a hurry, try editing /etc/hosts .


[And I bet Tiff Cluel chimes in that there's a list webobjects- 
[EMAIL PROTECTED], too!]


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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


Is Xcode Tools 2.4.1 missing the WebObjects adaptor source code?

2007-01-11 Thread Patrick Middleton
http://developer.apple.com/documentation/WebObjects/Deployment/ 
Deploying_Applications/Installation/chapter_3_section_3.html says  
(amonst other things) that This section discusses building HTTP  
adaptors from the source code in /Developer/Examples/WebObjects/ 
Source/Adaptors.  Reviewing the contents of packages provided  
installed via Xcode Tools 2.4.1, it's clear from  
WebObjectsExamples.pkg that /Developer/Examples/WebObjects has  
become  /Developer/Examples/WebObjects/Source , but no package  
appears to include the adaptor source code any more.


We're using our own adaptor which is derived from the stock Apache  
1.3.x mod_WebObjects.so. I would like to review the current makefiles  
so that I don't have to figure out myself how to change what I  
already have in order to be able to build a universal or i386-only  
binary on my ppc developer system.


Is the adaptor source still supplied but I haven't found it, or is it  
missing; and if it's missing, is this by accident or design?


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)
 
___

Do not post admin requests to the list. They will 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: running a perl script with RunTime.Exec causes perl script to die

2006-11-08 Thread Patrick Middleton


On 7 Nov 2006, at 23:46, Johan Henselmans wrote:

I have produced a perl script to do some printing and database  
housekeeping, which is called using Runtime.Exec.


The script connects to a postgresql database, selects a parent- 
record via an argument and then prints some information from the  
children records.


When I run this script from a shell, it runs fine.

However, when I call the script from the webobjects application, I  
get an error message:

...

The java code that calls the script is:


commands[0] = /usr/bin/perl;
commands[1] = /usr/local/bin/printorder.pl;
commands[2] =  --ordernr;
commands[3] = order.orderid().toString();

	   vars[0] = PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/ 
bin;

vars[1] = LD_LIBRARY_PATH=$LD_LIBRARY_PATH;


...


Is there anybody that has experienced something similar and has  
come up with a solution?


You are setting the perl script's environment variables in a way that  
doesn't work.
If you run the perl script from a shell, the interpreter inherits a  
suitable environment.
If run from java.lang.Runtime, LD_LIBRARY_PATH will be set to  
'$LD_LIBRARY_PATH'.  The dollar expansion is something done for you  
by the shell; but there is no shell, so no substitution is done.   
Rewrite your code to initialize vars[0] and vars[1] using explicit  
values, perhaps obtained via java.lang.System.getenv().


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2006-11-08 Thread Patrick Middleton


On 8 Nov 2006, at 16:54, Florijan Stamenkovic wrote:


Hi all,


Does anyone know an easy way to detect when a fault is fired? I  
would like to run some tests on my app to be able to better  
optimize fetching.


Thanks,
Flor


How about overriding EOCustomObject.clearFault() to write a log message?

I myself am using EOEditingContext.Delegat.  
editingContextShouldFetchObjects(,) .  The qualifier in the  
EOFetchSpecification argument is usually distinctive; I have managed  
to exploit this to prevent going to the database when firing an array  
fault as a consequence of adding or removing detail objects from a to- 
many relationship.



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2006-10-23 Thread Patrick Middleton


On 23 Oct 2006, at 11:03, Frank Stock wrote:


Hi,

I have to do crop images with Cocoa, so I wrote a JNI-framework to  
solve that, but it seems that Core Image doesn't clean up very  
well. So I use a terminal command now. The problem is, when my  
command line-routine is crashing  (I know that it shouldn't, but if  
it does..) WO is hanging.

I use the following routine:

try{
	Process runningApp = Runtime.getRuntime().exec(... to my  
routine);

  ...
	runningApp.waitFor();  // If the command line routine is  
crashing, WO is freezing here

   ...


}
catch(IOException e) {
NSLog.err.appendln(Didn't start up!);
throw e;
}

Any idea or a better way to solve my problem?

Thanks,
Frank Stock
NNS produtions
Belgium
 



Running the image conversion in a separate process space is good,  
because if it crashes, it doesn't crash your application with it.


This technique is working well for me in WO451/ObjC with ImageMagick  
convert on MacOSX 10.1.5 and with sips on MacOSX 10.4.x .


Do the image conversion in a separate thread.  Have synchronised  
instance variables/methods so that the calling thread can know when  
the conversion is complete.  Have the calling thread sleep for  
perhaps 1s perhaps 10 times -- or use sleep() or wait() and catch an  
InterruptedException  Of course, if conversion has not completed  
normally or crashed and exited in 10s, you have to decide what your  
app should do next.


Your command-line routine probably isn't crashing -- it's probably  
blocked waiting trying to read from standard input.



--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

___
Do not post admin requests to the list. They will 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: WO in Java or Objective-C...

2006-09-06 Thread Patrick Middleton


On 6 Sep 2006, at 16:55, Ricardo Strausz wrote:

On Sep 5, 2006, at 21:41, [EMAIL PROTECTED]  
wrote:



- many of us have large volumes of ObjC code

I'm wondering: how many?  Are there really a lot of us out there with
large Objective-C frameworks that we need to leverage in our WO apps?


+1

Dino


Some of us never got around to migrating to WO5, are still busily  
cutting WO451 code, and have plans (when less busy) to see how much  
production code can be made to run on 10.4.x/i386 via Rosetta.


-- Patrick

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


Complicated configurable HTML tables

2006-08-17 Thread Patrick Middleton

I have a woapp on which I'm working where there will soon be:
three basic screen layouts, based on an assumed device display width  
of 160px/320px/640+px, user selectable

some columns will always be present
some columns will be present if the user wants them shown
some columns will be present if the sysadmin wants them shown

It's a requirement that all this be nicely formatted; left or right  
text alignment, alternating table row background colours, and column  
widths to be specified as percentages.  At the moment I have lots of  
WOConditionals, such that if a particular set of conditions is met  
then the enclosed layout will be used, but this has become unmanageable.


The amount of information to be shown is such that one line of data  
could need between one and four HTML table rows to show it all  
depending on the configuration.  Wrapping and scrolling are bad  
ideas; we need 100% of the table width to be visible on the device  
screen.  Vertical scroll bar good; horizontal scroll bar bad; both  
scroll bars together very bad indeed.


I've got a fair idea how I'm going to make all this work -- but I'd  
be very grateful if anybody who has already encountered and solved  
this problem would like to share their solution!



---
Regards Patrick
OneStep Solutions Plc
www.onestep.co.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/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: WOHTTPConnection WORequest

2006-07-27 Thread Patrick Middleton


On 27 Jul 2006, at 17:43, David Griffith wrote:


Hi Jerry,

Well, I have no control over the other website.  What I need to do  
is this:


In my own WO App, I have a page which displays some information  
from the database about a domain name and who it is associated with.


I would like to have a button on that page that can be clicked  
which will then send a request to the 3rd party web site (which is  
just a standard website).  I want to submit a form to it as if I  
had gone to the page, entered my details in the form and clicked  
submit.  Except I don't want to manually enter my details, I want  
to submit the form without going to the actual webpage itself (so  
effectively I want to create a page that emulates the actual page  
on that webserver and submit it with form values filled in already  
(rather than anyone having to manually enter them).


Obviously that webserver will return a normal HTTP response page  
(HTML page) which is the page that I want to get back to my  
original WO App whereupon I will parse it for the information I  
need and place that information on my WOComponent as necessary.


I have done this with another programming tool in the past and  
built Google's language tools into my own application.  I am trying  
to do something similar with WebObjects but just can't find the  
correct way to do it.  Perhaps WebServices is what I need.  I will  
look into it further.


To give a more step-by-step idea of what I am trying to do:

User looks up a record in my app which contains a variable called  
'domainname'.


They click the button that says 'Lookup'.

My WOApp then needs to generate  a HTML form that can be submitted  
with some form field values to a URL that I specify, but with no  
user interaction of any kind.


I need to get the response page (HTML) from that URL back into my  
WO App.


From there I have no problem as I can parse it and get the info I  
need.


Regards,
David.


Of course, if you were really devious, you could adapt AJAX  
technology to do what you need.


http://developer.apple.com/internet/webcontent/xmlhttpreq.html

'domainname' -- are you by chance getting someone to type in their  
email address, and then trying to validate an MX record to see if  
it's real or not?



---
Regards Patrick
OneStep Solutions Plc
www.onestep.co.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/archive%40mail-archive.com

This email sent to archive@mail-archive.com


Re: Java Error on startup of App

2006-05-30 Thread Patrick Middleton


On 30 May 2006, at 11:43, Gino Pacitti wrote:


Hi All

I have been running an app on Tiger server + latest Webobjects run  
environment and recently updated development to the latest XCode 2.3


Now I have tried to build an existing running app and when I try to  
start it I get a error - this runs on the client but problem is  
when I upload to the server:


java.lang.UnsupportedClassVersionError: Application (Unsupported  
major.minor version 49.0)



Any ideas what this could be?

Gino


The JVM on the target machine has encountered a classfile in JDK 1.5  
format.  This most likely means you built using the JDK 1.5 compiler,  
which became the default after a recent software update, and the  
machine on which you are trying to deploy is still using the 1.4.2  
JRE.  Since WebObjects has not (yet?) been qualified for Java 5, you  
are best off rebuilding using JDK 1.4*, see also http:// 
docs.info.apple.com/article.html?artnum=75505 , as per Cliff Tuel's  
email Re: Java 1.5  WO?' of Tue, 25 Apr 2006 16:07:21 -0700 (PDT).


-- Patrick

___
Do not post admin requests to the list. They will 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: two databases from one application

2006-05-11 Thread Patrick Middleton


On 10 May 2006, at 17:20, Milan M wrote:


Hello all,

WO application I am working on was pretty simple up to this point:  
one apache webserver and one databaseserver serving data to it. The  
things turned more complicated now: In addition to the first  
database, we now want to add access to another database. Both of  
these databases have identical schema, and the tables in question  
are identical. Think of the second database as a backup.


At one point in the applicaiton, I want to take an enterprise  
object generated in defaultEditingContext and to save it to the  
other database.


I've dealt with this problem in EOF2.1 to EOF4.5 .  EOEntity names  
had to be unique across an eomodel group.  I haven't done any similar  
work in EOF 5.x, but the general fix *should* be the same.  One need  
to create two or more entirely separate EOF object graphs; have a  
look at http://developer.apple.com/documentation/webobjects/Reference/ 
API/com/webobjects/eocontrol/EOObjectStoreCoordinator.html ,  
especially the static methods setDefaultCoordinator() and  
defaultCoordinator() .


One will probably need, for one's own sanity, to avoid using the  
session default editing context, which will mean needing to manage  
locking oneself in any editing contexts one creates, presumably at  
least one per each EOF stack.


Looking at http://developer.apple.com/documentation/webobjects/ 
Reference/API/com/webobjects/eocontrol/EOEnterpriseObject.html ,  
registering the same object in more than one editing context should  
not be expected to work [see the doco for editingContext()], even in  
entirely separate EOF object graphs.  EOGlobalIDs should work, and  
the snapshot methods in both  
com.webobjectseocontrol.EOEnterpriseObject and  
com.webobjects.eoaccess.EODatabase will work.


So depending on exactly what my needs were, I might end up fetching  
from one database, obtaining row snapshots in the EOAccess layer,  
then doing some work at the EOAccess level using the other EOF object  
graph to write an equivalent set of snapshots into the other database.



Complicated?  Certainly.  But this approach does work.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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

2006-04-27 Thread Patrick Middleton


On 27 Apr 2006, at 14:29, James Cicenia wrote:


Hello -

I am developing a new website and decided correctly or incorrectly,  
to have my wrapper page(s) be the main page and then swap out the  
content in the wrapper with the switch component.


My question is.. normally I have code like nextPage.setEC(ec), etc.,

How do I do this with my architecture as the wrapper really is the  
next page?


Implement a new abstract subclass of WOComponent called something  
like WrapperArchitectureComponent.  Add an ivar and accessors for the  
editing context etc.  Override a couple of significant methods, eg  
awake(), appendToResponse(), takeValuesFromRequest() and invokeAction 
(), to call another method -- wrapperHelper() maybe? -- and then call  
super.


wrapperHelper() should look something like this:

public void wrapperHelper() {
if (ec==null) setEC((WrapperArchitectureComponent)parent().ec());
}

Make all your wrapped components and the wrapper inherit from  
WrapperArchitectureComponent, and in the wrapper page class itself,  
override

wrapperHelper():

public void wrapperHelper() {}

This isn't the only way of dealing with this, but all the good ways  
seem to involve making an abstract subclass of WOComponent to  
encapsulate as much of the plumbing as possible.




Or is what I am doing just wrong?


Almost certainly!

-- Patrick

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

2006-02-06 Thread Patrick Middleton


On 6 Feb 2006, at 14:27, Gino Pacitti wrote:


Hi All

Any thoughts on how to address this problem

I have a multi instance app that connects to a single data store.

For any user, across the instances, I need to increment a numerical  
value newly for each new registered user.


This then has to be saved back to the data store and for there to  
be no conflicts with similar values for new registrants...


Any ideas or have I missed something easy here..


It is possible to use the EOF primary key generation support  
creatively to generate things that aren't primary keys.


http://developer.apple.com/documentation/WebObjects/Reference/API/com/ 
webobjects/eoaccess/EOAdaptorChannel.html


EOAdaqptorChannel.primaryKeysForNewRowsWithEntity(int count, EOEntity  
entity)


-- Patrick

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

2005-12-07 Thread Patrick Middleton


On 7 Dec 2005, at 03:08, James Cicenia wrote:


Hello

We recently had a request for our application but they want the  
data that is stored in the database to be encrypted.


We are using mySQL. Anyone know anything at all about this?


http://books.slashdot.org/article.pl? 
sid=05/11/30/1634221mode=nocommenttid=221tid=172tid=6



-- Patrick

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

2005-11-16 Thread Patrick Middleton


On 16 Nov 2005, at 11:31, Georg Tuparev wrote:


Robert,

Thanks for the suggestion.

The problem is neither with curl nor with the DA. I tested this  
excessively. It is something in the middle that breaks (WO adaptor  
perhaps)... but I am really tapping in the dark...


cheers

gt


I agree.  I would suspect that a timeout is occurring in the  
woadaptor, and presumably the woadaptor is not using the configured  
timeout values.  Georg, can you record and analyse the tcp i/o by  
doing something like


# /usr/local/bin/tcpflow -i lo0 port 2004

on the machine running the application?

So why might the woadaptor be ignoring timeout settings, or doing  
something else unexpected?  I had thought about the connect timeout  
rather than the response timeout; if there were other other requests  
for which it takes many seconds to generate a response, then the  
woadaptor might return early; but then it would generate a no  
instance available page.


I had also thought that perhaps the response the application  
generates could be malformed, from the point of view of the adaptor;  
perhaps the content-length header is missing or incorrect.  That  
would explain why the problem doesn't show up with direct connect,  
but doesn't explain why it's an intermittent problem via the woadaptor.


--
Patrick Middleton
OneStep Solutions plc
351 London Road Phone: +44 (0)1702 426400
HadleighFax:   +44 (0)1702 556855
Essex. SS7 2BT  Email: [EMAIL PROTECTED]
England(MIME welcome)

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