Salome HOME
ADD a end user module (services.py) to help the manipulation of SALOME KERNEL service...
[modules/kernel.git] / src / ModuleCatalog / SALOME_ModuleCatalog_Handler.cxx
index bf3e999521fdcbc694f82826d46f49bdd80fc62e..afb3dde08a3c3cfd54d5cf7908eb302cb2527987 100644 (file)
@@ -1,31 +1,31 @@
-//  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  This library is free software; you can redistribute it and/or 
-//  modify it under the terms of the GNU Lesser General Public 
-//  License as published by the Free Software Foundation; either 
-//  version 2.1 of the License. 
-// 
-//  This library is distributed in the hope that it will be useful, 
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
-//  Lesser General Public License for more details. 
-// 
-//  You should have received a copy of the GNU Lesser General Public 
-//  License along with this library; if not, write to the Free Software 
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
-// 
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+//  SALOME ModuleCatalog : implementation of ModuleCatalog server which parsers xml description of modules
 //  File   : SALOME_ModuleCatalog_Handler.cxx
 //  Author : Estelle Deville
 //  Module : SALOME
 //  $Header$ 
-
+//
 #define WRITE_CATA_COMPONENT
 
 #include "SALOME_ModuleCatalog_Handler.hxx"
@@ -33,7 +33,6 @@
 #include "utilities.h"
 
 #include <sstream>
-using namespace std;
 
 #ifdef _DEBUG_
 static int MYDEBUG = 0;
@@ -232,7 +231,7 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
                   {
                     if ( _typeMap.find(aType.name) == _typeMap.end() )
                       {
-                        std::cerr << "Registered basic type: " << aType.name << " " << aType.kind << std::endl;
+                        MESSAGE("Registered basic type: " << aType.name << " " << aType.kind );
                         _typeMap[aType.name]=aType;
                         _typeList.push_back(aType);
                       }
@@ -262,7 +261,7 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
                   {
                     if ( _typeMap.find(aType.name) == _typeMap.end() )
                       {
-                        std::cerr << "Registered sequence type: " << aType.name << " " << aType.content << std::endl;
+                        MESSAGE("Registered sequence type: " << aType.name << " " << aType.content );
                         _typeMap[aType.name]=aType;
                         _typeList.push_back(aType);
                       }
@@ -321,7 +320,7 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
                   {
                     if ( _typeMap.find(aType.name) == _typeMap.end() )
                       {
-                        std::cerr << "Registered objref type: " << aType.name << " " << aType.id << std::endl;
+                        MESSAGE("Registered objref type: " << aType.name << " " << aType.id );
                         _typeMap[aType.name]=aType;
                         _typeList.push_back(aType);
                       }
@@ -382,7 +381,7 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
                   {
                     if ( _typeMap.find(aType.name) == _typeMap.end() )
                       {
-                        std::cerr << "Registered struct type: " << aType.name << " " << aType.id << std::endl;
+                        MESSAGE("Registered struct type: " << aType.name << " " << aType.id );
                         _typeMap[aType.name]=aType;
                         _typeList.push_back(aType);
                       }
@@ -413,6 +412,8 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
         _aModule.constraint = "";
         _aModule.icon="";       
         _aModule.interfaces.resize(0);
+        _aModule.implementationType ="";
+        _aModule.implementationName ="";
 
         xmlNodePtr aComponentSubNode = aComponentNode->xmlChildrenNode;
         while(aComponentSubNode != NULL)
@@ -478,7 +479,7 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
 
           // Tag test_component_multistudy
           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_multistudy) )
-            _aModule.multistudy = atoi( aContent.c_str() );
+            _aModule.multistudy = atoi( aContent.c_str() ) != 0;
 
           // Tag test_component_impltype
           if ( !xmlStrcmp(aComponentSubNode->name, (const xmlChar*)test_component_impltype) )
@@ -541,11 +542,11 @@ void SALOME_ModuleCatalog_Handler::ProcessXmlDocument(xmlDocPtr theDoc)
 
                         // Tag test_defaultservice
                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_defaultservice) )
-                          _aService.byDefault = (const char*)aCompServiceData;
+                          _aService.byDefault = atoi((const char*)aCompServiceData) !=0 ;
 
                         // Tag test_typeofnode
                         if ( !xmlStrcmp(aCompServiceSubNode->name, (const xmlChar*)test_typeofnode) )
-                          _aService.typeOfNode = (const char*)aCompServiceData;
+                          _aService.typeOfNode = atoi((const char*)aCompServiceData) !=0 ;
 
                         xmlFree(aCompServiceData);
                       }