Re: enumerating sessions?

2024-04-26 Thread Samuel Pelletier via Webobjects-dev
Hi,

As Hugi wrote, you can access the list via the session store.

Be careful with access to objects inside those sessions, especially EOs since 
you are outside their normal RR loop request.

I have a standard way to list active users and keep track of last access inside 
session by adding those attributes:
private long lastSleepDate;
private long lastUserRequestDate;
private boolean isRequestFromUser;

and adding those overrides...

@Override
public void awake() {
super.awake();

isRequestFromUser = true;
}

@Override
public void sleep() {
lastSleepDate = System.currentTimeMillis();
if (isRequestFromUser) {
lastUserRequestDate = lastSleepDate;
}
super.sleep();
}

public void setRequestIsPing() {
isRequestFromUser = false;
}


The setRequestIsPing is to discriminate auto refresh ping request in my page 
wrapper use to keep session alive when the app is displayed. I have this in the 
template:


And this in the component java class:

public String pingString() {
if (ERXApplication.isAjaxRequest(context().request())) {
session().setRequestIsPing();
}
return null;
}

And this to list active sessions (SessionInfo is  POJO):

WOServerSessionStore sessionStore = (WOServerSessionStore) 
WOApplication.application().sessionStore();
@SuppressWarnings("unchecked")
NSArray sessions = 
sessionStore._sessions().allValues();

NSMutableArray sessionInfos = new 
NSMutableArray<>();
for (Session session : sessions) {
SessionInfo info = new SessionInfo();
info.hashCode = session.hashCode();
info.lastSleepDatetime = session.lastSleepDatetime();
info.lastUserRequestDate = 
session.lastUserRequestDate();
info.timeOut = session.timeOutMillis();
info.usager = session.userAccessService().currentUser();
sessionInfos.add(info);
}
new 
ERXKey("lastUserRequestDate").desc().sort(sessionInfos);

Regards,

Samuel


> Le 26 avr. 2024 à 08:48, Hugi Thordarson via Webobjects-dev 
>  a écrit :
> 
> Hi,
> if you're using WO's standard session store (WOServerSessionStore) you should 
> be able to access the active sessions using:
> 
> ((WOServerSessionStore)WOApplication.application().sessionStore())._sessions()
> 
> It will return a dictionary consisting of sessionID -> Session.
> 
> Not using it though, I'm achieving this myself by using the notifications 
> posted by session management (SessionDidRestoreNotification, 
> SessionDidCreateNotification and SessionDidTimeOutNotification), so I can 
> keep track of more info (like when the session was last touched).
> 
> Cheers,
> - hugi
> 
> 
>> On Apr 26, 2024, at 12:33, OCsite via Webobjects-dev 
>>  wrote:
>> 
>> Hi there,
>> 
>> is there a way to enumerate sessions which are alive inside of a 
>> WO/ERXApplication?
>> 
>> I guess I can create such a list myself, adding new ones in session.awake, 
>> keeping it weak not to prevent old sessions to be destroyed (or perhaps 
>> storing just session IDs), yadda yadda, but it would be much easier and less 
>> error-prone just to use a WO/nder service, if there's one.
>> 
>> The purpose is that we need to allow an app administrator to list all the 
>> normal users which are currently logged in, and be able to force-logout 
>> selected ones.
>> 
>> Thanks!
>> OC
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is
>> 
>> This email sent to h...@karlmenn.is
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Debug frameworks with maven project

2024-04-10 Thread Samuel Pelletier via Webobjects-dev
Hi,

I created a new workspace with the latest Eclipse to migrate my project to 
maven. My projects run and I can debug the application code (set breakpoint, 
click on exception stack trace to open project source) but all debug functions 
are not working for frameworks. I set breakpoint in code but Eclipse open class 
from a jar instead of my source.

Also, I have to restart the app to test for my code change in frameworks even 
with an hot swap enable JRE. Seems Eclipse does not figure out the maven 
dependencies code is in the current workspace.

Is there something I miss here ?

Regards,

Samuel

 ___
Do not 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


wolifecycle-maven-plugin configuration options

2024-04-06 Thread Samuel Pelletier via Webobjects-dev
Hi,

My journey to Maven is going well, I ported 2 shared frameworks I use on every 
projects and my first app. There is many subtle details to go pass a "Hello 
world !" app.

My last discovery is a problem with component template in sub directory that 
are not found when deployed. I always use directories to group components, my 
app have 10s of them, one with 213...

After some digging, I found a configuration in wolifecycle-maven-plugin that 
resolved this situation.


true


There are some others options available including flattenResources and 
readPatternsets with a basic explanation but no real way to know if they are 
required or desirable and the defaults are disabled.

Is my fix is the correct way to use components in sub directory ?

Is there a reason to have this option disabled by default and in the new 
projects templates ?

Should I also enable flattenResources and readPatternsets ?

BTW, I use the migrations script with few modification from  
https://github.com/getsharp/womavenmigration.

Regards,

Samuel


 ___
Do not 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


Using Git Hub as private CI/CD and Maven repository

2024-04-02 Thread Samuel Pelletier via Webobjects-dev
Hi,

With the maven switch, I understand it is now easier to setup CI/CD and it is 
also much nicer to have a Maven private repository for internal frameworks and 
apps.

I see that Git Hub now have Actions and Packages that could provide those 
services even for private repo in free tier.

Are this services a good options and is there are some caveats I should know ?

If there is a more standard or usual way, I welcome any suggestions.

Regards,

Samuel

 ___
Do not 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: Maven follow up

2024-04-01 Thread Samuel Pelletier via Webobjects-dev
Tim,

Thank for the reply. I tried the download index on startup but still no search.

I do not understand the nature thing but found a preference in Eclipse that 
disable the annoying dialog : "Automatically detect missing natures and propose 
IDE extensions from Marketplace".

Follow up on my component problem, I just found the solution for with my 
framework component, it was related to the order of dependencies declaration, 
like ant, original WebObjects packages need to be after wonder ERExtensions...

Is there a way inside Eclipse to do mvn install ?

I still have not figured out how to build and deploy the app (replace the ant 
install and manual rsync to server I actually do)

Regards,

Samuel



> Le 1 avr. 2024 à 20:32, D Tim Cummings via Webobjects-dev 
>  a écrit :
> 
> Hi Samuel
> 
> Apparently we need to have the nature org.maven.ide.eclipse.maven2Nature in 
> our .project file because it is hard-coded in the original WebObjects. I 
> think we should add into WOLips that it also needs this nature and then 
> eclipse would stop complaining that no plugins are referencing this nature. 
> Unfortunately I don't know enough about eclipse plugin development to program 
> this.
> 
> I don't use search in maven pom editor myself but does this option help 
> "Download repository index updates on startup"?
> 
> 
> 
> 
> 
> I haven't used maven with my own frameworks so can't help you there.
> 
> Tim
> 
> 
> 
> On 2/4/24 07:53, Samuel Pelletier via Webobjects-dev wrote:
>> Hi all,
>> 
>> Sorry for long time since last message, my maven switch had to be postponed.
>> 
>> I manages to set up the basic and create a frameworks and an app. 
>> 
>> I have few questions with my current setup. 
>> 
>> Why Eclipse always complain about missing nature, the maven stuff is already 
>> there and working, I always click cancel but the prompt comes back from time 
>> to time. Is there a way to get rid of this alert ?
>> 
>> In the maven pom editor, the search function does not works, even for maven 
>> central libraries... This search seems a time saver tool I would like to use 
>> instead of copy paste from maven central...
>> 
>> I ported a frameworks but when I want to use it's component (TimeField 
>> here), I have this error: "Cannot find class or component named 'TimeField" 
>> in runtime or in a loadable bundle"
>> 
>> BTW, I did "mvn install" to have the framework in my local maven repository 
>> and it's sources are in my current workspace.
>> 
>> Thank in advance for help!
>> 
>> Samuel
>> 
>> 
>> 
>>  ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> <mailto:Webobjects-dev@lists.apple.com>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/tim%40triptera.com.au
>> 
>> This email sent to t...@triptera.com.au <mailto:t...@triptera.com.au>
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Maven follow up

2024-04-01 Thread Samuel Pelletier via Webobjects-dev
Hi all,

Sorry for long time since last message, my maven switch had to be postponed.

I manages to set up the basic and create a frameworks and an app. 

I have few questions with my current setup. 

Why Eclipse always complain about missing nature, the maven stuff is already 
there and working, I always click cancel but the prompt comes back from time to 
time. Is there a way to get rid of this alert ?

In the maven pom editor, the search function does not works, even for maven 
central libraries... This search seems a time saver tool I would like to use 
instead of copy paste from maven central...

I ported a frameworks but when I want to use it's component (TimeField here), I 
have this error: "Cannot find class or component named 'TimeField" in runtime 
or in a loadable bundle"

BTW, I did "mvn install" to have the framework in my local maven repository and 
it's sources are in my current workspace.

Thank in advance for help!

Samuel



 ___
Do not 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: Meetup maybe? Or call me maybe?

2023-12-21 Thread Samuel Pelletier via Webobjects-dev
Hi,

If you managed to create a new project, you where able to go far beyond my 
achievements !

I tried to switch to maven few times in the last years and just gave up each 
time after few hours and never managed to create a new project without error 
that build ever after reading and trying to understand the 3-4 page on the 
subject I found.

If someone familiar with the matter can create or update an existing page with 
a step by step procedure starting from a totally clean user account, it would 
be great.

Creating new Wonder project would be sufficient but also having some 
instructions to migrate a project using an BusinessLogic framework would be a 
dream.

Merry Christmas to everyone on the list,

Samuel


> Le 20 déc. 2023 à 20:34, Theodore Petrosky via Webobjects-dev 
>  a écrit :
> 
> Is there any interest in a Zoom meeting to discuss maven. I really don’t care 
> about the technology Hugi and I worked out TeamViewer (my office has an 
> account so there is no time limit)
> 
> Hugi are the documents you shared with me available on the WOCommunity xWiki? 
> I did have some problems converting my app. New D2W projects run.
> 
> How can we get together again?
> 
> Ted
> 
> I have a Zoom account, and TeamViewer.
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: AjaxAutoComplete

2023-11-11 Thread Samuel Pelletier via Webobjects-dev
Hi,

I managed to achieve your goal in my apps using this pattern :
- Create a submit js function using an AjaxSubmitButton
- Use the created function in afterUpdateElement on AjaxAutoComplete. 




Regards,

Samuel


> Le 10 nov. 2023 à 05:55, Stavros Panidis via Webobjects-dev 
>  a écrit :
> 
> Tim,
> 
> Sorry!. I could not put it to work. I am sure that I am making something 
> wrong.
> 
> My AjaxAutocomplete is
> 
>  "form-control" list = "$currentValuesForCustomers" selection = "$global" 
> value = "$value" item = "$currentValue" />
> 
> And then I have a AjaxObserveField as follows
> 
> 
>  "invoiceslist" action = "$customerSelected">
> 
> 
> Can you see what I am doing wrong?
> 
> Stavros
> 
> 
> 
>> On 9 Nov 2023, at 10:00 PM, webobjects-dev-requ...@lists.apple.com wrote:
>> 
>> Send Webobjects-dev mailing list submissions to
>>  webobjects-dev@lists.apple.com
>> 
>> To subscribe or unsubscribe via the World Wide Web, visit
>>  https://lists.apple.com/mailman/listinfo/webobjects-dev
>> or, via email, send a message with subject or body 'help' to
>>  webobjects-dev-requ...@lists.apple.com
>> 
>> You can reach the person managing the list at
>>  webobjects-dev-ow...@lists.apple.com
>> 
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of Webobjects-dev digest..."
>> 
>> 
>> Today's Topics:
>> 
>>   1. AjaxAutoComplete (Stavros Panidis)
>>   2. Re: AjaxAutoComplete (D Tim Cummings)
>>   3. Re: AjaxAutoComplete (Jesse Tayler)
>> 
>> 
>> --
>> 
>> Message: 1
>> Date: Thu, 9 Nov 2023 09:54:40 +0200
>> From: Stavros Panidis 
>> To: webobjects-dev@lists.apple.com
>> Subject: AjaxAutoComplete
>> Message-ID: 
>> Content-Type: text/plain;charset=us-ascii
>> 
>> Hi,
>> 
>> Is there any trick available to make AjaxAutoComplete field observable (by 
>> AjaxAobserveField) ?
>> 
>> Many thanks in advance for your help
>> 
>> Stavros
>> 
>> --
>> 
>> Message: 2
>> Date: Thu, 9 Nov 2023 20:00:33 +1000
>> From: D Tim Cummings 
>> To: webobjects-dev@lists.apple.com
>> Subject: Re: AjaxAutoComplete
>> Message-ID: 
>> Content-Type: text/plain; charset=UTF-8; format=flowed
>> 
>> Set parameter afterUpdateElement to "observe" and it will behave like it 
>> is in an AjaxObserveField
>> 
>> > "$theCustomerName" afterUpdateElement = "observe" />
>> 
>> Tim
>> 
>> On 9/11/23 17:54, Stavros Panidis via Webobjects-dev wrote:
>>> Hi,
>>> 
>>> Is there any trick available to make AjaxAutoComplete field observable (by 
>>> AjaxAobserveField) ?
>>> 
>>> Many thanks in advance for your help
>>> 
>>> Stavros
>>>  ___
>>> Do not 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/tim%40triptera.com.au
>>> 
>>> This email sent to t...@triptera.com.au
>> 
>> 
>> --
>> 
>> Message: 3
>> Date: Thu, 9 Nov 2023 12:00:52 -0500
>> From: Jesse Tayler 
>> To: D Tim Cummings 
>> Cc: webobjects-dev@lists.apple.com
>> Subject: Re: AjaxAutoComplete
>> Message-ID: <48f21de2-2301-4c1f-a473-25d1850a4...@oeinc.com>
>> Content-Type: text/plain; charset="utf-8"
>> 
>> I have used Ajax quite easily on a couple of components and for some reason, 
>> implementing even the simplest test was failing on updating a component of a 
>> similar sort.
>> 
>> Before I make a wholly new component ? are there flags or tests aside from 
>> jQuery which seems fine? I don?t readily see why this just isn?t seemingly 
>> observing and updating the way I expect?
>> 
>> Thoughts?
>> 
>>> On Nov 9, 2023, at 5:00 AM, D Tim Cummings via Webobjects-dev 
>>>  wrote:
>>> 
>>> Set parameter afterUpdateElement to "observe" and it will behave like it is 
>>> in an AjaxObserveField
>>> 
>>> >> "$theCustomerName" afterUpdateElement = "observe" />
>>> 
>>> Tim
>>> 
>>> On 9/11/23 17:54, Stavros Panidis via Webobjects-dev wrote:
 Hi,
 
 Is there any trick available to make AjaxAutoComplete field observable (by 
 AjaxAobserveField) ?
 
 Many thanks in advance for your help
 
 Stavros
 ___
 Do not 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/tim%40triptera.com.au
 
 This email sent to t...@triptera.com.au
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> 

Re: Weird apache crash in Ubuntu

2022-02-28 Thread Samuel Pelletier via Webobjects-dev
Hi Patrick,

Your apache mp3 is probably set to something other than prefork. The WOAdaptor 
does not support threaded mpm.

Regards,

Samuel


> Le 28 févr. 2022 à 14:22, Patrick Abuzeni via Webobjects-dev 
>  a écrit :
> 
> 
> Hello everyone
> 
> Have a Ubuntu 20.04.3 LTS (GNU/Linux 5.4.0-90-generic x86_64) cloud server 
> with a number of WO applications deployed. WOAdapter was compiled on the 
> server. Apache (Server version: Apache/2.4.41 (Ubuntu)) is regularly crashing 
> and for no reason. The application remains unaffected but an error does pop 
> up on the page from time to time and occasionally going to next page hangs. 
> Are considering running the applications without the WOAdapter and wonder if 
> anyone has seen this and if there is a way to get around this error maybe 
> without resorting to the mod_proxy?
> 
> [Mon Feb 28 11:55:57.449896 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 754580 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 12:08:20.227915 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 754978 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 12:08:20.227987 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 755017 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 12:08:20.228009 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 755302 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 13:11:34.192992 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 755479 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> double free or corruption (out)
> [Mon Feb 28 13:32:56.523508 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 756719 exit signal Aborted (6), possible 
> coredump in /etc/apache2
> [Mon Feb 28 13:33:39.569401 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 755371 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 13:34:42.635028 2022] [core:notice] [pid 719456:tid 
> 140259097431104] AH00051: child pid 757457 exit signal Segmentation fault 
> (11), possible coredump in /etc/apache2
> [Mon Feb 28 13:50:2
> 
> The "possible coredump" is a tease and is non-existent.
> 
> 
> Best Regards,
> 
> Patrick Abuzeni, MD
> 
> www.xeoTECH.com 
> 
> The information transmitted is intended only for the person or entity to 
> which it is addressed and may contain confidential and/or privileged 
> material. Any review, retransmission, dissemination or other use of, or 
> taking of any action in reliance upon, this information by persons or 
> entities other than the intended recipient is prohibited. If you received 
> this information in error, please contact the sender and delete the message 
> and material from all computers.
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Wrong SQL when joining in an OR-part of the qualifier

2022-02-15 Thread Samuel Pelletier via Webobjects-dev
OC,

I do not see your point about the qualifierWithQualifierFormat. Unless your 
users are writing the format string directly, you have code to build it. 
Building a qualifier format string or a qualifier object is the same thing, it 
is just easier and less error prone to build the object using ERXAndQualifier 
and ERXORQualifier...

WODisplayGroup can issue fetch to a database or use an array of object as 
source. See setObjectArray(NSArray objects). I always use it this way.

If your data size is small, you can also filter in memory and set the resulting 
array as your WODisplayGroup source.

Regards,

Samuel


> Le 15 févr. 2022 à 00:59, OCsite  a écrit :
> 
> Thanks to all for the answers!
> 
> Is there a way to use the ERExistsQualifier through 
> qualifierWithQualifierFormat? At the particular place it would be somewhat 
> difficult to create the qualifier tree programmatically, there are 
> considerably more complex qualifiers ANDed and ORred to the thing, which I 
> did not show for clarity, for they do not affect the problem.
> 
> (Also, it would be essentially impossible to do two fetches — the final 
> qualifier is used through a WODisplayGroup).
> 
> Thanks a lot again,
> OC
>  
>> On 15. 2. 2022, at 0:29, Samuel Pelletier > <mailto:sam...@samkar.com>> wrote:
>> 
>> Hi,
>> 
>> As Aaron wrote, ERExisitsQualifier will generate an SQL for your needs. You 
>> may also change the JOIN type to change it's behaviour in SQL. EOF apply 
>> table joins before qualifier, I suspect other ORM does the same too.
>> 
>> For that kind of quarry, you will probably have better performance doing 2 
>> fetches and merge the results in memory. OR is an optimisation (index) 
>> killer for SQL queries unless the interpreter is able to rewrite then as 
>> multiple select using index with UNION
>> 
>> If your columns are not indexed, forget this comment, you are doing table 
>> scan anyway,
>> 
>> Regards,
>> 
>> Samuel
>> 
>> 
>>> Le 14 févr. 2022 à 10:05, Aaron Rosenzweig via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> a 
>>> écrit :
>>> 
>>> Hi OC,
>>> 
>>> That’s called the object to relational impedance mismatch. The qualifier 
>>> works in memory but fails when you try to invoke with SQL. 
>>> 
>>> To get around it, you can use an ERXExistsQualifier for your to-one 
>>> relationship. Typically you use this with to-many relationships but it 
>>> actually can work with to-one relationships too. The reason it works is 
>>> because once inside the “exists” clause of SQL, it acts a bit like a 
>>> namespace shield… in other words it’s not doing an inner-join so not 
>>> negating things that you want to OR. 
>>> 
>>> Another possibility is to do multiple fetches. One with the attribute only. 
>>> Then a second with the relationship only. Then merge the results. 
>>> 
>>> A third possibility is to not use an inner-join when mapping your PLIST in 
>>> Entity Modeler, use one of the other join types… but that’s maybe not the 
>>> best option unless you really know what you are doing. 
>>> 
>>> Personally, I’d give the Exists qualifier a try. 
>>> 
>>> Cheers,
>>> — Aaron
>>> 
>>> 
>>>> On Feb 14, 2022, at 1:13 AM, ocs--- via Webobjects-dev 
>>>> mailto:webobjects-dev@lists.apple.com>> 
>>>> wrote:
>>>> 
>>>> Hi there,
>>>> 
>>>> lately, I am encountering wrong fetches (with FrontBase, if important). I 
>>>> log out my qualifier and SQL, and the gist of the problem is a join in the 
>>>> OR-part of the qualifier. I want to fetch rows where there's an empty 
>>>> attribute, OR when there's a specific join:
>>>> 
>>>> 06:52:06.510 DEBUG -> ((savedPresentationEndDate = null) or 
>>>> (lastValidPriceOfferCache.user = (model.DBUser)'[rc/Registration 
>>>> centre#104]'))
>>>> 
>>>> Alas, SQL-level, it boils down to something entirely different:
>>>> 
>>>> 06:52:06.535 DEBUG "DBAuction"@318794136 expression took 1 ms: SELECT ... 
>>>> FROM "T_AUCTION" t0, "T_PRICE_OFFER" T1 WHERE (T1."C_CREATOR_ID" = 104 
>>>> OR t0."C_PRESENTATION_END_DATE" is NULL) AND 
>>>> t0."C_LAST_VALID_PRICE_OFFER_CACHE" = T1."C_UID"
>>>> 
>>>> The SQL generator properly sets up the OR checking the right targ

Re: Wrong SQL when joining in an OR-part of the qualifier

2022-02-14 Thread Samuel Pelletier via Webobjects-dev
Hi,

As Aaron wrote, ERExisitsQualifier will generate an SQL for your needs. You may 
also change the JOIN type to change it's behaviour in SQL. EOF apply table 
joins before qualifier, I suspect other ORM does the same too.

For that kind of quarry, you will probably have better performance doing 2 
fetches and merge the results in memory. OR is an optimisation (index) killer 
for SQL queries unless the interpreter is able to rewrite then as multiple 
select using index with UNION

If your columns are not indexed, forget this comment, you are doing table scan 
anyway,

Regards,

Samuel


> Le 14 févr. 2022 à 10:05, Aaron Rosenzweig via Webobjects-dev 
>  a écrit :
> 
> Hi OC,
> 
> That’s called the object to relational impedance mismatch. The qualifier 
> works in memory but fails when you try to invoke with SQL. 
> 
> To get around it, you can use an ERXExistsQualifier for your to-one 
> relationship. Typically you use this with to-many relationships but it 
> actually can work with to-one relationships too. The reason it works is 
> because once inside the “exists” clause of SQL, it acts a bit like a 
> namespace shield… in other words it’s not doing an inner-join so not negating 
> things that you want to OR. 
> 
> Another possibility is to do multiple fetches. One with the attribute only. 
> Then a second with the relationship only. Then merge the results. 
> 
> A third possibility is to not use an inner-join when mapping your PLIST in 
> Entity Modeler, use one of the other join types… but that’s maybe not the 
> best option unless you really know what you are doing. 
> 
> Personally, I’d give the Exists qualifier a try. 
> 
> Cheers,
> — Aaron
> 
> 
>> On Feb 14, 2022, at 1:13 AM, ocs--- via Webobjects-dev 
>> mailto:webobjects-dev@lists.apple.com>> 
>> wrote:
>> 
>> Hi there,
>> 
>> lately, I am encountering wrong fetches (with FrontBase, if important). I 
>> log out my qualifier and SQL, and the gist of the problem is a join in the 
>> OR-part of the qualifier. I want to fetch rows where there's an empty 
>> attribute, OR when there's a specific join:
>> 
>> 06:52:06.510 DEBUG -> ((savedPresentationEndDate = null) or 
>> (lastValidPriceOfferCache.user = (model.DBUser)'[rc/Registration 
>> centre#104]'))
>> 
>> Alas, SQL-level, it boils down to something entirely different:
>> 
>> 06:52:06.535 DEBUG "DBAuction"@318794136 expression took 1 ms: SELECT ... 
>> FROM "T_AUCTION" t0, "T_PRICE_OFFER" T1 WHERE (T1."C_CREATOR_ID" = 104 
>> OR t0."C_PRESENTATION_END_DATE" is NULL) AND 
>> t0."C_LAST_VALID_PRICE_OFFER_CACHE" = T1."C_UID"
>> 
>> The SQL generator properly sets up the OR checking the right target PK, but 
>> then, instead of placing the join into the OR-part where it belongs to, it 
>> forces the join absolute to the entire condition — even to the NULL-check 
>> which should be completely independent.
>> 
>> That self-evidently is not what I need here: if t0."C_PRESENTATION_END_DATE" 
>> is NULL, I want to fetch the row regardless of whatever vaue there is or is 
>> not in the C_LAST_VALID_PRICE_OFFER_CACHE foreign key. Actually, if there 
>> happens to be NULL in C_PRESENTATION_END_DATE, I would prefer if the 
>> SQL-level would not try to join at all, for it is self-evidently 
>> superfluous. I've tried manually
>> 
>> SELECT * FROM "T_AUCTION" t0, "T_PRICE_OFFER" T1 WHERE 
>> (t0."C_PRESENTATION_END_DATE" is NULL) OR (T1."C_CREATOR_ID" = 104 AND 
>> t0."C_LAST_VALID_PRICE_OFFER_CACHE" = T1."C_UID")
>> 
>> which is what, I  believe, the SQL generator should have created from the 
>> qualifier, and it seems to work (at least, it produces no error; I cannot 
>> easily check whether the rows returned are OK. but they seem to t the first 
>> look).
>> 
>> Can perhaps anybody see how to fix the problem? (But for by generating 
>> directly my SQL at the application level, which I can do if need be, but 
>> would rather not, unless really the only way.)
>> 
>> Thanks,
>> OC
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> )
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com 
>> 
>> 
>> This email sent to aa...@chatnbike.com
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)

Re: FrontBase driver for Java 11+ - was Mac OS Monterey

2021-12-21 Thread Samuel Pelletier via Webobjects-dev
Hi Jérémy,

The fronbtbasejdbc driver on FrontBase site was updated with a new binary 
compiled for java 1.8+. Same version number but run on Java 8+ instead of the 
previous release limited to Java 16+.

Best regards,

Samuel



> Le 20 déc. 2021 à 03:11, Jérémy DE ROYER via Webobjects-dev 
>  a écrit :
> 
> Hi Jesse,
> 
> I would say that using eclipse 2021-12 using frontbasejdbc 2.5.10 was not… 
> successfull ;-)
> 
> BUT
> 
> Shifting from eclipse 2019-12 to 2020-12 on Monterey with the latest wolips 
> was the right decison thank’s to Samuel. it is much more fluid.
> 
> SO
> 
> I'm glad I followed Samuels' advice
> 
> And wait for the summer vacations to leave Java 1.8
> 
> Have a nice week,
> 
> Jérémy
> 
>> Le 20 déc. 2021 à 04:49, Jesse Tayler > > a écrit :
>> 
>> So basically everything went to shit right there 
>> 
>>> On Dec 19, 2021, at 5:14 PM, Jérémy DE ROYER via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> 
>>> wrote:
>>> 
>>> 
>>> Until now, everything works fine
>> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Mac OS Monterey

2021-12-19 Thread Samuel Pelletier via Webobjects-dev
Jérémy,

I use the latest available on update site: 
https://jenkins.wocommunity.org/job/WOLips_master/lastSuccessfulBuild/artifact/temp/dist/
 

Previous version had issues with latest Eclipse.

Regards,

Samuel

> Le 19 déc. 2021 à 04:47, Jérémy DE ROYER  a 
> écrit :
> 
> Merci Samuel for the help.
> 
> What version of wolips are you using with eclipse 2021-09 ? 
> 
> Jérémy
> 
>> Le 18 déc. 2021 à 22:37, Samuel Pelletier > <mailto:sam...@samkar.com>> a écrit :
>> 
>> Bonjour Jérémy,
>> 
>> I was about to send you a fix for the FrontBase sql generation problem when 
>> I decided to look at their site and there is a new jdbc 2.5.10 driver 
>> released few days ago that fixes the problem with newer Eclipse. I confirmed 
>> the fix with Eclipse 2021-09.
>> 
>> Regards,
>> 
>> Samuel
>> 
>> 
>>> Le 16 déc. 2021 à 09:59, Jérémy DE ROYER via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> a 
>>> écrit :
>>> 
>>> Hello John,
>>> 
>>> I use Monterey with eclipse 2019-12 with only « small » problems (bad 
>>> screen refresh). I don’t regret.
>>> 
>>> I’ve tried to install newer eclipse versions (2020-09 & 2021-09) but I had 
>>> problems with the frontbase plugin generating SQL so I stay with 2019-12 
>>> until we move to postgreSQL.
>>> 
>>> Have a nice day,
>>> 
>>> Jérémy 
>>> 
>>>> Le 16 déc. 2021 à 15:49, John Pollard via Webobjects-dev 
>>>> mailto:webobjects-dev@lists.apple.com>> a 
>>>> écrit :
>>>> 
>>>> I see my Mac is offering me Monterey. Have others installed this on a Mac 
>>>> they use for WO development? I use Eclipse (2018-12), EO Modeller, WOLips, 
>>>> Wonder.
>>>> 
>>>> Many thanks,
>>>> John
>>>> ___
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>>> <mailto:Webobjects-dev@lists.apple.com>)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/jeremy.deroyer%40ingencys.net
>>>>  
>>>> <https://lists.apple.com/mailman/options/webobjects-dev/jeremy.deroyer%40ingencys.net>
>>>> 
>>>> This email sent to jeremy.dero...@ingencys.net 
>>>> <mailto:jeremy.dero...@ingencys.net>
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> <mailto:Webobjects-dev@lists.apple.com>)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
>>> <https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com>
>>> 
>>> This email sent to sam...@samkar.com <mailto:sam...@samkar.com>
>> 
> 

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

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


Re: Mac OS Monterey

2021-12-18 Thread Samuel Pelletier via Webobjects-dev
Bonjour Jérémy,

I was about to send you a fix for the FrontBase sql generation problem when I 
decided to look at their site and there is a new jdbc 2.5.10 driver released 
few days ago that fixes the problem with newer Eclipse. I confirmed the fix 
with Eclipse 2021-09.

Regards,

Samuel


> Le 16 déc. 2021 à 09:59, Jérémy DE ROYER via Webobjects-dev 
>  a écrit :
> 
> Hello John,
> 
> I use Monterey with eclipse 2019-12 with only « small » problems (bad screen 
> refresh). I don’t regret.
> 
> I’ve tried to install newer eclipse versions (2020-09 & 2021-09) but I had 
> problems with the frontbase plugin generating SQL so I stay with 2019-12 
> until we move to postgreSQL.
> 
> Have a nice day,
> 
> Jérémy 
> 
>> Le 16 déc. 2021 à 15:49, John Pollard via Webobjects-dev 
>> mailto:webobjects-dev@lists.apple.com>> a 
>> écrit :
>> 
>> I see my Mac is offering me Monterey. Have others installed this on a Mac 
>> they use for WO development? I use Eclipse (2018-12), EO Modeller, WOLips, 
>> Wonder.
>> 
>> Many thanks,
>> John
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> )
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/jeremy.deroyer%40ingencys.net
>>  
>> 
>> 
>> This email sent to jeremy.dero...@ingencys.net 
>> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: AjaxAutoComplete in AjaxModalDialog

2021-12-05 Thread Samuel Pelletier via Webobjects-dev
Hi Ricardo,

I also noticed the problem outside modal dialog after testing it. After many 
try and errors, I found a pattern. There is a problem with the latest 
prototype.js clonePosition when the element is inside a float block (at least).

I simplified the clone position to use the new (prototype 1.7) Layout functions 
and it fixes my problems.

Here is the diff from my GitHub fork, can you give it a try on your apps. If 
you have good results, I will create a pull request for the main Wonder source.

https://github.com/wocommunity/wonder/compare/master...spelletier:Fix_prototype_clonePosition?expand=1#diff-b6bffd9eba6821e533154f2617bd3a1c5ec0378a3cbbb2acce98ecd245e3a085

Regards,

Samuel



> Le 4 déc. 2021 à 22:55, Ricardo Parada  a écrit :
> 
> Hi Samuel,
> 
> That sounds like a problem that we had that was solved by rolling back 
> prototype.js to version 1.7
> 
> I believe wonder uses a more recent version, 1.7.3. We tried 1.7, 1.7.1, 
> 1.7.2 and 1.7.3. 
> 
> I think all versions prior to 1.7.3 fix the display of AjaxAutoComplete. 
> 
> By the way, for us, the problem occurred outside ajax modal dialogs too when 
> the page was scrolled if I remember correctly. 
> 
> But we also had other stuff that required Ajax dragging and for that we had 
> to roll back all the way to the good old 1.7
> 
> I think I discussed this problem in the WebObjects slack channel and I may 
> have included screenshots of what I was seeing. 
> 
> Hope that helps. 
> 
> Sent from my iPhone
> 
>> On Dec 3, 2021, at 3:27 PM, Samuel Pelletier via Webobjects-dev 
>>  wrote:
>> 
>> Hi,
>> 
>> I want to use AjaxAutoComplete inside AjaxModalDialog and usually, it works 
>> OK. A very strange problem occur when the main page is scrolled though, the 
>> selection choices are displayed with a vertical distance from the textfield 
>> that correspond to the vertical scroll of the main page bellow.
>> 
>> It seems the javascript code compute this offset and set the absolute 
>> position using it. This is fine on the scrolled contents but not inside a 
>> modal dialog.
>> 
>> Someone knows a work around for this problem ?
>> 
>> Regards,
>> 
>> Samuel
>> 
>> 
>> ___
>> Do not 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/rparada%40mac.com
>> 
>> This email sent to rpar...@mac.com

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

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


AjaxAutoComplete in AjaxModalDialog

2021-12-03 Thread Samuel Pelletier via Webobjects-dev
Hi,

I want to use AjaxAutoComplete inside AjaxModalDialog and usually, it works OK. 
A very strange problem occur when the main page is scrolled though, the 
selection choices are displayed with a vertical distance from the textfield 
that correspond to the vertical scroll of the main page bellow.

It seems the javascript code compute this offset and set the absolute position 
using it. This is fine on the scrolled contents but not inside a modal dialog.

Someone knows a work around for this problem ?

Regards,

Samuel


 ___
Do not 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: Single thread creation queue?

2021-11-24 Thread Samuel Pelletier via Webobjects-dev
Jesse,

If you specify a case insensitive collation for your column in the table, you 
can preserve case and maintains case insensitive uniqueness. If you do not know 
about collation, begin by reading on the subject, they basically define how to 
compare and sort strings values.

Depending on the probability of duplicate and how you want to handle this 
problem, you can try-catch or pre check before saving, you probably prefer 
try-catch because it save a round-trip to the database. Tu use try-catch, you 
need the contraint in the database though.

Samuel

> Le 24 nov. 2021 à 08:02, Jesse Tayler  a écrit :
> 
> so, basically, you are suggesting that I store them flat lowercase and put a 
> constraint on these two strings and just lose any case the user entered which 
> is fine I think.
> 
> With the lowercase assured the constraint will prevent duplicates and I’d 
> catch that exception during creation and handle it
> 
>> On Nov 24, 2021, at 12:19 AM, Samuel Pelletier > <mailto:sam...@samkar.com>> wrote:
>> 
>> If your usernames (or keyString) are case insensitive, store them in a 
>> normalized case (in lowercase for exemple). 
>> 
>> You can add an overridden 
>> public void setKeyString(String value) {
>>  if (value != null) {
>>  value = value.toLowerCase();
>>  }
>>  super.setKeyString(value);
>> }
>> 
>> You may also specify a collation to the column in the database if you want 
>> to preserve case but index and compare as case insensitive.
>> 
>> Samuel
>> 
>>> Le 23 nov. 2021 à 17:26, Jesse Tayler via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> a 
>>> écrit :
>>> 
>>> 
>>> 
>>>> On Nov 23, 2021, at 5:17 PM, Paul Hoadley >>> <mailto:pa...@logicsquad.net>> wrote:
>>>> 
>>>> Are you able to paste in some code? There's probably a solution, but this 
>>>> is getting a bit hard to follow in the abstract.
>>>> 
>>> 
>>> So, I fetch first
>>> 
>>> EOQualifier qual = 
>>> DataPoint.TYPE.eq("twitter").and(DataPoint.KEY_STRING.likeInsensitive(username));
>>> 
>>> If there’s no EO, I create and save right away but at high volumes this 
>>> CREATE statement must create only unique entries and those entries must 
>>> match this qualifier which uses insensitive case
>>> 
>>> I figure the pattern should be to create an object with a DB level 
>>> constraint such that a duplicate raises an error, upon catching that error, 
>>> I can simply fetch again and return the one, single EO representing that 
>>> record
>>> 
>>> When I tried regular constraints I did not see a way to replicate the 
>>> required logic, so I found some advise about triggers and some other things 
>>> I didn’t fully understand.
>>> 
>>> I realize usernames generally have this kind of issue, so I figure this is 
>>> a design pattern that is hardly unique to us and I should get advice!
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> <mailto:Webobjects-dev@lists.apple.com>)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
>>> <https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com>
>>> 
>>> This email sent to sam...@samkar.com <mailto:sam...@samkar.com>
>> 
> 

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

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


