Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread Lasantha Samarakoon
​Agreeing with Jo.

Plus the comments have different meaning rather than marking sections, I
don't think it's a good practice to use comments to replace DIVs and other
block elements. ​If we can go ahead with DIVs other than comments we don't
need to filter nodes in the DOM to identify comment blocks as well. Instead
we can use whatever the available HTML attributes and "data-" attributes.

Regards,

*Lasantha Samarakoon* | Software Engineer
WSO2, Inc.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 (71) 214 1576
Email:  lasant...@wso2.com
Web:www.wso2.com

lean . enterprise . middleware

On Wed, Dec 14, 2016 at 10:47 AM, Joseph Fonseka  wrote:

> Hi Sajith
>
> On Wed, Dec 14, 2016 at 8:44 AM, SajithAR Ariyarathna 
> wrote:
>
>>
>> 2. Why did we use comments to propagate Zones to the client side instead
>>> of Divs.
>>>
>> divs clashes with CSS selectors (same goes for spans). These zone markers
>> should be invisible (which means they shouldn't create or affect visual
>> elements in the DOM). That's' why we chose HTML comments.
>>
>
> I am not sure if the above claim is correct. If Divs are not specifically
> styled it should not clash with CSS. Divs are meant to encapsulate
> a division or a section in the HTML which I believe what zone also
> represent.
>
> Thanks
> Jo
>
>
>
>>
>> Thanks.
>>
>> On Wed, Dec 14, 2016 at 8:05 AM, Joseph Fonseka  wrote:
>>
>>> Hi
>>>
>>> +1, few clarifications bellow.
>>>
>>> 1. I guess the default mode will be OVERWRITE.
>>> 2. Why did we use comments to propagate Zones to the client side instead
>>> of Divs.
>>>
>>> Thanks
>>> Jo
>>>
>>>
>>>
>>> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna <
>>> sajit...@wso2.com> wrote:
>>>
 Hi All,

 To do $subject, we are hoping to give a UUF client JS library. With the
 client-side library, webapp developers will be able to render fragments and
 push to zones similar to the server-side.

 Functions in the library:

 UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
 zoneName, mode)

 Using this function webapp developers can render a fragment in the
 client-side and push the content to a given zone.

 Here,

 *fragmentFullyQualifedName* - Fully qualified name
 (.) of the fragment that you want to
 render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
 *templateFillingObject* - JSON object which will be used to fill the
 fragment's template. e.g. {name: "My API", version: "1.0.0"}

 *zoneName* - Name of the zone that you want to push the rendered HTML.
 e.g. "grid"

 *mode* - Dictates how the pushing content orders with the existing
 content in the zone. Mode can be "PREPEND" (put the pushing content before
 the existing content), "APPEND" (put the pushing content after the existing
 content) or "OVERWRITE" (replace the existing content with the pushing
 content)


 UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)

 Using this function webapp devs can render a given Handlebars template
 and push it to a desired zone.

 Here,

 *hbsTemplate* - Handlebars template string


 Bringing zones to the client-side.

 When rendering a zone in the server-side, we can mark the start and end
 of a zone's content with HTML comments.

 e.g.

 
  content of zone grid goes here
  here is a div
  some more stuff
 

 HTML comments can be identified by filtering nodes in the DOM. And
 further filtering the comments that starts with [UUF-ZONE], we can
 identify UUF zone marking comments. Jerad did a POC for this. In that we
 were able to successfully identify zones and push content for all modes.


 We are hoping to expose this library through the "uuf-client" fragment
 in the common "foundation" component [1].

 [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
 nents/org.wso2.carbon.uuf.common.foundation

 WDYT?

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

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


>>>
>>>
>>> --
>>>
>>> --
>>> *Joseph Fonseka*
>>> WSO2 Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 772 512 430
>>> skype: jpfonseka
>>>
>>> * *
>>>
>>>
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 

Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread Joseph Fonseka
Hi Sajith

On Wed, Dec 14, 2016 at 8:44 AM, SajithAR Ariyarathna 
wrote:

>
> 2. Why did we use comments to propagate Zones to the client side instead
>> of Divs.
>>
> divs clashes with CSS selectors (same goes for spans). These zone markers
> should be invisible (which means they shouldn't create or affect visual
> elements in the DOM). That's' why we chose HTML comments.
>

I am not sure if the above claim is correct. If Divs are not specifically
styled it should not clash with CSS. Divs are meant to encapsulate
a division or a section in the HTML which I believe what zone also
represent.

Thanks
Jo



>
> Thanks.
>
> On Wed, Dec 14, 2016 at 8:05 AM, Joseph Fonseka  wrote:
>
>> Hi
>>
>> +1, few clarifications bellow.
>>
>> 1. I guess the default mode will be OVERWRITE.
>> 2. Why did we use comments to propagate Zones to the client side instead
>> of Divs.
>>
>> Thanks
>> Jo
>>
>>
>>
>> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna > > wrote:
>>
>>> Hi All,
>>>
>>> To do $subject, we are hoping to give a UUF client JS library. With the
>>> client-side library, webapp developers will be able to render fragments and
>>> push to zones similar to the server-side.
>>>
>>> Functions in the library:
>>>
>>> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
>>> zoneName, mode)
>>>
>>> Using this function webapp developers can render a fragment in the
>>> client-side and push the content to a given zone.
>>>
>>> Here,
>>>
>>> *fragmentFullyQualifedName* - Fully qualified name
>>> (.) of the fragment that you want to
>>> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
>>> *templateFillingObject* - JSON object which will be used to fill the
>>> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>>>
>>> *zoneName* - Name of the zone that you want to push the rendered HTML.
>>> e.g. "grid"
>>>
>>> *mode* - Dictates how the pushing content orders with the existing
>>> content in the zone. Mode can be "PREPEND" (put the pushing content before
>>> the existing content), "APPEND" (put the pushing content after the existing
>>> content) or "OVERWRITE" (replace the existing content with the pushing
>>> content)
>>>
>>>
>>> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>>>
>>> Using this function webapp devs can render a given Handlebars template
>>> and push it to a desired zone.
>>>
>>> Here,
>>>
>>> *hbsTemplate* - Handlebars template string
>>>
>>>
>>> Bringing zones to the client-side.
>>>
>>> When rendering a zone in the server-side, we can mark the start and end
>>> of a zone's content with HTML comments.
>>>
>>> e.g.
>>>
>>> 
>>>  content of zone grid goes here
>>>  here is a div
>>>  some more stuff
>>> 
>>>
>>> HTML comments can be identified by filtering nodes in the DOM. And
>>> further filtering the comments that starts with [UUF-ZONE], we can
>>> identify UUF zone marking comments. Jerad did a POC for this. In that we
>>> were able to successfully identify zones and push content for all modes.
>>>
>>>
>>> We are hoping to expose this library through the "uuf-client" fragment
>>> in the common "foundation" component [1].
>>>
>>> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
>>> nents/org.wso2.carbon.uuf.common.foundation
>>>
>>> WDYT?
>>>
>>> Thanks.
>>> --
>>> Sajith Janaprasad Ariyarathna
>>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>> 
>>>
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>>
>> --
>> *Joseph Fonseka*
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 772 512 430
>> skype: jpfonseka
>>
>> * *
>>
>>
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
> Sajith Janaprasad Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> 
>
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 

