Integrate branch 2.5 for the interface and autoloading

This commit is contained in:
Michael RICOIS 2013-11-05 13:13:59 +00:00
parent 5a72bd68cb
commit 4952654041
332 changed files with 11409 additions and 599 deletions

View File

@ -17,73 +17,43 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
protected function _initViewSettings()
{
$this->bootstrap('view');
$view = $this->getResource('view');
$view->setEncoding('UTF-8');
$view->doctype('HTML5');
$view->headMeta()
->appendHttpEquiv('viewport', 'width=device-width, initial-scale=1.0')
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink()
->appendStylesheet('/styles/reset.css', 'all')
->appendStylesheet('/styles/main.css', 'all');
$view->headScript()->appendFile('/scripts/jquery.js', 'text/javascript');
$view->headScript()->appendFile('/scripts/scripts.js', 'text/javascript');
->appendStylesheet('/libs/bootstrap-v3.0.0/css/bootstrap.min.css', 'all')
->appendStylesheet('/themes/default/css/docs.css', 'all')
->appendStylesheet('/themes/default/css/main.css', 'all');
$view->headScript()
->appendFile('/libs/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9'))
->appendFile('/libs/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9'));
$view->inlineScript()
->appendFile('/themes/default/js/jquery.js', 'text/javascript')
->appendFile('/libs/bootstrap-v3.0.0/js/bootstrap.min.js', 'text/javascript')
->appendFile('/themes/default/js/scripts.js', 'text/javascript');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('WebService Scores & Decisions');
$view->headTitle('Web Service API - Scores & Decisions');
}
//Initialisation global des paramètres de log
protected function _initLogging()
{
$c = Zend_Registry::get('config');
/*$c = Zend_Registry::get('config');
$WsLogger = new Zend_Log();
$WsFileWriter = new Zend_Log_Writer_Stream($c->profil->path->log.'/wsentreprise.log');
$WsFileWriter->addFilter(Zend_Log::INFO);
$WsLogger->addWriter($WsFileWriter);
Zend_Registry::set('WsLogger', $WsLogger);
}
protected function _initNavigation()
{
$view = $this->bootstrap('layout')->getResource('layout')->getView();
//@todo : gérer les versions et les clients
$menu = array(
array(
'label' => 'Accueil',
'controller' => 'index',
'action' => 'index',
),
array(
'label' => 'Documentation',
'controller' => 'documentation',
'action' => 'index',
'pages' => array(
array(
'label' => 'Entreprise',
'controller' => 'documentation',
'action' => 'index',
),
array(
'label' => 'Code erreurs/messages',
'controller' => 'documentation',
'action' => 'erreur',
),
array(
'label' => 'Exemples',
'controller' => 'documentation',
'action' => 'exemples',
),
),
),
array(
'label' => 'Démonstration',
'controller' => 'demo',
'action' => 'index',
),
);
$view->navigation(new Zend_Navigation($menu));
Zend_Registry::set('WsLogger', $WsLogger);*/
}
protected function _initRouter()

View File