Re: Single thread creation queue?

2021-11-23 Thread Samuel Pelletier via Webobjects-dev
If your usernames (or keyString) are case insensitive, store them in a 
normalized case (in lowercase for exemple). 

You can add an overridden 
public void setKeyString(String value) {
if (value != null) {
value = value.toLowerCase();
}
super.setKeyString(value);
}

You may also specify a collation to the column in the database if you want to 
preserve case but index and compare as case insensitive.

Samuel

> Le 23 nov. 2021 à 17:26, Jesse Tayler via Webobjects-dev 
>  a écrit :
> 
> 
> 
>> On Nov 23, 2021, at 5:17 PM, Paul Hoadley > > wrote:
>> 
>> Are you able to paste in some code? There's probably a solution, but this is 
>> getting a bit hard to follow in the abstract.
>> 
> 
> So, I fetch first
> 
>   EOQualifier qual = 
> DataPoint.TYPE.eq("twitter").and(DataPoint.KEY_STRING.likeInsensitive(username));
> 
> If there’s no EO, I create and save right away but at high volumes this 
> CREATE statement must create only unique entries and those entries must match 
> this qualifier which uses insensitive case
> 
> I figure the pattern should be to create an object with a DB level constraint 
> such that a duplicate raises an error, upon catching that error, I can simply 
> fetch again and return the one, single EO representing that record
> 
> When I tried regular constraints I did not see a way to replicate the 
> required logic, so I found some advise about triggers and some other things I 
> didn’t fully understand.
> 
> I realize usernames generally have this kind of issue, so I figure this is a 
> design pattern that is hardly unique to us and I should get advice!
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Single thread creation queue?

2021-11-22 Thread Samuel Pelletier via Webobjects-dev
Jesse,

So your row have a primary key and some other unique identifier derived other 
attributes.

If the compound key is a combinaison of full attribute values, you cana a 
compound unique key in the database. CREATE UNIQUE INDEX ON Table (col1, col2, 
..., coln)

If it is from partial values, the most reliable way is to add a string column 
with the computed key with it's unique constraint.

If you already have duplicate, you can add a method in the migration to resolve 
them before adding the constraint or do it manually...

Regards,

Samuel

> Le 22 nov. 2021 à 09:27, Jesse Tayler  a écrit :
> 
> It’s likely just a unique constraint perhaps.
> 
> It’s not UIDs or primary keys it’s a unique row type based on a couple 
> strings where there should be only one, and that one should last forever.
> 
> There’s an API where calls can come in basically at the same time and instead 
> of fetching first to see if the object exists, I should likely respond to an 
> SQL error rejecting a new row and then fetch and return that existing object 
> based on that error condition.
> 
> I’d suppose the database is the best place for that policy, but I don’t think 
> I’ve implemented constraints quite like that before so I’d need to write some 
> sort of Migrations for it if it’s to be reliable in all those situations 
> where it might encounter duplicate data…hmmm…
> 
> 
> 
> 
>> On Nov 22, 2021, at 8:59 AM, Samuel Pelletier  wrote:
>> 
>> Hi Jesse,
>> 
>> Your question may have multiple answers, can you describe the contexts and 
>> duplicate sources you fear ?
>> 
>> Is the primary key generated by the WO app or it is external (like a GUID) ?
>> 
>> Do you have a secondary identifier that should be unique ?
>> 
>> Anyway, you should add constraint in to the database if uniqueness is 
>> required (this apply to all frameworks in all language)
>> 
>> If you use EOF primary key generation, you should not have problems with 
>> duplicate keys. If you require high throughput, using UUID primary key or 
>> implementing a custom generator will help by saving round trips to the 
>> database server. If you insert in batch, it will be also faster than 
>> individual inserts.
>> 
>> Regards,
>> 
>> Samuel
>> 
>>> Le 22 nov. 2021 à 08:34, Jesse Tayler via Webobjects-dev 
>>>  a écrit :
>>> 
>>> I asked on slack but I figured I’d ping the list
>>> 
>>> Who has a good way to ensure a serial EO creation queue when the system 
>>> could be hit really fast and you must avoid duplicate entries?
>>> 
>>> I’m a bit surprised I don’t recall EOF style solutions for such things and 
>>> maybe the Amazon RDS database has a shared connection pattern the apps can 
>>> use, I didn’t see anything so I figure this is application level stuff.
>>> 
>>> Thoughts? Suggestions?
>>> ___
>>> Do not 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/samuel%40samkar.com
>>> 
>>> This email sent to sam...@samkar.com
>> 
> 

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

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


Re: Single thread creation queue?

2021-11-22 Thread Samuel Pelletier via Webobjects-dev
Hi Jesse,

Your question may have multiple answers, can you describe the contexts and 
duplicate sources you fear ?

Is the primary key generated by the WO app or it is external (like a GUID) ?

Do you have a secondary identifier that should be unique ?

Anyway, you should add constraint in to the database if uniqueness is required 
(this apply to all frameworks in all language)

If you use EOF primary key generation, you should not have problems with 
duplicate keys. If you require high throughput, using UUID primary key or 
implementing a custom generator will help by saving round trips to the database 
server. If you insert in batch, it will be also faster than individual inserts.

Regards,

Samuel

> Le 22 nov. 2021 à 08:34, Jesse Tayler via Webobjects-dev 
>  a écrit :
> 
> I asked on slack but I figured I’d ping the list
> 
> Who has a good way to ensure a serial EO creation queue when the system could 
> be hit really fast and you must avoid duplicate entries?
> 
> I’m a bit surprised I don’t recall EOF style solutions for such things and 
> maybe the Amazon RDS database has a shared connection pattern the apps can 
> use, I didn’t see anything so I figure this is application level stuff.
> 
> Thoughts? Suggestions?
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: again, merge on unlock did not happen :/

2021-10-11 Thread Samuel Pelletier via Webobjects-dev
Hi OC,

This is probably a bug in the change propagation. Do you use EOEditingContext 
with long life span (in Session for example) or short life one (in component 
and task) ?

My experience is short life is much better. At least, you are sure your EOs 
will reflect the latest snapshot when created in a new EOEditingContext. 
Creating an EO from an EOGlobalID is very fast when the snapshot is in the OSC 
(using localInstanceOf for example).

I hope this may help,

Samuel


> Le 7 oct. 2021 à 04:02, OCsite via Webobjects-dev 
>  a écrit :
> 
> Hi there,
> 
> I am again here with a mysterious bug; something like this happened before 
> (with slightly different setup), now it happened again. This time the 
> attributes involved were NSTimestamps; I (might be wrong, but I) believe the 
> attribute type is irrelevant to the problem and I am re-writing it below with 
> strings for clarity. Happened under a non-trivial load, nevertheless, 
> especially during the step (ii) below, nothing of importance happened in any 
> other thread (one unlocked its EC, none other logged anything at all). Single 
> OSC, single instance, no background threads (all the things below were normal 
> R/R workers), nothing fancy at all.
> 
> The problem, cleaned up for clarity, looks like this:
> 
> (i) eoX.foo=="old", eoX.bar=="ok"; two session default ECs -- let's call them 
> ecC[hanger] and ecO[bserver] -- have eoX in their registeredObjects
> 
> (ii) two intertwined threads do these operations in this order:
> - ThrO: ecO.lock
> - ThrC: ecC.lock
> - ThrC: eoX.foo="new" (in ecC)
> - ThrO: ecO changes other EOs which are not important for us; does not touch 
> eoX at all
> - ThrC: ecC.saveChanges (eoX.foo properly saved into DB as "new")
> - ThrO: ecO.saveChanges (other EOs properly saved, no change of eoX, which is 
> OK)
> - ThrC: ecC.unlock
> - ThrO: ecO.unlock
> 
> (iii) repeatedly happen these operations:
> - ecO.lock
> - ecO changes other EOs which are not important for us, never touches eoX
> - ecO.saveChanges (other EOs properly saved, no change of eoX, which proves 
> eoX was never in ecO.updatedObjects)
> - ecO.unlock
> 
> (iv) after a while, eoX in ecO is used conceptually like this:
> - ecO.lock
> - if (eoX.foo=="old") eoX.bar="stale"
> - ecO.saveChanges (saves into DB eoX.foo as "old" and eoX.bar as "stale")
> 
> Can you see any possible reason why on earth eoX.foo=="new" was not merged 
> into ecO as a side-effect of its first (or any subsequent) lock in (iii)? Can 
> you see any reasonable[1] way to prevent this kind of problems in future?
> 
> Alas creating a separate OSC for each session and syncing them manually is 
> not really an option for me.
> 
> [1] I've considered to check all registeredObjects of any EC in each unlock, 
> compare their values to the DB snapshot, if different, check whether they 
> were locally updated in the EC, if not, (log a warning and) fix the local EC 
> value from the snapshot. Does not seem to me reasonable though for (a) 
> efficiency -- I fear it would take too much time -- and (b) a danger of 
> unintended consequences (especially -- not only -- with unlocks during 
> processing of the ObjectsChangedInStoreNotification I fear all hell would 
> break loose if I try anything like that).
> 
> Thanks a lot,
> OC
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Headers and AJAX?

2020-10-05 Thread Samuel Pelletier via Webobjects-dev
Jesse,

I had to dig in the past to find out where I had this situation to handle.

There are few http headers to add on the server where the function are called.

Access-Control-Allow-Origin: origin addresses allowed to call the functions //

Access-Control-Allow-Credentials: true  // if you need to have cookies 
previously set.

Access-Control-Allow-Headers : headerList // Headers accepted in request (from 
the javascript to server code)

Access-Control-Expose-Headers : headerList // Headers returned in responses 
(from the server to javascript)

Regards,

Samuel



https://web.kaviju.com; />