-- 
*Joseph Fonseka*
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 772 512 430
skype: jpfonseka

* *
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread SajithAR Ariyarathna
Hi Chanaka,

What will be the location of these fragments? If it's the same as server
> side fragments it will give control over different UUF components IMO.

These are normal fragments that you use in the server-side.  Its not like
giving control to a different component, instead we are re-using the same
template in the client-side.

On Wed, Dec 14, 2016 at 10:47 AM, Chanaka Jayasena  wrote:

> Hi Sajith,
>
> This will be very useful for the developers. Now we are maintaining client
> side templates in public folder and doing ajax calls to fetch them and
> render.
>
> What will be the location of these fragments? If it's the same as server
> side fragments it will give control over different UUF components IMO.
>
> thanks,
> Chanaka
>
> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna 
> wrote:
>
>> Hi All,
>>
>> To do $subject, we are hoping to give a UUF client JS library. With the
>> client-side library, webapp developers will be able to render fragments and
>> push to zones similar to the server-side.
>>
>> Functions in the library:
>>
>> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
>> zoneName, mode)
>>
>> Using this function webapp developers can render a fragment in the
>> client-side and push the content to a given zone.
>>
>> Here,
>>
>> *fragmentFullyQualifedName* - Fully qualified name
>> (.) of the fragment that you want to
>> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
>> *templateFillingObject* - JSON object which will be used to fill the
>> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>>
>> *zoneName* - Name of the zone that you want to push the rendered HTML.
>> e.g. "grid"
>>
>> *mode* - Dictates how the pushing content orders with the existing
>> content in the zone. Mode can be "PREPEND" (put the pushing content before
>> the existing content), "APPEND" (put the pushing content after the existing
>> content) or "OVERWRITE" (replace the existing content with the pushing
>> content)
>>
>>
>> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>>
>> Using this function webapp devs can render a given Handlebars template
>> and push it to a desired zone.
>>
>> Here,
>>
>> *hbsTemplate* - Handlebars template string
>>
>>
>> Bringing zones to the client-side.
>>
>> When rendering a zone in the server-side, we can mark the start and end
>> of a zone's content with HTML comments.
>>
>> e.g.
>>
>> 
>>  content of zone grid goes here
>>  here is a div
>>  some more stuff
>> 
>>
>> HTML comments can be identified by filtering nodes in the DOM. And
>> further filtering the comments that starts with [UUF-ZONE], we can
>> identify UUF zone marking comments. Jerad did a POC for this. In that we
>> were able to successfully identify zones and push content for all modes.
>>
>>
>> We are hoping to expose this library through the "uuf-client" fragment in
>> the common "foundation" component [1].
>>
>> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
>> nents/org.wso2.carbon.uuf.common.foundation
>>
>> WDYT?
>>
>> Thanks.
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 
>>
>
>
>
> --
> Chanaka Jayasena
> Associate Tech Lead,
> email: chan...@wso2.com; cell: +94 77 4464006 <+94%2077%20446%204006>
> blog: http://chanaka3d.blogspot.com
>



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

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread SajithAR Ariyarathna
On Wed, Dec 14, 2016 at 9:01 AM, Irunika Weeraratne 
wrote:

