« ExempleDashboard » : différence entre les versions

De Wiki1000
Aucun résumé des modifications
 
(2 versions intermédiaires par le même utilisateur non affichées)
Ligne 12 : Ligne 12 :


[[image:dashboard_2.PNG]]
[[image:dashboard_2.PNG]]
[[image:dashboard_14.PNG]]


[[image:dashboard_3.PNG]]
[[image:dashboard_3.PNG]]


[[image:dashboard_14.PNG]]


[[image:dashboard_4.PNG]]
[[image:dashboard_4.PNG]]
Ligne 28 : Ligne 29 :
nous allons créer un fichier "home.html" dans ce nouveau répertoire.
nous allons créer un fichier "home.html" dans ce nouveau répertoire.


<source lang="html">
<source lang="html4strict">


<!DOCTYPE html>  
<!DOCTYPE html>  
Ligne 66 : Ligne 67 :
</html>
</html>
</source>
</source>


===Implémentation Sage 1000===
===Implémentation Sage 1000===
Ligne 114 : Ligne 114 :
[[image:dashboard_11.PNG]]
[[image:dashboard_11.PNG]]


libérer et redémarrer le service


===Utilisation===
===Utilisation===

Dernière version du 30 janvier 2015 à 10:18

{{#customtitle:Exemple de création d'un dashboard simple}}

Nous allons créer un dashboard. L'ouverture de ce dashboard effectuera une requête d'initialisation, et le dashboard pourra invoquer une méthode.

Tip : La création d'un dashboard créé un paquet métier, le créateur du dashboard doit avoir le droit correspondant.

Création du dashboard



Implémentation html

On constate que la publication a créé un répertoire dans "L1000Site/dashboards/"

nous allons créer un fichier "home.html" dans ce nouveau répertoire.

<source lang="html4strict">

<!DOCTYPE html> <html class="ui-tb"> <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../lib-1.0.0/css/dashboard.css" /> <link rel="stylesheet" type="text/css" href="../lib-1.0.0/jq/jquery-ui.css" /> <script src="../lib-1.0.0/jq/jquery.js"></script> <script src="../lib-1.0.0/js/jd1000.js"></script> <script src="../lib-1.0.0/jq/jquery-ui.js"></script> </head> <body class="ui-tb">

<button onclick="onClickEchoButton()">Echo</button>


<script> function onClickEchoButton(){ $.post($.l1000._api_+"/echo",{dataIn: 'test'}, function(data){ $('#echo_result').html(JSON.stringify(data)); },"json"); };

(function(win) { $.l1000.homeProc = "/home"; $.l1000.title = "Test"; $.l1000.renderProc = function(data) { $('#donnees_initialisation').html(JSON.stringify(data));}; $.l1000.initialize(); $.l1000.renderInit(); })(window); </script>

</body> </html> </source>

Implémentation Sage 1000

On constate dans la console d'administration que la publication a créé une archive de site et un paquet métier



On rentre dans l'application pour modifier le contenu de la classe

Il est préférable de choisir le répertoire du site du service pour le remote debugging

Le code des méthodes

<source lang="delphi"> //Procedure echo(req:Tjson; var resp:TObject); var json : Tjson; begin

 json := Tjson.Create();
 json.echo := req.AsString;
 resp := json;

end; </source>


<source lang="delphi"> //Procedure home(req:Tjson; var resp:TObject); var json:TJson; begin

 json := Tjson.Create('{ data : "données dinitialisation "}');
 resp := json;

end; </source>



libérer et redémarrer le service

Utilisation

Le dashboard est disponible ans le portail et également directement


{{#if:|

{{#if:{{{1}}}|— [[{{{1}}}]] |}} — Développement DSM

|

{{#if:|— [[{{{1}}}]] |}} — Développement DSM

}}