> Le 3 oct. 2020 à 12:06, Jesse Tayler  a écrit :
> 
> Right, so CORS is basically a browser thing and thus my command line or 
> mobile app requests have all worked
> 
> So, I added in my virtual host apache configuration
> 
>   Header set Access-Control-Allow-Origin "*"
> 
> But I’m not sure that’s allowing the headers through still?
> 
> Imagine a node.js server will just hit an API->JSON and I need to get a Key 
> privately from that request
> 
> I realize I’m just using those javascript fiddle editor things like postman 
> or whatever which I suppose isn’t entirely the same as a node.js request from 
> a server since I guess the request is coming out of the web page/browser in 
> those cases.
> 
> hmm…
> 
> 
>> On Oct 3, 2020, at 11:46 AM, Samuel Pelletier > <mailto:sam...@samkar.com>> wrote:
>> 
>> Hi Jesee,
>> 
>> If your queries are crossing origins, you need to add CORS headers in your 
>> responses or on your server configuration.
>> 
>> Those includes rules for allowed cookies and headers.
>> 
>> I do not think they are required for same origin requests but this may be 
>> something added lately.
>> 
>> Regards,
>> 
>> Samuel
>> 
>>> Le 3 oct. 2020 à 08:18, Jesse Tayler via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> a 
>>> écrit :
>>> 
>>> 
>>> I have relied on passing auth keys in headers from mobile apps and scripts.
>>> 
>>> I can even stuff a header into a curl statement
>>> 
>>> curl -H "Authorization: MY_PRIVATE_KEY"
>>> 
>>> In WO I can simply ask
>>> 
>>> request().headerForKey("Authorization”);
>>> 
>>> And I get that key,  always works as I’d expect
>>> 
>>> now I’m testing some AJAX and I see a few things
>>> 
>>> 1. It makes my header lowercase?
>>> 2. I can print out all headers and all keys from WO and I can see my header 
>>> listed but I’m never able to read it? Even if I use lowercase or change 
>>> keys I never get a header in WO when I send it from AJAX
>>> 
>>> How could this be?
>>> 
>>> Is this some OTHER form of header or something?
>>> 
>>> 
>>> I try a few ways to insert headers all to the same effect
>>> 
>>> 
>>> 
>>> beforeSend: function (xhr) {
>>> xhr.setRequestHeader ("Authorization", "MY_PRIVATE_KEY”);
>>> },
>>> 
>>> 
>>> 
>>> 
>>> Or--
>>> 
>>> 
>>> 
>>> headers: {
>>>  "Authorization": "MY_PRIVATE_KEY”,
>>> "my-second-header": "second value”
>>> },
>>> 
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> <mailto:Webobjects-dev@lists.apple.com>)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
>>> <https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com>
>>> 
>>> This email sent to sam...@samkar.com
>> 
> 

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

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


Re: Headers and AJAX?

2020-10-03 Thread Samuel Pelletier via Webobjects-dev
Hi Jesee,

If your queries are crossing origins, you need to add CORS headers in your 
responses or on your server configuration.

Those includes rules for allowed cookies and headers.

I do not think they are required for same origin requests but this may be 
something added lately.

Regards,

Samuel

> Le 3 oct. 2020 à 08:18, Jesse Tayler via Webobjects-dev 
>  a écrit :
> 
> 
> I have relied on passing auth keys in headers from mobile apps and scripts.
> 
> I can even stuff a header into a curl statement
> 
>   curl -H "Authorization: MY_PRIVATE_KEY"
> 
> In WO I can simply ask
> 
>   request().headerForKey("Authorization”);
> 
> And I get that key,  always works as I’d expect
> 
> now I’m testing some AJAX and I see a few things
> 
> 1. It makes my header lowercase?
> 2. I can print out all headers and all keys from WO and I can see my header 
> listed but I’m never able to read it? Even if I use lowercase or change keys 
> I never get a header in WO when I send it from AJAX
> 
> How could this be?
> 
> Is this some OTHER form of header or something?
> 
> 
> I try a few ways to insert headers all to the same effect
> 
> 
> 
>   beforeSend: function (xhr) {
>   xhr.setRequestHeader ("Authorization", "MY_PRIVATE_KEY”);
>   },
> 
> 
> 
> 
> Or--
> 
> 
> 
>   headers: {
>"Authorization": "MY_PRIVATE_KEY”,
>   "my-second-header": "second value”
>   },
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Multiple timezones

2020-02-26 Thread Samuel Pelletier via Webobjects-dev
Hi Michael,

There is no easy or universal answer to this question. The best solution also 
depends on the meaning of the timestamp data.

If your system is used on multiple timezones, ...

- you may have situation where you want to always display the time in the event 
location time zone like airplane takeoff and landing;

- you may want to always display the event time in the user local timezone like 
an event log;

- you may want to always display in a fixed time zone like a server log...

So you may or may not need to store the time zone of an event to display it 
properly.

To add some ugliness to this already complex problem, we have a very nasty 
thing called daylight saving time where we change the time zone of locations 
based on the date. This can easily create situation where an event change time 
when crossing the DST change dates...

First step is to analyse the problem and figure out how timestamps should be 
displayed.

Regards,

Samuel


> Le 25 févr. 2020 à 12:59, Michael Kondratov via Webobjects-dev 
>  a écrit :
> 
> Hello!
>Whats the winning strategy on dealing with users / records in multiple 
> timezones? We are starting add add companies that are few hours away from us 
> and don't know how to best handle it.
> 
> 
> 
> Sincerely,
> 
> 
> Michael
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Custom Ajax Component parent page re rendereing

2020-02-01 Thread Samuel Pelletier via Webobjects-dev
Hi Michael,

If processing an AjaxRequest, you should not see the entire page rerendered. 
You may verify by adding a break point on the main page appendToResponse method.

If you wonder why getters on your main component are called like list for a 
repetition, this is required to find out the child component that should 
process the request.

It may be confusing but the WebObject component request handling magic will 
reconstruct the WOElement tree on each request. This is why repetition list 
should be bound to array you are sure cannot change between requests (it can 
usually safely change during action handling and in append to response)

Regards,

Samuel

> Le 27 janv. 2020 à 18:06, Michael Kondratov via Webobjects-dev 
>  a écrit :
> 
> I am working on a small Ajax Component that would save current scroller 
> position. Everything is working except I just noticed that AjaxComponent 
> actually re-renders entire page while generating a small Ajax response. Is 
> that a normal behavior? 
> 
> 
> Michael
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Catalina and Frontbase

2020-01-03 Thread Samuel Pelletier via Webobjects-dev
Hi Jeffrey,

Have you tried to enable SQL logging to identify if the problem is always on 
the same statement and is repeatable ?

to enable SQL logging, set this in Property:  
log4j.logger.er.transaction.adaptor.EOAdaptorDebugEnabled=DEBUG

I did some tests with a fresh Catalina with database copies and everything 
worked as expected. I did not tested migration though.

You may experience a bug in your Java version too. I used the OpenJdk with DCE 
VM 11.0.5 found here https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases

Regards,

Samuel


> Le 29 déc. 2019 à 19:55, Jeffrey Schmitz via Webobjects-dev 
>  a écrit :
> 
> Hello List,
> 
>I’m trying to run my app under Catalina for the first time and am getting 
> a stack overflow when trying check migration status on my frontbase database 
> .  I’ve tried using java 11 and 13 and I’ve updated Frontbase to the Catalina 
> version.  Am hoping to not have ot downgrade to Mojave to get things to run 
> so thought I’d see if anyone has seen something like this before.
> 
> Here’s the summary of what works and what doesn’t:
> 
> App on Catalina (Java 13.0.1)/Catalina Frontbase/ = error
> App on Catalina/ (Java 11.0.2)/Catalina Frontbase = error
> App on Catalina (Java 13.0.1)/Mojave Frontbase = error
> App on Mojave (java “11.0.2")/Catalina Frontbase = WORKS
> 
> er.extensions.migration.ERXMigrationFailedException: Failed to migrate model 
> 'netbracketsFW'.
> at 
> er.extensions.migration.ERXMigrator.migrateToLatest(ERXMigrator.java:216)
> at 
> er.extensions.appserver.ERXApplication.finishInitialization(ERXApplication.java:1307)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at 
> com.webobjects.foundation.NSSelector._safeInvokeMethod(NSSelector.java:122)
> at 
> com.webobjects.foundation.NSNotificationCenter$_Entry.invokeMethod(NSNotificationCenter.java:588)
> at 
> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:532)
> at 
> com.webobjects.foundation.NSNotificationCenter.postNotification(NSNotificationCenter.java:546)
> at com.webobjects.appserver.WOApplication.run(WOApplication.java:1229)
> at 
> er.extensions.appserver.ERXApplication.run(ERXApplication.java:1427)
> at com.webobjects.appserver.WOApplication.main(WOApplication.java:548)
> at 
> er.extensions.appserver.ERXApplication.main(ERXApplication.java:885)
> at com.netbrackets.app.Application.main(Application.java:56)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:567)
> at com.webobjects._bootstrap.WOBootstrap.main(WOBootstrap.java:87)
> Caused by: java.lang.StackOverflowError
> at java.base/java.net.Socket$SocketInputStream.close(Socket.java:946)
> at 
> java.base/java.io.FilterInputStream.close(FilterInputStream.java:180)
> at com.frontbase.jdbc.FBJSocket.close(Unknown Source)
> at java.base/java.net.Socket$SocketInputStream.close(Socket.java:946)
> at 
> java.base/java.io.FilterInputStream.close(FilterInputStream.java:180)
> at com.frontbase.jdbc.FBJSocket.close(Unknown Source)
> …
> 
> 
> 
> 
> 
> 
> Jeffrey Schmitz
> netBrackets owner
> http://www.netBrackets.com  - it's nothin' but 
> net!
> (636) 284-1089
> 
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Safari ignores autocomplete="off" in AjaxAutoComplete component

2019-08-29 Thread Samuel Pelletier via Webobjects-dev
Hi Markus,

I do not experience this problem on my side. I do not remember experienced it 
either. I'm currently using Safari 12.1.2 on Mojave and on iOS 12.4 devices 
with latest Wonder.

The only problem I experience with AutoComplete is on iOS, the popup does not 
appears at the field location.

Samuel


> Le 29 août 2019 à 07:21, Markus Ruggiero via Webobjects-dev 
>  a écrit :
> 
> Seems there is a big issue with Safari and AjaxAutoComplete. The textfield is 
> explicitly set to autocomplete="off" but Safari ignores this. So when the 
> user starts typing Safari OVERLAYS the autocomplete list from the component 
> with its own autocomplete stuff making the component's provided pick list 
> unusable. The very same thing works correctly in Firefox.
> 
> Anybody knows what is going on here and how to fix this?
> 
> ---markus---
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: DirectConnect and Security

2019-08-14 Thread Samuel Pelletier via Webobjects-dev
Hi Mark,

You can probably override createRequest in your Application class to inject the 
header before calling the parent version. Another way could be to add a 
property in ERXApplication to "forceWebServerRequests".

public ERXRequest createRequest(String aMethod, String aURL, String 
anHTTPVersion, Map> someHeaders, NSData 
aContent, Map someInfo) {

Regards,

Samuel


> Le 12 août 2019 à 09:01, Samuel Pelletier via Webobjects-dev 
>  a écrit :
> 
> Hi Mark,
> 
> If you want to simulate a WOAdaotor environment and have the app generate 
> static file URL, configure your load balancer to add 
> "x-webobjects-adaptor-version" header like I do using apache reverse proxy:
> 
> RequestHeader set x-webobjects-adaptor-version "1"
> 
> Regards,
> 
> Samuel
> 
> 
>> Le 12 août 2019 à 06:52, Mark Gowdy via Webobjects-dev 
>> mailto:webobjects-dev@lists.apple.com>> a 
>> écrit :
>> 
>> 
>> 
>>> On 12 Aug 2019, at 10:03, Matthew Ness via Webobjects-dev 
>>> mailto:webobjects-dev@lists.apple.com>> 
>>> wrote:
>>> 
>>> 
>>> 
>>> On Sat, Aug 10, 2019, at 5:54 AM, Mark Gowdy via Webobjects-dev wrote:
>>>> Hi.
>>>> 
>>>> Is anyone aware of any security issues (or other considerations) with 
>>>> Direct Connect mode for a live deployment?
>>>> 
>>>> This will be using the Amazon’s Application Load Balancer.
>>>> And it _might_ mean that I can ditch Apache once and for all :-)
>>>> 
>>>> Thanks, 
>>>> 
>>>> Mark
>>> 
>>> 
>>> Hi Mark,
>>> 
>>> If you are applying a cert to your ALB, then SSL effectively terminates at 
>>> that point and the request is forwarded on to your direct connect EC2 
>>> instances.
>>> I'm not sure what kind of security issues you are envisioning. Your should 
>>> hold your EC2 instances security considerations to the same standard 
>>> whether using Apache over 443 or your app on, say, 5.
>>> To that end, there should be no accessibility outside the above mentioned 
>>> ALB connectivity and some administration bastion host for your terminal 
>>> access.
>>> 
>>> Having said all that, if your application is completely session-less, then 
>>> you're good to go.
>>> 
>>> If you have sessions in your app you still have some problems to overcome.
>>> You can use session affinity (sticky sessions) in ALB/ELB (but not Network 
>>> LB), but be aware they require cookies on the client.
>>> So, you have the sticky sessions working, great! As your load balancer 
>>> horizontally scales out, it's creating EC2 instances running your java app. 
>>> But when your ALB decides to scale _in_, it'll wipe one or more of your EC2 
>>> instances, which could still have active sessions.
>>> So, unless you de-/serialise your Sessions at the start and end of the R-R 
>>> loop and store that somewhere else (db/redis/etc) which your EC2 instances 
>>> would have access to, it may annoy some users. 
>>> Because of proprietary classes in WO, Session serialisation is unsolved and 
>>> inflexible.
>> 
>> Wow..
>> 
>> Thanks for the info.
>> 
>> My apps have session, and I was planning on using sticky sessions with the 
>> AWS’s ALB (Application Load Balancer).  I am aware of the cookie monster :-)
>> 
>> I will be using the ALB with an explicit list of AppServers, so I don’t 
>> _think_ that will be a problem.  There will be no auto-scaling (for now).
>> Basically, I plan to use ALB in the _similar_ way to Apache’s mod_proxy.
>> 
>> I tried session serialisation (in the DB) a long time ago, and it wasn’t an 
>> ideal solution.. I would rather not go there.
>> 
>> I am happy enough with any network security concerns (i.e. nothing within 
>> the VPC can be accessed externally).  The only way in is via the ALB (with 
>> SSL) with SSL redirection rules etc..
>> 
>> My question was mainly around Direct Connect mode in the Application.
>> e.g. I know it accesses the WebServer resources using a full system path in 
>> the URL.
>> But I know in that case it can’t access any files outside of its scope, so 
>> that should be fine.
>> 
>> I just wanted to check if anyone knew of any security ‘gotchas’ I was 
>> unaware when using DirectConnect.
>> 
>> Thanks, 
>> 
>> Mark
>> 
>>> 
>>> 
>>> Regards,
>>> 
>>> 
>>&g

Re: DirectConnect and Security

2019-08-12 Thread Samuel Pelletier via Webobjects-dev
Hi Mark,

If you want to simulate a WOAdaotor environment and have the app generate 
static file URL, configure your load balancer to add 
"x-webobjects-adaptor-version" header like I do using apache reverse proxy:

RequestHeader set x-webobjects-adaptor-version "1"

Regards,

Samuel


> Le 12 août 2019 à 06:52, Mark Gowdy via Webobjects-dev 
>  a écrit :
> 
> 
> 
>> On 12 Aug 2019, at 10:03, Matthew Ness via Webobjects-dev 
>>  wrote:
>> 
>> 
>> 
>> On Sat, Aug 10, 2019, at 5:54 AM, Mark Gowdy via Webobjects-dev wrote:
>>> Hi.
>>> 
>>> Is anyone aware of any security issues (or other considerations) with 
>>> Direct Connect mode for a live deployment?
>>> 
>>> This will be using the Amazon’s Application Load Balancer.
>>> And it _might_ mean that I can ditch Apache once and for all :-)
>>> 
>>> Thanks, 
>>> 
>>> Mark
>> 
>> 
>> Hi Mark,
>> 
>> If you are applying a cert to your ALB, then SSL effectively terminates at 
>> that point and the request is forwarded on to your direct connect EC2 
>> instances.
>> I'm not sure what kind of security issues you are envisioning. Your should 
>> hold your EC2 instances security considerations to the same standard whether 
>> using Apache over 443 or your app on, say, 5.
>> To that end, there should be no accessibility outside the above mentioned 
>> ALB connectivity and some administration bastion host for your terminal 
>> access.
>> 
>> Having said all that, if your application is completely session-less, then 
>> you're good to go.
>> 
>> If you have sessions in your app you still have some problems to overcome.
>> You can use session affinity (sticky sessions) in ALB/ELB (but not Network 
>> LB), but be aware they require cookies on the client.
>> So, you have the sticky sessions working, great! As your load balancer 
>> horizontally scales out, it's creating EC2 instances running your java app. 
>> But when your ALB decides to scale _in_, it'll wipe one or more of your EC2 
>> instances, which could still have active sessions.
>> So, unless you de-/serialise your Sessions at the start and end of the R-R 
>> loop and store that somewhere else (db/redis/etc) which your EC2 instances 
>> would have access to, it may annoy some users. 
>> Because of proprietary classes in WO, Session serialisation is unsolved and 
>> inflexible.
> 
> Wow..
> 
> Thanks for the info.
> 
> My apps have session, and I was planning on using sticky sessions with the 
> AWS’s ALB (Application Load Balancer).  I am aware of the cookie monster :-)
> 
> I will be using the ALB with an explicit list of AppServers, so I don’t 
> _think_ that will be a problem.  There will be no auto-scaling (for now).
> Basically, I plan to use ALB in the _similar_ way to Apache’s mod_proxy.
> 
> I tried session serialisation (in the DB) a long time ago, and it wasn’t an 
> ideal solution.. I would rather not go there.
> 
> I am happy enough with any network security concerns (i.e. nothing within the 
> VPC can be accessed externally).  The only way in is via the ALB (with SSL) 
> with SSL redirection rules etc..
> 
> My question was mainly around Direct Connect mode in the Application.
> e.g. I know it accesses the WebServer resources using a full system path in 
> the URL.
> But I know in that case it can’t access any files outside of its scope, so 
> that should be fine.
> 
> I just wanted to check if anyone knew of any security ‘gotchas’ I was unaware 
> when using DirectConnect.
> 
> Thanks, 
> 
> Mark
> 
>> 
>> 
>> Regards,
>> 
>> 
>> -- 
>> Matt
>> http://logicsquad.net
>> https://www.linkedin.com/company/logic-squad/
>> ___
>> Do not 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/mark%40gowdy.co.uk
>> 
>> This email sent to m...@gowdy.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:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Can WOPopupButton's selectedValue binding set a value in a component?

2019-03-29 Thread Samuel Pelletier
Hi Hugi,

I think most WOComponents (and elements) only push selectedValue or selection 
if the value change.

For your case, I think you should use javascript code with a AjaxProxy to 
communicate with your component controller or use some form of serialization 
using a hidden field.

I never used AjaxProxy but my understanding is this create a javascript proxy 
object in the page that implements RPC to java object created by the component. 

The JS code would read the actuel values from the proxy object or by 
deserializing them from the field, render the checkbox, handle the changes in 
the ui and send back the result.

Regards,

Samuel

> Le 29 mars 2019 à 11:58, Hugi Thordarson  a écrit :
> 
> Hi all.
> For … reasons* … I need to use the "selectedValue"-binding of a 
> WOPopupButton, rather than the "selection"-binding. However, it seems 
> "selectedValue" is unidirectional, i.e. if I bind it to a variable in a 
> component, the variable is read (to set the initially selected value when the 
> pop-up renders) but it's not set in the component when the form is submitted.
> 
> So… I guess the question is; shouldn't that binding be bidirectional, so I 
> can intercept the new [selectedValue] on form submission? It seems surprising 
> it doesn't just work, and it's tempting to think I'm simply just doing 
> something wrong.
> 
> If anyone can shed some light on this (or suggest a workaround) I'd be most 
> grateful. It would be lovely to able to avoid stuff like updating a hidden 
> field on the client when the pop-up changes (blech) or manually getting the 
> formValue from the request (pfft).
> 
> * For those interested in "reasons", it's that I have a few hundred select 
> boxes on a single page, each one containing the same identical list of few 
> hundred items. I'm populating these popups manually on the client using 
> JavaScript so I don't have to download a few megabytes of HTML on each 
> request. If anyone can suggest a different solution to *that* problem, then 
> that makes this question obsolete :).
> 
> Cheers,
> - hugi
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


ERRest and apache Commons Lang

2019-03-26 Thread Samuel Pelletier
Hi,

The current Wonder ERRest fail to produce json data with a 
NoClassDefFoundError: 
org/apache/commons/lang/exception/NestableRuntimeException referenced by 
JsonConfig, an old json library.

I suspect this problem is limited to ant users like me.

This class was part of common-lang.jar which was replaced in ERJar by 
common-lang3.jar. Common-lang changed the package to allows both major version 
to work together.

I re-added the commons-lang-2.6.jar into my ERJar to make ERRest works again 
successfully. Is there any downside to push this into the official Wonder ? The 
jar could also be added into ERRest directly.

Samuel



 ___
Do not 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: WOInstaller.jar needs update

2019-03-12 Thread Samuel Pelletier
Hi,

I concluded the same thing installing a new workstation and documented the 
procedure in the wiki. I initially suspected a java11 problem in the installer.

Samuel


> Le 12 mars 2019 à 08:10, Wolfgang Hartmann  a écrit :
> 
> Hy,
> 
> Apple changed the URL to the WebObjects-Installation: A call to 
> "http://download.info.apple.com/Mac_OS_X/061-4634.20080915.3ijd0/WebObjects543.dmg
>  
> "
>  returns a redirect to "https".
> 
> The WOInstaller.jar currently doesn't handle this situation and needs an 
> update of the URL.
> 
> As a workaround the file can be manually downloaded to "/tmp" and the 
> Installer could be called with "java -jar WOInstaller.jar dev54 
> WOINSTALL_DIR". The parameter "dev54" will read the file from "/tmp/" instead 
> of downloading it.
> 
> Best regards,
> Wolfy
> ___
> Do not 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Best deployment style for Mojave ?

2019-02-16 Thread Samuel Pelletier
I suggest to update the current deployment or create a new page on the 
wiki.wocommunity.org.

You can attach files to a page and it is easier to find the latest version of 
the documentation than search a mailing list archive.

Samuel

> Le 15 févr. 2019 à 13:09, Jeffrey Schmitz  a 
> écrit :
> 
> The tar I tried to send to the list that included the script and associated 
> files bounced due to size.  I will try again in a bit with a subset of the 
> files.
> 
> 
> 
>> On Jan 19, 2019, at 9:10 PM, Theodore Petrosky > > wrote:
>> 
>> there was a recent conversation that included a deployment script. I seem to 
>> recall December 29 with Jeffrey Schmitz 
>> 
>> the deployment script was included in the emails. hopefully it made it to 
>> the archive.
>> 
>> Ted
>> 
>>> On Jan 19, 2019, at 9:59 PM, Ken Anderson >> > wrote:
>>> 
>>> So, I haven’t deployed on a Mac for a VERY long time (always use war on 
>>> Linux).  What’s the right way to deploy on a recent Mac OS?  The 
>>> instructions say to download WO5.4.3 from Apple, but is that still right?
>>> 
>>> Thanks!
>>> Ken
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> )
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com 
>>> 
>>> 
>>> This email sent to tedp...@yahoo.com
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> )
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/jeff.schmitz%40netbrackets.com
>>  
>> 
>> 
>> This email sent to jeff.schm...@netbrackets.com 
>> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> )
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: WOLips, Eclipse 2018-12 with openjdk11 and dcevm-hotswap

2019-02-14 Thread Samuel Pelletier
Hi,

I managed to build your branch with the readme content (There are too many 
build instruction out there...) and after fixing the wo.root in the 
wobuild.property file that was not up to date. I built without jprofiler and 
without jrebel.

AddKey works again.

It would be a good thing to create the official repo with these and start the 
automatic builds. What is the next step to put that in place ?

Regards,

Samuel

> Le 13 févr. 2019 à 18:29, Michael Sharp  a écrit :
> 
> I’m building a WOLips4.10 variation locally from my branch at 
> https://github.com/getsharp/wolips/tree/eclipse_4_10 
> <https://github.com/getsharp/wolips/tree/eclipse_4_10>
> 
> The changes to their internal JDT APIs (such as StubUtility) was a pretty 
> good incentive to leave them alone all together.
> 
> Add Key and a few other broken features are fixed for me with this build.
> 
> Sharpy.
> 
> 
>> On 14 Feb 2019, at 7:37 am, Samuel Pelletier > <mailto:sam...@samkar.com>> wrote:
>> 
>> Hi all,
>> 
>> I experience Eclipse 2018-12 with WOLips and DCEVM and the latest WOLips and 
>> it works quite well to date.
>> 
>> I use the openjdk11 with DCEVM and Hotswap integrated found at this 
>> location, it is important to use the latest (+8 at this time) version if you 
>> use Groovy.
>>   https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases 
>> <https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases>
>> 
>> This download contains the entire JVM directory, to install it :
>>  cd /Library/Java/JavaVirtualMachines/
>>  sudo tar zxf /Users/yourDownloadLocation/java11-openjdk-dcevm-osx.tar.gz
>>  Then go to Eclipse preferences to add the new JVM.
>> 
>> This JVM is for dev only, it always starts with DCEVM and Hotswap. DCEVM is 
>> a free hot code replacement like JRebel and HotSwap contains plugins to help 
>> the engine.
>> 
>> Apps compile and run faster (real or placebo effet) than my previous setup.
>> 
>> The only downside to date is the addKey in the WO editor that no longer 
>> works.
>> 
>> It fail with java.lang.NoClassDefFoundError: 
>> org/eclipse/jdt/internal/corext/codemanipulation/StubUtility. I found the 
>> addKey problem in WOLips, the team moved an internal classe used by this 
>> function in the AddKeyInfo class. Here is the import that need to change in 
>> this file.
>> 
>> -import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
>> +import org.eclipse.jdt.internal.core.manipulation.StubUtility;
>> 
>> My problem now is I do not have a working WOLips build environment to test 
>> this. I tried to follow the Wiki instruction but I only get fail build du to 
>> missing something.
>> 
>> If someone has a working WOLips development setup, please update it with 
>> Eclipse 2018-12 and apply my patch to build a new WOLips. This will require 
>> a new WOLips version for Eclipse 4.10+ since this code will no longer works 
>> with the previous version.
>> 
>> Samuel
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> <mailto:Webobjects-dev@lists.apple.com>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/getsharp%40gmail.com 
>> <https://lists.apple.com/mailman/options/webobjects-dev/getsharp%40gmail.com>
>> 
>> This email sent to getsh...@gmail.com
> 

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

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


WOLips, Eclipse 2018-12 with openjdk11 and dcevm-hotswap

2019-02-13 Thread Samuel Pelletier
Hi all,

I experience Eclipse 2018-12 with WOLips and DCEVM and the latest WOLips and it 
works quite well to date.

I use the openjdk11 with DCEVM and Hotswap integrated found at this location, 
it is important to use the latest (+8 at this time) version if you use Groovy.
 https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases 


This download contains the entire JVM directory, to install it :
cd /Library/Java/JavaVirtualMachines/
sudo tar zxf /Users/yourDownloadLocation/java11-openjdk-dcevm-osx.tar.gz
Then go to Eclipse preferences to add the new JVM.

This JVM is for dev only, it always starts with DCEVM and Hotswap. DCEVM is a 
free hot code replacement like JRebel and HotSwap contains plugins to help the 
engine.

Apps compile and run faster (real or placebo effet) than my previous setup.

The only downside to date is the addKey in the WO editor that no longer works.

It fail with java.lang.NoClassDefFoundError: 
org/eclipse/jdt/internal/corext/codemanipulation/StubUtility. I found the 
addKey problem in WOLips, the team moved an internal classe used by this 
function in the AddKeyInfo class. Here is the import that need to change in 
this file.

-import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility;
+import org.eclipse.jdt.internal.core.manipulation.StubUtility;

My problem now is I do not have a working WOLips build environment to test 
this. I tried to follow the Wiki instruction but I only get fail build du to 
missing something.

If someone has a working WOLips development setup, please update it with 
Eclipse 2018-12 and apply my patch to build a new WOLips. This will require a 
new WOLips version for Eclipse 4.10+ since this code will no longer works with 
the previous version.

Samuel
 ___
Do not 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: WebObjects and prototype.js

2019-02-13 Thread Samuel Pelletier
Aaron,

I notice that you did not use the item and display string, i.e. use only a text 
form of auto complete. I tried to simplify one use and it still works.

Did the value got set when user is typing and the suggestion getter called ?

You may have another problem in the page that block the javascript execution 
during the initialization...

Another thing that may differ is the usage (or non usage) of javascript files 
.min versions, I use the full versions even on production.

Samuel


> Le 13 févr. 2019 à 14:01, Aaron Rosenzweig  a écrit :
> 
> Hi, actual neither of us are using “local” I didn’t remember the default and 
> assumed it was true. Appears the default is false, I was just explicitly 
> setting it. 
> 
> So I don’t know why it works for you but not for us with Prototype 1.7.3
> 
> AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
> e:  aa...@chatnbike.com <mailto:aa...@chatnbike.com>  t:  (301) 956-2319
>   
> 
>> On Feb 13, 2019, at 2:00 PM, Aaron Rosenzweig > <mailto:aa...@chatnbike.com>> wrote:
>> 
>> Hi Everyone especially Samuel!
>> 
>> This is what our code looks like:
>> 
>> > isLocal = "$false" afterUpdateElement = "$afterUpdateElementAction" 
>> frequency = "0.2" />
>> 
>> > updateContainerID = "$checkMarkContainerID" action = 
>> "$userSelectedFreeFormAddressText" />  
>> 
>> Note: the "afterUpdateElementAction" is javascript that clicks the submit 
>> button.
>> 
>> One difference, besides linguistic preference, is that yours is local but 
>> ours is not. We hand off to a service to scrub what is partially typed and 
>> then come back with suggestions. Note the “isLocal = false”
>> 
>> I have not tried the AjaxExample project. Literally our apps stopped 
>> working, people started screaming that the sky is falling, and to put out 
>> the fire I replaced the version of Prototype. 
>> 
>> AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
>> e:  aa...@chatnbike.com <mailto:aa...@chatnbike.com>  t:  (301) 956-2319
>>  
>> 
>>> On Feb 13, 2019, at 1:51 PM, Samuel Pelletier >> <mailto:sam...@samkar.com>> wrote:
>>> 
>>> Hi Aaron,
>>> 
>>> I have the latest wonder and my AjaxAutoCompletes are working as expected.
>>> 
>>> Have you tried the AjaxExample project ?
>>> 
>>> Maybe we have a different usage. I use it like this:
>>> >> displayString = "$enseignant.contact.nomComplet" value = 
>>> "$textToFindEnseignant" selection = "$selectedEnseignant" style="display: 
>>> inline-block; margin-bottom:0; width:120px;" afterUpdateElement = 
>>> "function(){ajouteEnseignant();}"/>
>>> >> updateContainerID = "blocPeriodeEditor" action = "$ajouterEnseignant" 
>>> class="tiny button" style="margin-bottom:0;"/>
>>> 
>>> Samuel
>>> 
>>> 
>>> 
>>> 
>>>> Le 12 févr. 2019 à 16:26, Aaron Rosenzweig >>> <mailto:aa...@chatnbike.com>> a écrit :
>>>> 
>>>> Hi Everyone,
>>>> 
>>>> We discovered after recently updating Wonder… that Prototype 1.7.3 is not 
>>>> compatible with Scriptaculous 1.9 (what is in Wonder).
>>>> 
>>>> At least, it is not compatible with the autocomplete functionality at a 
>>>> minimum. 
>>>> 
>>>> For the moment we have made a local branch of Wonder and employed 
>>>> Prototype 1.7.0 as that is the last blessed version for Scriptaculous. 
>>>> It’s possible that 1.7.2 might be ok, have not tried, but 1.7.3 does not 
>>>> work. 
>>>> AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
>>>> e:  aa...@chatnbike.com <mailto:aa...@chatnbike.com>  t:  (301) 956-2319
>>>>
>>>> 
>>>>> On Jan 21, 2019, at 5:18 AM, Michael Schmiedgen >>>> <mailto:schmied...@takwa.de>> wrote:
>>>>> 
>>>>> 
>>>>>>> We are using 1.7.3 for years with no known problems.
>>>>>> Where is a pull request? :-)
>>>>> 
>>>>> Here:
>>>>> https://github.com/wocommunity/wonder/pull/893 
>>>>> <https://github.com/wocommunity/wonder/pull/893>
>>>>> 
>>>>> :)
>>>>> 
>>>>> Michael
>>>>>

Re: WebObjects and prototype.js

2019-02-13 Thread Samuel Pelletier
Hi Aaron,

I have the latest wonder and my AjaxAutoCompletes are working as expected.

Have you tried the AjaxExample project ?

Maybe we have a different usage. I use it like this:



Samuel




> Le 12 févr. 2019 à 16:26, Aaron Rosenzweig  a écrit :
> 
> Hi Everyone,
> 
> We discovered after recently updating Wonder… that Prototype 1.7.3 is not 
> compatible with Scriptaculous 1.9 (what is in Wonder).
> 
> At least, it is not compatible with the autocomplete functionality at a 
> minimum. 
> 
> For the moment we have made a local branch of Wonder and employed Prototype 
> 1.7.0 as that is the last blessed version for Scriptaculous. It’s possible 
> that 1.7.2 might be ok, have not tried, but 1.7.3 does not work. 
> AARON ROSENZWEIG / Chat 'n Bike 
> e:  aa...@chatnbike.com   t:  (301) 956-2319
>   
> 
>> On Jan 21, 2019, at 5:18 AM, Michael Schmiedgen > > wrote:
>> 
>> 
 We are using 1.7.3 for years with no known problems.
>>> Where is a pull request? :-)
>> 
>> Here:
>> https://github.com/wocommunity/wonder/pull/893 
>> 
>> 
>> :)
>> 
>> Michael
>> 
>> 
>> -- 
>> ___
>> 
>> Michael Schmiedgen, BSc
>> Senior Software Engineer
>> 
>> Takwa GmbH
>> Friedrich-List-Str. 36
>> 99096 Erfurt GERMANY
>> 
>> Tel  +49 361 6534096
>> Fax  +49 361 6534097
>> Mail schmied...@takwa.de
>> Web  http://www.takwa.de/
>> ___
>> 
>> 
>> Amtsgericht Jena HRB 112964
>> Geschäftsführung: Ingo Buchholz
>> ___
>> Do not 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/aaron%40chatnbike.com 
>> 
>> 
>> This email sent to aa...@chatnbike.com 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> )
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: EOModel of sub-entity not added to EODatabase

2019-02-12 Thread Samuel Pelletier
Hi Fabian,

I'm not familiar with this low level part of EOF but after surfing the doc I 
may have something.

Have you try to register the CooperatingObjectStoreWasAddedNotification ? If 
the new object store is passed, you may have an opportunity to force load the 
model there.

Regards,

Samuel