> Hi,
> Can't we use standard JS libraries approach for this one?
> Here we have used zone names.
> eg : UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
> *zoneName*, mode)
>
> But AFAIK in standard JS this is done using Classes or IDs of elements.
>
> For an example can't we have something similar to
> *var zone = document.getElementById(zoneName);*
> *UFF.renderFragment(par1, par2, par3, zone);*
>
> This won't work as zone is not an element in the DOM. Zone is a
placeholder which will be filled with some HTML content when the page is
rendering (in the server-side).

IMHO I think that it would be better if we can find an approach which JS
> developers are more often familiar with.
>
> Also, IMHO I think we can use something similar to Jinja2 [1] kind of
> approach from Python Flask for server-side template rendering.
> [1]  http://jinja.pocoo.org/docs/dev/
>
> Thanks and Best Regards,
> Irunika
>
> *Irunika Weeraratne*
> *Software Engineer | WSO2, Inc. *
> *Email : irun...@wso2.com *
> *LinkedIn : https://lk.linkedin.com/in/irunika
> *
> *Mobile : +94712403314 <+94%2071%20240%203314>*
> *Lean . Enterprise . Middleware*
>
>
> On Wed, Dec 14, 2016 at 8:05 AM, Joseph Fonseka  wrote:
>
>> Hi
>>
>> +1, few clarifications bellow.
>>
>> 1. I guess the default mode will be OVERWRITE.
>> 2. Why did we use comments to propagate Zones to the client side instead
>> of Divs.
>>
>> Thanks
>> Jo
>>
>>
>>
>> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna > > wrote:
>>
>>> Hi All,
>>>
>>> To do $subject, we are hoping to give a UUF client JS library. With the
>>> client-side library, webapp developers will be able to render fragments and
>>> push to zones similar to the server-side.
>>>
>>> Functions in the library:
>>>
>>> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
>>> zoneName, mode)
>>>
>>> Using this function webapp developers can render a fragment in the
>>> client-side and push the content to a given zone.
>>>
>>> Here,
>>>
>>> *fragmentFullyQualifedName* - Fully qualified name
>>> (.) of the fragment that you want to
>>> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
>>> *templateFillingObject* - JSON object which will be used to fill the
>>> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>>>
>>> *zoneName* - Name of the zone that you want to push the rendered HTML.
>>> e.g. "grid"
>>>
>>> *mode* - Dictates how the pushing content orders with the existing
>>> content in the zone. Mode can be "PREPEND" (put the pushing content before
>>> the existing content), "APPEND" (put the pushing content after the existing
>>> content) or "OVERWRITE" (replace the existing content with the pushing
>>> content)
>>>
>>>
>>> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>>>
>>> Using this function webapp devs can render a given Handlebars template
>>> and push it to a desired zone.
>>>
>>> Here,
>>>
>>> *hbsTemplate* - Handlebars template string
>>>
>>>
>>> Bringing zones to the client-side.
>>>
>>> When rendering a zone in the server-side, we can mark the start and end
>>> of a zone's content with HTML comments.
>>>
>>> e.g.
>>>
>>> 
>>>  content of zone grid goes here
>>>  here is a div
>>>  some more stuff
>>> 
>>>
>>> HTML comments can be identified by filtering nodes in the DOM. And
>>> further filtering the comments that starts with [UUF-ZONE], we can
>>> identify UUF zone marking comments. Jerad did a POC for this. In that we
>>> were able to successfully identify zones and push content for all modes.
>>>
>>>
>>> We are hoping to expose this library through the "uuf-client" fragment
>>> in the common "foundation" component [1].
>>>
>>> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
>>> nents/org.wso2.carbon.uuf.common.foundation
>>>
>>> WDYT?
>>>
>>> Thanks.
>>> --
>>> Sajith Janaprasad Ariyarathna
>>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>>> 
>>>
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>>
>> --
>> *Joseph Fonseka*
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 772 512 430
>> skype: jpfonseka
>>
>> * *
>>
>>
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>


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

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread Chanaka Jayasena
Hi Sajith,