@ -84,9 +84,14 @@ class DemoController extends Zend_Controller_Action
$client = new Zend_Soap_Client('http://'.$hostName.'/'.$accesWs, $options);
$params = new StdClass();
$params->siret = $siret;
try {
$reponse = $client->getIdentite($params);
} catch (Zend_Soap_Client_Exception $e) {
$reponse = $e->getMessage();
}
$soap = array(
'requete' => $params,
'reponse' => $client->getIdentite($params)
'reponse' => $reponse,
);
$this->view->assign('soap',$soap);
$xml = array(

View File

@ -6,6 +6,97 @@ class DocumentationController extends Zend_Controller_Action
* Affichage de la documentation des webservices
*/
public function indexAction()
{
//Do nothing
}
/**
* Liste des services
*/
public function servicesAction()
{
}
/**
* Liste des version par service
*/
public function servicevAction()
{
$request = $this->getRequest();
$name = $request->getParam('name');
$this->view->key = $name;
}
public function serviceAction()
{
$request = $this->getRequest();
$type = $request->getParam('type', 'sd');
$ws = strtolower($request->getParam('name','entreprise'));
// Gestion des versions
$serviceVersions = array();
$configServiceVersions = $this->view->WsServices[$ws]['versions'];
foreach( $configServiceVersions as $section => $params ){
$serviceVersions[$section] = $params;
if ($params['defaut']) {
$defautVersion = $section;
}
}
$version = $request->getParam('version', $defautVersion);
$this->view->assign('serviceName', $this->view->WsServices[$ws]['name']);
$this->view->assign('serviceVersion', $version);
if ( $type == 'client') {
$client = $ws;
$ws = 'entreprise';
}
// Charger les classes et les types pour le service suivant la version
if ( $type == 'client') {
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
} else {
$pathClassService = 'WsScore/'.ucfirst($ws).'/v'.$version.'/';
}
//Génération du tableau de mapping
$classmap = include $pathClassService.'Config.php';
//Définir l'url d'accès au WSDL
$wsdl_url = $this->view->baseUrl();
if ( $type == 'client') {
$wsdl_url.= '/clients/'.$client.'/v'.$version;
} else {
$wsdl_url.= '/'.$ws.'/v'.$version;
}
if (APPLICATION_ENV == 'production'){
$wsdl_url.= '?wsdl';
} else {
$wsdl_url.= '?wsdl-auto';
}
// Affichage de la documentation
$doc = new Scores_WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
$tabServiceMethods = $doc->getServiceMethods();
// Tri des méthodes par ordre alphabétique
$tabServiceMethodsK = array();
foreach($tabServiceMethods as $method) {
$tabServiceMethodsK[$method['name']] = $method;
}
ksort($tabServiceMethodsK);
$tabServiceTypes = $doc->getServiceTypes();
$this->view->assign('wsdl', $wsdl_url);
$this->view->assign('serviceMethods', $tabServiceMethodsK);
$this->view->assign('serviceTypes', $tabServiceTypes);
}
/**
* Liste les exemples de code disponible pour chaque méthode
*/
public function exemplesAction()
{
$request = $this->getRequest();
$ws = strtolower($request->getParam('ws','Entreprise'));
@ -78,8 +169,7 @@ class DocumentationController extends Zend_Controller_Action
$wsdl_url.= '/'.$ws.'/v'.$version.'?wsdl-auto';
}
// Affichage de la documentation
require_once 'Web/WebClassDoc.php';
$doc = new WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
$doc = new Scores_WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
$tabServiceMethods = $doc->getServiceMethods();
// Tri des méthodes par ordre alphabétique
$tabServiceMethodsK = array();
@ -95,66 +185,6 @@ class DocumentationController extends Zend_Controller_Action
}
}
public function clientsAction()
{
$request = $this->getRequest();
$client = strtolower($request->getParam('nom'));
$ws = 'entreprise';
// Gestion des versions
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
$configServiceVersions = $clients[$client]['versions'];
foreach( $configServiceVersions as $section => $params ){
$serviceVersions[$section] = $params;
if ($params['defaut']) {
$defautVersion = $section;
}
}
$version = $request->getParam('version', $defautVersion);
// Charger les classes et les types pour le service suivant la version
$pathClassService = 'WsScore/Clients/'.ucfirst($client).'/v'.$version.'/';
//Génération du tableau de mapping
$classmap = include $pathClassService.'Config.php';
//Définir l'url d'accès au WSDL
$wsdl_url = $this->view->baseUrl();
if (APPLICATION_ENV == 'production'){
$wsdl_url.= '/clients/'.$client.'/v'.$version.'?wsdl';
} else {
$wsdl_url.= '/clients/'.$client.'/v'.$version.'?wsdl-auto';
}
// Affichage de la documentation
require_once 'Web/WebClassDoc.php';
$doc = new WebClassDoc(ucfirst($ws), $classmap, $pathClassService);
$tabServiceMethods = $doc->getServiceMethods();
// Tri des méthodes par ordre alphabétique
$tabServiceMethodsK = array();
foreach($tabServiceMethods as $method) {
$tabServiceMethodsK[$method['name']] = $method;
}
ksort($tabServiceMethodsK);
$tabServiceTypes = $doc->getServiceTypes();
$this->view->assign('wsdl', $wsdl_url);
$this->view->assign('serviceMethods', $tabServiceMethodsK);
$this->view->assign('serviceTypes', $tabServiceTypes);
}
/**
* Liste les exemples de code disponible pour chaque méthode
*/
public function exemplesAction()
{
}
/**
* Affichage exemple de code avec coloration syntaxique
* Le code doit être placé dans public/code et doit être nommé
@ -165,12 +195,11 @@ class DocumentationController extends Zend_Controller_Action
$langage = strtolower($this->_getParam('langage',''));
$element = $this->_getParam('element','');
$fichier = APPLICATION_PATH .
'/../public/code/' . $element . '-' . $langage . '.txt';
$fichier = APPLICATION_PATH . '/../public/assets/code/' . $element . '-' . $langage . '.txt';
if (file_exists($fichier)){
$sourceCode = file_get_contents($fichier);
require_once 'geshi/geshi.php';
require_once 'Vendors/geshi/geshi.php';
$geshi = new GeSHi($sourceCode, $langage);
$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
$sourceHighlight = $geshi->parse_code();

View File

@ -1,90 +1,14 @@
<?php
class IndexController extends Zend_Controller_Action
{
protected $serviceList = array();
protected $serviceClientList = array();
public function init()
{
$auth = Zend_Auth::getInstance();
if ( $auth->hasIdentity() ) {
//Lecture des webservices normaux
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
foreach( $services as $section => $params )
{
if ($params['actif']) {
$wsServices[$section] = $params;
}
}
//Parcourir les webservices
foreach($wsServices as $serviceName => $serviceInfo)
{
if ( !isset($wsServices[$serviceName]['idClient'])
|| $wsServices[$serviceName]['idClient'] == $auth->getIdentity()->idClient)
{
$serviceVersions = array();
$configServiceVersions = $wsServices[$serviceName]['versions'];
foreach( $configServiceVersions as $section => $params )
{
$serviceVersions[$section] = $params;
$this->serviceList[$serviceName]['version'] = $serviceVersions;
}
}
}
//Lecture des webservices Clients
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
foreach( $clients as $section => $params ){
if ($params['actif']) {
$wsClients[$section] = $params;
}
}
//Parcourir les webservices clients
foreach($wsClients as $serviceName => $serviceInfo)
{
if ( $wsClients[$serviceName]['idClient'] == $auth->getIdentity()->idClient ) {
$this->serviceList = array();
}
if ( $wsClients[$serviceName]['idClient'] == $auth->getIdentity()->idClient
|| in_array($auth->getIdentity()->username, $wsClients[$serviceName]['user']) )
{
$serviceVersions = array();
$configServiceVersions = $wsClients[$serviceName]['versions'];
foreach( $configServiceVersions as $section => $params )
{
$serviceVersions[$section] = $params;
$this->serviceList[$serviceName]['version'] = $serviceVersions;
$this->serviceList[$serviceName]['type'] = 'client';
}
}
}
}
}
public function indexAction()
{
$displayWs = array();
if (count($this->serviceList)>0)
}
public function contactAction()
{
foreach($this->serviceList as $key => $ws)
{
$displayWs[$key] = $ws;
}
}
$this->view->assign('ws', $displayWs);
}
public function testAction()
{
//Connexion au service - Faire comme ci on charger le WSDL de l'extérieur
//getFunctions / getTypes
//Pour chaque Function, identifier les Types puis proposer les champs associés
//Valider les formulaires pour executer la requête du service
//Utiliser le jeux de tests disponible
}
}

View File

@ -40,7 +40,7 @@ class RefController extends Zend_Controller_Action
break;
}
$data = file_get_contents('fichiers/'.$fichier);
$data = file_get_contents('assets/fichiers/'.$fichier);
$this->getResponse()->setHeader('Content-Length', strlen($data))
->setHeader('Cache-Control', 'private, max-age=0, must-revalidate')
@ -67,10 +67,10 @@ class RefController extends Zend_Controller_Action
{
if (!file_exists($path . $fichierCsv))
{
if (file_exists('sql/'.$fichierSql))
if (file_exists('assets/sql/'.$fichierSql))
{
//Connexion mysql
$sql = file_get_contents('sql/'.$fichierSql);
$sql = file_get_contents('assets/sql/'.$fichierSql);
require_once 'framework/common/mysql.php';
$db = new WDB();
$db->exportCSV($sql, $path . $fichierCsv, ',', "\n");

View File

@ -1,10 +1,15 @@
<?php
require_once 'framework/fwk.php';
/**
* Distribute all SOAP based Web Services
*
*/
class ServiceController extends Zend_Controller_Action
{
public function indexAction()
{
/**
* Be sure we don't make any render
*/
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();

View File

@ -14,6 +14,11 @@ class UserController extends Zend_Controller_Action {
public function loginAction()
{
$this->_helper->layout()->disableLayout();
$this->view->headLink()
->appendStylesheet('/themes/default/css/signin.css', 'all');
$this->view->headTitle()->append('Connexion');
$form = new Application_Form_Login();
$this->view->form = $form;
@ -61,6 +66,7 @@ class UserController extends Zend_Controller_Action {
public function logoutAction()
{
$this->_helper->layout()->disableLayout();
Zend_Auth::getInstance()->clearIdentity();
}

View File

@ -3,12 +3,4 @@ class Application_Model_Sdv1ClientsServices extends Zend_Db_Table_Abstract
{
protected $_name = 'clients_services';
protected $_schema = 'sdv1';
protected $_referenceMap = array(
'Login' => array(
'columns' => array('code'),
'refTableClass' => 'Application_Model_Sdv1UtilistateursService',
'refColumns' => array('serviceCode')
)
);
}

View File

@ -9,9 +9,9 @@ class Application_Model_Sdv1Utilisateurs extends Zend_Db_Table_Abstract
'refTableClass' => 'Sdv1Clients',
'refColumns' => 'id'
),
'Service' => array(
'ServiceCode' => array(
'columns' => 'login',
'refTableClass' => 'Sdv1UtilisateursService',
'refTableClass' => 'Sdv1ClientsServicesUsers',
'refColumns' => 'login'
),
);

View File

@ -13,7 +13,7 @@ class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
);
foreach ($langages as $langage => $lib){
$fichier = 'code/'.$method.'-'.$langage.'.txt';
$fichier = 'assets/code/'.$method.'-'.$langage.'.txt';
if (file_exists($fichier)){
$url = $this->view->url(
array(
@ -21,8 +21,7 @@ class Zend_View_Helper_DocExemple extends Zend_View_Helper_Abstract
'action' => 'code',
'langage' => $langage,
'element' => $method,
)
);
), null, true);
$exemple.= '<a href="'.$url.'">' . $lib . '</a>';
$exemple.= '&nbsp;';
}

View File

@ -11,7 +11,7 @@ class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
'controller' => 'user',
'action' => 'logout'
), null, true);
return '<a href="'.$logoutUrl.'" alt="Se déconnecter">Déconnexion : ' . $username . '</a>';
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
}
}
}