> Le 12 févr. 2019 à 07:16, Fabian Peters  a écrit :
> 
> Hello everybody!
> 
> I've come across an issue with cross-model inheritance (single-table in this 
> case). For a minimal test setup I added an EOModel FrameworkUser to 
> ERMoviesLogic, containing an abstract parent entity AbstractUser and a 
> concrete child entity FrameworkUser. I added a second EOModel AppUser with a 
> concrete child of AbstractUser called AppUser to the ERModernMoviesTest app.
> 
> Fetching for all AbstractUser EOs does return all concrete child EOs, i.e. 
> both FrameworkUser and AppUser. Accessing attributes that are available on 
> AbstractUser is fine, but deleting an AppUser EO causes an exception:
> 
>java.lang.IllegalStateException: Unable to find entity for object
> 
> It turns out that the EOModel AppUser is not being added to the EODatabase 
> when the fetch is carried out.
> 
> Deletion with concrete child entity in FrameworkUser:
> 
> ERXDatabase.addModel: FrameworkUser
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  - Using JDBCPlugIn 
> 'H2PlugIn' for ERCompositeAdaptor@1026056307
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  -  connecting with 
> dictionary: {driver = "org.h2.Driver"; plugin = "H2PlugIn"; password = 
> ""; URL = "jdbc:h2:mem:ERModernMoviesTest"; }
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  -  === Begin Internal 
> Transaction
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  -  evaluateExpression: 
>  t0.CUSTOMER_ID, RTRIM(t0.PASSWORD), RTRIM(t0.TYPE), t0.USER_ID, 
> RTRIM(t0.LOGIN) FROM rentalsuser t0 WHERE (t0.TYPE = ? OR t0.TYPE = ?)" 
> withBindings: 1:"app"(type), 2:"framework"(type)>
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  - 4 row(s) processed
> Feb 12 12:09:07 ERModernMoviesTest[9876] DEBUG NSLog  -  === Commit Internal 
> Transaction
> FetchTask._call: ringle: app
> FetchTask._call: jboyles: app
> FetchTask._call: lstark: app
> FetchTask._call: jjeffers: framework
> 
>=> java.lang.IllegalStateException: Unable to find entity for object 
> 
> 
> Deletion with only abstract parent entity AbstractUser in FrameworkUser:
> 
> ERXDatabase.addModel: FrameworkUser
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  - Using JDBCPlugIn 
> 'H2PlugIn' for ERCompositeAdaptor@22939787
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  -  connecting with 
> dictionary: {driver = "org.h2.Driver"; plugin = "H2PlugIn"; password = 
> ""; URL = "jdbc:h2:mem:ERModernMoviesTest"; }
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  -  === Begin Internal 
> Transaction
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  -  evaluateExpression: 
>  t0.CUSTOMER_ID, RTRIM(t0.PASSWORD), RTRIM(t0.TYPE), t0.USER_ID, 
> RTRIM(t0.LOGIN) FROM rentalsuser t0 WHERE t0.TYPE = ?" withBindings: 
> 1:"app"(type)>
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  - 3 row(s) processed
> Feb 12 12:11:36 ERModernMoviesTest[9876] DEBUG NSLog  -  === Commit Internal 
> Transaction
> FetchTask._call: ringle: app
> FetchTask._call: jboyles: app
> FetchTask._call: lstark: app
> 
>   =>  java.lang.IllegalStateException: Unable to find entity for object 
> 
> 
> Interestingly, the restricting qualifier is being correctly generated, i.e. 
> it contains the type for "app" and for "framework" EOs.
> 
> As a workaround, I add the following before the fetch
> 
>
> EODatabaseContext.registeredDatabaseContextForModel(ERXModelGroup.defaultGroup().modelNamed("AppUser"),
>  ec);
> 
> which forces the model to be loaded.
> 
> Now, my question is where can this be fixed in a generic manner? The fetch 
> causes an EOCooperatingObjectStoreNeededNotification notification to be sent, 
> which gets handled by EODatabaseContext._cooperatingObjectStoreNeeded(). But 
> that's a static method…
> 
> Fabian
> 
> P.S.: The fetch in question takes place in an EC created with an 
> EOObjectStoreCoordinator from the ERXTaskObjectStoreCoordinatorPool. AFAICT 
> this is only relevant in that the EOModel is more likely to not having been 
> added, compared to using an EOObjectStoreCoordinator that is shared among 
> sessions.
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

Re: Advice on whether to upgrade Eclipse / WOLips from Eclipse Mars 4.5

2019-02-11 Thread Samuel Pelletier
You can try the latest JDK with the latest DCEVM, it usually works even if 
version does not matches.

As anyone tried OpenJDK on Mac with Eclipse ?

There are now Mac binaries version of adopt OpenJDK end even a version with 
Hotswap included https://github.com/TravaOpenJDK/trava-jdk-11-dcevm/releases 
but I did not took the time to try yet.

Regards,

Samuel


> Le 11 févr. 2019 à 09:20, Theodore Petrosky  a écrit :
> 
> I really recommend DCEVM! It is so nice when I am first creating my model. I 
> can add attributes, edit methods in the attributes and I don’t have to 
> recompile my app!l
> 
> It lags behind the ‘current’ java at time (Only 181 not 201), but I highly 
> recommend it.
> 
>> On Feb 11, 2019, at 9:09 AM, John Pollard > > wrote:
>> 
>> Thanks for the warning, no not using that.
>> My JDK is now 1.8.0.201 and wolips47 installed ok.
>> 
>>> On 11 Feb 2019, at 13:15, Theodore Petrosky >> > wrote:
>>> 
>>> BTW, are you using  DCEVM ?
>>> 
>>> it is only available to java .181 though
>>> 
>>>  
 On Feb 11, 2019, at 8:10 AM, John Pollard >>> > wrote:
 
 I have now realised the command line is the JDK and the plugin the JRE, 
 have now installed the JRE to the latest, sorry for the noise on the list.
 John
 
> On 11 Feb 2019, at 12:59, John Pollard  > wrote:
> 
> When I download Java from Oracle and install it, the one at the plugin 
> path below is the one that is updated, not the version I pick up from the 
> command line.
> 
>> On 11 Feb 2019, at 12:51, Jesse Tayler > > wrote:
>> 
>> One of those is for Safari?
>> 
>> Odd there are two incompatible so I guess you should iron that out, just 
>> seems an odd configuration trouble…hmm…
>> 
>> 
>> 
>>> On Feb 11, 2019, at 7:46 AM, John Pollard >> > wrote:
>>> 
>>> Aha, it seems I have some Java version issues.
>>> Sys Prefs, Java says I have v201 located at /Library/Internet 
>>> Plug-ins/JavaAppletPlugin/plugin/Contents/Home/bin/Java
>>> 
>>> In the shell
>>> which java
>>> /usr/bin/java
>>> is a link to 
>>> /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
>>> which is the older version and also the one Eclipse is picking up
>>> 
>>> I will look at resolving the two versions.
>>> 
>>> Thanks
>>> John
>>> 
 On 11 Feb 2019, at 12:17, Dennis Bliefernicht 
 >>> > wrote:
 
 Heya,
 
> On 11. Feb 2019, at 12:34, John Pollard  > wrote:
> 
> I installed 2018-12 but on attempting to add WOLips47 I received the 
> following error:
> 
> Unable to read repository at 
> https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml
>  
> .
> sun.security.validator.ValidatorException: PKIX path building failed: 
> sun.security.provider.certpath.SunCertPathBuilderException: unable to 
> find valid certification path to requested target
> 
> Menu Eclipse -> About Eclipse -> Installation Details -> Configuration
> java.runtime.version=1.8.0_60-b27
> which I believe is up to date on my Mac
> 
> Any pointers to working round this?
 
 Probably this is the Java version (1.8.0_60 seems to be from autumn 
 2015); The JDK only included the required root certificates to accept 
 Let's Encrypt certificates (which jenkins.wocommunity.org 
  uses) in 1.8.0_101 (mid 2016) so you 
 either need to update the JDK/JRE (probably just the latest Java 8 
 version) you use for running eclipse or you need to add the required 
 root certificates manually to the trust store of the installed JRE.
 
 Greetings
 Dennis
 
 --
 
 
 
 
 
 
 -
 Dennis Bliefernicht • Head of Backend Development
 T +49 40 357 3001 62
 dennis.blieferni...@xyrality.com 
 
 
 XYRALITY GmbH • Friedensallee 290 • 22763 Hamburg
 www.xyrality.com 
 Registergericht: Hamburg HRB 115332
 Geschäftsführer: Sven Ossenbrüggen
 -
 
>>> 
>>> ___
>>> Do not post admin requests to the list. 

Re: Advice on whether to upgrade Eclipse / WOLips from Eclipse Mars 4.5

2019-02-08 Thread Samuel Pelletier
Hi,

I just installed 2018-12 and it seems faster than 4.7. I have only one problem 
to date, the "Add Key" function in the component editor no longer works for me. 
I see the dialog, specify the type and click "Add" as usual. The source editor 
come to front but the key is not added.

Adding an action still work though.

Are you experiencing the same problem ?

Regards,

Samuel


> Le 8 févr. 2019 à 12:04, Tim Worman  a écrit :
> 
> This. I’m definitely seeing better performance from 2018-12.
> 
> 
>> On Feb 6, 2019, at 3:04 AM, Theodore Petrosky > > wrote:
>> 
>> I just installed eclipse 2018-12. I am finding that it loads faster, my app 
>> is compiling and launching much faster and even the first run of my app, it 
>> is much more responsive (in developer mode).
>> 
>> for those reasons alone I recommend that one should do the update!!
>> 
>> Ted
>> 
>> 
>>> On Feb 6, 2019, at 12:44 AM, Faizel Dakri  wrote:
>>> 
>>> I’ve been using Eclipse 2018-12 for a few weeks now and it appears to be 
>>> working fine. I haven’t yet run into anything surprising.
>>> 
>>> F
>>> 
>>> -- 
>>> Faizel Dakri
>>> list...@dakri.com
>>> 
>>> 
>>> 
 On Feb 5, 2019, at 11:59 AM, Morris, Mark  wrote:
 
 I’m on Eclipse 4.6 and it’s working fine, but a few of my coworkers are on 
 Eclipse 4.7 and are very happy with it. (We all use WOLips.)
 
 Coincidentally I just downloaded Eclipse 2018-12 yesterday to give it a 
 try sometime in the next week or so. Anyone try this yet?
 
 Regards,
 Mark
 
 From: Webobjects-dev 
  on 
 behalf of Aaron Rosenzweig 
 Date: Tuesday, February 5, 2019 at 11:41 AM
 To: John Pollard 
 Cc: WebObjects Development 
 Subject: Re: Advice on whether to upgrade Eclipse / WOLips from Eclipse 
 Mars 4.5
 
 Hi John, I’m on Eclipse 4.6 and it is ok. I have not tried 4.7 with WO. 
 
 Newer Eclipse can sometimes bring better debugging and general Java 
 goodness but other than that… 
 
 If you are reasonably happy, I wouldn’t switch. 
 
 I guess for giggles and grins you could try out 4.7 and see how it goes. 
 AARON ROSENZWEIG / Chat 'n Bike
 e:  aa...@chatnbike.com  t:  (301) 956-2319
 
 
 
 
 
 
 
 On Feb 5, 2019, at 5:08 AM, John Pollard  wrote:
 
 Hi list,
 
 My last update of Eclipse/WOLips was in 2015 and I am on Eclipse Mars 
 4.5.2 + wolips / subclipse and all works fine.
 
 Should I move up (to Eclipse/WOLips 4.7?) or not much reason to do so?
 
 Many thanks for your advice,
 
 John
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com
 
 This email sent to aa...@chatnbike.com
 
 ___
 Do not post admin requests to the list. They will be ignored.
 Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/webobjects-dev/listfez%40dakri.com
 
 This email sent to list...@dakri.com
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/tedpet5%40yahoo.com
>>> 
>>> This email sent to tedp...@yahoo.com
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/lists%40thetimmy.com 
>> 
>> 
>> This email sent to li...@thetimmy.com 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> )
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:

Re: ERRest should return own content type

2019-01-31 Thread Samuel Pelletier
Hi André,

The mime is hard coded in the ERXXmlRestWriter.

Officially, text/xml and application/xml are valid, do you really need to 
change it ?

You can probably write a subclass of ERXXmlRestWriter and override only the 
public String contentType() method to return your desired mime and register the 
class like this:

ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new YouXMLWirter(), 
new ERXRestFormatDelegate(), ERXRestFormat.XML_KEY, "application/xml", 
"text/xml");

Regards,

Samuel


> Le 31 janv. 2019 à 18:48, André Rothe  a écrit :
> 
> Hi,
> 
> I'm playing around with ERRest. I have some routes, which return data as XML. 
> The content-type of the HTTP response is always text/xml, I try to change it 
> to application/xml, but it seems not to work with setHeader() on the 
> WOActionResult.generateResponse(). How I can set the header?
> 
> Thank you
> André
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Enterprise objects stored in JSON or byte

2018-12-19 Thread Samuel Pelletier
Hi Mark,

I've done dynamic forms in the past (in PHP and WO) and never tried to map them 
to an ORM entity. I think it is better to model your a Form entity and another 
one for answers (FilledForm or CompletedForm). The Form entity is the Meta 
model with the questions and the other contains only answers. You end with 2 
symmetric hierarchies with one answer class for each question type class 
(numeric, text, choice, boolean, image, ...). Each of the Answer class has it's 
edit component.

The display form component is build by displaying the proper edit component for 
each answer in order. For easy D2W integration, I think you can initialize a 
new form  with blank answers and simply use the D2W magic to display the 
complete form (using an ordered toMany from the CompletedForm entity to it's 
answers) .

Regards,

Samuel


> Le 19 déc. 2018 à 10:39, Mark Wardle  a écrit :
> 
> I want to define a group enterprise objects at runtime and yet use them in a 
> fairly similar way to "normal" enterprise objects. 
> 
> Essentially, I want a generic object that is backed by a NSDictionary (or 
> other persistence mechanism like bytes/protobuf) and has a defined behaviour 
> class. I would like to define the model at runtime rather than using 
> EOModeler. The definition of the object (list of properties and for each 
> property: name, dataType, class, prototype etc.) defined itself at runtime in 
> the backing database. 
> 
> Anyone done something similar, and if so, what is the best approach? I have 
> contemplated building a generic EO that delegates its behaviour and data to 
> the behaviour class and the backing NSDictionary respectively, and alters the 
> implementation of KVC to make it fairly transparent. I'm aware that some of 
> the hidden "magic" that comes from defining an object in EOModeler might be 
> lost. 
> 
> Any hints/tips gratefully received!
> 
> Best wishes,
> 
> 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: jrebel ???

2018-10-31 Thread Samuel Pelletier
DCEVM for Java 10 is into the OpenJdk Project. 

The problem I see is the support for open jdk on Mac. A rapid search seems to 
indicate that Homebrew 

Oracle seems to move Java into paid services, it is maybe the time to try Open 
jdk...

Is there any known problems with Open JDK and WO ?

Samuel


> Le 30 oct. 2018 à 17:56, Theodore Petrosky  a écrit :
> 
> is anyone using JRebel in their WO environment?
> 
> what about DCEVM? has it been updated to handle the updates to Java?
> 
> Lookin' for info.
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Migrations and Prototypes Question

2018-10-21 Thread Samuel Pelletier
Hi Tim,

I have the same problem with FrontBase and found where the code is but never 
tried to fix it.

If I remember correctly, the code you are looking for is in the WOLips eclipse 
plugin in the EOModeler module. I do not think it would be really hard to fix 
but I do not have a working setup for WOLips development.

Samuel


> Le 19 oct. 2018 à 16:08, Tim Worman  a écrit :
> 
> I’ve got a conundrum and I’m hoping someone can help with it.
> 
> My model has some date value attributes defined in an entity (not timestamp). 
> In one case I’m using the ‘date’ prototype and in another I’m testing the 
> ‘javaLocalDate’ prototype. When using these prototypes, all the value 
> conversions, etc., in the model are correct. They work. But I’ve always been 
> really flummoxed that migrations will never set the external fields as ‘date’ 
> types in the target database.
> 
> So, I’ve been digging in to try and get to the bottom of it.
> 
> My databases (OpenBase and MySQL) both support ‘date’ types. In my Wonder 
> version, OpenBase and MySQL plugins support the more modern 
> EOSchemaSynchronizationFactory and in both cases the proper synchronization 
> factory is initialized when needed.
> 
> I’m overriding createTableStatementsForEntityGroup(NSArray entities)…
> 
> Good, I have entities here...but when I log out the entities (and 
> attributes), none of the metadata about the attributes’ prototypes, value 
> conversions, etc., that appear in Entity Modeler are there - in other words I 
> have no way to capture the data type and override the external type that is 
> being sent to the database. When I log them out, all of the types are set to 
> NSTimestamp.
> 
> Does anyone have any clues, tips, (or just hazard signs) that they can share 
> for why I’m finding this impossible?
> 
> Tim
> UCLA GSE
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: javascript popup menu for a grid

2018-10-06 Thread Samuel Pelletier
Hi Aaron,

SPA app is something I will certainly use sometime in the future but there are 
some challenges with data freshness and complex business logic I expect.

EOF change propagation inside an app is very cool and a simple refresh of html 
make sure the user see ups to data data. 

I finally found a way to get a good compromise using AjaxInPlace with a 
position: absolute editor and a small script to adjust it's position (my table 
is inside a scrolling div)

Here is a table cell content:


d1003444Edit = AUL.updateFunc('d1003444', {}, 
'6.0.1.13.5.0.1.2.0.0.1.7.40584489.3.54916483.1.2.1.1.2');






AUC.register('d1003444');


The editor script that adjust the DIV top and hide the tooltip that may be 
displayed :
erxToolTip.hide();
editorTop = jQuery('#d1005038').offset().top - 
jQuery('#d1005038').offsetParent().offset().top;
jQuery('#d1005038 .floatingEditor')[0].style.top = editorTop + 'px'

I had to fix a problem in erxToolTip.hide() function that raised an error when 
no tooltips had been displayed.

The overhead is not bad, the d is an id from the displayed entity primary 
key.

Regards,

Samuel


> Le 4 oct. 2018 à 21:26, Aaron Rosenzweig  a écrit :
> 
> Hi Samuel,
> 
> If I understand your concerns:
> 
> 1) Do not want lots of DOM elements - would slow down the tablet / computer.
> 
> 2) Do not want WO to deliver a huge HTML either - likewise don’t want to use 
> the Wonder ajax components.
> 
> Then what you need is a single page app (SPA) that sends individual calls to 
> the server (either Direct Actions or REST routes which are close cousins). 
> 
> We have been using ENYO to do something like this where you click on a div 
> and then it morphs into something else then after you make your selection it 
> returns the DOM back to a single div. ENYO also has the ability to have 
> infinite scrollable lists of thousands of objects because it dynamically 
> brings them into the DOM and discards the others. 
> 
> React and Angular could also do this.
> 
> Polymer too.
> 
> There is a learning curve.
> 
> ENYO never made mainstream but I like it the most. The masterminds left and 
> started Polymer at Google but it isn’t the same. You don’t do any HTML with 
> Enyo and you have the cool Ares IDE written in Enyo. I’m sure Angular is nice 
> (v1 or v2) but it didn’t connect with me. React works but you are hand coding 
> HTML… at least it is in one JS file. React also doesn’t have UI widgets, you 
> have to make those yourself. 
> 
> In one of our projects we had very dynamic forms and too much going on. 
> Really put a strain on our servers. Now we let the client do the heavy 
> lifting and when the data is done we send it back home and validate it. Works 
> much better for high volume / lots of interactivity because you aren’t asking 
> WO to make the UI… only vend data. 
> AARON ROSENZWEIG / Chat 'n Bike <http://www.chatnbike.com/>
> e:  aa...@chatnbike.com <mailto:aa...@chatnbike.com>  t:  (301) 956-2319
>   
> 
>> On Oct 4, 2018, at 5:40 PM, Samuel Pelletier > <mailto:sam...@samkar.com>> wrote:
>> 
>> Hi all,
>> 
>> I want to build a grid of resource availability with a coloured status for 
>> each cell and allow fast editing of each cell status. I would like to 
>> display a popup with the status choices when the user click on a cell and 
>> get the selection back.
>> 
>> This grid will contains few hundred cells so I do not want to create the 
>> popup content for each cell. I would like to use some javascript to build 
>> the popup content and display it at the expected location when the user 
>> click a cell and pass enough information to retrace the edited cell.
>> 
>> I can easily find drop down libraries but they all seems intended for page 
>> navigation without hook required to pass data and handle the selection.
>> 
>> Is there a library with such module available ?
>> 
>> Thanks,
>> 
>> Samuel
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> <mailto:Webobjects-dev@lists.apple.com>)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com 
>> <https://lists.apple.com/mailman/options/webobjects-dev/aaron%40chatnbike.com>
>> 
>> This email sent to aa...@chatnbike.com
> 

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

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


javascript popup menu for a grid

2018-10-04 Thread Samuel Pelletier
Hi all,

I want to build a grid of resource availability with a coloured status for each 
cell and allow fast editing of each cell status. I would like to display a 
popup with the status choices when the user click on a cell and get the 
selection back.

This grid will contains few hundred cells so I do not want to create the popup 
content for each cell. I would like to use some javascript to build the popup 
content and display it at the expected location when the user click a cell and 
pass enough information to retrace the edited cell.

I can easily find drop down libraries but they all seems intended for page 
navigation without hook required to pass data and handle the selection.

Is there a library with such module available ?

Thanks,

Samuel
 ___
Do not 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: in which EO behalf a ValueFactory works?

2018-08-23 Thread Samuel Pelletier
Hi OC,

The ValueFactory methods are not well suited for you need. You want to create a 
child relationship serialized in the parent object, not a simple storage for 
basic container.

I suggest you try something like this with the model attribute for the 
serialized content named attributeBlob with a NSData type:

- Implement a method public NSData _attributeBlob() that will returns the 
serialized attribute.

- Implement a method public void _setAttributeBlob(NSData data) that will 
unserialize your blob to an instance variable with the back link to it's parent.

- Add a getter for the real attribute object like public MyCustomObject 
attribute()

- In the attribute object add a call to willChange() on the parent EO in method 
that mutate the object.

EOF will uses the method with an '_' during fetch and save if they exists 
(StoredValueForKey: protocol) so you can uses theses for your encoding 
decoding. The call to willChange() will add the object in the EOEditingContext 
changed objects.

I've done something similar without the backlink part in the past.

Regards,

Samuel


> Le 22 août 2018 à 13:31, ocs@ocs  a écrit :
> 
> Hi there,
> 
> quite unrelated to the other things, I would need to exploit the 
> ValueFactory/ValueConversion support of EOF to store my own complex values in 
> BLOBs.
> 
> There's a catch though: for a ValueFactory-generated object, I would need to 
> know which EO it belongs to (so that, iff the object's own internal state 
> changes, it can change the EO contents appropriately).
> 
> Is there any way to do that?
> 
> If important, here's the rationale: so far, I have used two distinct 
> attributes, conceptually like this:
> 
> ===
> class DBSomething extends ERXCustomObject {
>   NSData attributeBlob() { storedValueForKey("attributeBlob") } // modelled. 
> Never used directly, but for the cases below
>   MyCustomObject attribute() { new 
> MyCustomObject(attributeBlob,this,"attributeBlob") }
> }
> class MyCustomObject {
>   MyCustomObject(NSData contents, ERXEnterpriseObject owner, String key) {
> ... ...
> NSData blobRepresentation() { ... ... }
> void didChange() { owner.takeStoredValueForKey(blobRepresentation(), key) 
> }
> }
> ===
> 
> but it seems to me it would be cleaner if I could defer creation of 
> MyCustomObject to the ValueFactory, storing the changes to the 
> ValueConversion, and get rid of the ugly dichotomy of foo and fooBlob, 
> removing fooBlob completely and seeing only foo (of type MyCustomObject) at 
> the code level.
> 
> Thanks and all the best,
> OC
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: EOF bug?

2018-08-13 Thread Samuel Pelletier
Mark,objectsNoCopy() is declared in NSArray so all subclasses should have a working implementation.It is very risky to subclass and try to reimplement the basic functionality,you need to make sure the subclass conform to all the superclass behaviour past, present and future...  Interface are there for multiple implementations abstraction.I attached my version of the java source to put in ERExtension in the cone.webobjects.eoaccess package.Regards,SamuelLe 13 août 2018 à 13:51, Morris, Mark <mark.mor...@experian.com> a écrit :Just a little more info I discovered. This appears to have hit a subtle implementation problem with NSMutableArray. Its implementation of addObjectsFromArray() uses a protected method, objectsNoCopy(), on the *argument* array, not on *this* array. That seems to me to break the contract of “protected”. The argument array could be a different subclass, with a different implementation, and, based on the documentation, might not even implement objectsNoCopy(). So even if the writers of _EOExpressionArray had reimplemented NSMutableArray as required by the documentation (which they didn’t), this bug would have still surfaced due to the architecture issue in NSMutableArray’s implementation. -- Mark From: Webobjects-dev <webobjects-dev-bounces+mark.morris=experian@lists.apple.com> on behalf of "Morris, Mark" <mark.mor...@experian.com>Date: Monday, August 13, 2018 at 12:30 PMTo: Samuel Pelletier <sam...@samkar.com>Cc: "webobjects-dev@lists.apple.com" <webobjects-dev@lists.apple.com>Subject: Re: EOF bug? Hi Samuel, Yes, I considered suggesting the route of removing _array, but I was concerned that they went that way for a reason, although I can’t imagine what that would be. Like you said, it seems like a very odd choice. Yes, we compile our Wonder frameworks, so the file would be great. Thanks for looking into this! Regards,Mark  From: Samuel Pelletier <sam...@samkar.com>Date: Monday, August 13, 2018 at 12:09 PMTo: "Morris, Mark" <mark.mor...@experian.com>Cc: "webobjects-dev@lists.apple.com" <webobjects-dev@lists.apple.com>Subject: Re: EOF bug? Mark,  OK, I see, _EOExpressionArray is a very bad exemple of inheritance... pretending to be a NSMutableArray but in fact using a NSMutableArray and implement some parts of it. I do not see an easy way to patch this except by adding another fixed reimplemented class in ERExtensions.  I reimplemented it by removing the _array member and adjusting the Clone method. Just adding the objectsNoCopy() will not solve other NSMutableArray method mis behaviours.  Either the class is really a NSMutableArray or should not extend it and only the implemented methods will exists. With the current situation where we do not compile the WO frameworks, I think adjusting the hierarchy is not possible. Here is my Clone method. All references to _array including methods that only forwarded the call are removed. public Object clone(){_EOExpressionArray aCopy = new _EOExpressionArray(_prefix, _infix, _suffix);aCopy.addObjectsFromArray(this);return aCopy;} Do you compile your wonder frameworks ? If you do, I will send you the java file or you can create it yourself. Regards, Samuel Le 13 août 2018 à 10:23, Morris, Mark <mark.mor...@experian.com> a écrit : Hi Samuel, Thanks for the response! Sorry, it was a long night. The problem does indeed occur when objectsNoCopy() returns null, even though there are objects in the EOExpressionArray. However, the method directly in EOAttribute is actually addObjectsFromArray(), which calls objectsNoCopy() in its implementation. Regards,Mark From: Samuel Pelletier <sam...@samkar.com>Date: Monday, August 13, 2018 at 6:31 AMTo: "Morris, Mark" <mark.mor...@experian.com>Cc: "webobjects-dev@lists.apple.com" <webobjects-dev@lists.apple.com>Subject: Re: EOF bug? Hi Mark,  I checked my version of EOAttribute and was unable find call to objectsNoCopy() in the code. I checked the WO and ERAttributeExtension versions of the class. Are you on an older version of WO ? Samuel Le 13 août 2018 à 05:32, Morris, Mark <mark.mor...@experian.com> a écrit : Hi all, After much time and effort, I’ve traced a problem in my code to what appears to be a bug in EOF’s _EOExpressionArray. Let me state first that we’re way behind in our Wonder version, so it’s possible that Wonder has fixed this already, but a quick search didn’t find it. (We’re planning to catch up to current in the next few months.) The problem seems to stem from the fact that _EOExpressionArray extends NSMutableArray, but it doesn’t reimplement objectsNoCopy(). This is a problem, because _EOExpressionArray uses it’s own internal array, not the superclass’s. There’s a critical point in EOAttribute._normalizeDefinitionPath() where objectsNoCopy() is called but returns null, even though the _EOExpressionArray has elements, because it’s r

Re: EOF bug?

2018-08-13 Thread Samuel Pelletier
Mark,

OK, I see, _EOExpressionArray is a very bad exemple of inheritance... 
pretending to be a NSMutableArray but in fact using a NSMutableArray and 
implement some parts of it.

I do not see an easy way to patch this except by adding another fixed 
reimplemented class in ERExtensions. 

I reimplemented it by removing the _array member and adjusting the Clone 
method. Just adding the objectsNoCopy() will not solve other NSMutableArray 
method mis behaviours. 

Either the class is really a NSMutableArray or should not extend it and only 
the implemented methods will exists. With the current situation where we do not 
compile the WO frameworks, I think adjusting the hierarchy is not possible.

Here is my Clone method. All references to _array including methods that only 
forwarded the call are removed.

public Object clone()
{
_EOExpressionArray aCopy = new _EOExpressionArray(_prefix, 
_infix, _suffix);
aCopy.addObjectsFromArray(this);
return aCopy;
}

Do you compile your wonder frameworks ? If you do, I will send you the java 
file or you can create it yourself.

Regards,

Samuel


> Le 13 août 2018 à 10:23, Morris, Mark  a écrit :
> 
> Hi Samuel,
>  
> Thanks for the response!
>  
> Sorry, it was a long night. The problem does indeed occur when 
> objectsNoCopy() returns null, even though there are objects in the 
> EOExpressionArray. However, the method directly in EOAttribute is actually 
> addObjectsFromArray(), which calls objectsNoCopy() in its implementation.
>  
> Regards,
> Mark
>  
> From: Samuel Pelletier 
> Date: Monday, August 13, 2018 at 6:31 AM
> To: "Morris, Mark" 
> Cc: "webobjects-dev@lists.apple.com" 
> Subject: Re: EOF bug?
>  
> Hi Mark, 
>  
> I checked my version of EOAttribute and was unable find call to 
> objectsNoCopy() in the code. I checked the WO and ERAttributeExtension 
> versions of the class.
>  
> Are you on an older version of WO ?
>  
> Samuel
>  
> 
> 
> Le 13 août 2018 à 05:32, Morris, Mark  <mailto:mark.mor...@experian.com>> a écrit :
>  
> Hi all,
>  
> After much time and effort, I’ve traced a problem in my code to what appears 
> to be a bug in EOF’s _EOExpressionArray.
>  
> Let me state first that we’re way behind in our Wonder version, so it’s 
> possible that Wonder has fixed this already, but a quick search didn’t find 
> it. (We’re planning to catch up to current in the next few months.)
>  
> The problem seems to stem from the fact that _EOExpressionArray extends 
> NSMutableArray, but it doesn’t reimplement objectsNoCopy(). This is a 
> problem, because _EOExpressionArray uses it’s own internal array, not the 
> superclass’s. There’s a critical point in 
> EOAttribute._normalizeDefinitionPath() where objectsNoCopy() is called but 
> returns null, even though the _EOExpressionArray has elements, because it’s 
> referencing the superclass array instead of the one local to 
> _EOExpressionArray.
>  
> Has anyone seen this? Has it been patched? Thanks!
>  
> Regards,
> Mark
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> <mailto:Webobjects-dev@lists.apple.com>)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.apple.com_mailman_options_webobjects-2Ddev_samuel-2540samkar.com=DwMFaQ=BNNF-YNv0CLLslhP2Bcx5Q=R0ZqsewJs3eSJk7vLCqZv0r5kJlLXQLnGTeg9t8MlqA=AdvAfKTkUyccvBpaKhr9GvlfY3653NxMU8J5XO6ue2A=yDB_Rzh491N9j7il8RMpWcTkZo6Q_-nHy8gitXhx_28=>
> 
> This email sent to sam...@samkar.com <mailto:sam...@samkar.com>
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: EOF bug?