This will be very useful for the developers. Now we are maintaining client
side templates in public folder and doing ajax calls to fetch them and
render.

What will be the location of these fragments? If it's the same as server
side fragments it will give control over different UUF components IMO.

thanks,
Chanaka

On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna 
wrote:

> Hi All,
>
> To do $subject, we are hoping to give a UUF client JS library. With the
> client-side library, webapp developers will be able to render fragments and
> push to zones similar to the server-side.
>
> Functions in the library:
>
> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
> zoneName, mode)
>
> Using this function webapp developers can render a fragment in the
> client-side and push the content to a given zone.
>
> Here,
>
> *fragmentFullyQualifedName* - Fully qualified name
> (.) of the fragment that you want to
> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
> *templateFillingObject* - JSON object which will be used to fill the
> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>
> *zoneName* - Name of the zone that you want to push the rendered HTML.
> e.g. "grid"
>
> *mode* - Dictates how the pushing content orders with the existing
> content in the zone. Mode can be "PREPEND" (put the pushing content before
> the existing content), "APPEND" (put the pushing content after the existing
> content) or "OVERWRITE" (replace the existing content with the pushing
> content)
>
>
> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>
> Using this function webapp devs can render a given Handlebars template and
> push it to a desired zone.
>
> Here,
>
> *hbsTemplate* - Handlebars template string
>
>
> Bringing zones to the client-side.
>
> When rendering a zone in the server-side, we can mark the start and end of
> a zone's content with HTML comments.
>
> e.g.
>
> 
>  content of zone grid goes here
>  here is a div
>  some more stuff
> 
>
> HTML comments can be identified by filtering nodes in the DOM. And further
> filtering the comments that starts with [UUF-ZONE], we can identify UUF
> zone marking comments. Jerad did a POC for this. In that we were able to
> successfully identify zones and push content for all modes.
>
>
> We are hoping to expose this library through the "uuf-client" fragment in
> the common "foundation" component [1].
>
> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/
> components/org.wso2.carbon.uuf.common.foundation
>
> WDYT?
>
> Thanks.
> --
> Sajith Janaprasad Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> 
>



-- 
Chanaka Jayasena
Associate Tech Lead,
email: chan...@wso2.com; cell: +94 77 4464006
blog: http://chanaka3d.blogspot.com
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread Irunika Weeraratne
Hi,
Can't we use standard JS libraries approach for this one?
Here we have used zone names.
eg : UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
*zoneName*, mode)

But AFAIK in standard JS this is done using Classes or IDs of elements.

For an example can't we have something similar to
*var zone = document.getElementById(zoneName);*
*UFF.renderFragment(par1, par2, par3, zone);*

IMHO I think that it would be better if we can find an approach which JS
developers are more often familiar with.

Also, IMHO I think we can use something similar to Jinja2 [1] kind of
approach from Python Flask for server-side template rendering.
[1]  http://jinja.pocoo.org/docs/dev/

Thanks and Best Regards,
Irunika

*Irunika Weeraratne*
*Software Engineer | WSO2, Inc. *
*Email : irun...@wso2.com *
*LinkedIn : https://lk.linkedin.com/in/irunika
*
*Mobile : +94712403314*
*Lean . Enterprise . Middleware*


On Wed, Dec 14, 2016 at 8:05 AM, Joseph Fonseka  wrote:

