Re: re/store context somehow? (OCsite)

2024-05-17 Thread Amedeo Mantica via Webobjects-dev
I no longer use WO but I recall this framework in wonder: 
ERPersistentSessionStorage

Amedeo


> On 17 May 2024, at 22:01, Martino Limido via Webobjects-dev 
>  wrote:
> 
> Hi there,
> 
> it’s important to note that the `WOContext` object in WebObjects ends with 
> the lifecycle of the request and response. This means that simply storing the 
> `WOContext` object is not feasible as it will no longer be available after 
> the request is completed.
> 
> ### Possibility of Implementation:
> 
> 1. **Context Serialization**:
>   - While WebObjects does not natively support serializing the entire 
> `WOContext`, it is possible to manually serialize the essential parts of the 
> context. This includes capturing the state of components, user inputs, and 
> any relevant session information.
>   - You can use `context().clone()` in `Session.sleep()` to clone the context 
> state. However, ensure that all referenced objects within the context are 
> serializable. This might involve customizing the serialization process for 
> complex objects.
> 
> 2. **State Storage**:
>   - Store the serialized state in a persistent format, such as a database or 
> a session file. The storage mechanism should be robust enough to handle the 
> complexity of the serialized data and ensure it can be accurately retrieved 
> later.
> 
> 3. **State Restoration**:
>   - In the `restorePreviousAction` DirectAction, implement a mechanism to 
> deserialize and reintegrate the previously saved state. This involves 
> reconstructing the `WOContext` and ensuring all components and user states 
> are accurately restored.
>   - This might require a custom deserialization logic to handle complex 
> objects and ensure they are correctly linked within the session.
> 
> ### Challenges:
> - **Complexity**: Serializing complex objects and managing cross-references 
> can significantly increase code complexity. WebObjects' inherent statefulness 
> and deep object graph make this particularly challenging.
> - **Data Integrity**: Ensuring data consistency during the serialization and 
> deserialization process is critical. Any mismatch can lead to errors or 
> inconsistent application states.
> - **Performance**: Serialization and deserialization can impact performance, 
> especially if the context is large or complex. It’s important to optimize 
> this process to minimize the performance overhead.
> 
> ### Recommendation:
> Given the complexities and potential issues with this approach, it might be 
> better to rethink the application design. Consider structuring the 
> application to use DirectActions with simpler states that are easier to 
> restore. This could involve:
> - Breaking down complex states into smaller, more manageable parts that can 
> be easily serialized and deserialized.
> - Ensuring that each DirectAction has a well-defined and minimal state that 
> can be captured and restored without requiring the entire context.
> - Leveraging stateless designs where possible, and using session storage 
> judiciously to maintain essential state information.
> 
> ### Conclusion:
> Implementing this functionality is technically possible but requires 
> significant effort and a deep understanding of the object lifecycle in 
> WebObjects. Given that the `WOContext` object ends with the request/response 
> cycle, manually serializing and restoring its state is complex and 
> potentially error-prone.
> 
> 
> Best regards,  
> Martino
> 
>> Il giorno 17 mag 2024, alle ore 21:00, webobjects-dev-
>> 
>>  1. re/store context somehow? (OCsite)
>> 
>> 
>> --
>> 
>> Message: 1
>> Date: Thu, 16 May 2024 21:14:39 +0200
>> From: OCsite 
>> To: OCsite via Webobjects-dev 
>> Subject: re/store context somehow?
>> Message-ID: <1d450aeb-ded8-4b1a-8438-59039f31b...@ocs.cz>
>> Content-Type: text/plain; charset="utf-8"
>> 
>> Hi there,
>> 
>> my client made a somewhat weird request: wants me to store ?the last context 
>> the user worked in? in his session, and restore it when the user comes to 
>> the application through a specific Direct Action (and the session still 
>> lives).
>> 
>> In other words, suppose the user works in the app for awhile, and then 
>> closes his browser, remembering just the session ID, nothing else.
>> 
>> Next thing he does, he opens 
>> .../OurApp.woa/wa/restorePrevious?wosid=prevSessionID ? and wow, he finds 
>> the browser window in precisely the same state it was when he closed the 
>> browser some time ago. (Far as possible of course, let's assume for 
>> simplicity the internal app/session/DB state did not change meantime.)
>> 
>> I guess most probably I need to save context().clone() into session each 
>> time in Session.sleep(), that's not difficult. But then in my 
>> DirectAction.restorePreviousAction I need to resurrect the saved context 
>> somehow, but I can't find a way to do that. Does anybody know how to?
>> 
>> Thanks!
> 