2018-08-13 Thread Samuel Pelletier
Hi Mark,

I checked my version of EOAttribute and was unable find call to objectsNoCopy() 
in the code. I checked the WO and ERAttributeExtension versions of the class.

Are you on an older version of WO ?

Samuel


> Le 13 août 2018 à 05:32, Morris, Mark  a écrit :
> 
> Hi all,
>  
> After much time and effort, I’ve traced a problem in my code to what appears 
> to be a bug in EOF’s _EOExpressionArray.
>  
> Let me state first that we’re way behind in our Wonder version, so it’s 
> possible that Wonder has fixed this already, but a quick search didn’t find 
> it. (We’re planning to catch up to current in the next few months.)
>  
> The problem seems to stem from the fact that _EOExpressionArray extends 
> NSMutableArray, but it doesn’t reimplement objectsNoCopy(). This is a 
> problem, because _EOExpressionArray uses it’s own internal array, not the 
> superclass’s. There’s a critical point in 
> EOAttribute._normalizeDefinitionPath() where objectsNoCopy() is called but 
> returns null, even though the _EOExpressionArray has elements, because it’s 
> referencing the superclass array instead of the one local to 
> _EOExpressionArray.
>  
> Has anyone seen this? Has it been patched? Thanks!
>  
> 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Long responses, without a session?

2018-05-29 Thread Samuel Pelletier
Mark,

That's a good solution if your long running task execution time is within your 
adaptor read timeout.

Samuel


> Le 29 mai 2018 à 06:02, Mark Wardle  a écrit :
> 
> Thanks Samuel. Perhaps I should do this purely in the browser in JS and hit a 
> REST endpoint and then pass a ticket to a WO DA when I know credentials are 
> correct. 
> 
> Mark
> 
> On Thu, 24 May 2018 at 22:39 Samuel Pelletier  <mailto:sam...@samkar.com>> wrote:
> Hi Mark,
> 
> I've never done that with WO but it is possible to return partial data to the 
> browser and have it rendered bi using chunked response. I do not know if it 
> is possible to force WO to flush the response content to the client and keep 
> adding content after...
> 
> If you can validate that the request is from a human and look valid, you may 
> defer the session creation after this validation and have a quick response 
> for failure.
> 
> Otherwise, just create session with very short lifespan like 5 minutes with 
> setTimeOut(5*60) in the session constructor and adjust it after the 
> successful logon with WOSessiion.setTimeOut(3*3600); // for 3 hours
> 
> I now tend to add an AjaxPing to my wrapper and use shorter session.
> 
> Regards,
> 
> Samuel
> 
> 
> > Le 24 mai 2018 à 17:18, Mark Wardle  > <mailto:m...@wardle.org>> a écrit :
> > 
> > Hi all,
> > 
> > I am cleaning up some code and identifying some long-acting responses that 
> > sometimes take 2-3 seconds because they call external services over a 
> > network. I'd like to turn them into long responses to show users that 
> > something is happening and also prevent alerts in my log files. One of the 
> > sometimes slow actions is logging in via a KDC.
> > 
> > I have found ERXLongResponse which looks as if it will do the trick but it 
> > is unclear to me whether this will work for user login. My landing page 
> > using exclusively direct actions to prevent inadvertent session creation. 
> > Is there a way of running a long response task without creating a session?
> > 
> > Many thanks,
> > 
> > Mark
> > 
> > ___
> > Do not post admin requests to the list. They will be ignored.
> > Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> > <mailto:Webobjects-dev@lists.apple.com>)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> > <https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com>
> > 
> > This email sent to sam...@samkar.com <mailto:sam...@samkar.com>
> 

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

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


Re: Long responses, without a session?

2018-05-24 Thread Samuel Pelletier
Hi Mark,

I've never done that with WO but it is possible to return partial data to the 
browser and have it rendered bi using chunked response. I do not know if it is 
possible to force WO to flush the response content to the client and keep 
adding content after...

If you can validate that the request is from a human and look valid, you may 
defer the session creation after this validation and have a quick response for 
failure.

Otherwise, just create session with very short lifespan like 5 minutes with 
setTimeOut(5*60) in the session constructor and adjust it after the successful 
logon with WOSessiion.setTimeOut(3*3600); // for 3 hours

I now tend to add an AjaxPing to my wrapper and use shorter session.

Regards,

Samuel


> Le 24 mai 2018 à 17:18, Mark Wardle  a écrit :
> 
> Hi all,
> 
> I am cleaning up some code and identifying some long-acting responses that 
> sometimes take 2-3 seconds because they call external services over a 
> network. I'd like to turn them into long responses to show users that 
> something is happening and also prevent alerts in my log files. One of the 
> sometimes slow actions is logging in via a KDC.
> 
> I have found ERXLongResponse which looks as if it will do the trick but it is 
> unclear to me whether this will work for user login. My landing page using 
> exclusively direct actions to prevent inadvertent session creation. Is there 
> a way of running a long response task without creating a session?
> 
> Many thanks,
> 
> 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Bug in NSArray et. al. ?

2018-05-14 Thread Samuel Pelletier
Hi Markus,

There is already an array operator defined in Wonder for isEmpty: @isEmpty

With the current NSArray key value coding handling, there is only a single 
exception to the rule that pass the key to array values, it is for the "count" 
key.

There is already 2 way to get the if "array.isEmpty" : by using aor by using  
and there is an ERXKey for this operator like Contact.ADDRESSES.atIsEmpty().

I think adding this exception could make thing more clear and I do not thing 
there would be code break, an array of boolean for the emptiness of a array 
inside does not seem very useful unlike an array of real values...

But as there is already other ways to achieve the same result, I vote to keep 
thing as is.

Regards,

Samuel

> Le 14 mai 2018 à 08:17, Markus Ruggiero  a écrit :
> 
> 
>> On 14 May 2018, at 12:17, Johann Werner  wrote:
>> 
>> Hi Markus,
>> 
>> aligning isEmpty to mimic count in KVC context is a logic step but I would 
>> advise against it as changing that behavior could silently break code of 
>> many projects.
>> 
>> A far better implementation could have been to route all KVC calls to the 
>> NSArray object itself and introduce something like @items if you want the 
>> KVC to evaluate on every contained item. At least that would be more 
>> expressive.
>> 
>> jm2c
>> 
>> jw
>> 
> 
> 
> Valid point. 
> 
> I have long ago fixed this once in my WonderSources and used this in my 
> Learning The Wonders book. Of course, this was a mistake on my side (or maybe 
> just an "oversight"). But just the other day I got a mail from someone 
> working through the book and getting stuck on isEmpty (example at end of 
> chapter 11)
> 
> For the time being I'll go with my private patch. Maybe others have different 
> viewpoint.
> 
> ---markus---
> 
>> 
>>> Am 14.05.2018 um 10:54 schrieb Markus Ruggiero :
>>> 
>>> NSArray implements java.util.List
>>> This interface specifies the method boolean isEmpty() and NSArray correclty 
>>> implements it.
>>> 
>>> Unfortunately key-value-coding does not know about this. When using isEmpty 
>>> in a binding (eg. WOConditional) the key "isEmpty" is not trapped but 
>>> passed on to all the objects. 
>>> 
>>> isEmpty should be trapped in NSArray.java in the same way count() is 
>>> handled.
>>> 
>>> What do you think? 
>>> 
>>> ---markus---
>> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Looking towards JDK 9, 10

2018-04-30 Thread Samuel Pelletier
Hi Paul,

The actual situation of Java is not clear. Java 9 is already end of life and 10 
will be before Java 8. Java 8 that will be supported at least until next 
January and also until December 2020 but we do not know the details about the 
later date...

See this page full of "more details will be coming... " 
http://www.oracle.com/technetwork/java/eol-135779.html

The next real version seem to be 11 but it is not available yet.

Anyone have tried to compile with a newer version ?

Samuel



> Le 30 avr. 2018 à 07:11, Paul Hoadley  a écrit :
> 
> Hello,
> 
> Just out of curiosity, has anyone experimented with migration to JDK 9 or 10? 
> There are a handful of usages of internal APIs in both the WebObjects JARs, 
> as well as ERExtensions and ERProfiling. (Some of those would be easily 
> replaced in Wonder, and jdeps gives alternatives. I take it Signal and 
> SignalHandler are still present in JDK 9, though jdeps (from JDK 8) is saying 
> Resource and URLClassPath have been removed, and would need suitable 
> alternatives found. I'm not sure what the path would be for the offending 
> classes in WebObjects.)
> 
> Has anyone looked at this, or is JDK 8 likely to be the end of the road?
> 
> 
> -- 
> Paul Hoadley
> https://logicsquad.net/ 
> https://www.linkedin.com/company/logic-squad/
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: AjaxObserveField does not trigger action

2018-04-25 Thread Samuel Pelletier
Hi,

You should take a look into AjaxExample and AjaxExample2 project. The Dependent 
Lists in AjaxExample demonstrate how to build dependant popups.

I noticed few missing things in your html :

- Your need a woform around your popup. (That may be the cause of your 
javascript error.

- You need to refresh an AjaxUpdateContainer that contains at least your second 
popup and add it's id in the "updateContainerID" binding of the first 
AjaxObserveField if you want the browser to display the updated choices.

With the Ajax framework, the cycle is usually like this :
1- Some user action trigger data to be send to the server (with 
AjaxObserveField or AjaxSubmitButton)
2- A server side action is executed (action binding of 
AjaxObserveField, AjaxSubmitButton, AjaxHyperLink or AjaxUpdateLink)
3- User interface (html) is refreshed to display changes by refreshing 
an AjaxUpdateContainer, AjaxModalDialog or refreshing the page. This may be 
done with the "updateContainerID" binding or in the Java code in Ajax action 
with AjaxUpdateContainer.updateContainerWithID(updateContainerID, context); and 
AjaxModalDialog.update(context, title); or AjaxModalDialog.update(context, 
newContent, title);

A user action may trigger any combinaison of these, you control everything. For 
example, you may uses AjaxObserveField to update server side data and save it 
without refreshing the html. You may want to update server value without saving 
it, refreshing a part of the interface only, ...

Regards,

Samuel

 
> Le 25 avr. 2018 à 04:55, Kenan Esau  a 
> écrit :
> 
> Hi,
> 
> I am trying to update one Popup when another Popup changes. I tried to use 
> this as a template:
> 
> https://www.mail-archive.com/webobjects-dev@lists.apple.com/msg43630.html 
> 
> 
> But I never get that far since the the AjaxObserveField never triggers the 
> action in the underlying java...
> 
> 
> 
>   PopUp:
>   
>   
>   
>   
> 
> 
> Popup1 : WOPopUpButton {
>   id = „popupone";
>   list = allentries;
>   item = aEntry;
>   displayString = aEntry.name
>   selection = selectedEntry
> }
> 
> Popup1Observer : AjaxObserveField {
>   action = popup1Change;
>   id = „popupObserver";
>   observeFieldID = "popupone";
> }
> 
> popup1Change() in the underlying java is never called since there is an error 
> in the java-script on the client-side:
> 
> As soon as I try to use an AjaxObserveField I always get an error in the 
> underlying javascript / prototype.js:6416 whenever I change the value of my 
> first popup
> 
>   getValue: function(element) {
> element = $(element);
> var method = element.tagName.toLowerCase();
> return Form.Element.Serializers[method](element);
>   },
> 
> element.tagname is always ‚undefined‘!?!?!
> 
> Am I doing something wrong? Is there an example I could use for 
> AjaxObserveField and AjaxUpdateContainer?
> 
> 
> Thanks for your Help!
> 
> Kenan
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: downloading large files still not work

2018-04-13 Thread Samuel Pelletier
Hello Andrea,

I searched the adaptor source and the C struct representing a response use 
unsigned variables for the length values.

unsigned content_length;
unsigned content_buffer_size;
unsigned content_read; /* total amount of data read from the instance */
unsigned content_valid; /* amount of valid data in content buffer */

This limits the size to 4 GB.Recent  Apache API seems to use long for content 
length so it should be possible to adjust the struct elements types and method 
signatures.

You can maybe bypass the adaptor for these requests if you can made then 
session less and use sore rewrite in apache.

Regards,

Samuel


> Le 12 avr. 2018 à 05:48, Andreas Hirtzel (H Greenline GmbH) 
>  a écrit :
> 
> Hello list,
>  
> I wonder, that the "file size download limit" problem using http adaptors 
> still exists. I use Microsoft IIS server (Windows 2016) with IIS WebObjects 
> adaptor and be not able to download large files. The adaptor log has two 
> entries
>  
> Debug: Header read: content-length: 7778483298
> Info: content-length was set expl.: 3483516002 <-- !?
>  
> I was also not able to download large files using the Apache WebObjects 
> adaptor. Are there any updates?
>  
> Regards
> Andreas
> ___
> Do not 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: UBUNTU 16.04 MySQL performance

2018-03-13 Thread Samuel Pelletier
Hi Stavros,

I would not expect MySQL to be slower on any Linux, usually, it is the reverse 
situation.

Very long query like this one is probably very io intensive, even 3 second is 
quite long for a query (except for large data set reporting). So I suggest you 
look at these:

- The cpu and io during the fetch. If CPU is low, you are waiting for io. If 
your mac is running a PCI Express SSD, it is probably way faster than the AWS 
storage.

- Your MySQL server setting for memory caches may differ.

- Last and not least, check if your server process is not using more memory 
than your physical (vm allocation). This would generate memory swapping, thus 
using io...

Unless you are fetching a very large number of rows, I would optimize this 
query.

EOF does not play well with long queries.

Regards,

Samuel

> Le 13 mars 2018 à 09:07, Stavros Panidis  a écrit :
> 
> Hi all,
> 
> Recently I tested an app in an AWS Lightsail instance UBUNTU 16.04 server 
> running MySQL 5.7.
> 
> I realised extremely slow performance running queries, comparing to the same 
> exactly database running on a Mac OS X High Sierra. For example a query that 
> is performed within 3 seconds on MAC takes around 3.5 minutes to complete in 
> UBUNTU.
> 
> Database is SNOMED CT (a large medical terms database downloaded from UMLS). 
> MySQL version, database structure and indexes are identical in both servers.
> 
> I understand that has nothing to do with WebObjects but does anyone had a 
> similar experience with MySQL in ubuntu?
> 
> Many thanks in advance
> 
> Stavros Panidis
> stavros.pani...@gmail.com 
> 
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: certficate on wocommunity.org

2018-02-23 Thread Samuel Pelletier
Hi Maik,

No more complaints from Eclipse.

About compatibility, Let's Encrypt works with Java 7 >= 7u111 and Java 8 >= 
8u101 out of the box. For previous versions, the Let's Encrypt root certificate 
need to be added to the Java root store.

Samuel


> Le 23 févr. 2018 à 03:28, Maik Musall <m...@selbstdenker.ag> a écrit :
> 
> Hi Samuel,
> 
> thanks for noticing. I had set up the scripting to upload the entire chain to 
> the load balancer, but apparently it ignores the intermediate in that 
> process. So I now set the intermediate in it's intermediate store, and it 
> seems it's working now.
> 
> I also noticed ssllabs complaining about weak DH parameters. Unfortunately I 
> can't set those per service, and globally setting DH keys longer than 1024 
> would break some sites that rely on connectivity with older clients. But I 
> changed the ciphersuites set in favor of ECDHE instead of DHE, which also 
> solves this. Java 6 could have a problem with this, but I guess (and hope) 
> nobody's still using that to run Eclipse or something.
> 
> I also set a CAA DNS record, and now we've got an A rating :)
> 
> Can you please check if you can access without problems now?  
> 
> Thanks
> Maik
> 
> 
>> Am 23.02.2018 um 01:38 schrieb Samuel Pelletier <sam...@samkar.com 
>> <mailto:sam...@samkar.com>>:
>> 
>> Hi Maik,
>> 
>> I think there is a missing chain cert on the server.
>> 
>> At least Eclipse update refuse to connect to the update site with this error:
>> Unable to read repository at 
>> https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml
>>  
>> <https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml>.
>> Unable to read repository at 
>> https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml
>>  
>> <https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml>.
>> sun.security.validator.ValidatorException: PKIX path building failed: 
>> sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
>> valid certification path to requested target
>> 
>> Checking the ssl config with 
>> https://www.ssllabs.com/ssltest/analyze.html?d=jenkins.wocommunity.org 
>> <https://www.ssllabs.com/ssltest/analyze.html?d=jenkins.wocommunity.org> 
>> reveals that the certificate chain is incomplete.
>> 
>> I do not have problems with browser that either already have it or download 
>> it silently but Java does not seem to like this.
>> 
>> With apache, the chain is added with a config like this:
>> SSLCertificateChainFile "/[...]/letsencrypt/live/[...]/chain.pem"
>> 
>> Samuel
>> 
>> 
>> 
>>> Le 21 févr. 2018 à 11:34, Maik Musall <m...@selbstdenker.ag 
>>> <mailto:m...@selbstdenker.ag>> a écrit :
>>> 
>>> Done.
>>> 
>>> Sorry for the delay, it took a while to figure out how to automate this 
>>> with our load balancers in front of everything terminating the TLS 
>>> connections ;-)
>>> 
>>> Maik
>>> 
>>> 
>>>> Am 21.02.2018 um 08:23 schrieb Maik Musall <m...@selbstdenker.ag 
>>>> <mailto:m...@selbstdenker.ag>>:
>>>> 
>>>> Hi all,
>>>> 
>>>> I just noticed that the TLS certificate on wocommunity.org 
>>>> <http://wocommunity.org/> has expired, and I thought I already had set up 
>>>> letsencrypt so I ignored the warning emails from Comodo. Turns out I had 
>>>> not. So hang on, I will fix this today.
>>>> 
>>>> Maik
>>>> 
>>>> ___
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>>> <mailto:Webobjects-dev@lists.apple.com>)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/maik%40selbstdenker.ag
>>>>  
>>>> <https://lists.apple.com/mailman/options/webobjects-dev/maik%40selbstdenker.ag>
>>>> 
>>>> This email sent to m...@selbstdenker.ag <mailto:m...@selbstdenker.ag>
>>> 
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> <mailto:Webo

Re: certficate on wocommunity.org

2018-02-22 Thread Samuel Pelletier
Hi Maik,

I think there is a missing chain cert on the server.

At least Eclipse update refuse to connect to the update site with this error:
Unable to read repository at 
https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml.
Unable to read repository at 
https://jenkins.wocommunity.org/job/WOLips47/lastSuccessfulBuild/artifact/temp/dist/content.xml.
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
valid certification path to requested target

Checking the ssl config with 
https://www.ssllabs.com/ssltest/analyze.html?d=jenkins.wocommunity.org reveals 
that the certificate chain is incomplete.

I do not have problems with browser that either already have it or download it 
silently but Java does not seem to like this.

With apache, the chain is added with a config like this:
SSLCertificateChainFile "/[...]/letsencrypt/live/[...]/chain.pem"

Samuel



> Le 21 févr. 2018 à 11:34, Maik Musall  a écrit :
> 
> Done.
> 
> Sorry for the delay, it took a while to figure out how to automate this with 
> our load balancers in front of everything terminating the TLS connections ;-)
> 
> Maik
> 
> 
>> Am 21.02.2018 um 08:23 schrieb Maik Musall > >:
>> 
>> Hi all,
>> 
>> I just noticed that the TLS certificate on wocommunity.org 
>>  has expired, and I thought I already had set up 
>> letsencrypt so I ignored the warning emails from Comodo. Turns out I had 
>> not. So hang on, I will fix this today.
>> 
>> Maik
>> 
>> ___
>> Do not 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/maik%40selbstdenker.ag
>>  
>> 
>> 
>> This email sent to m...@selbstdenker.ag
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Property to set the public host of an application

2018-02-20 Thread Samuel Pelletier
Hi list,

Yesterday, I created a pull request to finally fix the problem of creating 
email and url to the app in background tasks where the WOContext does not have 
an URL from the server to know the server name and the WOHost is not a suitable 
server to use in an URL. It is now merged in the master branch.

To use these, simply create a context using
ERXWOContext sessionLessContext = ERXWOContext.newContext();
sessionLessContext.generateCompleteURLs();
String url = sessionLessContext.urlWithRequestHandlerKey(...)

or create a component with ERXApplication.instantiatePage(String pageName) or 
ERMailUtils.instantiatePage() as both will use ERXWOContext.newContext();

Here are the 2 added properties:

## If your WOHost is not your public host name, specify the public host to use 
for complete URL 
## generated without a server request like background tasks that send emails.
# er.extensions.ERXApplication.publicHost=www.yourPublicHost.com
## Set to true to switch default request used in background tasks to https
# er.extensions.ERXApplication.publicHostIsSecure=false

Samuel

 ___
Do not 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: Any ideas for movable/draggable AjaxModalDialog?

2018-02-20 Thread Samuel Pelletier
Hi Markus,

I was curious about this and it is easy and cool. I just sent a pull request 
for this change. You can see the changes here:

https://github.com/wocommunity/wonder/pull/852/files

BTW, I alway use a custom modal box.js file with default slideDownDuration and 
slideUpDuration set to 0 because the default 0.5 second delay seem an eternity 
for me. Is there anyone else that feel like this about these delay ?

Regards,

Samuel


> Le 20 févr. 2018 à 05:28, Markus Ruggiero  a écrit 
> :
> 
> I am using AjaxModalDialog successfully in my Wonder7 app. The other day the 
> customer asked whether it was possible to move / drag the dialog window. It 
> is not a necessity but would be great. I have not found anything in 
> AjaxModalDialog that suggest this capability. Anyone knows how to do this?
> 
> Thanks
> ---markus---
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: ER.Rest - 405 Status on preflight

2018-01-22 Thread Samuel Pelletier
Hi Raymond,

405 is not a CORS problem, those are displayed as error in the browser as not 
authorized (or something similar) and the real GET, POST or PUT request is 
never issued to the app. The preflight usually issue a OPTION request to get 
the headers.

You should begin by identifying the exact request that return the 405. If you 
enable web inspector in your browser, you should see the request and response 
in the Network pane. Check the request url, method and header sent.

Next step if to identify if your app routes handle this request. It would 
probably be helpful to trace the request with ERRest source code in Eclipse.

The current ERRest default routes handle the options request by returning the 
values in the properties. If you added your routes manually, you may need to 
add one for the OPTIUONS method.

Regards,

Samuel




> Le 22 janv. 2018 à 03:12, Raymond NANEON  a écrit :
> 
> Hi,
> 
> I want to use my WO app as API for my angular webApp that's means I'm in CORS 
> situation and server side I add this attributes in properties :
> 
> ERXRest.accessControlAllowOrigin=*
> ERXRest.allowWindowNameCrossDomainTransport=true
> ERXRest.allowJSONP=true
> 
> But When I try GET from my webApp, the preflight send me 405 status
> 
> ERROR er.rest.routes.ERXRouteController  - Request failed: - 405
> 
> How to avoid this error on preflight?
> 
> Thanks a lot for help
> 
> 
> Envoyé depuis iCloud
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Fighting with Ajax Modal Dialogs et.al.