> Hi
>
> +1, few clarifications bellow.
>
> 1. I guess the default mode will be OVERWRITE.
> 2. Why did we use comments to propagate Zones to the client side instead
> of Divs.
>
> Thanks
> Jo
>
>
>
> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna 
> wrote:
>
>> Hi All,
>>
>> To do $subject, we are hoping to give a UUF client JS library. With the
>> client-side library, webapp developers will be able to render fragments and
>> push to zones similar to the server-side.
>>
>> Functions in the library:
>>
>> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
>> zoneName, mode)
>>
>> Using this function webapp developers can render a fragment in the
>> client-side and push the content to a given zone.
>>
>> Here,
>>
>> *fragmentFullyQualifedName* - Fully qualified name
>> (.) of the fragment that you want to
>> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
>> *templateFillingObject* - JSON object which will be used to fill the
>> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>>
>> *zoneName* - Name of the zone that you want to push the rendered HTML.
>> e.g. "grid"
>>
>> *mode* - Dictates how the pushing content orders with the existing
>> content in the zone. Mode can be "PREPEND" (put the pushing content before
>> the existing content), "APPEND" (put the pushing content after the existing
>> content) or "OVERWRITE" (replace the existing content with the pushing
>> content)
>>
>>
>> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>>
>> Using this function webapp devs can render a given Handlebars template
>> and push it to a desired zone.
>>
>> Here,
>>
>> *hbsTemplate* - Handlebars template string
>>
>>
>> Bringing zones to the client-side.
>>
>> When rendering a zone in the server-side, we can mark the start and end
>> of a zone's content with HTML comments.
>>
>> e.g.
>>
>> 
>>  content of zone grid goes here
>>  here is a div
>>  some more stuff
>> 
>>
>> HTML comments can be identified by filtering nodes in the DOM. And
>> further filtering the comments that starts with [UUF-ZONE], we can
>> identify UUF zone marking comments. Jerad did a POC for this. In that we
>> were able to successfully identify zones and push content for all modes.
>>
>>
>> We are hoping to expose this library through the "uuf-client" fragment in
>> the common "foundation" component [1].
>>
>> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
>> nents/org.wso2.carbon.uuf.common.foundation
>>
>> WDYT?
>>
>> Thanks.
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 
>>
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
>
> --
> *Joseph Fonseka*
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 772 512 430
> skype: jpfonseka
>
> * *
>
>
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread SajithAR Ariyarathna
Hi Jo,

1. I guess the default mode will be OVERWRITE.
>
Yes, we decided to add other modes for completeness.

> 2. Why did we use comments to propagate Zones to the client side instead
> of Divs.
>
divs clashes with CSS selectors (same goes for spans). These zone markers
should be invisible (which means they shouldn't create or affect visual
elements in the DOM). That's' why we chose HTML comments.

Thanks.

On Wed, Dec 14, 2016 at 8:05 AM, Joseph Fonseka  wrote:

> Hi
>
> +1, few clarifications bellow.
>
> 1. I guess the default mode will be OVERWRITE.
> 2. Why did we use comments to propagate Zones to the client side instead
> of Divs.
>
> Thanks
> Jo
>
>
>
> On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna 
> wrote:
>
>> Hi All,
>>
>> To do $subject, we are hoping to give a UUF client JS library. With the
>> client-side library, webapp developers will be able to render fragments and
>> push to zones similar to the server-side.
>>
>> Functions in the library:
>>
>> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
>> zoneName, mode)
>>
>> Using this function webapp developers can render a fragment in the
>> client-side and push the content to a given zone.
>>
>> Here,
>>
>> *fragmentFullyQualifedName* - Fully qualified name
>> (.) of the fragment that you want to
>> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
>> *templateFillingObject* - JSON object which will be used to fill the
>> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>>
>> *zoneName* - Name of the zone that you want to push the rendered HTML.
>> e.g. "grid"
>>
>> *mode* - Dictates how the pushing content orders with the existing
>> content in the zone. Mode can be "PREPEND" (put the pushing content before
>> the existing content), "APPEND" (put the pushing content after the existing
>> content) or "OVERWRITE" (replace the existing content with the pushing
>> content)
>>
>>
>> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>>
>> Using this function webapp devs can render a given Handlebars template
>> and push it to a desired zone.
>>
>> Here,
>>
>> *hbsTemplate* - Handlebars template string
>>
>>
>> Bringing zones to the client-side.
>>
>> When rendering a zone in the server-side, we can mark the start and end
>> of a zone's content with HTML comments.
>>
>> e.g.
>>
>> 
>>  content of zone grid goes here
>>  here is a div
>>  some more stuff
>> 
>>
>> HTML comments can be identified by filtering nodes in the DOM. And
>> further filtering the comments that starts with [UUF-ZONE], we can
>> identify UUF zone marking comments. Jerad did a POC for this. In that we
>> were able to successfully identify zones and push content for all modes.
>>
>>
>> We are hoping to expose this library through the "uuf-client" fragment in
>> the common "foundation" component [1].
>>
>> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
>> nents/org.wso2.carbon.uuf.common.foundation
>>
>> WDYT?
>>
>> Thanks.
>> --
>> Sajith Janaprasad Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> 
>>
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
>
> --
> *Joseph Fonseka*
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 772 512 430
> skype: jpfonseka
>
> * *
>
>
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


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

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] SNMP Connector

