Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-13 Thread Kishanthan Thangarajah
On Wed, Jan 11, 2017 at 6:15 PM, Sagara Gunathunga  wrote:

>
> Shouldn't we add and maintain this doc in UUF Github repo itself ?
>

Its already added to github -
https://github.com/wso2/carbon-uuf-maven-tools/tree/master/plugin

>
> Thanks !
>
> On Wed, Jan 11, 2017 at 5:59 PM, SajithAR Ariyarathna 
> wrote:
>
>> [+ShanM]
>>
>> On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
>> indu...@wso2.com> wrote:
>>
>>> Hi UUF team,
>>>
>>> I think it's better to give some description about the "onRequest()"
>>> method and how it works in [1], since for a beginner, it might be somewhat
>>> difficult to understand.
>>>
>>> [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnn
>>> JyUjH3vxOrv0k0rK5hc/edit
>>>
>>> Thanks and Regards
>>> --
>>> Indunil Upeksha Rathnayake
>>> Software Engineer | WSO2 Inc
>>> Emailindu...@wso2.com
>>> Mobile   0772182255
>>>
>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sagara Gunathunga
>
> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
> V.P Apache Web Services;http://ws.apache.org/
> Linkedin; http://www.linkedin.com/in/ssagara
> Blog ;  http://ssagara.blogspot.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Kishanthan Thangarajah*
Technical Lead,
Platform Technologies Team,
WSO2, Inc.
lean.enterprise.middleware

Mobile - +94773426635
Blog - *http://kishanthan.wordpress.com *
Twitter - *http://twitter.com/kishanthan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-12 Thread KasunG Gajasinghe
On Thu, Jan 12, 2017 at 11:39 PM, Manuranga Perera  wrote:

> @UUF team
>
> It's OK to provide a POST in theory, but we have to see what they are
> going to do with it. I think they are trying to do a self accepting page.
> In Jaggery is was very hard to unsaturated the code when same code is
> responsible for showing and adding (let say a new user).
>

Yes. This was done not just in Jaggery, some of our Mgt console JSP UI
pages also have this incorrect behavior. In Java, use of Servlets for
handling POSTs is quite clear. But, how it should be handled in a framework
like UUF? (Or Jaggery for that matter?)


> Let's not repeat that error.
>
> And it's a very common use cause to show whet you just added.
>
> So UUF, Please don't just impalement the feature, think about the full use
> case and give a sample (eg: should they use ajax to submit button?, should
> it go to the same page or different page, if error occurred on POST where
> is that viewed? maybe ask UX?)
>
> Let's give a sample on "how to do a form in UUF". Let's have a chat if
> needed.
>
>
On, how to do a form in UUF. Currently, this is how we are handling it  --

$ cat sample.js
function onRequest(env) {
if (env.request.method == "POST" &&
env.request.formParams["formId"]="myform")
{
// do stuff related to myform
}

if (env.request.method == "GET") {
// do stuff for GET
}
}


>
> On Wed, Jan 11, 2017 at 3:42 PM, KasunG Gajasinghe 
> wrote:
>
>> Hi Sajith,
>>
>> +1. Having one single method like #onRequest to handle both GET and POST
>> is considered a bad practice as per HTTP specification since these HTTP
>> methods serve different purposes entirely.
>>
>> In Servlets, we have #doGet and #doPost to handle GET and POST requests
>> separately. Something to think about, since we cannot easily change the API
>> once the GA is out!
>>
>> Thanks.
>>
>>
>> On Wed, Jan 11, 2017 at 6:15 PM, Sagara Gunathunga 
>> wrote:
>>
>>>
>>> Shouldn't we add and maintain this doc in UUF Github repo itself ?
>>>
>>> Thanks !
>>>
>>> On Wed, Jan 11, 2017 at 5:59 PM, SajithAR Ariyarathna >> > wrote:
>>>
 [+ShanM]

 On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
 indu...@wso2.com> wrote:

> Hi UUF team,
>
> I think it's better to give some description about the "onRequest()"
> method and how it works in [1], since for a beginner, it might be somewhat
> difficult to understand.
>
> [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnn
> JyUjH3vxOrv0k0rK5hc/edit
>
> Thanks and Regards
> --
> Indunil Upeksha Rathnayake
> Software Engineer | WSO2 Inc
> Emailindu...@wso2.com
> Mobile   0772182255 <077%20218%202255>
>



 --
 Sajith Janaprasad Ariyarathna
 Software Engineer; WSO2, Inc.;  http://wso2.com/
 

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev


>>>
>>>
>>> --
>>> Sagara Gunathunga
>>>
>>> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
>>> V.P Apache Web Services;http://ws.apache.org/
>>> Linkedin; http://www.linkedin.com/in/ssagara
>>> Blog ;  http://ssagara.blogspot.com
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>>
>> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
>> email: kasung AT spamfree wso2.com
>> linked-in: http://lk.linkedin.com/in/gajasinghe
>> blog: http://kasunbg.org
>> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> With regards,
> *Manu*ranga Perera.
>
> phone : 071 7 70 20 50
> mail : m...@wso2.com
>



-- 

*Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
phone: +1 650-745-4499 <+1%20650-745-4499>, 77 678 0813
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-12 Thread Manuranga Perera
@UUF team

It's OK to provide a POST in theory, but we have to see what they are going
to do with it. I think they are trying to do a self accepting page.
In Jaggery is was very hard to unsaturated the code when same code is
responsible for showing and adding (let say a new user).
Let's not repeat that error.

And it's a very common use cause to show whet you just added.

So UUF, Please don't just impalement the feature, think about the full use
case and give a sample (eg: should they use ajax to submit button?, should
it go to the same page or different page, if error occurred on POST where
is that viewed? maybe ask UX?)

Let's give a sample on "how to do a form in UUF". Let's have a chat if
needed.


On Wed, Jan 11, 2017 at 3:42 PM, KasunG Gajasinghe  wrote:

> Hi Sajith,
>
> +1. Having one single method like #onRequest to handle both GET and POST
> is considered a bad practice as per HTTP specification since these HTTP
> methods serve different purposes entirely.
>
> In Servlets, we have #doGet and #doPost to handle GET and POST requests
> separately. Something to think about, since we cannot easily change the API
> once the GA is out!
>
> Thanks.
>
>
> On Wed, Jan 11, 2017 at 6:15 PM, Sagara Gunathunga 
> wrote:
>
>>
>> Shouldn't we add and maintain this doc in UUF Github repo itself ?
>>
>> Thanks !
>>
>> On Wed, Jan 11, 2017 at 5:59 PM, SajithAR Ariyarathna 
>> wrote:
>>
>>> [+ShanM]
>>>
>>> On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
>>> indu...@wso2.com> wrote:
>>>
 Hi UUF team,

 I think it's better to give some description about the "onRequest()"
 method and how it works in [1], since for a beginner, it might be somewhat
 difficult to understand.

 [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnn
 JyUjH3vxOrv0k0rK5hc/edit

 Thanks and Regards
 --
 Indunil Upeksha Rathnayake
 Software Engineer | WSO2 Inc
 Emailindu...@wso2.com
 Mobile   0772182255 <077%20218%202255>

>>>
>>>
>>>
>>> --
>>> Sajith Janaprasad Ariyarathna
>>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>> 
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Sagara Gunathunga
>>
>> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
>> V.P Apache Web Services;http://ws.apache.org/
>> Linkedin; http://www.linkedin.com/in/ssagara
>> Blog ;  http://ssagara.blogspot.com
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
> email: kasung AT spamfree wso2.com
> linked-in: http://lk.linkedin.com/in/gajasinghe
> blog: http://kasunbg.org
> phone: +1 650-745-4499 <(650)%20745-4499>, 77 678 0813
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-11 Thread KasunG Gajasinghe
Hi Sajith,

+1. Having one single method like #onRequest to handle both GET and POST is
considered a bad practice as per HTTP specification since these HTTP
methods serve different purposes entirely.

In Servlets, we have #doGet and #doPost to handle GET and POST requests
separately. Something to think about, since we cannot easily change the API
once the GA is out!

Thanks.


On Wed, Jan 11, 2017 at 6:15 PM, Sagara Gunathunga  wrote:

>
> Shouldn't we add and maintain this doc in UUF Github repo itself ?
>
> Thanks !
>
> On Wed, Jan 11, 2017 at 5:59 PM, SajithAR Ariyarathna 
> wrote:
>
>> [+ShanM]
>>
>> On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
>> indu...@wso2.com> wrote:
>>
>>> Hi UUF team,
>>>
>>> I think it's better to give some description about the "onRequest()"
>>> method and how it works in [1], since for a beginner, it might be somewhat
>>> difficult to understand.
>>>
>>> [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnn
>>> JyUjH3vxOrv0k0rK5hc/edit
>>>
>>> Thanks and Regards
>>> --
>>> Indunil Upeksha Rathnayake
>>> Software Engineer | WSO2 Inc
>>> Emailindu...@wso2.com
>>> Mobile   0772182255 <077%20218%202255>
>>>
>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sagara Gunathunga
>
> Associate Director / Architect; WSO2, Inc.;  http://wso2.com
> V.P Apache Web Services;http://ws.apache.org/
> Linkedin; http://www.linkedin.com/in/ssagara
> Blog ;  http://ssagara.blogspot.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Kasun Gajasinghe*Associate Technical Lead, WSO2 Inc.
email: kasung AT spamfree wso2.com
linked-in: http://lk.linkedin.com/in/gajasinghe
blog: http://kasunbg.org
phone: +1 650-745-4499, 77 678 0813
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-11 Thread Sagara Gunathunga
Shouldn't we add and maintain this doc in UUF Github repo itself ?

Thanks !

On Wed, Jan 11, 2017 at 5:59 PM, SajithAR Ariyarathna 
wrote:

> [+ShanM]
>
> On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
> indu...@wso2.com> wrote:
>
>> Hi UUF team,
>>
>> I think it's better to give some description about the "onRequest()"
>> method and how it works in [1], since for a beginner, it might be somewhat
>> difficult to understand.
>>
>> [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnn
>> JyUjH3vxOrv0k0rK5hc/edit
>>
>> Thanks and Regards
>> --
>> Indunil Upeksha Rathnayake
>> Software Engineer | WSO2 Inc
>> Emailindu...@wso2.com
>> Mobile   0772182255
>>
>
>
>
> --
> Sajith Janaprasad Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sagara Gunathunga

Associate Director / Architect; WSO2, Inc.;  http://wso2.com
V.P Apache Web Services;http://ws.apache.org/
Linkedin; http://www.linkedin.com/in/ssagara
Blog ;  http://ssagara.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-11 Thread SajithAR Ariyarathna
[+ShanM]

On Wed, Jan 11, 2017 at 5:54 PM, Indunil Upeksha Rathnayake <
indu...@wso2.com> wrote:

> Hi UUF team,
>
> I think it's better to give some description about the "onRequest()"
> method and how it works in [1], since for a beginner, it might be somewhat
> difficult to understand.
>
> [1] https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnnJyUjH
> 3vxOrv0k0rK5hc/edit
>
> Thanks and Regards
> --
> Indunil Upeksha Rathnayake
> Software Engineer | WSO2 Inc
> Emailindu...@wso2.com
> Mobile   0772182255
>



-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/

___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Document onRequest() method in the UUF developer's guide

2017-01-11 Thread Indunil Upeksha Rathnayake
Hi UUF team,

I think it's better to give some description about the "onRequest()" method
and how it works in [1], since for a beginner, it might be somewhat
difficult to understand.

[1]
https://docs.google.com/document/d/10UDdArHV1eYEfiONu8saqPnnJyUjH3vxOrv0k0rK5hc/edit

Thanks and Regards
-- 
Indunil Upeksha Rathnayake
Software Engineer | WSO2 Inc
Emailindu...@wso2.com
Mobile   0772182255
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev