Salome HOME
NRI : Add componentusername.
authornri <nri@opencascade.com>
Fri, 16 May 2003 15:59:48 +0000 (15:59 +0000)
committernri <nri@opencascade.com>
Fri, 16 May 2003 15:59:48 +0000 (15:59 +0000)
idl/SALOME_ModuleCatalog.idl
src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Acomponent_impl.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Handler.cxx
src/ModuleCatalog/SALOME_ModuleCatalog_Handler.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_Parser.hxx
src/ModuleCatalog/SALOME_ModuleCatalog_impl.cxx

index d7e079c39420aeeb53aec9d189a8733980037617..789722be47efa598bb89cab4242ca024f160c574 100644 (file)
@@ -87,6 +87,7 @@ This struct contains GUI elements used for representation of the module in %IAPP
   struct IAPP_Affich
   {
     string modulename; /*!<Name of the module.*/
+    string moduleusername; /*!<UserName of the module.*/
     string moduleicone; /*!<Icone representing the module.*/
   };
 /*!
@@ -179,6 +180,11 @@ Sets/gets the name of the component
 */
     readonly attribute string componentname;
 
+/*! 
+Sets/gets the user name of the component
+*/
+    readonly attribute string componentusername;
+
 /*! 
 Defines whether the component can be multistudy or not
 */
index 8ba33793a1eadf408009c692fc6c9626b0dd08a2..65476af917500b215415ae8f3eb3174a94c33a4a 100644 (file)
@@ -19,6 +19,7 @@ using namespace std;
 //----------------------------------------------------------------------  
 SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl(
                    const char* name,
+                   const char* username,
                   const char* constraint,  
                   SALOME_ModuleCatalog::ComponentType componenttype,
                   CORBA::Boolean componentmultistudy,
@@ -31,6 +32,10 @@ SALOME_ModuleCatalog_AcomponentImpl::SALOME_ModuleCatalog_AcomponentImpl(
   _component_name = new char[strlen(name)+1];
  strcpy(_component_name, name);
 
+  // Affect component user name
+  _component_user_name = new char[strlen(username)+1];
+ strcpy(_component_user_name, username);
+
  // Affect constraint
  _constraint =new char[strlen(constraint)+1];
  strcpy(_constraint, constraint);
@@ -63,6 +68,7 @@ SALOME_ModuleCatalog_AcomponentImpl::~SALOME_ModuleCatalog_AcomponentImpl()
   MESSAGE("Component destruction")
   // empty memory
   delete [] _component_name;
+  delete [] _component_user_name;
   delete [] _constraint;
 }
 
@@ -369,6 +375,15 @@ char* SALOME_ModuleCatalog_AcomponentImpl::componentname()
   return CORBA::string_dup(_component_name);
 }
 
+//----------------------------------------------------------------------
+// Function : componentusername
+// Purpose  : obtain the componentusername
+//----------------------------------------------------------------------
+char* SALOME_ModuleCatalog_AcomponentImpl::componentusername()
+{
+  return CORBA::string_dup(_component_user_name);
+}
+
 //----------------------------------------------------------------------
 // Function : multistudy
 // Purpose  : define if a component can be multistudy or not