2016-12-13 Thread Thulasika Vijayanathan
Hi Malaka,

Need to do the code review, I will arrange.

Thanks,
Thulasika

On Wed, Dec 14, 2016 at 5:46 AM, Malaka Silva  wrote:

> Hi Thulasika,
>
> How are we progressing with this?
>
> On Thu, Dec 8, 2016 at 4:13 PM, Thulasika Vijayanathan  > wrote:
>
>> Hi ,
>>
>> SNMP connector send the SNMP messages to SNMP listener, to send the SNMP
>> messages we need to specify the following properties:
>>
>>- Request Identifier: A number used to match requests with replies.
>>It is generated by the device that sends a request and copied into this
>>field in a Response-PDU by the responding SNMP entity.
>>- Error Index: When Error Status is non-zero, this field contains a
>>pointer that specifies which object generated the error. Always zero in a
>>request.
>>- Variable Bindings: A set of name-value pairs identifying the MIB
>>objects in the PDU, and in the case of messages other than requests,
>>containing their values.
>>- PDU Type: An integer value that indicates the PDU type.
>>
>>
>> Thanks,
>> Thulasika.
>>
>> On Thu, Dec 8, 2016 at 11:06 AM, Malaka Silva  wrote:
>>
>>> Hi Thulasika,
>>>
>>> How are you progressing with this. It'll be great if you could explain
>>> what level of details we can publish and how?
>>>
>>> On Fri, Dec 2, 2016 at 12:38 PM, Thulasika Vijayanathan <
>>> thulas...@wso2.com> wrote:
>>>
 Hi,

 I am planning to implement the SNMP connector to send the SNMP messages
 to other devices.

 When a device send a message to the ESB mediation flow(that means when
 we receive a request/message to ESB mediation flow), the connector should
 be able to compose and address the SNMP message and send it to the
 destination which will be listening to the SNMP messages as shown below.



 Please give your suggestion on this.


 Thanks,

 Thulasika.

 On Thu, Nov 24, 2016 at 9:57 AM, Thulasika Vijayanathan <
 thulas...@wso2.com> wrote:

> Hi,
>
> From this method we can retrieve the managed device's system
> details(local or remote device), For example, When using this get method 
> we
> can get the response as follows: Linux thulasi-ThinkPad-T540p
> 4.4.0-47-generic #68~14.04.1-Ubuntu SMP Wed Oct 26 19:42:11 UTC 2016
> x86_64].
>
> Thanks,
> Thulasika.
>
> On Wed, Nov 23, 2016 at 6:20 PM, Malaka Silva  wrote:
>
>> Hi Thulasika,
>>
>> The use case we should support is the SNMP connector should
>> send/publish SNMP messages in ESB mediation flow.
>>
>> I am not sure what do you mean by retrieve stats. Is there any use
>> case that you try to cover.
>>
>> On Wed, Nov 23, 2016 at 1:35 PM, Sidath Weerasinghe 
>> wrote:
>>
>>> Hi Thulasika,
>>>
>>> can you explain how do you expose server analytics via SNMP ?
>>>
>>>
>>> On Wed, Nov 23, 2016 at 11:43 AM, Thulasika Vijayanathan <
>>> thulas...@wso2.com> wrote:
>>>
 Hi,

 I have planned to implement the SNMP connector. Simple Network
 Management Protocol (SNMP) is a widely used protocol for monitoring 
 network
 devices  such as servers, printers, hubs, switches, and routers on an 
 IP
 network.

 Connector will have the following operation:
 snmpGet():-  It is performed to retrieve one or more values from
 the managed remote/local device.

 [1] https://wso2.org/jira/browse/ESBCONNECT-133

 Thanks,
 --
 Thulasika
 Associate Software Engineer
 Mobile:0778014295
 email: thulas...@wso2.com 

 ___
 Architecture mailing list
 Architecture@wso2.org
 https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


>>>
>>>
>>> --
>>> Thank You,
>>> Best Regards,
>>>
>>> Sidath Weerasinghe
>>>
>>>
>>> *Intern*
>>>
>>> *WSO2, Inc. *
>>>
>>> *lean . enterprise . middleware *
>>>
>>>
>>> *Mobile: +94719802550 <%2B94719802550>*
>>>
>>> *Email: *sid...@wso2.com
>>>
>>> Blog: https://medium.com/@sidath
>>>
>>> Linkedin: https://lk.linkedin.com/in/sidathweerasinghe
>>>
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Senior Technical Lead
>> M: +94 777 219 791
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300 <011%202%20145300>
>> Skype : malaka.sampath.silva
>> LinkedIn : 