2017-12-12 Thread Samuel Pelletier
Markus,

I think you just stick too much on the textfield part... Suppose you just want 
to display the selected address in a string instead (and then replace the 
string by a textfield).

The tricky part is to refresh the form with the selected address information 
added to it. You could do some javascript or update the server state and 
refresh the form. I prefer to update the server and refresh. Are you familiar 
with AjaxUpdateContainer and AjaxObserveField ? In my recent apps, I tend to 
autosave almost everything on each field update so users never loose change 
because a save button was forgot.

Samuel


> Le 12 déc. 2017 à 12:22, Markus Ruggiero <mailingli...@kataputt.com> a écrit :
> 
> Samuel,
> 
> can you imagine? I am even more confused right now because I think I 
> understand what you're telling me --- but then I am not able to make sense of 
> it and adapt it to my problem.
> 
> Can you/someone else create a minimalistic complete demo that shows exactly 
> how to do the following:
> 
> in html:
> 
> <... wo form ... >
> .
>  [button or link here to open 
> a modal dialog]
> 
> <... end wo form ... >
> 
> 
> in wod:
> shippingAddressTextfield : WOTextField { value = currentObject.address; }
> 
> 
> The modal dialog shows a tablular list of ShippingAddresses, each 
> ShippingAddress has additional fields to help the user pick the right one. 
> There is a button or link besides each row to pick that particular one.
> The contents of the dialog should preferably be generated by a separate 
> component, but I can also do it right inside the main component if that was 
> simpler to do.
> 
> When the user picks one of the address rows the dialog should close and the 
> address string should be put into the text field (possibly just putting it 
> there as if the user had typed it himself)
> There should be a way to dismiss the dialog without picking anything.
> When the user selects a ShippingAddress the textfiels should not be editable 
> anymore
> Particularly great would be to not only show the selected address but do a 
> currentObject.addObjectToBothSidesOfRelationshipWithKey(selectedShippingAddress,
>  CustomerRequest.SHIPPING_ADDRESS_KEY); This would require the dialog 
> component to have the currentObject passed to it somehow. How to do this?
> 
> I know how to do some of these things with plain javascript but then I have 
> no idea how to integrate with WO. So I started to look into Ajax.framework 
> and studied the AjaxExamples. This didn't help but confuses me even more as 
> the examples just show how some components are being used but there is no 
> explanation of the underlying concepts and how to solve a problem with these 
> things.
> 
> Thanks a lot
> ---markus---
> 
> 
>> On 12 Dec 2017, at 13:32, Samuel Pelletier <sam...@samkar.com 
>> <mailto:sam...@samkar.com>> wrote:
>> 
>> Markus,
>> 
>> I have a very similar implementation is an app where a new user is added by 
>> selecting a contact.
>> 
>> In my UsagerList component where I have the new user function I have this in 
>> my html file:
>> 
>> > width = "800" title = "$localizer.UsagerList.button.ajouterUsager" class = 
>> "tiny button" style = "margin-bottom:0;">
>>  > "$addUsager"/>
>> 
>> 
>> > action = "$editItem" dialogId = "usagerEditor" 
>> >Éditer
>> 
>> The add button open the modal that display my ContactSelector component with 
>> 2 bindings. The selectedContact will contain the selected contact (an object 
>> of my Contact entity) and the selectAction will be performed upon selection.
>> 
>> In my UsagerList java class, I have apublic WOActionResults 
>> addUsager() method that create or edit a user for this contact in a modal 
>> dialog. In your case, just put the value in the desired attribute of your 
>> edited object and close the displayed modal dialog by calling 
>> AjaxModalDialog.close(context()); For your situation, I would add the to the 
>> closeUpdateContainerID = "editor" AjaxModalDialog bindings to refresh the 
>> form and show the selection to the user.
>> 
>> 
>> public WOActionResults addUsager() {
>>  EOEditingContext ec = ERXEC.newEditingContext();
>>  Usager usager = Usager.fetchUsager(ec, 
>> Usager.CONTACT.eq(selectedContact().localInstanceIn(ec)));
>>  if (usager != null) {
>>  setEditedItem(usager);
>>  AjaxModalDialog.open(context(), "usagerEditor", 
>> localizer().localizedStringForKeyWithDefa

Re: Fighting with Ajax Modal Dialogs et.al.

2017-12-12 Thread Samuel Pelletier
Markus,

I have a very similar implementation is an app where a new user is added by 
selecting a contact.

In my UsagerList component where I have the new user function I have this in my 
html file:





Éditer

The add button open the modal that display my ContactSelector component with 2 
bindings. The selectedContact will contain the selected contact (an object of 
my Contact entity) and the selectAction will be performed upon selection.

In my UsagerList java class, I have a   public WOActionResults addUsager() 
method that create or edit a user for this contact in a modal dialog. In your 
case, just put the value in the desired attribute of your edited object and 
close the displayed modal dialog by calling AjaxModalDialog.close(context()); 
For your situation, I would add the to the closeUpdateContainerID = "editor" 
AjaxModalDialog bindings to refresh the form and show the selection to the user.


public WOActionResults addUsager() {
EOEditingContext ec = ERXEC.newEditingContext();
Usager usager = Usager.fetchUsager(ec, 
Usager.CONTACT.eq(selectedContact().localInstanceIn(ec)));
if (usager != null) {
setEditedItem(usager);
AjaxModalDialog.open(context(), "usagerEditor", 
localizer().localizedStringForKeyWithDefault("UsagerList.text.editerUsager"));
}
else {
Usager newUsager = Usager.createUsager(ec);

newUsager.setContact(newUsager.localInstanceOf(selectedContact()));
newUsager.setUserName(selectedContact().email());
setEditedItem(newUsager);
AjaxModalDialog.open(context(), "usagerEditor");
}
return null;
}

The ContactSelector component needs to be non synchronizing, either by 
extending ERXNonSynchronizingComponent or by overriding the 
synchronizesVariablesWithBindings method.

Here is the selectContact method in ContactSelector:
public WOActionResults selectContact() {
EOEditingContext ec = (EOEditingContext) 
valueForBinding(EditingContextBindingName);
if (ec == null) {
setValueForBinding(item(), SelectedContactBindingName);
}
else {
setValueForBinding(item().localInstanceIn(ec), 
SelectedContactBindingName);
}
return (WOActionResults) valueForBinding(SelectActionBindingName);
}

Samuel



> Le 12 déc. 2017 à 05:59, Markus Ruggiero <mailingli...@kataputt.com> a écrit :
> 
> Hi Samuel,
> 
> thanks for your help, but there are some things still not clear.
> 
> I have that WOTextField I want to populate. Next to the text field I need a 
> clickable element (link, button, whatever) that the user user can use to call 
> up an overlay modal dialog. This dialog gets a list of addresss from the 
> database. The user can then click one of the addresses (a link or a button) 
> to pick the one he needs. This selection action should close the dialog and 
> put the selected address string into the text field.
> 
> I already have a component that retrieves the possible addresses and lists 
> them in tabular form. It also shows a [pick this] link. 
> 
> That's as far as I got. Currently the dialog opener displays the "Select 
> Address" link (should eventually replace the Address Index button. What do I 
> do in that yellow component when the user clicks one of the select buttons? 
> And how can I pass values to the ShippingAddressSelection component? It ought 
> to know the object being edited on the main form, but it is called up by the 
> componentName binding on the dialog, no way to bind anything.
> 
> I must miss something very simple. The Ajax Examples are not of help here (or 
> I just don't get it), as they show some things but actually do not give an 
> answer to a "how do I do this..." type of question.
> 
> Thanks for bearing with me.
> ---markus---
> 
> addressSelectionDialogOpener : AjaxModalDialogOpener {
>   dialogId = "selectAddressDialog";
>   linkTitle = "Select Address";
>   label = "Select Address";
> }
> 
> selectAddressDialog : AjaxModalDialog {
>   pageName = "ShippingAddressSelection";
>   id = "selectAddressDialog";
>   title = "Select Shipping Address";
>   centerVertically = true;
>   locked = true;
>   width = 630;
>   height = 320;
>   overlayOpacity = "0.5";
>   overlayDuration = "0.1";
>   slideDownDuration = "0.1";
>   slideUpDuration = "0.1";
>   closeUpdateContainerID = "shippingAddressUpdateContainer";
> }
> 
> 
> 
>> On 11 Dec 2017, at 21:59, Samuel Pelletier <sam...@samkar.com 
>> <mailto:sam...@samkar.com>

Re: Fighting with Ajax Modal Dialogs et.al.

2017-12-11 Thread Samuel Pelletier
Hi Markus,

If I understand your requirement correctly, you want a modal that allows 
selecting some value(s) for a form field and want the selection be visible in 
the displayed form after the modal close.

The trick is to define an AjaxUpdateContainer around the zone to be updated 
after the modal close. If you use AjaxObserveFields on your form, you can have 
a large section refreshed safely.

You also need to define the AjaxModalDialog with it's id and add the 
closeUpdateContainerID binding to specify the AjaxUpdateContainer to update 
when the dialog close.




Samuel



> Le 11 déc. 2017 à 11:41, Markus Ruggiero  a écrit :
> 
> it always the same ... not using these things often results in utter 
> confusion when finally I need to do this.
> 
> I have a standard page with a large form.
> On that page there is a text field that the user can ...
>   - enter an value directly
>   - depending on previously made selections further up in the form the 
> value is already set and cannot be changed
>   - depending on previously made selections further up in the form there 
> is a button/link next to the text field that should open a modal dialog with 
> a list of strings to pick from (the field is not editable direcly).
> My problem is that 3rd option.
> 
> I already have a small component that loads the available strings from the 
> database and shows them in a table. The user can then click a [pick this] - 
> hyperlink next to an entry (or close the selection box without picking 
> anything. The picked 
> value should be put into the text field.
> 
> I succeeded partially with the help of the Ajax Examples. Tried 
> AjaxModalDialog as well as AjaxModalUpdate. I can show a dialog with both 
> elements and the correct data, but from there? . I am lost.
> 
> Which one to use, AjaxModalDialog or AjaxModalUpdate?
> How do I get the selected String back / put it into the underlying 
> object-to-be-edited, update the display and close the dialog.
> 
> Can anyone provide me with a simple example? 
> 
> Thanks a lot
> ---markus---
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Database connection

2017-11-08 Thread Samuel Pelletier
Hi André,

You can even remove some code. Wonder try to load some specific properties 
files is a specific order. This ordered loading allows to override a setting in 
a file loaded after another with the same setting.

Here are the one I use in load order: 

1 - the main file named "Properties" created by the project template is loaded 
first. You may have a file inside each framework and in the app itself.

2 - A file named "Properties.username" where username is the current system 
username.

3- The file named "Properties.dev" loaded only in development mode.

By default username is the system username but you can specify this name in the 
Java arguments. By adding "-user.name prod" in the Monitor Additional 
Arguments, Wonder will load the Properties.prod file for exemple.

This is a zero code way to do the same thing you do manually if you specify the 
database connection in the Properties.username file.

Regards,

Samuel



> Le 8 nov. 2017 à 03:31, André Rothe  a écrit :
> 
> Hi René,
> 
> I have found a solution for my problems:
> 
> In the JavaMonitor I have configured two applications with the same binaries. 
> The only difference is a VM parameter -Dconfigfile=foo.config in the first 
> application and the parameter -Dconfigfile=bar.config in the other 
> application.
> 
> With these parameters I can use different database configurations, which are 
> stored into the configuration files.
> 
> In the Application class I can use
> 
> FileInputStream fs = new FileInputStream(System.getProperty("user.dir") + 
> System.getProperty("file.separator") + System.getProperty("configfile"));
> Properties p = new Properties();
> p.load(fs);
> 
> to get the database credentials. According to your post, in the model I have 
> removed all connections, this will result in an Exception, if I access an 
> EOEditingContext (i.e. within a Session). To prevent that, I set the 
> connection within the Application class, before any access to the database.
> 
> EOModel model = EOModelGroup.defaultGroup().modelNamed("MyModelName");
> EODatabaseContext dc = 
> EODatabaseContext.registeredDatabaseContextForModel(model, new 
> EOEditingContext());
> EOAdaptor da = dc.adaptorContext().adaptor();
> 
> The database credentials I can store into an NSMutableDictionary:
> 
> NSMutableDictionary cred = new NSMutableDictionary();
> cred.takeValueForKey(p.getProperty("username"), "username");
> cred.takeValueForKey(p.getProperty("password"), "password");
> cred.takeValueForKey(p.getProperty("url"), "URL");
> cred.takeValueForKey(p.getProperty("driver"), "driver");
> 
> Then I set the new ConnectionDictionary for the EOAdapter and EOModel:
> 
> da.setConnectionDictionary(cred);
> model.setConnectionDictionary(cred);
> 
> This works also for all other EOEditingContext instances within the 
> application, I don't have to switch the connection for every new EC instance.
> 
> Some ideas I got from https://stackoverflow.com/questions/13459208 and 
> http://mirror.informatimago.com/next/developer.apple.com/documentation/WebObjects/Enterprise_Objects/Connecting/chapter_10_section_8.html#//apple_ref/doc/uid/TP30001011-DontLinkChapterID_6-TPXREF144
> 
> Best regards
> André
> 
> 
> Am 2017-11-06 17:05, schrieb René Bock:
>> Hi André
>> we don't store database connection infos in the eo-model.  Instead we follow:
>> https://wiki.wocommunity.org/display/documentation/Best+Practices-Properties+Files
>> e.g:
>> dbConnectURLGLOBAL=jdbc:mysql://localhost/DbName
>> dbConnectUserGLOBAL=ojp
>> dbConnectPasswordGLOBAL=X
>> dbEOPrototypesEntityGLOBAL=EOJDBCMySQLPrototypes
>> dbConnectPluginGLOBAL=MySQLPlugIn
>>> Am 06.11.2017 um 16:55 schrieb André Rothe :
>>> Hi,
>>> three questions according the database connection:
>>> I have a model, which has a database connection defined in a connection 
>>> dictionary. But the model should not open the connection per default, it 
>>> should get the credentials from another property file which will differ 
>>> between the instances of the application in the JavaMonitor. If I use this 
>>> solution:
>>> http://mirror.informatimago.com/next/developer.apple.com/documentation/WebObjects/Enterprise_Objects/Connecting/chapter_10_section_8.html
>>> the app will connect to the default database and makes then a reconnect to 
>>> the later provided database. Is it possible to prevent the first connect?
>>> If I use multiple EOEditingContexts in my application, I have to change the 
>>> connection parameters for every EC. When is the best time to set these for 
>>> the session.defaultEditingContext()? Can I get the current connection 
>>> credentials from an EditingContext instance to use it on another EC 
>>> instance?
>>> Thank you.
>>> Best regards
>>> André
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>>> 

Re: Access control

2017-11-03 Thread Samuel Pelletier
Hi,

There is nothing in Wonder but I built a framework I use on all my app that 
support a large set of cases of user access control. There is a service and 
annotations to specify the component access that are easy to integrate withe 
the Wonder checkAccess method in ERXComponent.

You can find my code on Github https://github.com/Kaviju/KAAccessControl

Samuel


> Le 31 oct. 2017 à 17:10, Michael Kondratov  a 
> écrit :
> 
> Ted,
>   No, we are not using D2W (maybe we should be!) . I though maybe there 
> is something in addition to ERXComponents checkAccess()
> 
> 
> Michael Kondratov
> Aspire Auctions, Inc.
> 216-231-5515
> 
>> On Oct 31, 2017, at 4:29 PM, Ted Petrosky  wrote:
>> 
>> If you are talking about d2w? Then the short answer it Œyes¹. You can
>> create permissions for each user, then create a rule ³if this permission,
>> then show these components.
>> 
>> I suspect you question is not that simple.
>> 
>> Theodore Petrosky
>> AgencySacks
>> 345 Seventh Ave., 7th FLR
>> New York, NY 10001
>> 
>> 212 225-9323
>> 
>> 
>> 
>> 
>> 
>> On 10/31/17, 4:24 PM, "Webobjects-dev on behalf of Michael Kondratov"
>> > behalf of mich...@aspireauctions.com> wrote:
>> 
>>> Hello!
>>>   Is there a Wonder way of specifying access to different components
>>> for users?
>>> 
>>> Michael
>>> 
>>> Sent from my iPad
>>> ___
>>> Do not 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/tpetrosky%40agencys
>>> acks.com
>>> 
>>> This email sent to tpetro...@agencysacks.com
>> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Webobjects POS

2017-07-18 Thread Samuel Pelletier
Hi,

Interfacing peripherals with web app is always a challenge. Is is even more 
with serial devices like POS printers and EMV terminals. There is basically 2 
options I see:

1- Using some sort of plugin on the web browser that would allows your code to 
access the physical world outside the browser. This create fragile setups.

2- Using either a custom build box (using raspberry Pi for example) or a 
standard serial to IP interface that would connect to your app and provide the 
interface to the serial devices and possibly any other peripherals required. 
This box is assigned some identifier liked to a user of a user terminal.

With option 2, your server is connected to a set of real peripherals and can 
communicate with them. You need to write the server part and find a way to 
associate your connected user to it's peripherals. You also need to implement 
the protocol used by the peripheral.

If your EMV terminals are IP, there is maybe a way to connect them directly to 
your server.

I have done this for label printer and some dry contacts in a shop.

Samuel


> Le 14 juil. 2017 à 16:07, Michael Kondratov  a 
> écrit :
> 
> Has anyone developed a POS system using WO? How were you able to integrate 
> the credit card terminals?
> 
> Michael
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Tip request: How to avoid coercing twice in NSValidation

2017-05-24 Thread Samuel Pelletier
Hi,

I never bind the password field directly to the attribute. If the password is 
entered by the user, I put 2 field and compare them before saving so I uses 2 
variables inside the component.

Some notes about password...

- If you need strong passwords, never allow the user to enter their password, 
humans do not have good entropy. It is usually far better to generate a 6 chars 
random string than a user specified password.

- Always salt passwords. Ideally with a random string at least as long as the 
password. You will need to store the salt somewhere with the hashed password. 
In my user access and authentication framework, I put it before the hash in the 
password attribute.

- Uses time (and ideally a resource) consuming algorithm for the hashing to 
make brute force really hard. A PKDF2 with few 1000 iterations or bcrypt does 
well. You can easily go to 250ms of computing time to hash a password, for long 
term and high security, some go to more than 1 second. This may even help for 
bad passwords. SHA is now way too fast with GPU and custom ASIC, you would need 
billons of iterations to have a significant slowing of brute force.

- Requiring frequent passwords change is useless, even lower the security it is 
now finally recognized by the NIST. A good password need to be changed only 
when compromised.

- Requiring mix capitals letters of symbols does not really helps, people still 
uses dictionary works by replacing commun letter with numbers. Dictionary 
attacks know there tricks.


Samuel


> Le 23 mai 2017 à 06:26, getsh...@gmail.com a écrit :
> 
> Hi Riccardo,
> 
> I’m interested in how others deal with this too.
> 
> My approach is to never bind directly to the password attribute.
> 
> With forms that persist a password value I bind to a component ivar, check 
> validity on the raw string to whatever my password policy might dictate (in 
> the component’s action method) then call the password attribute setter 
> passing the digested string.
> 
> Sharpy..
> 
> 
>> On 23 May 2017, at 7:33 pm, Riccardo De Menna > > wrote:
>> 
>> Hi all,
>> 
>> I have a request for tips on how to properly perform a task…
>> 
>> Whenever I have to deal with database fields that contain passwords I 
>> generally use some sort of ‘digest’ as early as possible and then only store 
>> and compare the digested data. I’d like to apply this digest in the 
>> validateValueForKey method of my EOGenericRecord subclass, coercing the 
>> value, but I’m having problems because validateValueForKey gets called 
>> twice, first at component validation level and then when things are actually 
>> saved (I think it’s called by validateTakeValueForKeyPath  first and 
>> validateForSave later right?).
>> 
>> Result: My digest algorithm is applied twice and this obviously messes up 
>> with the whole thing.
>> 
>> What should I do to avoid this?
>> 
>> One idea would be to intercept component validation on 
>> validateTakeValueForKeyPath and skip coercion there. Or skip it later on the 
>> validateForSave.
>> 
>> What would be the right way? Also… is it somehow guaranteed that validation 
>> happens twice? Could it happen three times? More? If so, my idea would not 
>> work.
>> 
>> What do you think?
>> 
>> Riccardo
>> ___
>> Do not 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/getsharp%40gmail.com 
>> 
>> 
>> This email sent to getsh...@gmail.com 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
> )
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


ERXFetchSpecificationBatchIterator for efficient batch fetches

2017-05-17 Thread Samuel Pelletier
Hi all,

I want to share my discovery of the day as this is probably useful to others.

In an app that need to process records sometime in huge batches I had some 
trouble getting my loop working correctly using some manual batching code du to 
some rules that may postpone some record processing.

Today, I found ERXFetchSpecificationBatchIterator, a helper class to do batch 
fetches that work and is isolated from external changes to the data during the 
process. This class fetch all the primary keys and iterate through them. It 
also allows to change the EOEditingContext during the process to optimise the 
garbage collection. It try to replicate a database cursor in EOF by fetching 
real EO by batch using their PK. Only the PK list and current batch of EO is 
kept in memory.

Very simple to use, it needs a fetch specification, an EOEditingContext and a 
batch size like this:

ERXSortOrderings sortOrderings = IsaacActivityRecord.DATE.ascs();
ERXFetchSpecification fs = IsaacActivityRecord.fetchSpec();
fs.setQualifier(IsaacActivityRecord.PROCESSED_DATE.isNull());
fs.setSortOrderings(sortOrderings);

ERXFetchSpecificationBatchIterator batchFs = new 
ERXFetchSpecificationBatchIterator<>(fs);
batchFs.setEditingContext(ec);
batchFs.setBatchSize(1);

int nbActivities = 0;
while (batchFs.hasMoreElements()) {
IsaacActivityRecord activityRecord = batchFs.next();

if (++nbActivities % 500 == 0) { // Save every 500 records
ec.saveChanges();
}
}
ec.saveChanges();

Samuel


 ___
Do not 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: Creating working wocontext()

2017-04-19 Thread Samuel Pelletier
Hi Klaus,

I never managed to get the url generation works as expected outside the RR loop.

For these case, I add a property with the base public url, construct the 
required url manually and uses the src and href bindings.

If there is a bette way, I would like to know it too.

Samuel

> Le 14 avr. 2017 à 16:15, Klaus Berkling  a écrit :
> 
> 
> Hi Gang.
> 
> I’m sending a scheduled email (ERQSJob) using a WOComponent as the message 
> content.  When the email is sent the links in the component page are wrong.  
> I tried the different  pageWithName and instantiatePage methods and they work 
> for non-scheduled messages.
> 
> I can create a wocontext from a fake worequest:
> 
> WORequest fakeRequest = new ERXRequest("GET", 
> "https://apps.berkling.us/...woa ", 
> "HTTP 1.1", null, null, null);
> WOContext context = new ERXWOContext(fakeRequest);
> 
> I generate the links with completeURLWithRequestHandlerKey() to an direct 
> action. I also have links to web resources like images. The urls will look 
> like ‘http://localhost:…https://apps.berkling.us/ 
> …’, prepending the localhost 
> part.
> 
> Anyone tackle this before?
> 
> 
> Klaus Berkling
> www.berkling.us  | Photography 
> 
> 
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Set case insensitive unique index with ERXMigrations

2017-04-19 Thread Samuel Pelletier
Jeff,

With FrontBase, I usually create the table with the migration and execute this 
SQL to alter the column collation: 
"ALTER COLUMN \"TableName\".\"columnName\" TO COLLATE 
\"CaseInsensitive\";"

Same logic to initialize unique sequence to lower value:
"SET UNIQUE = 10 FOR \"TableName\";"

This way, the custom parts are put in evidence in the code.

Samuel


> Le 17 avr. 2017 à 23:50, Jeff Schmitz  a écrit :
> 
> Just to finish this out, I ended up having to use the collation option as I 
> couldn’t figure out how to implement Maik’s option in Frontbase SQL.  In the 
> end, my table creation where the name field is created to be case insensitive 
> looks like this in my migration function.  Note that the first sql statement 
> below is unique to Frontbase.
> 
> 
>   String sql = "CREATE COLLATION CASE_INSENSITIVE FOR 
> INFORMATION_SCHEMA.SQL_TEXT FROM EXTERNAL('CaseInsensitive.coll1');";
>   this.execSql(database, sql);
> 
> 
>   sql = "CREATE TABLE \"t_user\" ( " +
>   " \"c_credential\" VARCHAR(50) NOT NULL, " +
>   " \"c_email\" VARCHAR(255) NOT NULL, " +
>   " \"c_first\" VARCHAR(50) NOT NULL, " +
>   " \"id\" INTEGER NOT NULL, " +
>   " \"c_last\" VARCHAR(50) NOT NULL, " +
>   " \"c_name\" VARCHAR(50) NOT NULL COLLATE CASE_INSENSITIVE, " +
>   " );";
>   this.execSql(database, sql);
> 
>   sql = "SET UNIQUE = 100 FOR \"t_user\";";
>   this.execSql(database, sql);
>   
>   sql = "ALTER TABLE \"T_USER\" ADD PRIMARY KEY (\"ID\") NOT DEFERRABLE 
> INITIALLY IMMEDIATE;";
>   this.execSql(database, sql);
> 
> ERXMigrationTable userTable = database.existingTableNamed("t_user");
> userTable.addUniqueIndex("uniqueUser", 
> userTable.existingColumnNamed("c_name"));
> 
> One other note is that if you have an existing table that you don’t want to 
> have to drop and recreate I’m not sure how you would add the collate command 
> to an existing column.
> 
> Jeff
> 
> 
>> On Apr 14, 2017, at 10:18 AM, Musall, Maik > > wrote:
>> 
>> I doubt you can create a function based index through the ERXMigration API.
>> Use plain SQL for this one.
>> 
>> Maik
>> 
>>> Am 14.04.2017 um 15:12 schrieb Jeff Schmitz >> >:
>>> 
>>> Just getting around to adding this, but can’t figure out how to do this as 
>>> part of my migration code:
>>> 
>>> Currently I have:
>>> userTable.addUniqueIndex("uniqueUser", 
>>> userTable.existingColumnNamed("c_name"));
>>> 
>>> Is there something along the lines of:
>>> 
>>> userTable.addCaseInsensitiveUniqueIndex("uniqueUser", 
>>> userTable.existingColumnNamed("c_name"));
>>> 
>>> Or is there some way of adding such a constraint using EOModeler?
>>> 
>>> thanks,
>>> 
>>> Jeff
>>> 
>>> 
 On Mar 27, 2017, at 3:52 AM, Musall, Maik > wrote:
 
 Hi,
 
 I would just create a unique function based index, like this:
 
 CREATE UNIQUE INDEX indexname ON MyTable( UPPER(columnName) );
 
 No extensions required. Works with every RDBMS that supports function 
 based indexes.
 
 Maik
 
> Am 27.03.2017 um 02:29 schrieb Paul Hoadley  >:
> 
> Hi Jeff,
> 
> On 25 Mar 2017, at 04:16, Jeff Schmitz  > wrote:
> 
>> Just a quick question on how to create a case insensitive unique index 
>> in an ERXMigration?
> 
> As Samuel mentioned, this is going to be database-dependent. We’ve been 
> using PostgreSQL’s CITEXT type for a year or so now, and it works as 
> designed. Because it’s an extension type, you need to run:
> 
> CREATE EXTENSION IF NOT EXISTS citext;
> 
> at some point—we do this in a migration upgrade(). You can then add and 
> alter columns and add indexes in the usual way. There’s a brief 
> discussion on performance here:
> 
> http://stackoverflow.com/questions/31133603/in-postgresql-weird-issue-about-citext-performance
>  
> 
> 
> though that’s not specific to indexing that column type.
> 
> (Finally, if you are using PostgreSQL, and you do need to add this 
> extension to an existing database during a migration, there is a small 
> issue with the JDBC info not being available to EOF quite early enough, 
> which is easily fixed. I can dig up the thread if you need it.)
> 
> 
> -- 
> Paul Hoadley
> http://logicsquad.net/ 
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> 

Re: Opinion on ERXKey type parameterization

2017-03-30 Thread Samuel Pelletier
Paul,

I never used and didi not even known the existence of 
ERXGenericRecord.valueForKey(). The problem with these powerful ERXKey is that 
some operator will reduce a collection and some will create a collection. There 
is no way to infer these results with the current way they are done (using 
generics). I see no way to make the ERXGenericRecord.valueForKey() type to work 
all the time.

For simple key this may works but with key path, things get very complex.

For exemple traversing 2 toMany relationships will return an array of array of 
the final type that can be reduced to a single level array using atFlatten() 
and this one to a single object with atObjectAtIndex(index) or atMax(), ...

A new method could be added to return a new no-op  key with the NSArray version 
of the type to use with ERXGenericRecord.valueForKey() if required. As I do not 
know where ERXGenericRecord.valueForKey is used, I cannot comment on this.

This complexity may explain the proposition to have a native equivalent in 
Swift, they probably want make sure it will always works by having a better 
knowledge of the effect of operations chain.

Samuel



> Le 29 mars 2017 à 19:40, Paul Hoadley  a écrit :
> 
> On 29 Mar 2017, at 09:19, Paul Hoadley  wrote:
> 
>> Anyone else got any thoughts on all this?
> 
> 
> I see it was discussed on the old Wonder list back in 2009. Dave Avendasora 
> asked the exact question I asked:
> 
>> Since this is a to-many relationship shouldn't it be 
>> "ERXKey"?
> 
> 
> And Mike Schrag answered:
> 
>> no it just doesn't really work this way ... if it did this, it's easy to 
>> extend it to add the array, but it's impossible to deconstruct it to get the 
>> inner type.  there are methods to extend keys, etc with array variants for 
>> most operations, but you rarely actually want the type of the key to be 
>> NSArray
> 
> 
> Along with Samuel’s observations, seems like case closed. It does still seem 
> to leave ERXGenericRecord.valueForKey(ERXKey key) broken in the case of 
> to-many relationship ERXKeys, though, doesn’t it? (Worse, it will break at 
> runtime.)
> 
> 
> -- 
> Paul Hoadley
> http://logicsquad.net/
> 
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: Opinion on ERXKey type parameterization

2017-03-28 Thread Samuel Pelletier
Hi,

After paying a lot with ERXKey, I came to the conclusion that the current 
templates are correct. Using the collection as the type seems good at first but 
if you use aggregation functions they no longer works.

ERXKey have 2 typed methods to get the value: 
public T valueInObject(Object obj)
public NSArray arrayValueInObject(Object obj) 

When you know the value is an array, use the arrayValueInObject variant. It 
always works even when traversing toMany relationships to get all the firstName 
of contacts of some entity like this:

NSArray firstNames = 
SomeEntity.CONTACTS.dot(Contact.FIRST_NAME).arrayValueInObject(anInstanceOfSomeEntity);

If you want the latest birthDate:

LocalDate lastBirthDate = 
SomeEntity.CONTACTS.atMax(Contact.BIRTH_DATE).valueInObject(anInstanceOfSomeEntity);

There is many operations available and it is probably not possible to determine 
the final type of an ERXKey chain (array or instance) and using the 2 value 
getters always works.

For relationships, I do not think it can really create confusion but if your 
key represent an array of String or number values, you will probably use 
aggregate key one day that will no longer works as expected because your ERXKey 
have a NSArray type.

Is there any benefit to specify the type as NSArray for these ERXKey I do 
not see ?

Regards,

Samuel



> Le 27 mars 2017 à 00:10, Paul Hoadley  a écrit :
> 
> Hello,
> 
> Say I have a ‘Foo' entity, with a to-many relationship ‘bars’ to a ‘Bar’ 
> entity. Every Velocity generation template I’ve ever seen will output 
> something like:
> 
>  public static final ERXKey BARS = new ERXKey(“bars”);
> 
> or, even better:
> 
>  public static final ERXKey BARS = new ERXKey(“bars”, 
> ERXKey.Type.ToManyRelationship);
> 
> But shouldn’t ERXKey there be parameterized as ERXKey? 
> Admittedly, I’m struggling to see where it would make a huge difference—but 
> just for completeness?
> 
> 
> -- 
> Paul Hoadley
> http://logicsquad.net/
> 
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Set case insensitive unique index with ERXMigrations

2017-03-27 Thread Samuel Pelletier
Hi Maik,

Works great for english but usually not enough for french or other languages 
with accents. For example french Canadians expect case insensitive search and 
ordering to consider all the variants of e (eEéÉèÈêÊëË) equals same for c and 
ç, etc.

This varie with language and I think even with countries for the same language 
in some cases. This is why unicode created collations.

Samuel

> Le 27 mars 2017 à 04:52, Musall, Maik  a écrit :
> 
> Hi,
> 
> I would just create a unique function based index, like this:
> 
> CREATE UNIQUE INDEX indexname ON MyTable( UPPER(columnName) );
> 
> No extensions required. Works with every RDBMS that supports function based 
> indexes.
> 
> Maik
> 
>> Am 27.03.2017 um 02:29 schrieb Paul Hoadley > >:
>> 
>> Hi Jeff,
>> 
>> On 25 Mar 2017, at 04:16, Jeff Schmitz > > wrote:
>> 
>>> Just a quick question on how to create a case insensitive unique index in 
>>> an ERXMigration?
>> 
>> As Samuel mentioned, this is going to be database-dependent. We’ve been 
>> using PostgreSQL’s CITEXT type for a year or so now, and it works as 
>> designed. Because it’s an extension type, you need to run:
>> 
>> CREATE EXTENSION IF NOT EXISTS citext;
>> 
>> at some point—we do this in a migration upgrade(). You can then add and 
>> alter columns and add indexes in the usual way. There’s a brief discussion 
>> on performance here:
>> 
>> http://stackoverflow.com/questions/31133603/in-postgresql-weird-issue-about-citext-performance
>>  
>> 
>> 
>> though that’s not specific to indexing that column type.
>> 
>> (Finally, if you are using PostgreSQL, and you do need to add this extension 
>> to an existing database during a migration, there is a small issue with the 
>> JDBC info not being available to EOF quite early enough, which is easily 
>> fixed. I can dig up the thread if you need it.)
>> 
>> 
>> -- 
>> Paul Hoadley
>> http://logicsquad.net/ 
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>> )
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/maik%40selbstdenker.ag
>>  
>> 
>> 
>> This email sent to m...@selbstdenker.ag 
> 
> ___
> Do not 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Set case insensitive unique index with ERXMigrations

2017-03-26 Thread Samuel Pelletier
Hi Jeff,

The case insensitivity of the index should not impact the performance. The 
number of indexes and their size will as the server need to insert the new 
value in all of them during an insert.

As there is no standard way for specifying case insensitivity (not even to 
define case insensitivity since it is locale dependant), you will need to add 
custom SQL to your migration.

I use this pattern in my migration classes for these purpose:

// First line of the update method: 
NSMutableArray updateScript = new NSMutableArray();
// After the table creation methods or even within for LocalDateTime attribute: 
updateScript.add("ALTER COLUMN \"Intranet\".\"Bureau\".\"nom\" TO COLLATE 
\"CaseInsensitive\";");
...
updateScript.add("SET UNIQUE = 0 FOR TypeRessource;");
...
// After the add foreign key constraint: 
for (String sql : updateScript) {
ERXJDBCUtilities.executeUpdateScript(database.adaptorChannel(), sql);
}

Regards,

Samuel


> Le 24 mars 2017 à 13:46, Jeff Schmitz  a écrit :
> 
> Just a quick question on how to create a case insensitive unique index in an 
> ERXMigration?  e.g. I’d like to apply it to the below index.
> 
> ERXMigrationColumn[] entryColumns = { 
> entryTable.existingColumnNamed("poolID"), 
> entryTable.existingColumnNamed("c_name") };
> entryTable.addUniqueIndex("poolUniqueEntry", entryColumns);
> 
> Also, how much is using a case insensitive unique index likely to affect 
> performance on inserts?
> 
> Thanks!
> Jeff
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: ERXWOConditional - where does it get installed?

2017-03-14 Thread Samuel Pelletier
Ricardo,

This patch seem dangerous to first. I do not thing it is safe to have state in 
WODynamicElement. I think they can be reused by the framework.

The correct way is to make sure the condition does not change during RR loop 
cycle, same apply to WORepetition list for example.

Regards,

Samuel

> Le 14 mars 2017 à 09:53, Ricardo Parada <rpar...@mac.com> a écrit :
> 
> Thanks Samuel.  I see that now.
> 
> Have others experienced a problem where a form is submitted and then during 
> takeValuesFtomTequest a condition that was false when the page was rendered 
> becomes true all of a sudden causing some input elements (textfields, pop-up 
> list, etc.) to participate in takeValuesFromRequest even though those 
> elements were not on the page when the form was submitted? This causes those 
> elements to be set to null.   I've ran into such bugs in the past many times.
> 
> I have been able to prevent that from happening by using the following code: 
> 
> 
> public class MPVWOConditional extends ERXWOConditional {
> 
>protected boolean conditionValue = false;
> 
>public MPVWOConditional(String name, NSDictionary dict, WOElement element) 
> {
>   super(name, dict, element);
>}
> 
>@Override
>public void appendToResponse(WOResponse woresponse, WOContext wocontext) {
>   // Cache the condition every time the page is being rendered
>   conditionValue = 
> _condition.booleanValueInComponent(wocontext.component());
>   super.appendToResponse(woresponse, wocontext);
>}
> 
>/**
> * Returns the value for the condition binding cached during 
> appendToResponse.
> * This makes the takeValuesFromRequest consistent with the 
> appendToResponse
> * preceding it by making sure that input elements that were not present on
> * the page at the time the form was submitted do not participate in
> * takeValuesFromRequest inadvertently.
> */
> @Override
> protected boolean conditionInComponent(WOComponent wocomponent) {
>return conditionValue;
> }
> }
> 
> 
> 
> 
>> On Mar 14, 2017, at 9:39 AM, Samuel Pelletier <sam...@samkar.com 
>> <mailto:sam...@samkar.com>> wrote:
>> 
>> Hi,
>> 
>> If you use inline bindings with ONGL, the class WOHelperFunctionTagRegistry 
>> registers classes mapped to tag 
>> 
>>  WOHelperFunctionTagRegistry.registerTagShortcut("ERXElse", 
>> "else");
>>  
>> WOHelperFunctionTagRegistry.registerTagShortcut("ERXWOConditional", "if");
>>  
>> WOHelperFunctionTagRegistry.registerTagShortcut("ERXWOConditional", 
>> "conditional");
>> 
>> Samuel
>> 
>> 
>>> Le 13 mars 2017 à 19:46, Ricardo Parada <rpar...@mac.com 
>>> <mailto:rpar...@mac.com>> a écrit :
>>> 
>>> Hi all,
>>> 
>>> Does anybody know where does ERXWOConditional install to replace 
>>> WOConditional?
>>> 
>>> I created an MPVWOConditional which extends ERXWOConditional and fixes a 
>>> bug and want to install it as the one to use for WOConditional. 
>>> 
>>> I checked in ERXPatches but it does not seem to be getting installed there. 
>>>  Does anybody know?
>>> 
>>> Thanks
>>> ___
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com 
>>> <mailto:Webobjects-dev@lists.apple.com>)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com 
>>> <https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com>
>>> 
>>> This email sent to sam...@samkar.com <mailto:sam...@samkar.com>

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

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


Re: ERXWOConditional - where does it get installed?

2017-03-14 Thread Samuel Pelletier
Hi,

If you use inline bindings with ONGL, the class WOHelperFunctionTagRegistry 
registers classes mapped to tag 

WOHelperFunctionTagRegistry.registerTagShortcut("ERXElse", 
"else");

WOHelperFunctionTagRegistry.registerTagShortcut("ERXWOConditional", "if");

WOHelperFunctionTagRegistry.registerTagShortcut("ERXWOConditional", 
"conditional");

Samuel


> Le 13 mars 2017 à 19:46, Ricardo Parada  a écrit :
> 
> Hi all,
> 
> Does anybody know where does ERXWOConditional install to replace 
> WOConditional?
> 
> I created an MPVWOConditional which extends ERXWOConditional and fixes a bug 
> and want to install it as the one to use for WOConditional. 
> 
> I checked in ERXPatches but it does not seem to be getting installed there.  
> Does anybody know?
> 
> Thanks
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: WOWODC17?? a little OT

2017-01-19 Thread Samuel Pelletier
Nobody wants to organize it in Europe?

I'm not sure Pascal want to engage in this project and I have a divorce to 
complete... You now know why the WO Community project stalled last fall.

I know the Montréal event manager can help someone to organize it in Europe.

Samuel


> Le 19 janv. 2017 à 11:48, Hugi Thordarson  a écrit :
> 
> Montreal?
> 
> - hugi
> 
> 
>> On 17. jan. 2017, at 20:02, Chuck Hill > > wrote:
>> 
>> It is a smallish island.  Where is he going to hide?
>> 
>> 
>> 
>> From:  on behalf 
>> of Ken Anderson 
>> Date: Tuesday, January 17, 2017 at 11:59 AM
>> To: Tim Worman 
>> Cc: "webobjects-dev@lists.apple.com" 
>> Subject: Re: WOWODC17?? a little OT
>> 
>> 
>> 
>> Somehow I don’t think Hugi is taking us seriously…
>> 
>> 
>> 
>> On Jan 17, 2017, at 2:42 PM, Tim Worman  wrote:
>> 
>> 
>> 
>> Ha! LOL! I love that. That sense of humor is all the invitation I need. If I 
>> could fit WOWODC ‘17 in my schedule, I will, wherever it is.
>> 
>> Tim
>> UCLA GSE
>> 
>> 
>> 
>> On Jan 13, 2017, at 6:39 AM, Hugi Thordarson  wrote:
>> 
>> Awesome, I’ve already booked a venue. Look forward to seeing you guys.
>> 
>> 
>> 
>> 
>> 
>> 
>> On 13. jan. 2017, at 14:22, Markus Ruggiero  
>> wrote:
>> 
>> Iceland? Would be interesting. And I may go if there is a WOWODC17 at all
>> 
>> 
>> 
>> On 13.01.2017, at 04:10, Chuck Hill  wrote:
>> 
>> You have an extremely lenient definition of food!
>> 
>> +1 on women and hot springs
>> 
>> 
>> 
>> 
>> 
>> 
>> -100 on hakarl
>> 
>> hakarl? what's that? Must be aful judging by Chuck's thumbs down
>> 
>> ---markus---
>> 
>> 
>> ___
>> Do not 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/hugi%40karlmenn.is
>> 
>> This email sent to h...@karlmenn.is
>> 
>> 
>> ___
>> Do not 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/lists%40thetimmy.com
>> 
>> This email sent to li...@thetimmy.com
>> 
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/kenlists%40anderhome.com
>> 
>> This email sent to kenli...@anderhome.com
>> 
>> 
>> 
>> ___
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/hugi%40karlmenn.is 
>> 
>> 
>> This email sent to h...@karlmenn.is 
> 
> 
> ___
> Do not 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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


Re: Slow partial ajax requests (and perhaps a solution)

2017-01-19 Thread Samuel Pelletier
Hi René,

My guest is the InputFieldComponents is doing redundant computations in getter 
methods used in the HTML parsing. If you move all the validation logic and save 
the results in variables in the appendToResponse and make sure the entire 
component is refreshed by the Ajax container, you should have much better 
results.

All getters required during the HTML parsing will be called on each phase of 
the RR loop so it is always a good practice to limit their scope to fast values 
retrieving instead of value computing. BTW, you do not want these values to 
change between append to response call as they may even change the element tree.

Regards,

Samuel


> Le 19 janv. 2017 à 10:32, René Bock  a écrit :
> 
> Hi list,
> 
> In our framework, we are using partial ajax requests to validate input field 
> as soon as the user leaves the text field.
> 
> In a very complex form, we noticed that the response time of the partial 
> requests depends on the position of the input field. The validation logic is 
> encapsulated in InputFieldComponent, and the form component is mainly a 
> WORepetition of these InputFieldComponents.  
> 
> The range of the measured  response times is something between 60 ms for the 
> first component and 1200 ms for the last component in the form.   The longest 
> response time is about the  same as I would do a normal form submit.
> 
> 
> Did anybody noticed a similar phenomena?
> 
> 
> Anyway, my questions are:
> 
> 1. Why does the position of a field make a difference at all?  
> 2. Is there a possibility to speed up things?
> 
> 
> Here my observations:
> 
> A profiling session reveals, that a lot of time is spent in 
> takeFormValuesFromRequest and invokeAction.
> 
> 
> Answer for #1: As soon as ajaxSubmitButton which triggered the request is 
> found, invokeAction is somehow "interrupted".  (see 
> ERXAjaxContext.wasFormSubmitted...)  
> 
> 
> As it is possible to eliminate unnecessary component tree traversal after the 
> right ajaxSubmitButton.action is found,  it should also be possible to ignore 
> the other irrelevant childComponents.
> 
> 
> ASSUMPTION: 
> a) for partial submits, we get only one form value (i.e the 
> partialFormSenderID).  
> b) the partialFormSenderID is the path of the sender component in the overall 
> component hierarchy.
> 
> IDEA:  for the component hierarchy tree traversal, we may ignore child 
> components not on the path to the partialFormSender.
> 
> 
> Solution (proof of concept) for #2: In ERXWORepetition, I changed 
> takeFormValuesFromRequest and invokeAction as follows:
> 
> 
> public void takeValuesFromRequest(WORequest worequest, WOContext wocontext) {
> WOComponent wocomponent = wocontext.component();
> String partialFormSenderID = 
> ERXAjaxApplication.partialFormSenderID(worequest); 
> 
> Context context = createContext(wocomponent);
> 
> int count = _count(context, wocomponent);
> boolean checkHashCodes = checkHashCodes(wocomponent);
> 
> for (int index = 0; index < count; index++) {
> _prepareForIterationWithIndex(context, index, wocontext, wocomponent, 
> checkHashCodes);
>   if(partialFormSenderID == null || 
> partialFormSenderID.startsWith(wocontext.elementID())) {  // NO RECURSION if 
> component[index] does not match senderID 
> super.takeValuesFromRequest(worequest, wocontext);
> }
> }
> if (count > 0) {
> _cleanupAfterIteration(count, wocontext, wocomponent);
> }
> }
> 
> invokeAction is patched in similar way.
> 
> The result is, that the ajax request at the bottom of the page takes now 60 
> ms instead of 1200ms :-)
> Unfortunately, this is not a general solution. There are scenarios, there 
> invokeAction will not invoke any actions at all :-(
> 
> Has anybody an idea for a general solution?  Maybe a completely different 
> approach?
> 
> 
> 
> Best regards (and sorry for this long post)
> 
> 
> René Bock
> 
> --
> Phone: +49 69 650096 18
> 
> salient GmbH, Lindleystraße 12, 60314 Frankfurt
> Main: +49 69 65 00 96 0  |  http://www.salient-doremus.de 
>  | http://www.openforms.de 
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: Storing Session ID in Cookie And Multiple Browser Windows

2017-01-12 Thread Samuel Pelletier
Hi,

Cookies are shared per browser instance so it is not possible to have distinct 
sessions inside a single browser. You can uses different browser and they will 
have their own sessions so if you need 2 simultaneous sessions, you can use a 
window in FireFox and Chrome for example.

WOComponent actions are not working well with multiple tabs or windows in the 
same session, the "You backtracked to far" will always come. I usually set the 
page cache very low like 2 so the user does not think it is supposed to works 
and get the error very early.

Samuel

> Le 11 janv. 2017 à 21:42, Michael Hast  a écrit :
> 
> Hello:
> 
> We recently switch our applications to store the session ID in cookies. With 
> the session ID in the URL we were able to open the same application in 
> multiple browser tabs each working with their own session. Is that possible 
> with cookies? We are not experiencing "You backtracked to far" every once in 
> a while because each browser tab works with the same session.
> 
> Michael
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: ERAttachment "db" storageType....Problem

2017-01-10 Thread Samuel Pelletier
Hi,

If you use the component provided to upload attachments, everything is linked 
automatically.

An exemple using an AjaxUpload in a user edit page:


If you create then programmatically, you will get an ERAttachement EO that you 
need to assign to your "Master" object attachement relationship. There is no 
universal rule for the Own Destination, it depend on your usage like any other 
relationship. ERAttachement are EO like all others for you model.

Regards,

Samuel


> Le 10 janv. 2017 à 01:18, Kwasi O-Ahoofe  a écrit :
> 
> Has anyone been able to successfully implement ERAttachment with StorageType 
> = “db”? The following is my question/difficulty:
> 
> I am still wrestling with ERAttachment ‘magic’..!! I can finally ‘easily’ 
> upload attachment files and populate  database 
> entities , but I can’t 
> figure/find out the magic that’s required to set the Owning EO’s 
>  Attribute Value for the to-one ‘destination’ 
> RelationshipKey. 
> That is: when and how is the JOIN attribute VALUE SET by the attachment 
> , so that when the owning EO (masterObject) is retrieved the 
> appropriate attachment is located and rendered?
> 
>   RelationshipKey myAttachment >>  MasterObject {attachmentID} 
> >ERAttachment {id}
> 
>   such that: MasterObject.myAttachment() = stored_attachment
> 
> In short, the correct corresponding attachment is retrieved ONLY if:   
>   MasterObject. attachmentID() = ERAttachment.id()
> 
> But can’t see when/where MasterObject. attachmentID is set!
> 
> Can’t find it in documentation or Javadoc (api: Project Wonder 7.0.0-SNAPSHOT)
> 
> Any help will be appreciated.. Thank you!
> 
> PS: The attachments are created and saved in the DB but the attachmentID is 
> NOT set in the owning/masterObject !!!
> 
> Kwasi
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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


Re: dcevm

2016-12-13 Thread Samuel Pelletier
Ted,

This official release includes the fix to reset the validation cache found last 
august.

Remaining changes are to support other frameworks.

Samuel

> Le 12 déc. 2016 à 13:06, Theodore Petrosky  a écrit :
> 
> is anyone using hotswap-agent-0.4.0-SNAPSHOT
> 
> it looks like an update to the agent. I stumbled across this when I installed 
> the jdk1.8.0_112.jdk
> 
> is there any need to do this?
> 
> Ted
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: excel dates

2016-11-29 Thread Samuel Pelletier
Hi,

The Apache POI library will convert your java Date values directly if you use 
the setValue(java.util.Date value) or setCellValue(java.util.Calendar value).

You can also specify a formatter for the cell to control how Excell will 
display the date.

POI is very easy to use to create XLS or XLSX document.

Samuel

> Le 28 nov. 2016 à 13:07, Theodore Petrosky  a écrit :
> 
> So excel stores and expects to find date as an integer. The number of days 
> since 01-01-1900.
> 
> I am trying to write out to excel and I have these dates. So is created a 
> method that calculates the number of days from 01-01-1900. My problem is that 
> I am two days off, so I adjusted the jan01 date two days.
> 
> Does anyone know why it is two days off? the only thing I can think of is 
> that it is calculating the leap years incorrectly. every four years except 
> century years, and there are two century years here (1900 and 2000),
> 
>   public int dateAsInt() {
>   
>   SimpleDateFormat format = new SimpleDateFormat("-MM-dd");
> 
>   Date date = null;
>   try {
>   date = format.parse ( "1899-12-30" );
>   } catch (ParseException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
>   }
>   
>   NSTimestamp jan011900 = new NSTimestamp(date);
> 
>   System.out.println(jan011900);
>   
>   long diff = eventDate().getTime() - jan011900.getTime(); // 
> diff is in milliseconds
>   long roundingOffset = ( diff >= 0 ) ? 12 : -12; // if diff is 
> positive, offset up, if negative, offset down
>   // next, convert diff to hours, offset by .5 days to round the 
> end result, divide by 24 and truncate.
>   long days = ( ( diff / ( 1000 * 60 * 60 ) ) + roundingOffset ) 
> / 24;
>   
>   return (int)days;
>   }
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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

Re: Multi-tenant Postgres support with EOF ?

2016-11-25 Thread Samuel Pelletier
Josef,

Personally, I use a single schema and connection to the database with the 
object representing the current tenant in the session and put all the fetch 
logic in that class that will add the required filtering qualifier. This way of 
doing things allow a single instance to easily serve multiple tenant and if 
there is shared objects they are not duplicated. This way will create a big 
database with big tables containing all the data for all tenants. The app and 
deployment setup are much simpler though.

Others uses multiple connections or schema but it require some runtime tweaking 
of the model. This way seems more adapted to setup with separate instance for 
each tenant, the model tweaking is done on app startup for the complete life of 
the app. This way allow multiple instance of the database server and will split 
the load on multiple app and database instances. I do not see any real 
advantages of this way if all app instance connect to a single database unless 
there is other code that may connect directly to the data and there is no way 
to create filtering views for these needs.

Depending on the number of tenant, the expected size of the data and number of 
concurrent users a method may be more adapted than the other. If a single is 
enough, my guess is the first way is enough. My own experience seem to indicate 
a 2012 Mac mini with a SSD can serve at least 300 concurrent users if the app 
is properly optimized with small sessions and page caches. I would expect more 
but never tried.

Regards,

Samuel

> Le 25 nov. 2016 à 11:07, Vanek Josef  a écrit :
> 
> 
> Hi,
> 
> We are developing a large website/REST solution for multiple customers. 
> Ideally every customer shall have access only to their own data through ACLs 
> or other mechanism.
> 
> We have been thinking of Postgres' native schema management and use if for a 
> multi-tenant solution. Has anyone implemented a Wonder's EOF extension that 
> would be able 
> to handle requests on the same connection but on a different scheme depending 
> on some login configuration?
> 
> If anyone has advice about the best practice for multi-tenancy DB 
> architectures with WO that differs from our thoughts above, please respond
> There must be some people who have experimented with Wonder and multi-tenancy.
> 
> Many thanks,
> Josef
> ___
> Do not 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/samuel%40samkar.com 
> 
> 
> This email sent to sam...@samkar.com 
 ___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

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

Re: macOS Sierra Occasionally Very Slow

2016-11-21 Thread Samuel Pelletier
Hi,

This limit and many others are adjustable with the sysctl command and the 
/etc/sysctl.conf file read at boot time.

On my 10.11 workstation, kern.ipc.somaxconn (number of connection allowed) is 
128 but I read that the freebsd kernel allows 1.5X before refusing the 
connections, darwin may does the same thing.

This reminds me I should check these on my servers...

Samuel



> Le 18 nov. 2016 à 10:18, Michael Kondratov  a 
> écrit :
> 
> And desktop limit I think is around 200.
> 
> Sent from my iPhone
> 
>> On Nov 18, 2016, at 9:49 AM, Henrique Prange  wrote:
>> 
>> Hi Stavros,
>> 
>> I'm having issues on my development machine. We deploy our apps on Amazon 
>> AWS. So, I don't know about issues in production related to macOS Sierra.
>> 
>> Cheers,
>> 
>> Henrique
>> 
>>> On 18 Nov 2016, at 09:14, Stavros Panidis  wrote:
>>> 
>>> Hi Henrique,
>>> You mean for deployment or development.
>>> 
>>> Since I recently update to Sierra (development) and I don’t see any 
>>> problems (yet);
>>> 
>>> Stavros
>>> 
 On 17 Nov 2016, at 22:00, webobjects-dev-requ...@lists.apple.com wrote:
 
 Send Webobjects-dev mailing list submissions to
   webobjects-dev@lists.apple.com
 
 To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.apple.com/mailman/listinfo/webobjects-dev
 or, via email, send a message with subject or body 'help' to
   webobjects-dev-requ...@lists.apple.com
 
 You can reach the person managing the list at
   webobjects-dev-ow...@lists.apple.com
 
 When replying, please edit your Subject line so it is more specific
 than "Re: Contents of Webobjects-dev digest..."
 
 
 Today's Topics:
 
 1. macOS Sierra Occasionally Very Slow (Henrique Prange)
 2. Re: macOS Sierra Occasionally Very Slow (Michael Kondratov)
 
 
 --
 
 Message: 1
 Date: Thu, 17 Nov 2016 13:37:51 -0200
 From: Henrique Prange 
 To: webobjects-dev@lists.apple.com
 Subject: macOS Sierra Occasionally Very Slow
 Message-ID: <7fcada0d-5be7-467d-8717-f98c8ca3c...@gmail.com>
 Content-Type: text/plain; charset="utf-8"
 
 Hi guys,
 
 I've been experiencing two issues since updating to macOS Sierra.
 
 1) App and tests throwing "java.lang.IllegalStateException: Cannot 
 guarantee unique global ID generation: InetAddress for local host not 
 accessible" exception
 
 2) Unit tests occasionally running very slowly.
 
 I've solved those problems by mapping my computer hostname to the 
 canonical 127.0.0.1 address into /etc/hosts file.
 
 Looks like the issue is related to the java.net.InetAddress.getLocalHost() 
 method. You can find more information on this post [1].
 
 I hope this saves someone's time.
 
 [1]https://thoeni.io/post/macos-sierra-java/
 
 Cheers,
 
 Henrique
 -- next part --
 An HTML attachment was scrubbed...
 URL: 
 
 
 --
 
 Message: 2
 Date: Thu, 17 Nov 2016 10:56:49 -0500
 From: Michael Kondratov 
 To: Henrique Prange 
 Cc: webobjects-dev@lists.apple.com
 Subject: Re: macOS Sierra Occasionally Very Slow
 Message-ID: <2eaf7c09-44d6-4d4a-9103-e704ebce8...@aspireauctions.com>
 Content-Type: text/plain; charset="utf-8"
 
 We just moved away from macOS. Severe issues with TCP tuning. Socket 
 limits etc.
 
 Michael
 
 Sent from my iPhone
 