index 3d9fe1fa1ec157071b799f9c4f38b6fd3cd73fbd..3cbde7fd7629f585a6a6adbe9462bb91a30c7eb1 100644 (file)
@@ -20,6 +20,7 @@ class SALOME_ModuleCatalog_AcomponentImpl: public POA_SALOME_ModuleCatalog::Acom
 public:
   //! standard constructor
   SALOME_ModuleCatalog_AcomponentImpl(const char* name, 
+                                     const char* username, 
                                      const char* constraint, 
                                      SALOME_ModuleCatalog::ComponentType componenttype, 
                                      CORBA::Boolean componentmultistudy,
@@ -96,6 +97,12 @@ public:
   */
   virtual char* componentname();
 
+  //! method to obtain the componentusername
+  /*!
+    \return the component user name
+  */
+  virtual char* componentusername();
+
   //! method to define if a component can be multistudy or not
   /*!
     \return true if the component supports multistudy
@@ -116,6 +123,7 @@ public:
 
 private :
   char* _component_name ;
+  char* _component_user_name ;
   char* _constraint;
   char* _icone;
   SALOME_ModuleCatalog::ComponentType _componenttype;
index 77b9d298d9364f7062bc3da759b4f9ee9a7933eb..f22bf8ce042c4251ea7869df7d6236e8d6092407 100644 (file)
@@ -23,6 +23,7 @@ SALOME_ModuleCatalog_Handler::SALOME_ModuleCatalog_Handler()
   test_path_prefix = "path-prefix" ;
 
   test_component_name = "component-name";
+  test_component_username = "component-username";
   test_component_type = "component-type" ;
   test_component_multistudy="component-multistudy";
   test_component_icone="component-icone" ;
@@ -119,6 +120,9 @@ bool SALOME_ModuleCatalog_Handler::endElement(const QString&,
   // tag test_component_name
   if((qName.compare(QString(test_component_name))==0)) 
     _amodule.Parsercomponentname = content ;
+  // tag test_component_username
+  if((qName.compare(QString(test_component_username))==0)) 
+    _amodule.Parsercomponentusername = content ;
   // tag test_component_type
    if((qName.compare(QString(test_component_type))==0)) 
      {
index 3efd158260e1eaac996318e446baf152f1893a98..be38d636469e844be541dc2855d1c20d4ede20b0 100644 (file)
@@ -90,6 +90,7 @@ private:
   const char* test_path_prefix ;
 
   const char* test_component_name;
+  const char* test_component_username;
   const char* test_component_type ;
   const char* test_component_multistudy ;
   const char* test_component_icone ;
index 050ecfdeea6f6133d82f4fb3df07a884138d5b6f..d84a4ba5ba97d5525b21479d5980ad58ce0175e1 100644 (file)
@@ -51,6 +51,7 @@ typedef vector<ParserDefInterface> ListOfDefinitionInterface;
 struct ParserComponent
 {
   string Parsercomponentname;
+  string Parsercomponentusername;
   ParserComponentType Parsercomponenttype;
   bool Parsercomponentmultistudy ;
   string Parsercomponenticone;
index 9cf8efc5b2de494c6caf8cb6de2955f4a60ec250..ba6ff0a512772bac785ca8cf9bd7c7fc5eb63074 100644 (file)
@@ -165,7 +165,7 @@ SALOME_ModuleCatalogImpl::GetComponentList()
   for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
     {
        _list_components[ind]=(_personal_module_list[ind].Parsercomponentname).c_str();
-       //SCRUTE(_list_components[ind]) ;
+       SCRUTE(_list_components[ind]) ;
     }
 
   int indice = _personal_module_list.size() ;
@@ -185,18 +185,19 @@ SALOME_ModuleCatalogImpl::GetComponentList()
        }
       if (!_find)
        {
-         //MESSAGE("A new component " << _general_module_list[ind].Parsercomponentname << " has to be to added in the list");
+         MESSAGE("A new component " << _general_module_list[ind].Parsercomponentname << " has to be to added in the list");
           _list_components->length(indice+1);
          // The component is not already defined => has to be taken
          _list_components[indice]=(_general_module_list[ind].Parsercomponentname).c_str();   
-         //SCRUTE(_list_components[indice]) ;
+         SCRUTE(_list_components[indice]) ;
 
          indice++;
        }
-      // else 
-       //MESSAGE("The component " <<_general_module_list[ind].Parsercomponentname << " was already defined in the personal catalog") ;
+      else 
+       MESSAGE("The component " <<_general_module_list[ind].Parsercomponentname << " was already defined in the personal catalog") ;
      }
 
+  MESSAGE ( "End of GetComponentList" )
   return _list_components._retn();
 }
 
@@ -222,6 +223,7 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList()
   for (unsigned int ind=0; ind < _personal_module_list.size();ind++)
     {
        _list_components_icone[ind].modulename=(_personal_module_list[ind].Parsercomponentname).c_str();
+       _list_components_icone[ind].moduleusername=(_personal_module_list[ind].Parsercomponentusername).c_str();
        _list_components_icone[ind].moduleicone=(_personal_module_list[ind].Parsercomponenticone).c_str();
        //SCRUTE(_list_components_icone[ind].modulename); 
        //SCRUTE(_list_components_icone[ind].moduleicone);
@@ -248,6 +250,7 @@ SALOME_ModuleCatalogImpl::GetComponentIconeList()
           _list_components_icone->length(indice+1);
          // The component is not already defined => has to be taken
          _list_components_icone[indice].modulename=(_general_module_list[ind].Parsercomponentname).c_str();  
+         _list_components_icone[indice].moduleusername=(_general_module_list[ind].Parsercomponentusername).c_str();  
          _list_components_icone[indice].moduleicone=(_general_module_list[ind].Parsercomponenticone).c_str(); 
          //SCRUTE(_list_components_icone[indice].modulename) ;
          //SCRUTE(_list_components_icone[indice].moduleicone);
@@ -370,6 +373,7 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
   _list_interfaces.length(0);
   char* _constraint = NULL;
   char* _icone = NULL;
+  char* _componentusername = NULL;
   SALOME_ModuleCatalog::ComponentType _componenttype = SALOME_ModuleCatalog::OTHER; // default initialisation
   CORBA::Boolean _componentmultistudy = false ; // default initialisation
   ListOfPathPrefix _pathes ;
@@ -430,6 +434,9 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
          // get component icone
          _icone = CORBA::string_dup(_personal_module_list[ind].Parsercomponenticone.c_str());
 
+         // get component user name
+         _componentusername = CORBA::string_dup(_personal_module_list[ind].Parsercomponentusername.c_str());
+
          // get component interfaces
          _list_interfaces = duplicate_interfaces(_personal_module_list[ind].ParserListInterface);
 
@@ -443,6 +450,7 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
     {
       SALOME_ModuleCatalog_AcomponentImpl* aComponentImpl = 
        new SALOME_ModuleCatalog_AcomponentImpl(componentname,
+                                               _componentusername,
                                                _constraint,
                                                _componenttype,
                                                _componentmultistudy,
@@ -502,6 +510,9 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
              // get component icone
              _icone = CORBA::string_dup(_general_module_list[ind].Parsercomponenticone.c_str());
 
+             // get component user name
+             _componentusername = CORBA::string_dup(_general_module_list[ind].Parsercomponentusername.c_str());
+
              // get component interfaces
              _list_interfaces = duplicate_interfaces(_general_module_list[ind].ParserListInterface);
 
@@ -514,6 +525,7 @@ SALOME_ModuleCatalogImpl::GetComponent(const char* componentname)
        {
          SALOME_ModuleCatalog_AcomponentImpl* aComponentImpl = 
            new SALOME_ModuleCatalog_AcomponentImpl(componentname,
+                                                   _componentusername,
                                                    _constraint,
                                                    _componenttype,
                                                    _componentmultistudy,