Re: [Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread Joseph Fonseka
Hi

+1, few clarifications bellow.

1. I guess the default mode will be OVERWRITE.
2. Why did we use comments to propagate Zones to the client side instead of
Divs.

Thanks
Jo



On Tue, Dec 13, 2016 at 10:37 PM, SajithAR Ariyarathna 
wrote:

> Hi All,
>
> To do $subject, we are hoping to give a UUF client JS library. With the
> client-side library, webapp developers will be able to render fragments and
> push to zones similar to the server-side.
>
> Functions in the library:
>
> UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
> zoneName, mode)
>
> Using this function webapp developers can render a fragment in the
> client-side and push the content to a given zone.
>
> Here,
>
> *fragmentFullyQualifedName* - Fully qualified name
> (.) of the fragment that you want to
> render. e.g. "org.wso2.carbon.apimgt.store.api-grid"
> *templateFillingObject* - JSON object which will be used to fill the
> fragment's template. e.g. {name: "My API", version: "1.0.0"}
>
> *zoneName* - Name of the zone that you want to push the rendered HTML.
> e.g. "grid"
>
> *mode* - Dictates how the pushing content orders with the existing
> content in the zone. Mode can be "PREPEND" (put the pushing content before
> the existing content), "APPEND" (put the pushing content after the existing
> content) or "OVERWRITE" (replace the existing content with the pushing
> content)
>
>
> UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)
>
> Using this function webapp devs can render a given Handlebars template and
> push it to a desired zone.
>
> Here,
>
> *hbsTemplate* - Handlebars template string
>
>
> Bringing zones to the client-side.
>
> When rendering a zone in the server-side, we can mark the start and end of
> a zone's content with HTML comments.
>
> e.g.
>
> 
>  content of zone grid goes here
>  here is a div
>  some more stuff
> 
>
> HTML comments can be identified by filtering nodes in the DOM. And further
> filtering the comments that starts with [UUF-ZONE], we can identify UUF
> zone marking comments. Jerad did a POC for this. In that we were able to
> successfully identify zones and push content for all modes.
>
>
> We are hoping to expose this library through the "uuf-client" fragment in
> the common "foundation" component [1].
>
> [1]  https://github.com/wso2/carbon-uuf-common/tree/master/compo
> nents/org.wso2.carbon.uuf.common.foundation
>
> WDYT?
>
> Thanks.
> --
> Sajith Janaprasad Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> 
>
> ___
> Architecture mailing list
> Architecture@wso2.org
> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>
>


-- 

-- 
*Joseph Fonseka*
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: +94 772 512 430
skype: jpfonseka

* *
___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture


Re: [Architecture] SNMP Connector

2016-12-13 Thread Malaka Silva
Hi Thulasika,

How are we progressing with this?

On Thu, Dec 8, 2016 at 4:13 PM, Thulasika Vijayanathan 
wrote:

> Hi ,
>
> SNMP connector send the SNMP messages to SNMP listener, to send the SNMP
> messages we need to specify the following properties:
>
>- Request Identifier: A number used to match requests with replies. It
>is generated by the device that sends a request and copied into this field
>in a Response-PDU by the responding SNMP entity.
>- Error Index: When Error Status is non-zero, this field contains a
>pointer that specifies which object generated the error. Always zero in a
>request.
>- Variable Bindings: A set of name-value pairs identifying the MIB
>objects in the PDU, and in the case of messages other than requests,
>containing their values.
>- PDU Type: An integer value that indicates the PDU type.
>
>
> Thanks,
> Thulasika.
>
> On Thu, Dec 8, 2016 at 11:06 AM, Malaka Silva  wrote:
>
>> Hi Thulasika,
>>
>> How are you progressing with this. It'll be great if you could explain
>> what level of details we can publish and how?
>>
>> On Fri, Dec 2, 2016 at 12:38 PM, Thulasika Vijayanathan <
>> thulas...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I am planning to implement the SNMP connector to send the SNMP messages
>>> to other devices.
>>>
>>> When a device send a message to the ESB mediation flow(that means when
>>> we receive a request/message to ESB mediation flow), the connector should
>>> be able to compose and address the SNMP message and send it to the
>>> destination which will be listening to the SNMP messages as shown below.
>>>
>>>
>>>
>>> Please give your suggestion on this.
>>>
>>>
>>> Thanks,
>>>
>>> Thulasika.
>>>
>>> On Thu, Nov 24, 2016 at 9:57 AM, Thulasika Vijayanathan <
>>> thulas...@wso2.com> wrote:
>>>
 Hi,

 From this method we can retrieve the managed device's system
 details(local or remote device), For example, When using this get method we
 can get the response as follows: Linux thulasi-ThinkPad-T540p
 4.4.0-47-generic #68~14.04.1-Ubuntu SMP Wed Oct 26 19:42:11 UTC 2016
 x86_64].

 Thanks,
 Thulasika.

 On Wed, Nov 23, 2016 at 6:20 PM, Malaka Silva  wrote:

