Merge with branch 2.5 for the interface and ini files remove
@ -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()
|
||||
|
@ -22,8 +22,8 @@ class DemoController extends Zend_Controller_Action
|
||||
public function indexAction()
|
||||
{
|
||||
//Liste
|
||||
|
||||
|
||||
|
||||
|
||||
$tabMethods = array();
|
||||
foreach($this->methods as $method => $element){
|
||||
$url = $this->view->url(array(
|
||||
@ -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(
|
||||
|
@ -7,69 +7,160 @@ class DocumentationController extends Zend_Controller_Action
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$ws = strtolower($request->getParam('ws','Entreprise'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
//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'));
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
//Si client possède un webservice particulier alors on redirige vers la doc clients
|
||||
$clients = include APPLICATION_PATH . '/../library/WsScore/Clients/ClientsConfig.php';
|
||||
foreach( $clients as $section => $params ){
|
||||
if ($params['actif']) {
|
||||
$wsClients[$params['idClient']] = $section;
|
||||
}
|
||||
}
|
||||
|
||||
if (array_key_exists($auth->getIdentity()->idClient, $wsClients)){
|
||||
|
||||
$this->_forward('clients', 'documentation', null, array(
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
'nom' => $wsClients[$auth->getIdentity()->idClient]
|
||||
));
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
|
||||
// Liste des webservices
|
||||
$services = include APPLICATION_PATH . '/../library/WsScore/ServicesConfig.php';
|
||||
foreach( $services as $section => $params )
|
||||
{
|
||||
if ($params['actif']) {
|
||||
$wsServices[$section] = $params;
|
||||
}
|
||||
}
|
||||
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
|
||||
// On vérifie que l'utilisateur peut accèder à la documentation
|
||||
$username = $auth->getIdentity()->username;
|
||||
$idClient = $auth->getIdentity()->idClient;
|
||||
if ( array_key_exists($ws, $wsServices) )
|
||||
{
|
||||
if ( isset($wsServices['idClient']) && $idClient!=$wsServices['idClient'] )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if ( isset($wsServices['user']) && !in_array($username, $wsServices['user']) )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['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/'.ucfirst($ws).'/v'.$version.'/';
|
||||
|
||||
if ( array_key_exists($ws, $wsServices) )
|
||||
{
|
||||
if ( isset($wsServices['idClient']) && $idClient!=$wsServices['idClient'] )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
if ( isset($wsServices['user']) && !in_array($username, $wsServices['user']) )
|
||||
{
|
||||
$this->renderScript('documentation/nodoc.phtml');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Gestion des versions
|
||||
$serviceVersions = array();
|
||||
$configServiceVersions = $wsServices[$ws]['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/'.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 (APPLICATION_ENV == 'production'){
|
||||
@ -77,82 +168,21 @@ class DocumentationController extends Zend_Controller_Action
|
||||
} else {
|
||||
$wsdl_url.= '/'.$ws.'/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;
|
||||
}
|
||||
// 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);
|
||||
|
||||
$tabServiceTypes = $doc->getServiceTypes();
|
||||
$this->view->assign('wsdl', $wsdl_url);
|
||||
$this->view->assign('serviceMethods', $tabServiceMethodsK);
|
||||
$this->view->assign('serviceTypes', $tabServiceTypes);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -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();
|
||||
@ -182,7 +211,7 @@ class DocumentationController extends Zend_Controller_Action
|
||||
'Element non traités, Vous pouvez aussi nous fournir des exemples.');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Affichage de la liste des erreurs avec leur code
|
||||
*/
|
||||
|
@ -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)
|
||||
{
|
||||
foreach($this->serviceList as $key => $ws)
|
||||
{
|
||||
$displayWs[$key] = $ws;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->assign('ws', $displayWs);
|
||||
}
|
||||
|
||||
public function testAction()
|
||||
public function contactAction()
|
||||
{
|
||||
//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
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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");
|
||||
|
@ -1,11 +1,16 @@
|
||||
<?php
|
||||
require_once 'framework/fwk.php';
|
||||
|
||||
/**
|
||||
* Distribute all SOAP based Web Services
|
||||
*
|
||||
*/
|
||||
class ServiceController extends Zend_Controller_Action
|
||||
{
|
||||
public function indexAction()
|
||||
{
|
||||
$this->_helper->layout->disableLayout();
|
||||
/**
|
||||
* Be sure we don't make any render
|
||||
*/
|
||||
$this->_helper->layout->disableLayout();
|
||||
$this->_helper->viewRenderer->setNoRender();
|
||||
|
||||
$request = $this->getRequest();
|
||||
@ -64,12 +69,12 @@ class ServiceController extends Zend_Controller_Action
|
||||
|
||||
// Charger les classes et les types pour le service suivant la version
|
||||
if ('clients' == $serviceName) {
|
||||
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Config.php';
|
||||
|
||||
$pathServiceClassIni = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/Clients/'.$clientClassName.'/v'.$version.'/Entreprise.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
|| array_key_exists('mode', $serviceVersions[$version])
|
||||
&& $serviceVersions[$version]['mode']=='auto') {
|
||||
$pathServiceUrl = 'clients/'.$client.'/v'.$version.'?wsdl-auto';
|
||||
} else {
|
||||
@ -78,10 +83,10 @@ class ServiceController extends Zend_Controller_Action
|
||||
//On redéfini le nom du service
|
||||
$serviceClassName = 'Entreprise';
|
||||
$fichierWsdl = $clientClassName.'-'.$serviceClassName.'-'.$version.'.wsdl';
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/Config.php';
|
||||
|
||||
$pathServiceClassIni = 'WsScore/'.$serviceClassName.'/v'.$version.'/Config.php';
|
||||
$pathServiceClassPhp = 'WsScore/'.$serviceClassName.'/v'.$version.'/'.$serviceClassName.'.php';
|
||||
//Gestion du mode de génération du wsdl
|
||||
if ( APPLICATION_ENV == 'development'
|
||||
@ -92,12 +97,12 @@ class ServiceController extends Zend_Controller_Action
|
||||
$pathServiceUrl = $serviceName.'/v'.$version.'?wsdl';
|
||||
}
|
||||
$fichierWsdl = $serviceClassName.'-'.$version.'.wsdl';
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Get map of WSDL type to PHP Classes
|
||||
$classmap = include $pathServiceClassIni;
|
||||
|
||||
|
||||
//Inclusion des classes de données
|
||||
require_once $pathServiceClassPhp;
|
||||
|
||||
|
@ -14,12 +14,17 @@ class UserController extends Zend_Controller_Action {
|
||||
|
||||
public function loginAction()
|
||||
{
|
||||
$this->view->headTitle()->append('Connexion');
|
||||
$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;
|
||||
$request = $this->getRequest();
|
||||
if ($request->isPost()) {
|
||||
$formData = $request->getPost ();
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
@ -61,6 +66,7 @@ class UserController extends Zend_Controller_Action {
|
||||
|
||||
public function logoutAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
Zend_Auth::getInstance()->clearIdentity();
|
||||
}
|
||||
|
||||
|
@ -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')
|
||||
)
|
||||
);
|
||||
}
|
@ -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'
|
||||
),
|
||||
);
|
||||
|
@ -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.= ' ';
|
||||
}
|
||||
|
@ -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>';
|
||||
}
|
||||
}
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
<h2><?=$this->langage?></h2>
|
||||
<pre><?=$this->code?></pre>
|
||||
<?=$this->code?>
|
||||
|
@ -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']?>"> </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>
|
63
application/views/scripts/documentation/service.phtml
Normal 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>
|
43
application/views/scripts/documentation/services.phtml
Normal 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 } ?>
|
40
application/views/scripts/documentation/servicev.phtml
Normal 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 } ?>
|
@ -1 +1,3 @@
|
||||
<?php
|
||||
<div class="container">
|
||||
<p class="text-muted credit"> © <?=date('Y')?> <a href="http://www.scores-decisions.com">Scores & Décisions</a>.</p>
|
||||
</div>
|
@ -1,12 +1,35 @@
|
||||
<h1>WebService Scores & Décisions</h1>
|
||||
<div>
|
||||
<div id="menu">
|
||||
<?php echo $this->navigation()->menu(); ?>
|
||||
</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>
|
||||
<!-- 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 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>
|
6
application/views/scripts/index/contact.phtml
Normal 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>
|
@ -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
|
||||
<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>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>
|
||||
</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>
|
26
application/views/scripts/layout.phtml
Normal 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>
|
@ -1,23 +0,0 @@
|
||||
<?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="global">
|
||||
<div id="header">
|
||||
<?php echo $this->render('header.phtml') ?>
|
||||
</div>
|
||||
<div id="content" style="clear:both;">
|
||||
<?php echo $this->layout()->content; ?>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo $this->render('footer.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -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>
|
||||
|
@ -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>
|
||||
|
||||
|
@ -1,55 +0,0 @@
|
||||
Le fichier Zend/Soap/Wsdl/Strategy/DefaultComplexType.php a été modifié pour
|
||||
générer la documentation automatiquement.
|
||||
|
||||
/**
|
||||
* Traitement éléments de documentation à placer dans le WSDL
|
||||
* Supprime les retours chariots.
|
||||
* Récupére les éléments de documentation
|
||||
*/
|
||||
$comment = '';
|
||||
$docBlock = preg_replace('/\n/', '', $property->getDocComment() );
|
||||
if (preg_match('/\/\*\*(.+) \* @var\s+[^\s]+\s+(?:\*|@)/m', $docBlock, $docBlockMatches)) {
|
||||
$comment.= preg_replace(
|
||||
array('/\r/', '/\t\s\*/'),
|
||||
array('', ''), $docBlockMatches[1]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajout des éléments de documentation au WSDL
|
||||
*/
|
||||
if (!empty($comment)){
|
||||
$annotation = $dom->createElement('xsd:annotation');
|
||||
$documentation = $dom->createElement('xsd:documentation', trim($comment));
|
||||
$annotation->appendChild($documentation);
|
||||
$element->appendChild($annotation);
|
||||
}
|
||||
|
||||
===============================================================================>
|
||||
|
||||
Le fichier Zend/Soap/AutoDiscover.php a été modifié
|
||||
function _addFunctionToWsdl
|
||||
|
||||
$sequenceElement = array(
|
||||
'name' => $param->getName(),
|
||||
'type' => $wsdl->getType($param->getType()),
|
||||
'desc' => $param->getDescription()
|
||||
);
|
||||
|
||||
===============================================================================>
|
||||
|
||||
Le fichier Zend/Soap/Wsdl.php a été modifié
|
||||
function _parseElement
|
||||
|
||||
} elseif ($key == 'desc') {
|
||||
if (!empty($value)) {
|
||||
$annotation = $this->_dom->createElement('xsd:annotation');
|
||||
$documentation = $this->_dom->createElement('xsd:documentation', trim($value));
|
||||
$annotation->appendChild($documentation);
|
||||
$elementXml->appendChild($annotation);
|
||||
}
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
========================
|
||||
|
71
library/Application/Controller/Plugin/Services.php
Normal 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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
1
library/Metier/Search/Search.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
1
library/Metier/Search/SearchAct.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
1
library/Metier/Search/SearchDir.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
1
library/Metier/Search/SearchEnt.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
5
library/Metier/Search/SearchHisto.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
class SearchHisto
|
||||
{
|
||||
|
||||
}
|
3581
library/Metier/scores/Cache/CacheTabFormules.php
Normal file
25
library/Metier/scores/Cache/CacheTabInfla.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
return array(
|
||||
1991=>3.2,
|
||||
1992=>2.4,
|
||||
1993=>2.1,
|
||||
1994=>1.7,
|
||||
1995=>1.7,
|
||||
1996=>2,
|
||||
1997=>1.2,
|
||||
1998=>0.7,
|
||||
1999=>0.5,
|
||||
2000=>1.7,
|
||||
2001=>1.7,
|
||||
2002=>1.9,
|
||||
2003=>2.1,
|
||||
2004=>2.1,
|
||||
2005=>1.8,
|
||||
2006=>1.6,
|
||||
2007=>1.5,
|
||||
2008=>2.8,
|
||||
2009=>0.1,
|
||||
2010=>1.5,
|
||||
2011=>2.1,
|
||||
2012=>2,
|
||||
);
|
22
library/Metier/scores/Cache/CacheTabRendObli.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
return array(
|
||||
1994=>5.65,
|
||||
1995=>5.29,
|
||||
1996=>4.69,
|
||||
1997=>4.93,
|
||||
1998=>3.92,
|
||||
1999=>3.99,
|
||||
2000=>4.35,
|
||||
2001=>3.35,
|
||||
2002=>2.83,
|
||||
2003=>2.68,
|
||||
2004=>2.45,
|
||||
2005=>2.46,
|
||||
2006=>2.66,
|
||||
2007=>2.86,
|
||||
2008=>3.45,
|
||||
2009=>2.81,
|
||||
2010=>2.17,
|
||||
2011=>1.7,
|
||||
2012=>0,
|
||||
);
|
6008
library/Metier/scores/Cache/CacheTabVariables.php
Normal file
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
class WebClassDoc
|
||||
class Scores_WebClassDoc
|
||||
{
|
||||
private $serviceClass;
|
||||
|
||||
@ -86,17 +86,17 @@ class WebClassDoc
|
||||
$typesElement = array();
|
||||
if (count($this->classmap)>0)
|
||||
{
|
||||
|
||||
|
||||
foreach ($this->classmap as $className)
|
||||
{
|
||||
$class = new ReflectionClass($className);
|
||||
$paramsElement = array();
|
||||
foreach ($class->getProperties() as $property) {
|
||||
if ($property->isPublic() && preg_match_all('/@var\s+([^\s]+)/m', $property->getDocComment(), $matches)) {
|
||||
|
||||
|
||||
$name = $property->getName();
|
||||
$type = $matches[1][0];
|
||||
|
||||
|
||||
/**
|
||||
* Traitement éléments de documentation à placer dans le WSDL
|
||||
* Supprime les retours chariots.
|
||||
@ -110,7 +110,7 @@ class WebClassDoc
|
||||
array('' , ''), $docBlockMatches[1]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Traitement des @xsd (Provisoire)
|
||||
* Définition des longueurs dans la documentation
|
||||
@ -137,7 +137,7 @@ class WebClassDoc
|
||||
}
|
||||
$comment.= ')';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Traitement des références
|
||||
* @ref fichier:titre:nom_du_fichier
|
||||
@ -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;
|
||||
}
|
||||
@ -175,7 +175,7 @@ class WebClassDoc
|
||||
'type' => $type,
|
||||
'description' => trim($comment)
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
$paramsElement[] = $paramElement;
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
<?php
|
||||
require_once('Zend/Soap/Client.php');
|
||||
|
||||
class ServiceDiscover {
|
||||
|
||||
class ServiceDiscover
|
||||
{
|
||||
protected $serviceWsdl = null;
|
||||
protected $serviceOptions = array();
|
||||
protected $serviceStructure = array();
|
||||
|
Before Width: | Height: | Size: 620 B After Width: | Height: | Size: 620 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 696 B After Width: | Height: | Size: 696 B |
Before Width: | Height: | Size: 848 B After Width: | Height: | Size: 848 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 874 B |
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 570 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 752 B |
Before Width: | Height: | Size: 865 B After Width: | Height: | Size: 865 B |
Before Width: | Height: | Size: 956 B After Width: | Height: | Size: 956 B |
Before Width: | Height: | Size: 596 B After Width: | Height: | Size: 596 B |
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
Before Width: | Height: | Size: 584 B After Width: | Height: | Size: 584 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 153 B After Width: | Height: | Size: 153 B |
Before Width: | Height: | Size: 219 B After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 592 B After Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 790 B After Width: | Height: | Size: 790 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 918 B After Width: | Height: | Size: 918 B |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 772 B |
Before Width: | Height: | Size: 661 B After Width: | Height: | Size: 661 B |
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 207 B After Width: | Height: | Size: 207 B |
Before Width: | Height: | Size: 222 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 688 B After Width: | Height: | Size: 688 B |
Before Width: | Height: | Size: 144 B After Width: | Height: | Size: 144 B |
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 633 B |
Before Width: | Height: | Size: 90 B After Width: | Height: | Size: 90 B |
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
Before Width: | Height: | Size: 492 B After Width: | Height: | Size: 492 B |
Before Width: | Height: | Size: 605 B After Width: | Height: | Size: 605 B |
Before Width: | Height: | Size: 657 B After Width: | Height: | Size: 657 B |