View File

@ -1,2 +1,2 @@
<h2><?=$this->langage?></h2>
<pre><?=$this->code?></pre>
<?=$this->code?>

View File

@ -1,46 +1,40 @@
<div id="wsdl">
<h1>WSDL</h1>
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
<i>Le fichier est accessible sans authentification.</i>
<div class="page-header"><h1>Authentification</h1></div>
<p>
Le WebService utilise une authentification http basic.
Il s'agit donc de transmettre comme paramètres d'authentification
</p>
<p><code>http://{login}:{password}@url</code></p>
<p>
- <code>{password}</code> est une chaine construite de cette façon md5({login}|{pass}) <br/>
- <code>{login}</code> est l'identifiant fournit <br/>
- <code>{pass}</code> le mot de passe fournit.
</p>
<div class="bs-callout bs-callout-warning">
Info sur le fonctionnement authentification basic
</div>
<div class="op-list">
<h1>Liste des opérations :</h1>
<ol>
<?php foreach ($this->serviceMethods as $method) {?>
<li>
<b><?php echo $method['name'];?></b>
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
</li>
<?php } ?>
</ol>
</div>
<p>
Vous trouverez dans ces exemples les prérequis pour s'authentifier et suivant
les outils et langage la possibilité de générer le code à partir du WSDL.<br/>
Exemple : <?=$this->docExemple('authentication')?>
</p>
<div class="op-detail">
<h1>Détails :</h1>
<?php foreach ($this->serviceMethods as $method) {?>
<div class="function">
<a name="<?=$method['name']?>">&nbsp;</a>
<h2><?=$method['name']?></h2>
<div class="titre">Description :</div>
<div class="description"><?=$this->docDescription($method)?></div>
<div class="titre">Empreinte :</div>
<div class="complement"><?=$this->docComplement($method)?></div>
<div class="function-detail" id="<?=$method['name']?>">
<p><?=$this->docMethod($method)?></p>
<div class="titre">Paramètres :</div>
<div class="parameters">
<?=$this->docParameter($method['params'], $this->serviceTypes);?>
</div>
<div class="titre">Retour :</div>
<div class="return">
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
</div>
</div>
<?php $exemple = $this->docExemple($method['name'])?>
<?php if (!empty($exemple)) {?>
<p>Exemple : <?=$exemple?></p>
<?php }?>
</div>
<?php } ?>
</div>
<div class="page-header"><h1>Compatibilité</h1></div>
<p>Notre service web a été testé avec ces langages/librairies</p>
<ul>
<li>PHP : PHP5 SOAP Extension</li>
<li>Perl : SOAP::Lite</li>
<li>Java : JAX-WS</li>
<li>(En cours de test) - Python : SOAPpy</li>
<li>(En cours de test) - C# : .Net Framework</li>
<li>(En cours de test) - VB.Net : .Net Framework</li>
<li>(En cours de test) - C++ : gSOAP</li>
</ul>
<br/>
<p>
Pour toutes remarques ou question merci d'adresser un email à
<a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
</p>