Re: Monitor scheduling

2020-07-13 Thread Amedeo Mantica via Webobjects-dev
https://docs.oracle.com/javase/8/docs/api/java/util/TimerTask.html

Sent from my iPhone

> On 13 Jul 2020, at 08:30, GILQUIN Pierre via Webobjects-dev 
>  wrote:
> 
> 
> Hi,
>  
> I have a extraction job that need to be ran only one time the week-end. The 
> process stopped when done
> I am not allowed to use crontab to schedule this job.
>  
> I try on the wonder monitor without success so far. Is there a way to do that 
> ?
> To sum-up : scheduled on Saturday night without Auto recover
>  
> Thanks in advance
> Pierre
> ___
> Do not 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/amedeomantica%40me.com
> 
> This email sent to amedeomant...@me.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: Sign in with apple?

2020-06-03 Thread Amedeo Mantica via Webobjects-dev
I use this library

https://github.com/auth0/java-jwt 

the Apple public Keys for verification are here

https://appleid.apple.com/auth/keys 

Amedeo



> On 2 Jun 2020, at 14:41, Jesse Tayler via Webobjects-dev 
>  wrote:
> 
> 
> 
>> On Jun 1, 2020, at 9:40 PM, Ray Kiddy  wrote:
>> 
>> 
>> Somebody comes in to the app, I get their e-mail address and sent them an 
>> "invite" into the app. This is exactly as secure as any password-storage 
>> system that uses e-mail to reset passwords
> 
> 
> This means the user has to invoke a new session by getting a link in email 
> each time they access? 
> 
> I suppose that link cannot be shared since it expires?
> 
> I mean it sounds interesting, I am interested in what is going on with your 
> suggestion.
> 
> Just seems like sending around links that allow people to enter directly has 
> various dangers and complexities itself, and I wonder what the resulting 
> experience is and what the level of security is. 
> 
> Isn’t this technically pushing the password back to your email login and 
> isn’t that really no different than the O-Auth or Apple sign in? 
> 
> Apple sign in is preferable to users because it is easy and doesn’t offer 
> private information to the site, Facebook login seems the same but is 
> reversed. Facebook login is there to let Facebook see where you login and 
> when so it can sell that data to advertisers.
> 
> The idea of not using passwords at all is interesting, but I’m not sure this 
> would be what I’m thinking about.
> 
> I’m going to guess this is not a bank, but what sort of service uses this 
> email authentication and why was it implemented?
> 
> ___
> Do not 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/amedeomantica%40me.com
> 
> This email sent to amedeomant...@me.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: Sign in with apple?

2020-05-31 Thread Amedeo Mantica via Webobjects-dev
I did it using a Java library, not a wo project but this doesn’t matter. You 
just need an awt token validation library. I’ll post it tomorrow. 
Amedeo

Sent from my iPhone

> On 31 May 2020, at 17:31, Jesse Tayler via Webobjects-dev 
>  wrote:
> 
> 
> 
> Indeed.
> 
> And I can see why without too much trouble right here... reminds me of APNS 
> which I initially did by hand in JAVA but later so many services just worked 
> so much better...
> 
> I’ll fish around and report if I learn anything interesting, but it does seem 
> likely this would be the intelligent sort of route one would take.
> 
> 
>> On May 31, 2020, at 11:20 AM, Aaron Rosenzweig  wrote:
>> 
>> It’s a good question Jesse. Seems more people these days are paying a small 
>> fee to people who have perfect solutions we can use immediately. Auth0 and 
>> Okta come to mind but there are a plethora of choices.
>> 
>> https://auth0.com/blog/try-sign-in-with-apple-in-your-auth0-apps-today/
>> 
>> https://developer.okta.com/blog/2019/06/04/what-the-heck-is-sign-in-with-apple
>> 
>> 
>> https://auth0.com/docs/quickstart/webapp/java/01-login
>> 
>> https://developer.okta.com/code/java/
>> 
>> AARON ROSENZWEIG / Chat 'n Bike
>> e:  aa...@chatnbike.com  t:  (301) 956-2319   
>>  
>> 
>>> On May 31, 2020, at 8:35 AM, Jesse Tayler via Webobjects-dev 
>>>  wrote:
>>> 
>>> 
>>> I thought to myself, say —  I should support "Sign in with Apple” —  and 
>>> wondered if anyone has experiences they’d like to share about integrating 
>>> with your WO Apps??
>>> 
>>> 
>>> ___
>>> Do not 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/amedeomantica%40me.com
> 
> This email sent to amedeomant...@me.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