SlideShare uma empresa Scribd logo
1 de 13
ERYEM
CAMPS
Dashboard Yammer sous SharePoint
1
Présenté par :
Barbar MITRI bmitri@eryem.com
Philippe SFEIR psfeir@eryem.com
Levallois 15/01/2015
Plan
1. Présentation du sujet
1. Concept de Single Page Application
2. Architecture applicative
2. Démo et architecture projet
3. Conclusion
4. Références
2
Single Page Application
3
Une nouvelle façon d’envisager la navigation web
Serveur Web
Cloud
navigateur client
Chargement de la
page d’accueil:
charge une fois pour
toutes l’ensemble
des fichiers html, js,
css
Action utilisateur: insertion dynamique de
données dans la page, jamais de
rechargement complet de la page
4
Architecture applicative
4
Un niveau de portabilité inédit !!
1°)
2°)
3°)
6°)
Serveur
SharePoint
Poste client
NodeJS :
Module développé par
Barbar MITRI
Démo
5
6
Architecture du projet Durandal
7
Index.html
<!DOCTYPE html>
<html>
<head>
<title>Durandal</title>
<!– références vers fichiers css -->
<script type="text/javascript"
src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['c
orechart']}]}"></script>
</head>
<body>
<div id="applicationHost">
<div class="splash">
<div class="message">
Je charge le contenu statique: pages html, scripts js, fichier css, <b> UNE FOIS POUR TOUTES
!!</b>
</div>
<i class="fa fa-spinner fa-spin"></i>
</div>
</div>
<script src="lib/require/require.js" data-main="app/main"></script>
</body>
</html>
8
main.js requirejs.config({
paths: {
'text': '../lib/require/text',
'durandal':'../lib/durandal/js',
'plugins' : '../lib/durandal/js/plugins',
'transitions' : '../lib/durandal/js/transitions',
'knockout': '../lib/knockout/knockout-3.1.0',
'bootstrap': '../lib/bootstrap/js/bootstrap',
'jquery': '../lib/jquery/jquery-1.9.1',
'services': '../app/services',
'async': '../lib/durandal/js/plugins/async',
'propertyParser': '../lib/durandal/js/plugins/propertyParser',
'goog': '../lib/durandal/js/plugins/goog'
}
});
define('gmaps', ['async!http://maps.google.com/maps/api/js?sensor=false'],
function () {
console.log('Google maps loaded');
return window.google.maps;
});
define(['durandal/system', 'durandal/app', 'durandal/viewLocator'], function
(system, app, viewLocator) {
//>>excludeStart("build", true);
system.debug(true);
//>>excludeEnd("build");
app.title = 'Durandal Starter Kit';
app.configurePlugins({
router:true,
dialog: true
});
app.start().then(function() {
viewLocator.useConvention();
app.setRoot('viewmodels/shell', 'entrance');
});
});
9
shell.js
define(['plugins/router', 'durandal/app'], function (router, app) {
return {
router: router,
search: function() {
//It's really easy to show a message box.
//You can add custom options too. Also, it returns a promise for the user's response.
app.showMessage('Search not yet implemented...');
},
activate: function () {
router.map([
{ route: '', title:'Welcome', moduleId: 'viewmodels/welcome', nav: true },
{ route: 'flickr', moduleId: 'viewmodels/flickr', nav: true },
{ route: 'yamhisto', moduleId: 'viewmodels/yamhisto', nav: true },
{ route: 'map', moduleId: 'viewmodels/mapgoogle', nav: false },
{ route: 'chart', moduleId: 'viewmodels/chart', nav: true },
{ route: 'userStats/:UserId', moduleId: 'viewmodels/userStats', nav: false }
]).buildNavigationModel();
return router.activate();
}
};
});
10
chart.js
var activate = function () {
jQuery.when(services.getStatMsgByUser(), services.getStatFileByUser()).then(function
(msgByUser, fileByUser) {
msgArray[0] = ['Nom', 'Nombre de messages'];
fileArray[0] = ['Nom', 'Nombre de fichiers partagés'];
jQuery.each(msgByUser[0], function (index, item) {
msgArray[index + 1] = [item.name, item.number_msg];
});
jQuery.each(fileByUser[0], function (index, item) {
fileArray[index + 1] = [item.name, item.number_file];
});
});
};
var compositionComplete = function (view, parent) {
var msgData = google.visualization.arrayToDataTable(msgArray);
var fileData = google.visualization.arrayToDataTable(fileArray);
var msgOptions = {
title: 'Nombre de messages par utilisateur'
};
var fileOptions = {
title: 'Nombre de fichiers partagés par utilisateur'
};
var msgChart = new
google.visualization.PieChart(document.getElementById('msgChart'));
msgChart.draw(msgData, msgOptions);
var fileChart = new
google.visualization.PieChart(document.getElementById('fileChart'));
fileChart.draw(fileData, fileOptions);
};
11
Chart.html
<section>
<h2 data-bind="html: displayName"></h2>
<table>
<tr>
<td>
<div id="msgChart" style="width: 900px; height: 500px;"></div>
</td>
<td>
<div id="fileChart" style="width: 900px; height: 500px;"></div>
</td>
</tr>
</table>
</section>
Conclusion
12
Avec DurandalJS on peut construire des applications
JavaScript dynamiques et simples.
Inclus : JQuery , Knockout et RequireJS
Riche en fonctionnalités et multiplateforme
Références
13
Tutoriels et exemples javascript – jQuery:
http://www.w3schools.com/
Tutoriels et exemples knockoutJS (MVVM):
http://learn.knockoutjs.com/
Exemples DurandalJS:
http://durandaljs.com/
Proxy : http://nodejs.org/

Mais conteúdo relacionado

Destaque

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Destaque (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Application SharePoint "Tableau de bord Yammer"

  • 1. ERYEM CAMPS Dashboard Yammer sous SharePoint 1 Présenté par : Barbar MITRI bmitri@eryem.com Philippe SFEIR psfeir@eryem.com Levallois 15/01/2015
  • 2. Plan 1. Présentation du sujet 1. Concept de Single Page Application 2. Architecture applicative 2. Démo et architecture projet 3. Conclusion 4. Références 2
  • 3. Single Page Application 3 Une nouvelle façon d’envisager la navigation web Serveur Web Cloud navigateur client Chargement de la page d’accueil: charge une fois pour toutes l’ensemble des fichiers html, js, css Action utilisateur: insertion dynamique de données dans la page, jamais de rechargement complet de la page
  • 4. 4 Architecture applicative 4 Un niveau de portabilité inédit !! 1°) 2°) 3°) 6°) Serveur SharePoint Poste client NodeJS : Module développé par Barbar MITRI
  • 7. 7 Index.html <!DOCTYPE html> <html> <head> <title>Durandal</title> <!– références vers fichiers css --> <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['c orechart']}]}"></script> </head> <body> <div id="applicationHost"> <div class="splash"> <div class="message"> Je charge le contenu statique: pages html, scripts js, fichier css, <b> UNE FOIS POUR TOUTES !!</b> </div> <i class="fa fa-spinner fa-spin"></i> </div> </div> <script src="lib/require/require.js" data-main="app/main"></script> </body> </html>
  • 8. 8 main.js requirejs.config({ paths: { 'text': '../lib/require/text', 'durandal':'../lib/durandal/js', 'plugins' : '../lib/durandal/js/plugins', 'transitions' : '../lib/durandal/js/transitions', 'knockout': '../lib/knockout/knockout-3.1.0', 'bootstrap': '../lib/bootstrap/js/bootstrap', 'jquery': '../lib/jquery/jquery-1.9.1', 'services': '../app/services', 'async': '../lib/durandal/js/plugins/async', 'propertyParser': '../lib/durandal/js/plugins/propertyParser', 'goog': '../lib/durandal/js/plugins/goog' } }); define('gmaps', ['async!http://maps.google.com/maps/api/js?sensor=false'], function () { console.log('Google maps loaded'); return window.google.maps; }); define(['durandal/system', 'durandal/app', 'durandal/viewLocator'], function (system, app, viewLocator) { //>>excludeStart("build", true); system.debug(true); //>>excludeEnd("build"); app.title = 'Durandal Starter Kit'; app.configurePlugins({ router:true, dialog: true }); app.start().then(function() { viewLocator.useConvention(); app.setRoot('viewmodels/shell', 'entrance'); }); });
  • 9. 9 shell.js define(['plugins/router', 'durandal/app'], function (router, app) { return { router: router, search: function() { //It's really easy to show a message box. //You can add custom options too. Also, it returns a promise for the user's response. app.showMessage('Search not yet implemented...'); }, activate: function () { router.map([ { route: '', title:'Welcome', moduleId: 'viewmodels/welcome', nav: true }, { route: 'flickr', moduleId: 'viewmodels/flickr', nav: true }, { route: 'yamhisto', moduleId: 'viewmodels/yamhisto', nav: true }, { route: 'map', moduleId: 'viewmodels/mapgoogle', nav: false }, { route: 'chart', moduleId: 'viewmodels/chart', nav: true }, { route: 'userStats/:UserId', moduleId: 'viewmodels/userStats', nav: false } ]).buildNavigationModel(); return router.activate(); } }; });
  • 10. 10 chart.js var activate = function () { jQuery.when(services.getStatMsgByUser(), services.getStatFileByUser()).then(function (msgByUser, fileByUser) { msgArray[0] = ['Nom', 'Nombre de messages']; fileArray[0] = ['Nom', 'Nombre de fichiers partagés']; jQuery.each(msgByUser[0], function (index, item) { msgArray[index + 1] = [item.name, item.number_msg]; }); jQuery.each(fileByUser[0], function (index, item) { fileArray[index + 1] = [item.name, item.number_file]; }); }); }; var compositionComplete = function (view, parent) { var msgData = google.visualization.arrayToDataTable(msgArray); var fileData = google.visualization.arrayToDataTable(fileArray); var msgOptions = { title: 'Nombre de messages par utilisateur' }; var fileOptions = { title: 'Nombre de fichiers partagés par utilisateur' }; var msgChart = new google.visualization.PieChart(document.getElementById('msgChart')); msgChart.draw(msgData, msgOptions); var fileChart = new google.visualization.PieChart(document.getElementById('fileChart')); fileChart.draw(fileData, fileOptions); };
  • 11. 11 Chart.html <section> <h2 data-bind="html: displayName"></h2> <table> <tr> <td> <div id="msgChart" style="width: 900px; height: 500px;"></div> </td> <td> <div id="fileChart" style="width: 900px; height: 500px;"></div> </td> </tr> </table> </section>
  • 12. Conclusion 12 Avec DurandalJS on peut construire des applications JavaScript dynamiques et simples. Inclus : JQuery , Knockout et RequireJS Riche en fonctionnalités et multiplateforme
  • 13. Références 13 Tutoriels et exemples javascript – jQuery: http://www.w3schools.com/ Tutoriels et exemples knockoutJS (MVVM): http://learn.knockoutjs.com/ Exemples DurandalJS: http://durandaljs.com/ Proxy : http://nodejs.org/

Notas do Editor

  1. Description du concept de Single Page Application
  2. 1 => connexion à l’application Sharepoint 2 => Sharepoint renvoie le contenu Statique au client : html + CSS + JS 3=> avec l’autorisation de Sharepoint on redirige le client vers le serveur Proxy (NodeJS) 4=> proxy solicite le serveur de base de données 5=> reponse de la base 6=> le proxy retourne les données vers le client
  3. Exemple de graphe obtenu: nombre de messages postés par utilisateur du réseau Yammer
  4. Contient: Un dossier « app » lui-même composé d’un dossier « services » contenant le fichier avec les méthodes de service, d’un dossier « viewmodels », d’un dossier « views » Un dossier « css » contenant les feuilles de style Un dossier « lib » contenant les librairies js Durandal et les plugins js Les autres dossiers natifs à un projet App pour SharePoint
  5. Le code suivant: <script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1','packages':['corechart']}]}"></script> référence l’api google utilisée pour dessiner les graphiques. Le code suivant: <script src="lib/require/require.js" data-main="app/main"></script> charge require.js et l’attribut data-main indique le fichier js servant de point d’entrée, ici main.js
  6. requirejs.config permet d’enregistrer un raccourci pour chaque fichier javascript ou dossier utilisé define permet de charger les fichiers js référencés de manière asynchrone et d’exécuter le code personnalisé dans le callback, avec un espace de nommage isolé de l’espace de nommage global de javascript. app.setRoot définit la page d’accueil de l’application, ici shell.html
  7. shell.js est le viewmodel javascript associé à la page d’accueil. La fonction activate s’exécute à chaque fois que la page est atteinte. router.map permet de définir des routes pour la navigation côté client. Lorsque le client requête une route, commençant par #, le fichier javascript correspondant est exécuté et la page html chargée. Aucun appel serveur n’est effectué, l’ensemble des fichiers étant déjà chargés dans le navigateur client.
  8. chart.js est le fichier associé à la route #chart. La fonction activate est exécutée en premier chaque fois que la page est requêtée. Elle construit un tableau avec les données Yammer récupérées par les web services. La fonction compositionComplete est exécutée après activate, une fois que l’ensemble des éléments HTML du DOM a été chargé dans le navigateur. C’est dans cette fonction que sont réalisées les manipulation sur le DOM permettant d’afficher les graphiques grâce aux APIs de google.
  9. Le fichier chart.html contient le squelette html de la page. Les méthodes google appelées dans le viewmodel vont insérer les graphes dans les deux div.