View File

@ -0,0 +1,63 @@
<div class="page-header"><h1>Service <?=$this->serviceName?> v<?=$this->serviceVersion?></h1></div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">WSDL</h3>
</div>
<div class="panel-body">
<p><a href="<?=$this->wsdl?>">Télécharger le WSDL</a></p>
<i>Le fichier est accessible sans authentification.</i>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Liste des opérations</h3>
</div>
<div class="panel-body">
<ol>
<?php foreach ($this->serviceMethods as $method) {?>
<li>
<b><?php echo $method['name'];?></b>
<a href="#<?php echo $method['name'];?>"><i>Détail</i></a>
</li>
<?php } ?>
</ol>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Détails</h3>
</div>
<ul class="list-group">
<?php foreach ($this->serviceMethods as $method) {?>
<li class="list-group-item">
<a id="<?=$method['name']?>"></a><h4><?=$method['name']?></h4>
<h5>Description</h5>
<div class="bs-callout bs-callout-php">
<h4><code><?=$this->docMethod($method)?></code></h4>
<p><?=$this->docComplement($method)?></p>
<p><?=$this->docDescription($method)?></p>
</div>
<h5>Paramètres</h5>
<div class="bs-callout bs-callout-php">
<?=$this->docParameter($method['params'], $this->serviceTypes);?>
</div>
<h5>Retour</h5>
<div class="bs-callout bs-callout-php">
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
</div>
<h5>Exemple</h5>
<div class="bs-callout bs-callout-php">
<?=$this->docExemple($method['name'])?>
</div>
</li>
<?php } ?>
</ul>
</div>