> On Nov 17, 2016, at 10:37 AM, Henrique Prange  wrote:
> 
> Hi guys,
> 
> I've been experiencing two issues since updating to macOS Sierra.
> 
> 1) App and tests throwing "java.lang.IllegalStateException: Cannot 
> guarantee unique global ID generation: InetAddress for local host not 
> accessible" exception
> 
> 2) Unit tests occasionally running very slowly.
> 
> I've solved those problems by mapping my computer hostname to the 
> canonical 127.0.0.1 address into /etc/hosts file.
> 
> Looks like the issue is related to the 
> java.net.InetAddress.getLocalHost() method. You can find more information 
> on this post [1].
> 
> I hope this saves someone's time.
> 
> [1]https://thoeni.io/post/macos-sierra-java/
> 
> Cheers,
> 
> Henrique
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> 

Re: problem is maintain checkbox status while doing pagination

2016-11-08 Thread Samuel Pelletier
You can also use an AjaxObserveField around the list to update async.

Also, I think you need ERXDisplayGroup, I thing WODisplayGroup clear the 
selection on page change.

Samuel


> Le 8 nov. 2016 à 11:51, Chuck Hill  a écrit :
> 
> You need to use a form submission to change pages, not a  hyperlink.
>  
> From:  on behalf 
> of sai krishna Bhogireddy 
> Date: Monday, November 7, 2016 at 11:25 PM
> To: "webobjects-dev@lists.apple.com" 
> Subject: problem is maintain checkbox status while doing pagination
>  
> Hi,
> 
> I am displaying list of objects using a
> WODisplaygroup, and WORepetition. The user will select
> some items from first page, then move on to next page
> and select some and so on using check boxes.
> 
> The problem is when the use selects a previous page,
> his selection is gone. How to implement this. I want
> the user's earlier selection still checked when he
> traverses to a previous page, so that when he presses
> a button such as "select checked items" all his
> selection from multiple pages is stored.
> 
> 
> Is there any code sample of a small app available to
> show how to accomplish this.
> 
> Thanks.
> 
> sai krishna
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com

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

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

