Showing posts with label Web. Show all posts
Showing posts with label Web. Show all posts

2019/05/29

How I integrated Nuxeo Web Components into Angular, React and Vue.js



I like Angular Framework and happy to discover Web components as a great way to include features in it.


The idea here is to include these Nuxeo elements (polymer web components) in a basic Angular app offering search capabilities in a Nuxeo platform.

Other integrations have been successfully completed for React and Vue. Those one were quite easy and "natural" to do; see in React and Vue.js tutorials. So i'm curious to implement topics found in the web to enable js web components.





I finally did following these 7 steps :

1) using the Angular CLI to generate a new project.


$ ng new my-nuxeo-angular-app$ cd my-nuxeo-angular-app


2) Install components


$ npm install @nuxeo/nuxeo-elements @nuxeo/nuxeo-ui-elements


3) Because as many of web components are JS only, add JavaScript support to your app


tsconfig.json{  compilerOptions: {    "allowJs": true  }}


4) Enable custom elements schema


import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';...@NgModule({   …   schemas: [CUSTOM_ELEMENTS_SCHEMA],   …})


5) Verify that you can run the application


$ ng serve


Cool...


6) Then customize your app


Here the idea - as React and Vue integrations done - is to set a selection into a Nuxeo instance running on 8080 port.


And it works ! :)




and with some document list:

To give you feedback about major problems solved.


> A nuxeo-connection element needs to be out from any angular digest, so include it in you index.html is a way to connect to your Nuxeo instance.


> You would need to listen on some element events due to an common observer pattern. In this case, an angular child view can be useful:


page.html
<you-observed-component #observed />


component.ts
Class youObserverComponent {
  ...
 @ViewChild(observed) observed: ElementRef;
  // observed.addEventListner(‘your-event’,(e) => { …});

7) About API proxy or manage CORS


Angular gives you the opportunity to test in dev mode your local api through a local proxy; then Nuxeo:8080 could be mapped via


angular.json
"proxyConfig": "proxy.conf.json",


proxy.conf.json
{
 "/nuxeo": {
   "target": "http://localhost:8080/"
 }
}


The other way is to allow CORS in your API server, like described here https://doc.nuxeo.com/nxdoc/cross-origin-resource-sharing-cors/

Final conclusion and resources



Like explained at the begining, it was less natural to include web elements in angular than vue or react. The main reason is that angular is managing DOM in a more strict way and probably less open than other frameworks.
But again, after some optimization, the app looks cool and efficient ?!




Enjoy!

@mat

2017/06/27

2014/03/07

#Techs - Cloud

Quelles questions à un service Cloud concernant la sécurité ?
Le sujet m'intéresse, utilisateur d'OVH (cocorico!) mais soyons ouvert ...

1 - Combien de temps comptez-vous en prendre soin ?

Trouver depuis combien de temps le fournisseur existe et quelle est sa position sur le marché.

2 - Allez-vous regarder mes données ?

Certains fournisseurs de cloud peuvent utiliser vos données pour créer des informations qu’ils rendront anonymes avant de les vendre à des annonceurs ? Voir le cryptage des données et engagement de confidentialité.

3 - Niveau de la situation de vulnérabilité?

Quelle est l'architecture de solutions cloud qui stocke vos données.
Equipement digne d’une entreprise, dans un datacenter et avec un cryptage constant.

4 - N’importe qui peut-il prendre mes données ?

S'assurer que votre fournisseur offre un crytage total et un transfert de données via une connexion SSL.


Et voilà à vous de jouer ;-)
Cf site comparatif rigolo :  http://www.cloudscreener.com

2010/09/30

[Fr][Web] HTML5, Arcade Fire & Google

Cela fait longtemps qu'on me parle de l'HTML5
et puis en tant que "fan" google & autres petites pépites technologiques,
je me devais de voir et d'aller faire un tour ici : Chrome Experiments - Arcade Fire
Effectivement, on voit mieux !
enjoy

2010/03/22

[En][Web] Twitt Research

Meeyoung Cha, Hamed Haddadi, Fabricio Benevenuto and Krishna Gummadi, a group of researchers from Germany, England and Brazil, have demonstrate what we suspected all instinctively: the number of followers on Twitter do not mean much and has little to do with influence.

In reaching this conclusion, researchers have examined the accounts of 54 million Twitter users, from the 80 million monitored by their servers. They calculated various statistics from the analysis of these accounts, including the size of the audience, the ability to be retweet and be mentioned in tweets.

Conclusion: Those who have a large number of followers may be popular, but this did not correlate with any influence. A large number of followers does not to be mentioned or retweet significantly.

The results of this research were published on the website devoted to this research project :
http://twitter.mpi-sws.org