View File

@ -0,0 +1,43 @@
<div class="page-header"><h1>Liste des services disponibles</h1></div>
<p class="lead">Ci-dessous la liste des services disponibles, personnalisés ou standards.</code>.</p>
<?php foreach ($this->WsServices as $service => $params) {?>
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
<a href="<?=$this->url(array(
'controller'=>'documentation',
'action'=>'servicev',
'name'=>$service,
'type'=>$params['type']),null,true)?>">
<?=$params['name']?>
</a>
</div>
<div class="panel-body">
<p>Informations</p>
</div>
<?php if (isset($params['versions'])) { ?>
<ul class="list-group">
<?php foreach ($params['versions'] as $version => $versionElement) { ?>
<li class="list-group-item">
<a href="<?=$this->url(array(
'controller'=>'documentation',
'action'=>'service',
'name'=>$service,
'type'=>$params['type'],
'version'=>$version),null,true)?>">
Version <?=$version?></a>
<?php if ( $versionElement['defaut'] === true ) { ?>
<span style="float:right;" class="label label-success">Défaut</span>
<?php } elseif ( $versionElement['defaut'] === false ) {?>
<span style="float:right;" class="label label-danger">Déprécié</span>
<?php } elseif ( $versionElement['defaut'] == 'beta') {?>
<span style="float:right;" class="label label-warning">Beta</span>
<?php }?>
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
<?php } ?>

View File

@ -0,0 +1,40 @@
<?php
$service = null;
if ( array_key_exists($this->key, $this->WsServices) ) {
$service = $this->WsServices[$this->key];
}
?>
<?php if ( $service === null ) {?>
<?php } else {?>
<div class="page-header"><h1>Versions du service <?=$service['name']?></h1></div>
<p class="lead">...</p>
<?php if (isset($service['versions'])) { ?>
<?php foreach ($service['versions'] as $version => $versionElement) { ?>
<div class="panel panel-default">
<div class="panel-heading">
<a href="<?=$this->url(array(
'controller'=>'documentation',
'action'=>'service',
'name'=>$this->key,
'type'=>$service['type'],
'version'=>$version))?>">
Version <?=$version?></a>
<?php if ( $versionElement['defaut'] === true ) { ?>
<span style="float:right;" class="label label-success">Défaut</span>
<?php } elseif ( $versionElement['defaut'] === false ) {?>
<span style="float:right;" class="label label-danger">Déprécié</span>
<?php } elseif ( $versionElement['defaut'] == 'beta') {?>
<span style="float:right;" class="label label-warning">Beta</span>
<?php }?>
</div>
<div class="panel-body">
<p>Information</p>
</div>
</div>
<?php }?>
<?php }?>
<?php } ?>