> Hi Thulasika,
>
> The use case we should support is the SNMP connector should
> send/publish SNMP messages in ESB mediation flow.
>
> I am not sure what do you mean by retrieve stats. Is there any use
> case that you try to cover.
>
> On Wed, Nov 23, 2016 at 1:35 PM, Sidath Weerasinghe 
> wrote:
>
>> Hi Thulasika,
>>
>> can you explain how do you expose server analytics via SNMP ?
>>
>>
>> On Wed, Nov 23, 2016 at 11:43 AM, Thulasika Vijayanathan <
>> thulas...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I have planned to implement the SNMP connector. Simple Network
>>> Management Protocol (SNMP) is a widely used protocol for monitoring 
>>> network
>>> devices  such as servers, printers, hubs, switches, and routers on an IP
>>> network.
>>>
>>> Connector will have the following operation:
>>> snmpGet():-  It is performed to retrieve one or more values from the
>>> managed remote/local device.
>>>
>>> [1] https://wso2.org/jira/browse/ESBCONNECT-133
>>>
>>> Thanks,
>>> --
>>> Thulasika
>>> Associate Software Engineer
>>> Mobile:0778014295
>>> email: thulas...@wso2.com 
>>>
>>> ___
>>> Architecture mailing list
>>> Architecture@wso2.org
>>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>>
>>>
>>
>>
>> --
>> Thank You,
>> Best Regards,
>>
>> Sidath Weerasinghe
>>
>>
>> *Intern*
>>
>> *WSO2, Inc. *
>>
>> *lean . enterprise . middleware *
>>
>>
>> *Mobile: +94719802550 <%2B94719802550>*
>>
>> *Email: *sid...@wso2.com
>>
>> Blog: https://medium.com/@sidath
>>
>> Linkedin: https://lk.linkedin.com/in/sidathweerasinghe
>>
>> ___
>> Architecture mailing list
>> Architecture@wso2.org
>> https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
>>
>>
>
>
> --
>
> Best Regards,
>
> Malaka Silva
> Senior Technical Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300 <011%202%20145300>
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> https://wso2.com/signature
> http://www.wso2.com/about/team/malaka-silva/
> 
> https://store.wso2.com/store/
>
> Don't make Trees rare, we 

[Architecture] Improving clint-side rendering support in UUF

2016-12-13 Thread SajithAR Ariyarathna
Hi All,

To do $subject, we are hoping to give a UUF client JS library. With the
client-side library, webapp developers will be able to render fragments and
push to zones similar to the server-side.

Functions in the library:

UUF.renderFragment(fragmentFullyQualifedName, templateFillingObject,
zoneName, mode)

Using this function webapp developers can render a fragment in the
client-side and push the content to a given zone.

Here,

*fragmentFullyQualifedName* - Fully qualified name
(.) of the fragment that you want to render.
e.g. "org.wso2.carbon.apimgt.store.api-grid"
*templateFillingObject* - JSON object which will be used to fill the
fragment's template. e.g. {name: "My API", version: "1.0.0"}

*zoneName* - Name of the zone that you want to push the rendered HTML. e.g.
"grid"

*mode* - Dictates how the pushing content orders with the existing content
in the zone. Mode can be "PREPEND" (put the pushing content before the
existing content), "APPEND" (put the pushing content after the existing
content) or "OVERWRITE" (replace the existing content with the pushing
content)


UUF.renderTemplate(hbsTemplate,  templateFillingObject, zoneName, mode)

Using this function webapp devs can render a given Handlebars template and
push it to a desired zone.

Here,

*hbsTemplate* - Handlebars template string


Bringing zones to the client-side.

When rendering a zone in the server-side, we can mark the start and end of
a zone's content with HTML comments.

e.g.


 content of zone grid goes here
 here is a div
 some more stuff


HTML comments can be identified by filtering nodes in the DOM. And further
filtering the comments that starts with [UUF-ZONE], we can identify UUF
zone marking comments. Jerad did a POC for this. In that we were able to
successfully identify zones and push content for all modes.


We are hoping to expose this library through the "uuf-client" fragment in
the common "foundation" component [1].

[1]
https://github.com/wso2/carbon-uuf-common/tree/master/components/org.wso2.carbon.uuf.common.foundation

WDYT?

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

___
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture