204 lines
6.3 KiB
TeX
204 lines
6.3 KiB
TeX
|
\documentclass{beamer}
|
|||
|
\usetheme{focus}
|
|||
|
\usepackage{minted}
|
|||
|
\usepackage{mdframed}
|
|||
|
|
|||
|
\setbeameroption{show notes}
|
|||
|
\surroundwithmdframed{minted}
|
|||
|
\AtBeginEnvironment{frame}{\setcounter{footnote}{0}}
|
|||
|
\setbeamerfont{footnote}{size=\tiny}
|
|||
|
|
|||
|
\title{Formation : usage des API Publik}
|
|||
|
\author{Valentin Deniaud}
|
|||
|
\titlegraphic{\includegraphics[scale=0.75]{eo.pdf}}
|
|||
|
\institute{Académie de Versailles}
|
|||
|
\date{29/06/2021}
|
|||
|
|
|||
|
\begin{document}
|
|||
|
|
|||
|
\begin{frame}
|
|||
|
\maketitle
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Sommaire}
|
|||
|
\tableofcontents
|
|||
|
\end{frame}
|
|||
|
|
|||
|
|
|||
|
\begin{frame}[noframenumbering,plain]
|
|||
|
Ne pas oublier de lancer l'enregistrement !
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\section{Introduction}
|
|||
|
\begin{frame}{Vue d'ensemble}
|
|||
|
\begin{itemize}
|
|||
|
\item Pas un logiciel mais plusieurs « briques »
|
|||
|
\item Écrites en Python/Django
|
|||
|
\begin{itemize}
|
|||
|
\item Mais ce n'est pas important !
|
|||
|
\note[item]{Passer par les API permet justement d'utiliser son langage favori}
|
|||
|
\end{itemize}
|
|||
|
\item Reliées entre elles via
|
|||
|
\begin{itemize}
|
|||
|
\item API webservices
|
|||
|
\note[item]{Et ouais, le consommateur numéro 1 des API Publik c'est Publik.}
|
|||
|
\item Provisionning
|
|||
|
\item SSO
|
|||
|
\end{itemize}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Les briques et leurs fonctions}
|
|||
|
\begin{itemize}
|
|||
|
\item w.c.s. : démarches
|
|||
|
\note[item]{On va se concentrer sur wcs.}
|
|||
|
\item authentic : connexion
|
|||
|
\note[item]{Et parler un peu de l'API authentic.}
|
|||
|
\item combo : portail
|
|||
|
\item passerelle : connexion
|
|||
|
\note[item]{Éventuellement un laïus sur à quel point c'est nul les connecteurs + pas le but de cette formation.}
|
|||
|
\item chrono : prise de rendez-vous
|
|||
|
\note[item]{L'API chrono est foisonnante mais on va pas en parler sauf cas d'usage spécifique.}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Schéma général}
|
|||
|
\includegraphics[scale=0.49]{architecture.png}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Documentation utile}
|
|||
|
\small{\url{https://doc-publik.entrouvert.com/dev/connecteurs/}}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\section{Source de données}
|
|||
|
\begin{frame}[fragile]{Présentation}
|
|||
|
\begin{itemize}
|
|||
|
\item Objectif : récupérer des informations depuis un SI externe
|
|||
|
\item Dictionnaire JSON
|
|||
|
\item Structure très simple
|
|||
|
\note[item]{Rendre une API compatible Publik, c'est facile !}
|
|||
|
\end{itemize}
|
|||
|
\begin{minted}[tabsize=4]{json}
|
|||
|
{
|
|||
|
"err": 0,
|
|||
|
"data": {
|
|||
|
"text": "Donnée 1",
|
|||
|
"id": 1,
|
|||
|
"xxx": "clé supplémentaire"
|
|||
|
}
|
|||
|
}
|
|||
|
\end{minted}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}[fragile]{Et les erreurs ?}
|
|||
|
\begin{minted}[tabsize=4]{json}
|
|||
|
{
|
|||
|
"err": 1,
|
|||
|
"err_class": "TypeError",
|
|||
|
"err_desc": "name must be a string",
|
|||
|
"data": null
|
|||
|
}
|
|||
|
\end{minted}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Utilisation dans une démarche}
|
|||
|
\begin{itemize}
|
|||
|
\item Alimentation d'un champ liste\footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/fabrique-formulaires/form-champs/champ_liste/}}
|
|||
|
\note[item]{Exemple à base d'etherpad, genre \url{https://pad.inpt.fr/p/test-ws}}
|
|||
|
\item Cas d'usage avancé : autocomplétion\footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/les-tutos/utiliser-l-autocompletion/}}
|
|||
|
\note[item]{Exemple à partir d'un connecteur passerelle existant}
|
|||
|
\begin{itemize}
|
|||
|
\item Requis quand il y a beaucoup de données
|
|||
|
\end{itemize}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Utilisation dans le portail}
|
|||
|
\begin{itemize}
|
|||
|
\item Cellule JSON\footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/fabrique-formulaires/form-champs/champ_liste/}}
|
|||
|
\note[item]{Exemple à base d'etherpad, bis}
|
|||
|
\note[item]{Ne pas trop s'apesantir parce que relou pour nous d'intégrer ça.}
|
|||
|
\item Utilisation du langage de template Django\footnote{\url{https://docs.djangoproject.com/fr/2.2/ref/templates/language/}}
|
|||
|
\item Des filtres supplémentaires sont disponibles\footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/parametrage-avance/utiliser-les-filtres/}}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\section{Appel Webservice}
|
|||
|
\begin{frame}{Présentation}
|
|||
|
\begin{itemize}
|
|||
|
\item Objectif : envoyer des données
|
|||
|
\note[item]{Exemple à base de \url{https://requestbin.com}}
|
|||
|
\begin{itemize}
|
|||
|
\item Toujours en JSON
|
|||
|
\end{itemize}
|
|||
|
\item Et en récupérer (même format que les sources de données)
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Utilisation}
|
|||
|
\begin{itemize}
|
|||
|
\item Dans les workflows
|
|||
|
\begin{itemize}
|
|||
|
\item Action « Webservice »\footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/fabrique-de-workflows/les-actions-de-workflow/elements_appeler-webservices/}}
|
|||
|
\item Envoyer les données de la demande
|
|||
|
\end{itemize}
|
|||
|
\item Dans les formulaires
|
|||
|
\begin{itemize}
|
|||
|
\item Déclaration dans les paramètres
|
|||
|
\item Condition de sortie de page, champ commentaire...
|
|||
|
\end{itemize}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\section{API}
|
|||
|
\begin{frame}{Authentification}
|
|||
|
\begin{itemize}
|
|||
|
\item Authentification HTTP Basic, à privilégier
|
|||
|
\item Authentification par signature \footnote{\url{https://doc-publik.entrouvert.com/dev/wcs/api-webservices/authentification/}}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\subsection{API démarches}
|
|||
|
\begin{frame}{Agir sur une demande}
|
|||
|
\begin{itemize}
|
|||
|
\item Déclencheur d'une action « Saut automatique » \footnote{\url{https://doc-publik.entrouvert.com/admin-fonctionnel/fabrique-de-workflows/les-actions-de-workflow/actions_transition-automatique/}}
|
|||
|
\begin{itemize}
|
|||
|
\item Ou d'une action globale
|
|||
|
\end{itemize}
|
|||
|
\item Appel authentifié en POST vers l'adresse du formulaire à traiter \footnote{\url{https://doc-publik.entrouvert.com/dev/wcs/api-webservices/traitement-d-un-formulaire/}}
|
|||
|
\end{itemize}
|
|||
|
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}{Web services exposés}
|
|||
|
\begin{itemize}
|
|||
|
\item w.c.s. expose une large API
|
|||
|
\begin{itemize}
|
|||
|
\item Récupérer la liste de tous les formulaires
|
|||
|
\item Récupérer les données d'un formulaire
|
|||
|
\item Compléter un formulaire
|
|||
|
\end{itemize}
|
|||
|
\item Documentation : \url{https://doc-publik.entrouvert.com/dev/wcs/api-webservices/}
|
|||
|
\note[item]{Souligner que c'est une approche alternative, push vs pull, tout ça.}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\subsection{API connexion}
|
|||
|
|
|||
|
\begin{frame}{Web services exposés}
|
|||
|
\begin{itemize}
|
|||
|
\item authentic expose une large API
|
|||
|
\begin{itemize}
|
|||
|
\item Lister et rechercher des utilisateurs
|
|||
|
\item Créer ou supprimer un utilisateur
|
|||
|
\item Agir sur les rôles
|
|||
|
\end{itemize}
|
|||
|
\item Documentation : \url{https://doc-publik.entrouvert.com/dev/api-authentic/}
|
|||
|
\end{itemize}
|
|||
|
\end{frame}
|
|||
|
|
|||
|
\begin{frame}[focus]
|
|||
|
Fin !
|
|||
|
\end{frame}
|
|||
|
\end{document}
|