View File

@ -1 +1,3 @@
<?php
<div class="container">
<p class="text-muted credit"> &copy; <?=date('Y')?> <a href="http://www.scores-decisions.com">Scores & Décisions</a>.</p>
</div>

View File

@ -1,12 +1,35 @@
<h1>WebService Scores & Décisions</h1>
<div>
<div id="menu">
<?php echo $this->navigation()->menu(); ?>
<!-- Fixed navbar -->
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Web Service API</a>
</div>
<div style="float:right;">
<?php echo $this->profileLink(); ?>
</div>
<div id="breadcrumbs" style="clear:both;">
<?php /*echo $this->navigation()->breadcrumbs()->setMinDepth(0)->setLinkLast(true)->setSeparator(" >> ");*/ ?>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="<?=$this->url(array('controller'=>'index', 'action'=>'index'),null,true)?>">Accueil</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'index'),null,true)?>">Information Général</a></li>
<li class="divider"></li>
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'services'),null,true)?>">Liste des services</a></li>
<li class="divider"></li>
<?php if ( count($this->WsServices)>0 ) {?>
<?php foreach ( $this->WsServices as $service => $params) {?>
<li><a href="<?=$this->url(array('controller'=>'documentation','action'=>'service','name'=>$service,'type'=>$params['type']),null,true)?>"><?=$params['name']?></a></li>
<?php }?>
<?php }?>
</ul>
</li>
<li><a href="<?=$this->url(array('controller'=>'demo', 'action'=>'index'), null, true)?>">Démonstration</a></li>
<li><a href="<?=$this->url(array('controller'=>'index', 'action'=>'contact'), null, true)?>">Contact</a></li>
</ul>
<p class="navbar-text pull-right"><?=$this->profileLink()?></p>
</div><!--/.nav-collapse -->
</div>
</div>

View File

@ -0,0 +1,6 @@
<div class="page-header"><h1>Contact</h1></div>
<p class="lead"></p>
<p>Pour toutes questions concernant les paramètres techniques ou une explication des données, vous pouvez contactez
votre commercial ou le service support (support@scores-decisions.com).</p>
<p>Merci de rappeler pour référence le login utilisé pour l'accès au WebService.</p>

View File

@ -1,82 +1,7 @@
<h1>Liste des services disponibles</h1>
<ul>
<?php foreach ($this->ws as $key => $ws) {?>
<li>
<?php if (array_key_exists('type', $ws) && $ws['type'] == 'client') {?>
<a href="<?=$this->url(array('controller' => 'documentation', 'action' => 'clients', 'nom' => strtolower($key)))?>">
<?=ucfirst($key)?>
</a>
<?php } else {?>
<a href="<?=$this->url(array('controller' => 'documentation', 'ws' => $key))?>">
<?=ucfirst($key)?>
</a>
<?php }?>
</li>
<?php if (isset($ws['version'])) { ?>
<ul>
<?php foreach ($ws['version'] as $version => $versionElement) { ?>
<?php if ($versionElement['actif']) { ?>
<li>
<?php if (array_key_exists('type', $ws) && $ws['type'] == 'client') {?>
<a href="<?=$this->url(array(
'controller' => 'documentation',
'action' => 'clients',
'nom' => strtolower($key),
'version' => $version,
))?>">Version <?=$version?></a>
<?php } else {?>
<a href="<?=$this->url(array(
'controller' => 'documentation',
'ws' => $key,
'version' => $version,
))?>">Version <?=$version?></a>
<?php }?>
<?php echo ( $versionElement['defaut']) ? '(défaut)' : '';?>
</li>
<?php } ?>
<?php } ?>
</ul>
<?php } ?>
<?php } ?>
</ul>
<br/>
<h1>Authentification</h1>
<p>
Le WebService utilise une authentification http basique.
Il s'agit donc de transmettre comme paramètres d'authentification
</p>
<p>http://{login}:{password}@url</p>
<p>
{password} est une chaine construite de cette façon md5({login}|{pass}) <br/>
ou {login} est l'identifiant fournit <br/>
et {pass} le mot de passe fournit.
</p>
<p>
Vous trouverez dans ces exemples les prérequis pour s'authentifier et suivant
les outils et langage la possibilité de générer le code à partir du WSDL.<br/>
Exemple : <?=$this->docExemple('authentication')?>
</p>
<br/>
<h1>Compatibilité</h1>
<p>Notre service web a été testé avec ces langages/librairies</p>
<ul>
<li>PHP : PHP5 SOAP Extension</li>
<li>Perl : SOAP::Lite</li>
<li>Java : JAX-WS</li>
<li>(En cours de test) - Python : SOAPpy</li>
<li>(En cours de test) - C# : .Net Framework</li>
<li>(En cours de test) - VB.Net : .Net Framework</li>
<li>(En cours de test) - C++ : gSOAP</li>
</ul>
<br/>
<p>
Pour toutes remarques ou question merci d'adresser un email à
<a href="mailto:support@scores-decisions.com">support@scores-decisions.com</a>
<div class="page-header"><h1>Web Service API</h1></div>
<p class="lead">Scores & Décisions fournit un ensemble d'information sous la forme d'une API
compatible avec le protocole SOAP permettant la communication et l'échange de données avec vos
applications métier.
</p>
<p>La documentation vous fournira les éléments techniques relatifs aux <em>paramètres de connexion</em>,
<em>structure des données</em>, ...</p>