Re: AIX adaptor errors

2016-11-04 Thread Samuel Pelletier
Michael,

I do not think there is without a major code refactoring. Anyway, I do not 
think this make a big difference for an app server. 

You can also skip the WO Adaptor and use mod proxy, there was some 
presentations in the last WOWODCs about this.

Samuel

> Le 4 nov. 2016 à 00:08, Michael Kondratov  a 
> écrit :
> 
> Hello,
>   I am seeing this errors from the adaptor: WOShmem_unlock(): failed to 
> unlock 156 bytes at 0x36860: Invalid argument
> 
> Any pointers?
> 
> MIchael
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: id uuid type

2016-10-25 Thread Samuel Pelletier
Hi Theodore,

Can you be more specific about the problem you experience ? 

Any errors or description of wrong behaviour can help a lot here. 

Samuel


> Le 23 oct. 2016 à 21:33, Theodore Petrosky  a écrit :
> 
> I spent the day chasing my tail. If I use the new uuid type for my id column, 
> I lose the ability to use ERCoreBL.
> 
> is there a way to use the new uuid column type and  keep ERCoreBusinessLogic 
> intact?
> 
> Or am I missing something obvious?
> 
> Ted
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: Best charting?

2016-10-19 Thread Samuel Pelletier
Ken,

You may want to look at d3, a javascript library for data visualisation with 
many widgets. It is like jQueryUI but specialized for data display. Search d3 
yourGraphType in google or explore the d3 sample page.

There are few very sharp commercial libraries I looked into but never used. 

I recommend you take the time to list your requirements because there are many 
options and it is sometime hard to find one that does everything...

Samuel


> Le 18 oct. 2016 à 15:37, Ken Anderson  a écrit :
> 
> All,
> 
> I have some data that I’d like to be able to make HTML 5 charts from.  Are 
> there any decent tools for doing this with WO?
> 
> Thanks!
> Ken
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: quick followup: ERXExistsQualifier blocks *all coordinators* even before a SELECT?!?

2016-10-15 Thread Samuel Pelletier
Hi OC,

You may also try to fetch without the exists qualifier and apply it in memory 
on the fetched objects to see if the locking will append too.

I looked a bit into the code and there is at least a global lock involved in 
the execution, EOModel._EOGlobalModelLock. These are in methods to get 
informations about the model so I expect the lock to be very shorts

If you can create a repeatable case and be able to suspend the program during 
the pause, you will at least be able to find out where it append.

There is probably better way to investigate locking problems but I do not know 
them.

Regards,

Samuel


> Le 13 oct. 2016 à 12:39, OC  a écrit :
> 
> To be sure where the delay happens, I have tried to re-write the code [1] to
> 
> === 1 ===
> def me=new 
> EOKeyValueQualifier('user',EOQualifier.QualifierOperatorEqual,sess.currentUser)
> def hasme=new ERXExistsQualifier(me,'userLinks')
> def fs=new EOFetchSpecification('DBGenGeneratedItem',hasme,null)
> NSLog.err.appendln "FETCH STARTS..."
> all=session.defaultEditingContext().objectsWithFetchSpecification(fs)
> NSLog.err.appendln "... FETCH DID END"
> ===
> 
> and still the delay (which looks like waiting for the beackground threads) 
> happens in betwixt "FETCH STARTS" and "=== Begin Internal Transaction".
> 
> Thus, it is self-evident it happens somewhere in 
> objectsWithFetchSpecification, if (and only if!) the qualifier contains 
> ERXExistsQualifier.
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: WORedirect with a known MIME type?

2016-10-10 Thread Samuel Pelletier
Hi OC,

The mime type of the final file is sent by the final web server. The redirect 
simply tell the browser to get the content elsewhere and does not define it's 
type.

In Apache, the mime type sent is defined in a mime.types file in the conf 
directory. The matching is based on the file extension. You can orreride the 
default with configuration directives.

Samuel 

> Le 9 oct. 2016 à 15:24, o...@ocs.cz a écrit :
> 
> Hello there,
> 
> at the moment, my application can return a file to the user through
> 
> ===
>WOResponse downloadFile(String mimeType, File path) {
>WOResponse wor=new WOResponse()
>wor.setHeader("$mimeType; name=\"$path.name\"","content-type")
>wor.setContent(path.getText("utf-8"))
>wor.disableClientCaching()
>wor.removeHeadersForKey("Cache-Control")
>wor.removeHeadersForKey("cache-control")
>wor.removeHeadersForKey("pragma")
>wor
>}
> ===
> 
> The 'path' though happens to map to an URL, accessible directly through the 
> HTTP server (without a need to go through the application at all). Therefore, 
> I would like to replace the code above by something like
> 
> ===
>WORedirect downloadFile(String mimeType, File path) {
>WORedirect wor=new WORedirect(context())
>wor.setUrl(URLForFile(path))
>wor
>}
> ===
> 
> to save, especially for bigger files, the memory and CPU. Nevertheless, I 
> can't see any way how to set the MIME type; is there any trick to do that?
> 
> Thanks,
> OC
> 
> 
> ___
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: slack question

2016-10-05 Thread Samuel Pelletier
Hi,

I think the list is better for questions and slack for discussion. Discussions 
about the future, others subjects than WO pertinent to the community, beer, etc 
are better suited in Slack I think and have no interest for long term indexing 
and search.

Slack group the message in discussions and this is easier to follow a long 
thread without all the previous quotes we have in the email format. Anyone can 
create a new channel (subject) in the group and invite new members.

Samuel


> Le 5 oct. 2016 à 08:14, Theodore Petrosky  a écrit :
> 
> so now that questions are being asked on Slack, will Google find these 
> answers in a search?  I think not! But of course I don’t know enough.
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: EOF inserts already existing M:N relationships/empty snapshot?!?

2016-09-20 Thread Samuel Pelletier
OC,

Did you created the M:N relationship using the modeler or you created it 
manually ?

These are tricky to correctly configure.

Your situation may be caused by an improper flattened relationship settings. 
The flattened relationships should have nothing checked in the Advanced pane of 
the modeler.

On my models, I always create them with the modeler and the relationships to 
the inner entity does not have "own relationship" checked but have the 
"Propagate primary key" checked.

Samuel


> Le 20 sept. 2016 à 14:50, o...@ocs.cz a écrit :
> 
> Hello there,
> 
> I have a pretty common setup: entities User and DataBlock, an M:N 
> relationship represented by an intermediate entity containing just the two 
> keys, flattened on both sides. At both sides the relationships are 
> appropriately flattened. Set to own destination+delete rule cascade.
> 
> The problem is, upon inserting a new DataBlock and its relationship to a 
> current user, beside the two objects which should be inserted (the new 
> DataBlock and the new relationship), relationships to other (old) DataBlocks, 
> which were before simply _fetched_ for the current user (just to display the 
> current state), get inserted too — which, of course, causes an integrity 
> constraint violation “this PK already exists“.
> 
> My code looks essentially like this:
> 
> ===
> EOEditingContext ec= ...
> DBDataBlock ndb=new DBDataBlock()
> ec.insertObject(ndb)
> ndb.addObjectToBothSidesOfRelationshipWithKey(currentUser,'dataBlockUsers')
> // logs here, see below
> ec.saveChanges()
> ===
> 
> Immediately before ec.saveChanges(), I log out
> 
> (a) ec.insertedObjects(), which contains only one object (I have overridden 
> toString() to get the PK /and other attributes, removed here for conciseness/ 
> of an EO):
> 
> []
> 
> this is all right, null PK means a newly added object, it's the very 'ndb' 
> datablock I just have inserted and which I am now saving.
> 
> (b) contents of the flattened M:N relationship 'ndb.dataBlockUsers' from the 
> DBDataBlock@79adaefa to DBUser, which looks like this:
> 
> []
> 
> again, quite all right: only one related user, the currentUser which I have 
> just added to the relationship.
> 
> (c) contents of the flattened M:N inverse relationship from the current user, 
> which looks like this:
> 
> [, , 
> , , 
> , , 
> , , 
> ]
> 
> for the third time, all right: 8 of them previously fetched, already existing 
> relationships to other (old) datablocks for the current user, plus one new 
> relationship to the newly added DBDataBlock@79adaefa. Perfect so far.
> 
> At this moment, ec.saveChanges is performed. I log the database operations 
> from databaseContextWillPerformAdaptorOperations delegate method, and it 
> looks like this:
> 
> ===
> -IN-adaptorOps === SPC: about to perform 10 DB operations |19:54:37.061 
> 20.9.16|WorkerThread1
>   - 1: INSERT on 'DBDataBlock'  1{uid:142}
>   - 2: INSERT on 'DB_UserDataBlock'  2{db_id:123, 
> user_id:105}
>   - 3: INSERT on 'DB_UserDataBlock'  2{db_id:122, 
> user_id:105}
>   - 4: INSERT on 'DB_UserDataBlock'  2{db_id:103, 
> user_id:105}
>   - 5: INSERT on 'DB_UserDataBlock'  2{db_id:116, 
> user_id:105}
>   - 6: INSERT on 'DB_UserDataBlock'  2{db_id:142, 
> user_id:105}
>   - 7: INSERT on 'DB_UserDataBlock'  2{db_id:119, 
> user_id:105}
>   - 8: INSERT on 'DB_UserDataBlock'  2{db_id:129, 
> user_id:105}
>   - 9: INSERT on 'DB_UserDataBlock'  2{db_id:124, 
> user_id:105}
>   - 10: INSERT on 'DB_UserDataBlock'  2{db_id:133, 
> user_id:105}
> ===
> 
> i.e., along with inserting the two new objects (1: the new datablock, 6: the 
> new relationship), EOF for some darned reason decides to insert _also_ all 
> those relationship objects it _fetched_ before! Of course, since they were 
> fetched, they already exist in the database, and thus cause an integrity 
> constraint violation “this PK already exists“.
> 
> Well, logging out 
> "currentUser.editingContext().committedSnapshotForObject(currentUser)['userDataBlock']"
>  before saveChanges, I get an empty array. I must admit I don't know whether 
> there should be the relationship objects in this snapshot, but anyway:
> 
> - if not, I have no idea where to find the culprit;
> - if yes, well, the culprit of those inserts is explained, but why on earth 
> the snapshot is not properly maintained by EOF?!?
> 
> Any idea what might be the culprit, or at least, how to find it? I am afraid 
> I am rather 

Re: Invisible and invalid char in textfield

2016-09-13 Thread Samuel Pelletier
Flavio,

Thank you, this works perfectly.

It could be easily added to ERXWOTextField and WOText element by default...

Is there any situation where control char would be desirable in a web text 
input (except for the tab and new line) ?

Samuel


> Le 13 sept. 2016 à 10:05, Flavio Donadio <fla...@donadio.com.br> a écrit :
> 
> Samuel,
> 
> 
> The user might have copied from another app and pasted into the field.
> 
> The solution is to strip control characters from the user input. As you may 
> know, there are a lot of ways to do that and dependent on the use case. For 
> example, if it’s a multiline text input control (textarea), you may want to 
> keep certain characters like carriage returns, line feeds and tabs.
> 
> One example of stripping all control characters using pure Java:
> 
>   String.replaceAll("\\p{Cntrl}", "”);
> 
> … and one example of stripping every control character, except for CR, LF and 
> TAB:
> 
>   String.replaceAll("[\\p{Cntrl}^\r\n\t]+", "");
> 
> I am sure NSString has methods for that...
> 
> 
> Cheers,
> Flavio
> 
>> On 13/09/2016, at 09:40, Samuel Pelletier <sam...@samkar.com> wrote:
>> 
>> Hi,
>> 
>> I just encountered a strange error where a user managed to put a DEL char 
>> inside a text field. This char raise an SQL Exception in the server.
>> 
>> First, I really would like to know how they manage to do this ! I do not 
>> even know how to put a DEL (code 127) inside text with the keyboard. I had 
>> some case with other control char in the past too.
>> 
>> Second, is there a wonder way to filter these or a Javascript method to 
>> prevent them from the source, or any suggestion to handle this ?
>> 
>> Real users are alway a source of unpredicted challenges. 
>> 
>> Thank,
>> 
>> Samuel
>> ___
>> Do not 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/flavio%40donadio.com.br
>> 
>> This email sent to fla...@donadio.com.br
> 


 ___
Do not 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

Invisible and invalid char in textfield

2016-09-13 Thread Samuel Pelletier
Hi,

I just encountered a strange error where a user managed to put a DEL char 
inside a text field. This char raise an SQL Exception in the server.

First, I really would like to know how they manage to do this ! I do not even 
know how to put a DEL (code 127) inside text with the keyboard. I had some case 
with other control char in the past too.

Second, is there a wonder way to filter these or a Javascript method to prevent 
them from the source, or any suggestion to handle this ?

Real users are alway a source of unpredicted challenges. 

Thank,

Samuel
 ___
Do not 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: EO awake ??

2016-09-12 Thread Samuel Pelletier
Hi all,

I think there is another condition to met for the automatic creation. The 
primary key of the source should also be the foreign key to the destination 
entity.

Own destination means that the destination object is owned by the source and 
should be deleted when removed from the relationship.

This works for toOne and toMany and I think create more confusion than solve 
problems... You should make sure a object is never passed to another owner 
because it will be deleted in the process.

Samuel



> Le 12 sept. 2016 à 11:31, Theodore Petrosky  a écrit :
> 
> Chuck, could you expound a little here? I refer to “An owned, mandatory, 
> to-one will get created automatically by EOF”
> 
> Maybe I am not modeling this correctly. I am creating a person entity and a 
> security entity. then I create a relationship of person to-one security where 
> security can not be null. (optional is not selected)
> 
> In my D2W app, if I create a new person, the security entity relation is not 
> automatically created. I thought I had to create this in the EO’s init, or 
> awakeFromInsertion methods.
> 
> Am I supposed to do something more to the model to make this “automatic”?
> 
> Ted
> 
> 
> 
>> On Sep 6, 2016, at 2:14 PM, Chuck Hill > > wrote:
>> 
>> Did you do the check for null after the call to super? 
>>  
>> An owned, mandatory, to-one will get created automatically by EOF.  I am 
>> pretty sure that is what is happening and then you are creating and 
>> assigning a second one.
>>  
>> Chuck
>>  
>>  
>> From: > > on 
>> behalf of Theodore Petrosky >
>> Date: Tuesday, September 6, 2016 at 10:08 AM
>> To: Johann Werner >
>> Cc: WebObjects-Dev > >
>> Subject: Re: EO awake ??
>>  
>> I tried the first suggestion of wrapping the createSecurity in a check to 
>> see if it is null and I got the same result.
>>  
>> then I moved the createSecurity method call into the init method and I get 
>> the same issue. I could probably trick it by making the security entity not 
>> mandatory. but as the createSecurity is in the init call, the person will 
>> always get a security.
>>  
>> Ted
>>  
>>  
>> On Sep 6, 2016, at 12:44 PM, Johann Werner > > wrote:
>> Hi Ted,
>> why not just check if there is already a value in your awakeFromInsertion?
>> public void awakeFromInsertion(EOEditingContext editingContext) {
>> super.awakeFromInsertion(editingContext);
>> if (security() == null) {
>>  setSecurity(Security.createSecurity(editingContext, true, true, 
>> true, true, true));
>> }
>> }
>> But probably you should be using the init(EOEditingContext editingContext) 
>> method instead, which is highly advisable.
>> jw
>> Am 06.09.2016 um 18:27 schrieb Theodore Petrosky > >:
>> I have a to one relation Person to one Security. I keep all my security 
>> booleans in entity Security.
>> I am overriding awakeFromInsertion so that when I create a new person, it is 
>> assigned a security entity.
>> I have a problem in migrations. I have a postupgrade method that creates a 
>> person. in this method I have:
>>Person.createPerson(editingContext, new NSTimestamp(), "Theodore", 
>> true, "Petrosky", “pw", “user", Security.createSecurity(editingContext, 
>> true, true, true, true, true));
>> the security is mandatory as it should be. However on first run (to run the 
>> migrations), I end up with two security entities. Obviously, when a person 
>> is created and inserted the awake is fired and I get this orphan.
>> How can I eliminate this extra security entity? I was hoping that I could 
>> just not add a security entity in the createPerson line, but then my app 
>> complains that security is mandatory.
>> Person.createPerson(editingContext, new NSTimestamp(), "Theodore", true, 
>> "Petrosky", “pw", “user”, null);
>> In the past I would have just used ERXJDBCUtilities.executeUpdate and added 
>> the admin user with manual sql. I thought I would be clever and use the 
>> postupgrade method.
>>  
>>  
>> ___
>> Do not 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/chill%40gevityinc.com 
>> 
>>  
>> This email sent to ch...@gevityinc.com 
> ___
> Do not post admin 

Re: EO awake ??

2016-09-06 Thread Samuel Pelletier
Hi Ted,

The current execution of the code you posted is this:

1- The object is created and inserted

2- Awake from Insertion is called and a Security is created (it was probably 
null)

3- SetSecurity is called by Person.createPerson method with the provided 
Security.


So, it the Security object of a Person is not suppose to change, you can put 
your guard in the setSecurity method.


Samuel


> Le 6 sept. 2016 à 13:08, Theodore Petrosky  a écrit :
> 
> I tried the first suggestion of wrapping the createSecurity in a check to see 
> if it is null and I got the same result.
> 
> then I moved the createSecurity method call into the init method and I get 
> the same issue. I could probably trick it by making the security entity not 
> mandatory. but as the createSecurity is in the init call, the person will 
> always get a security.
> 
> Ted
> 
> 
>> On Sep 6, 2016, at 12:44 PM, Johann Werner  wrote:
>> 
>> Hi Ted,
>> 
>> why not just check if there is already a value in your awakeFromInsertion?
>> 
>> public void awakeFromInsertion(EOEditingContext editingContext) {
>>  super.awakeFromInsertion(editingContext);
>>  if (security() == null) {
>>  setSecurity(Security.createSecurity(editingContext, true, true, 
>> true, true, true));
>>  }
>> }
>> 
>> But probably you should be using the init(EOEditingContext editingContext) 
>> method instead, which is highly advisable.
>> 
>> jw
>> 
>> 
>>> Am 06.09.2016 um 18:27 schrieb Theodore Petrosky :
>>> 
>>> I have a to one relation Person to one Security. I keep all my security 
>>> booleans in entity Security.
>>> 
>>> I am overriding awakeFromInsertion so that when I create a new person, it 
>>> is assigned a security entity.
>>> 
>>> I have a problem in migrations. I have a postupgrade method that creates a 
>>> person. in this method I have:
>>> 
>>> Person.createPerson(editingContext, new NSTimestamp(), 
>>> "Theodore", true, "Petrosky", “pw", “user", 
>>> Security.createSecurity(editingContext, true, true, true, true, true));
>>> 
>>> the security is mandatory as it should be. However on first run (to run the 
>>> migrations), I end up with two security entities. Obviously, when a person 
>>> is created and inserted the awake is fired and I get this orphan.
>>> 
>>> How can I eliminate this extra security entity? I was hoping that I could 
>>> just not add a security entity in the createPerson line, but then my app 
>>> complains that security is mandatory.
>>> 
>>> Person.createPerson(editingContext, new NSTimestamp(), "Theodore", true, 
>>> "Petrosky", “pw", “user”, null);
>>> 
>>> In the past I would have just used ERXJDBCUtilities.executeUpdate and added 
>>> the admin user with manual sql. I thought I would be clever and use the 
>>> postupgrade method.
>> 
>> 
> 
> 
> ___
> Do not 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/samuel%40samkar.com
> 
> This email sent to sam...@samkar.com


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

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

Re: Deadlocks, editing context locking and network tasks

2016-09-05 Thread Samuel Pelletier
Mark,

I discover some useful classes in the er.extensions.concurrency package inside 
ERExtensions.

Bases on these my current pattern for background tasks is this:

ERXApplication._startRequest();
ec = ERXEC.newEditingContext(parentObjectStore);
try {
do the job without worrying about locks, auto locking will handle then
}
finally {
ec = null;
ERXApplication._endRequest();
}

> 1. For a background thread, it is appropriate to create a new editing context 
> (ERXEC.newEditingContext(Bosc)) using a dedicated and new object store 
> coordinator (created using osc = new ERXObjectStoreCoordinator()).

The new editing context is mandatory, the new OSC depends on your case, as 
usual there are pros and cons...
Pros:
- You will use a new connection to the database and if your connections 
settings and use case allows it (do not create long lock in the database 
server), you will not block others threads of your app.

Cons:
- You will not uses the snapshot cache of the main OSC so everything 
will be fetched, this can represent a large memory duplication and will require 
more time if most or your data os already cached.
- Your changes will NOT be propagated to others EOEditingcontexts, they 
only propagate inside an OSC.

Unless you need to perform long fetch (or update), a separate OSC may is 
probably not be the most efficient solution. It is really dependant on the type 
of database access performed by the task.

> 
> 2. For a background thread, all such editing contexts should be lock()’ed and 
> then unlock()’ed - unlocked in finally {} clause in case of uncaught 
> exceptions. Automatic locking is only for ECs used within the R-R loop?

You can, see the beginning of the message.

> 3. But what should one do if, either during a background thread, R-R loop 
> (direct action or component action), one locks an editing context, does some 
> processing of objects within that context, makes a network call, and then 
> does some more processing within that context. Should one simply lock() and 
> then hope for the best, or unlock, do the network process and then re-lock at 
> the end. Are there any issues running unlock() if the EC isn’t actually 
> locked? What happens if that network call never returns?

That should not be a problem if your EOEditing context is private but you will 
not receive the change of the EO from others EOEditingcontexts when you are 
locked. As other said, you should have some timeout in place and handle them 
properly.

I do not know about too many unlock, I do not expect it to cause problems but I 
suggest to try, this is easy.


> 4. Is locking an EC from a newly created OSC completely independent from all 
> other OSC ECs? If that lock isn’t released for some time, does it matter?

As any lock, all resources used will never be released. This will include the 
snapshot cache of everything fetched in this EC.

Samuel



 ___
Do not 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

Adding allowed attribute to built in element validation

2016-08-23 Thread Samuel Pelletier
Hi,

Anyone knows how to add binding to the validation and auto complete in the WO 
editor for built in element like the textfield ?

I use the placeholder binding to add this attribute to the element but this 
confuse the editor that no longer auto complete after an element like this:



The HTML is properly generated but the auto complete that break make me crazy.

Thanks,

Samuel


 ___
Do not 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

  1   2   3   >