View File

@ -0,0 +1,26 @@
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="wrap">
<?php echo $this->render('header.phtml') ?>
<div class="container">
<?php echo $this->layout()->content; ?>
</div>
</div>
<div id="footer">
<?php echo $this->render('footer.phtml'); ?>
</div>
<?php echo $this->inlineScript(); ?>
</body>
</html>

View File

@ -1,2 +1,32 @@
<p>Identifiez-vous pour accèder aux ressources</p>
<?=$this->form?>
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
<?php echo $this->headScript(); ?>
</head>
<body>
<div id="wrap">
<div class="container">
<form class="form-signin" method="<?=$this->form->getMethod()?>" action="<?=$this->form->getAction()?>">
<h2 class="form-signin-heading">Web Service API</h2>
<input name="login" value="<?=$this->form->getValue('login')?>" type="text" class="form-control" placeholder="Identifiant" autofocus>
<input name="pass" value="<?=$this->form->getValue('pass')?>" type="password" class="form-control" placeholder="Mot de passe">
<button class="btn btn-lg btn-primary btn-block" type="submit">Connexion</button>
</form>
</div>
</div>
<div id="footer">
<?php echo $this->render('footer.phtml'); ?>
</div>
<?php echo $this->inlineScript(); ?>
</body>
</html>

View File

@ -1 +1,24 @@
Vous avez été déconnecté.
<?php echo $this->doctype(); ?>
<html>
<head>
<?php echo $this->headMeta(); ?>
<?php echo $this->headTitle(); ?>
<?php echo $this->headStyle(); ?>
<?php echo $this->headLink(); ?>
</head>
<body>
<div id="wrap">
<div class="container">
<p>Vous avez été déconnecté.</p>
</div>
</div>
<div id="footer">
<?php echo $this->render('footer.phtml'); ?>
</div>
</body>
</html>

View File

@ -1,6 +1,8 @@
README
======
Le webservice est basé sur le ZendFramework pour générer les WSDLs.
Display the documentation of our services, manage the SOAP services
Based on ZendFramework version 1.x
Fichier de configuration
========================

View File

@ -0,0 +1,71 @@
<?php
class Application_Controller_Plugin_Services extends Zend_Controller_Plugin_Abstract
{
/**
* Vérifie les autorisations
* Utilise _request et _response hérités et injectés par le FC
*
* @param Zend_Controller_Request_Abstract $request : non utilisé, mais demandé par l'héritage
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
$controller = $request->getControllerName();
$action = $request->getActionName();
if ( $controller === 'service' ) {
} else {
$auth = Zend_Auth::getInstance();
$username = $auth->getIdentity()->username;
$idClient = $auth->getIdentity()->idClient;
$wsServices = array();
//Get all webservice client
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
foreach( $clients as $section => $params ) {
if ( $params['actif']
&& (isset($params['idClient']) && in_array($idClient,$params['idClient'])) ) {
$params['name'] = $section;
$params['type'] = 'client';
if ( $idClient == 1 ) {
$params['name'] = 'Client - '.ucfirst($section);
}
$wsServices[$section] = $params;
}
}
//Standard service
if ( count($wsServices)==0 || $idClient==1 ) {
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
foreach( $services as $section => $params )
{
if ( $params['actif'] ) {
$params['name'] = ucfirst($section);
$params['type'] = 'sd';
if ( isset($params['idClient']) && in_array($idClient,$params['idClient']) ) {
if ( $idClient == 1 ) {
$params['name'] = 'SD - '.ucfirst($section);
}
$wsServices[$section] = $params;
}
elseif ( !isset($params['idClient']) ) {
if ( $idClient == 1 ) {
$params['name'] = 'SD - '.ucfirst($section);
}
$wsServices[$section] = $params;
}
}
}
}
$layout = Zend_Layout::getMVCInstance();
$view = $layout->getView();
$view->WsServices = $wsServices;
}
}
}

View File

@ -1,5 +1,5 @@
<?php
class WebClassDoc
class Scores_WebClassDoc
{
private $serviceClass;
@ -155,7 +155,7 @@ class WebClassDoc
'controller' => 'ref',
'action' => 'fichier',
'q' => $ref[3],
));
), null, true);
$comment.= '<a href="'.$urlFichier.'">'.$ref[2].'</a>';
break;
case 'mysql':
@ -163,7 +163,7 @@ class WebClassDoc
'controller' => 'ref',
'action' => 'table',
'q' => $ref[3],
));
), null, true);
$comment.= '<a href="'.$urlMysql.'">'.$ref[2].'</a>';
break;
}

View File

@ -1,8 +1,8 @@
<?php
require_once('Zend/Soap/Client.php');
class ServiceDiscover {
class ServiceDiscover
{
protected $serviceWsdl = null;
protected $serviceOptions = array();
protected $serviceStructure = array();

View File

Before

Width:  |  Height:  |  Size: 620 B

After

Width:  |  Height:  |  Size: 620 B

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 696 B

After

Width:  |  Height:  |  Size: 696 B

View File

Before

Width:  |  Height:  |  Size: 848 B

After

Width:  |  Height:  |  Size: 848 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 874 B

After

Width:  |  Height:  |  Size: 874 B

View File

Before

Width:  |  Height:  |  Size: 570 B

After

Width:  |  Height:  |  Size: 570 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 752 B

View File

Before

Width:  |  Height:  |  Size: 865 B

After

Width:  |  Height:  |  Size: 865 B

View File

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 956 B

View File

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 596 B

View File

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

View File

Before

Width:  |  Height:  |  Size: 148 B

After

Width:  |  Height:  |  Size: 148 B

View File

Before

Width:  |  Height:  |  Size: 584 B

After

Width:  |  Height:  |  Size: 584 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 153 B

View File

Before

Width:  |  Height:  |  Size: 219 B

After

Width:  |  Height:  |  Size: 219 B

View File

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View File

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View File

Before

Width:  |  Height:  |  Size: 592 B

After

Width:  |  Height:  |  Size: 592 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 790 B

After

Width:  |  Height:  |  Size: 790 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 918 B

After

Width:  |  Height:  |  Size: 918 B

View File

Before

Width:  |  Height:  |  Size: 772 B

After

Width:  |  Height:  |  Size: 772 B

View File

Before

Width:  |  Height:  |  Size: 661 B

After

Width:  |  Height:  |  Size: 661 B

View File

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 688 B

View File

Before

Width:  |  Height:  |  Size: 152 B

After

Width:  |  Height:  |  Size: 152 B

View File

Before

Width:  |  Height:  |  Size: 207 B

After

Width:  |  Height:  |  Size: 207 B

View File

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 222 B

View File

Before

Width:  |  Height:  |  Size: 688 B

After

Width:  |  Height:  |  Size: 688 B

View File

Before

Width:  |  Height:  |  Size: 144 B

After

Width:  |  Height:  |  Size: 144 B

View File

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 633 B

View File

Before

Width:  |  Height:  |  Size: 90 B

After

Width:  |  Height:  |  Size: 90 B

View File

Before

Width:  |  Height:  |  Size: 462 B

After

Width:  |  Height:  |  Size: 462 B

View File

Before

Width:  |  Height:  |  Size: 492 B

After

Width:  |  Height:  |  Size: 492 B

View File

Before

Width:  |  Height:  |  Size: 605 B

After

Width:  |  Height:  |  Size: 605 B

View File

Before

Width:  |  Height:  |  Size: 657 B

After

Width:  |  Height:  |  Size: 657 B

View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

View File

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

View File

Before

Width:  |  Height:  |  Size: 564 B

After

Width:  |  Height:  |  Size: 564 B

View File

Before

Width:  |  Height:  |  Size: 644 B

After

Width:  |  Height:  |  Size: 644 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 431 B

After

Width:  |  Height:  |  Size: 431 B

View File

Before

Width:  |  Height:  |  Size: 572 B

After

Width:  |  Height:  |  Size: 572 B

View File

Before

Width:  |  Height:  |  Size: 668 B

After

Width:  |  Height:  |  Size: 668 B

Some files were not shown because too many files have changed in this diff Show More