Salome HOME
Merge Python 3 porting: additional chnages.
authorrnv <rnv@opencascade.com>
Tue, 27 Jun 2017 16:07:30 +0000 (19:07 +0300)
committerrnv <rnv@opencascade.com>
Tue, 27 Jun 2017 16:07:30 +0000 (19:07 +0300)
1  2 
bin/salome_utils.py
idl/SALOMEDS.idl
src/KERNEL_PY/salome_study.py
src/SALOMEDS/SALOMEDS_Client.cxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_Study.hxx
src/SALOMEDS/SALOMEDS_Study_i.cxx
src/SALOMEDS/SALOMEDS_Study_i.hxx
src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.cxx
src/SALOMEDSImpl/SALOMEDSImpl_Study.hxx

Simple merge
index bc22b3d339437d8859e606cefd945c9eadf4b7d1,87a4f2df2113f8e2fa100d3acaef55c09fa4718f..eb14c2fa06516d9e39bbef8b5e82b59354aa745d
@@@ -41,7 -41,7 +41,7 @@@ module SALOMED
  {
  /*! \brief Name of the file in which the %Study is saved.
  */
-   typedef string URLPath;
 -  typedef wstring URL;
++  typedef wstring URLPath;
  
  /*! \brief Main identifier of an object in %SALOME application
  */
  */
    typedef string SalomeReference;
  
 -/*! \brief List of the names of studies which are currently open in this %SALOME session.
 -
 -Since %SALOME is a multi-study application, it allows to open a lot of studies
 -during each working session.
 -*/
 -  typedef sequence<URL> ListOfOpenStudies;
+ //! List of file names
+   typedef sequence<string> ListOfFileNames;
  //! List of modification dates of a study
    typedef sequence<string> ListOfDates ;
  //! An unbounded sequence of strings
  //! Exception indicating that this feature hasn't been implemented in %SALOME application.
    exception NotImplemented {};
  
 +  //==========================================================================
 +/*! \brief %Study Builder Interface
  
 -  //===========================================================================
 - /*! \brief %Study Interface
 -
 -    The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
 -   Most of the %Study operations are handled by the StudyManager and the StudyBuilder.
 -   What is left in the %Study interface are elementary inquiries.
 -   (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
 -      and set methods.) A %Study is explored by a set of tools, mainly iterators
 -    , which are described further. Nevertheless, the %Study
 -     interface allows the search of an object by name or by ID.
 -     \note
 -     <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
 -    In general it's a string of names of directories divided by a slash '/'.
 -     <BR><VAR>The Context</VAR> is the current directory of an object.</P>
 +  The purpose of the Builder is to add and/or remove objects and attributes.
 +  A %StudyBuilder is linked to a %Study. A
 +  command management is provided for the undo/redo functionalities.
 +  \note
 +  <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
 +  item's position in the tree-type structure of the browser. In general it has the following
 +  form: <TT>0:2:1:1</TT>
  */
 +  //==========================================================================
  
 -  interface Study
 +  interface StudyBuilder
    {
 +/*! \brief %LockProtection Exception
  
 -//! Invalid study reference
 -    exception StudyInvalidReference {};
 -//! Invalid study context
 -    exception StudyInvalidContext {};
 -//! Invalid study component
 -    exception StudyInvalidComponent {};
 -//! Invalid directory of the %study exception
 -    exception StudyInvalidDirectory {};
 -//! Exception pointing that this name of the study has already been used.
 -    exception StudyNameAlreadyUsed {};
 -//! study object already exists
 -    exception StudyObjectAlreadyExists {};
 -//! Invalid name of the %study exception
 -    exception StudyNameError {};
 -//! Invalid study comment
 -    exception StudyCommentError {};
 -
 -/*! \brief The name of the %Study
 -
 -   This is equivalent to the methods setName() & getName()
 +    This exception is raised while attempting to modify a locked %study.
  */
 -    attribute wstring     Name; // equivalent to setName() & getName()
 -/*! \brief The ID of the %Study
 +    exception LockProtection {};
 +/*! \brief Creation of a new %SComponent.
  
 -   This is equivalent to the methods setID() & getID()
 -*/
 -    attribute short      StudyId;
 -//! Sequence containing %SObjects
 -    typedef sequence<SObject> ListOfSObject;
 -//!  Get the persistent reference to the %Study.
 -    PersistentReference  GetPersistentReference() raises(StudyInvalidReference);
 -//! Get a transient reference to the %Study.
 -    SalomeReference      GetTransientReference() raises(StudyInvalidReference);
 +   Creates a new %SComponent
 +   \param ComponentDataType    Data type of the %SComponent which will be created.
  
 -/*! \brief indicate whether the %Study is empty
 +<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    \return True if the %Study is empty
  */
 -    boolean IsEmpty() raises(StudyInvalidReference);
 -/*! \brief  Find a %SComponent by its name.
 -
 -   \param aComponentName    It's a string value in the Comment Attribute of the Component,
 -    which is looked for, defining the data type of this Component.
 +    SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
 -<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
 +/*! \brief Definition of the instance to the %SComponent
  
 +    Defines the instance to the %SComponent.
  */
 -    SComponent FindComponent  (in string aComponentName) raises(StudyInvalidReference);
 +    void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
  
 -/*! \brief  Find a %SComponent by ID of the according %SObject
 +/*! \brief Deletion of a %SComponent
 +
 +  Removes a %SComponent.
  */
 -    SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
 -/*! \brief  Find a %SObject by the Name Attribute of this %SObject
 +    void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
  
 -    \param anObjectName String parameter defining the name of the object
 -    \return The obtained %SObject
 +/*! \brief Creation of a new %SObject
  
 -<em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
 -*/
 -    SObject       FindObject      (in string anObjectName) raises(StudyInvalidReference);
 -/*! \brief  Find a %SObject by its ID
 +   Creates a new %SObject under a definite father %SObject.
  
 -    \param aObjectID This parameter defines the ID of the required object
 -    \return The obtained %SObject
 -*/
 -    SObject       FindObjectID    (in ID aObjectID) raises(StudyInvalidReference);
 -/*! \brief Create a %SObject by its ID
 +   \param theFatherObject The father %SObject under which this one should be created.
 +   \return New %SObject
  
 -    \param aObjectID This parameter defines the ID of the required object
 -    \return The created %SObject
 -*/
 -    SObject       CreateObjectID    (in ID aObjectID) raises(StudyInvalidReference);
 -/*!  \brief Find a %SObject by IOR of the object belonging to this %SObject.
 +<em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    \param anObjectName This parameter defines the IOR of the object
 -    \return The obtained %SObject
  */
 -    SObject       FindObjectIOR   (in ID aObjectIOR) raises(StudyInvalidReference);
 -/*! \brief  Find in the study all %SObjects produced by a given %Component.
  
 -    \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
 -    \param aComponentName The name of the component, which objects are searched for.
 -*/
 -    ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
 -/*! \brief  Find a %SObject by the path to it.
 +    SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
  
 -    \param thePath The path to the required %SObject.
 -    \return The obtained %SObject.
 -*/
 -    SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
 -/*! \brief Get the path to the %SObject.
 -*/
 -    string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
 +/*! \brief Creation of a new %SObject with a definite %tag
  
 -/*! \brief  Set the context of the %Study.
 +   Creates a new %SObject with a definite %tag.
  
 -    \param thePath String parameter defining the context of the study.
 +   \param atag Long value corresponding to the tag of the new %SObject.
 +   \return New %SObject
  
 -<em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -    void SetContext(in string thePath) raises (StudyInvalidReference, StudyInvalidContext);
 -/*!  \brief Get the context of the %Study.
 +    SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
 +/*! \brief Deletion of the %SObject
  
 -<em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
 -*/
 -    string GetContext() raises (StudyInvalidReference, StudyInvalidContext);
 -/*!  \brief Get a list of names of objects corresponding to the context.
 +  Removes a %SObject from the %StudyBuilder.
  
 -   \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
 +  \param anObject The %SObject to be deleted.
  */
 -    ListOfStrings GetObjectNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
 -/*! \brief Get a list of names of directories and subdirectories corresponding to the context.
 +    void    RemoveObject   (in SObject anObject) raises(LockProtection);
 +/*! \brief Deletion of the %SObject with all his child objects.
  
 -   \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
 -*/
 -    ListOfStrings GetDirectoryNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
 -/*! \brief  Get a list of names of Files corresponding to the context.
 +  Removes the %SObject with all his child objects.
  
 -    \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
 +  \param anObject The %SObject to be deleted with all child objects.
  */
 -    ListOfStrings GetFileNames(in string theContext) raises (StudyInvalidReference, StudyInvalidContext);
 -/*! \brief Get a list of names of Components corresponding to the context.
 +    void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
  
 -   \note  If the parameter <VAR>theContext</VAR> is empty, then the current context will be used.
 -*/
 -    ListOfStrings GetComponentNames(in string theContext) raises(StudyInvalidReference);
 -/*!  \brief Create a new iterator of child levels of the given %SObject.
 +/*!
 +   Loads a %SComponent.
  
 -    \param aSO The given %SObject
 -    \return A new iterator of child levels of the given %SObject.
 -*/
 -    ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
 +<em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -/*!  \brief Create a new iterator of the %SComponents.
 +*/
 +    void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
 +/*!
 +   Loads a %SObject.
  
 -    \return A new iterator of the %SComponents.
 +   \param sco %SObject to be loaded.
  */
 -    SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
 +    void  Load (in SObject sco);
  
 -/*! \brief  Create a new %StudyBuilder to add or modify an object in the study.
 +/*! \brief Looking for or creating an attribute assigned to the %SObject
  
 -   \return A new %StudyBuilder.
 +    Allows to find or create an attribute of a specific type which is assigned to the object.
 +    \param anObject        The %SObject corresponding to the attribute which is looked for.
 +    \param aTypeOfAttribute     Type of the attribute.
  
 -<em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
 +<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -    StudyBuilder NewBuilder() raises(StudyInvalidReference);
 -/*! \brief Labels dependency
  
 -    Updates the map with IOR attribute. It's an inner method used for optimization.
 -*/
 -    void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
 +    GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
 +                                         in  string         aTypeOfAttribute) raises(LockProtection);
  
 -/*! \brief Getting properties of the study
 +/*! \brief Looking for an attribute assigned to a %SObject
  
 -   Returns the attribute, which contains the properties of this study.
 +    Allows to find an attribute of a specific type which is assigned to the object.
 +    \param anObject        The %SObject corresponding to the attribute which is looked for.
 +    \param aTypeOfAttribute     Type of the attribute.
 +    \param anAttribute       Where the attribute is placed if it's found.
 +    \return True if it finds an attribute.
 + */
  
 -<em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
 +    boolean FindAttribute(in  SObject        anObject,
 +                                 out GenericAttribute anAttribute,
 +                                 in  string         aTypeOfAttribute);
 +/*! \brief Deleting the attribute assigned to the %SObject
  
 -*/
 -    AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
 -/*! \brief  Indicate whether the %study has been saved
 -*/
 -    attribute boolean IsSaved;
 -/*! \brief  Indicate whether the %study has been modified and not saved.
 +    Removes the attribute of a specific type which is assigned to the object.
 +    \param anObject        The %SObject corresponding to the attribute.
 +    \param aTypeOfAttribute     Type of the attribute.
  
 -  Returns True if the %study has been modified and not saved.
 +<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -    boolean IsModified() raises(StudyInvalidReference);
 -
 -/*! \brief  Mark the %study as being modified and not saved.
 +    void RemoveAttribute(in  SObject        anObject,
 +                         in  string         aTypeOfAttribute) raises(LockProtection);
 +/*!
 +    Adds a reference between %anObject and %theReferencedObject.
 +    \param anObject The %SObject which will get a reference
 +    \param theReferencedObject The %SObject having a reference
  */
 -    void Modified() raises(StudyInvalidReference);
  
 -/*! \brief  Indicate the file where the %study has been saved
 +    void Addreference(in SObject anObject,
 +                      in SObject theReferencedObject) ;
 +
 +/*!
 +    Removes a reference from %anObject to another object.
 +    \param anObject The %SObject which contains a reference
  */
 -    attribute wstring URL;
  
 -/*! \brief List of %SObjects
 +    void RemoveReference(in SObject anObject) ;
  
 -    Returns the list of %SObjects which refers to %anObject.
 -*/
 -    ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
 +/*! \brief Identification of the %SObject's substructure.
  
 -/*! \brief The date of the last saving of the study
 +      Identification of the %SObject's substructure by GUID.
  
 -    Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
 -*/
 -    string GetLastModificationDate() raises(StudyInvalidReference);
 -/*! \brief The list of modification dates of the study
  
 -    Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
 -      Note : the first modification begins the list.
 +      \param anObject The %SObject which will be identified
 +      \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
  */
-      void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
 -    ListOfDates GetModificationsDate() raises(StudyInvalidReference);
 -/*! \brief Object conversion.
++    void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
 +/*!
 +Searches for a definite %SObject with a definite GUID and returns True if it finds it.
  
 -    Converts an object into IOR.
 -    \return    IOR
 +\param anObject A definite %SObject which will be identified
 +\param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
  */
 -    string ConvertObjectToIOR(in Object theObject);
 -/*! \brief Object conversion.
 +     boolean IsGUID(in SObject anObject, in string theGUID);
  
 -    Converts IOR into an object.
 -    \return    An object
 -*/
 -    Object ConvertIORToObject(in string theIOR);
 +/*! \brief Creation of a new command
  
 -/*!  \brief Get a new %UseCaseBuilder.
 -*/
 -    UseCaseBuilder  GetUseCaseBuilder() raises(StudyInvalidReference);
 +   Creates a new command which can contain several different actions.
  
 -/*! \brief  Close the components in the study, remove itself from the %StudyManager.
 -*/
 -    void Close() raises(StudyInvalidReference);
 +<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -/*! \brief  Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
  */
 -    void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
 +    void NewCommand(); // command management
 +/*! \brief Execution of the command
  
 -/*!
 -    Functions for internal usage only
 -*/
 -    void AddPostponed(in string theIOR) raises(StudyInvalidReference);
 +   Commits all actions declared within this command.
  
 -    void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
 +   \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
  
 -    void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
 +<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    void UndoPostponed(in long theWay) raises(StudyInvalidReference);
 -
 -    boolean DumpStudy(in string thePath,
 -                      in string theBaseName,
 -                      in boolean isPublished,
 -                      in boolean isMultiFile) raises(StudyInvalidReference);
 -
 -/*! \brief  Get an AttributeParameter used to store common parameters for given %theSavePoint.
 -
 -    \param theID identifies a common parameters set (Example: "Interface Applicative")
 -    \param theSavePoint is number of a set of parameters as there can be several sets
 -*/
 -    AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
 -
 -/*! \brief  Get an AttributeParameter used to store parameters for given %theModuleName.
 -
 -    \param theID identifies a common parameters set (Example: "Interface Applicative")
 -    \param theModuleName is a name of the module (Example: "Geometry")
 -    \param theSavePoint is number of a set of parameters as there can be several sets
  */
 -    AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
 -
 -
 -/*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
 -
 -    \param theModuleName is a name of the module (Example: "Geometry")
 -    \param indent is a string to use for script indentation
 -*/
 -    string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
 -
 +    void CommitCommand() raises(LockProtection); // command management
  /*!
 -    Private method, returns an implementation of this Study.
 -   \param theHostname is a hostname of the caller
 -   \param thePID is a process ID of the caller
 -   \param isLocal is set True if the Study is launched locally with the caller
 -*/
 -    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
 -
 -
 -/*! \brief  Mark this Study as being locked by the given locker.
 -
 -    The lock status can be checked by method IsStudyLocked
 -    \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
 -*/
 -    void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
 -
 -/*! \brief Indicate if the Study is locked
 -
 -   Returns True if the Study was marked locked.
 +    Returns True if at this moment there is a command under execution.
  */
 -    boolean IsStudyLocked() raises(StudyInvalidReference);
 +    boolean HasOpenCommand();
 +/*! \brief Cancelation of the command
  
 -/*! \brief  Mark this Study as being unlocked by the given locker.
 +    Cancels all actions declared within the command.
  
 -     The lock status can be checked by method IsStudyLocked
 -    \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
 +<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -    void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
 +    void AbortCommand(); // command management
 +/*! \brief Undolimit
  
 -/*! \brief  Get the list of IDs of the Study's lockers.
 +    The number of actions which can be undone
  */
 -    ListOfStrings GetLockerID() raises(StudyInvalidReference);
 +    attribute long  UndoLimit;
 +/*! \brief Undo method
  
 -/*! \brief  Create real variable with Name theVarName and value theValue
 +    Cancels all actions of the last command.
  
 -    (or set if variable value into theValue already exists)
 -    \param theVarName is a name of the variable
 -    \param theVarName is a value of the variable.
 -*/
 -    void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
 +    \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
  
 -/*! \brief  Create integer variable with Name theVarName and value theValue
 +<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    (or set if variable value into theValue already exists)
 -    \param theVarName is a name of the variable
 -    \param theVarName is a value of the variable.
  */
 -    void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
 -/*! \brief  Create boolean variable with Name theVarName and value theValue
 +    void Undo() raises (LockProtection);
 +/*! \brief Redo method
  
 -    (or set if variable value into theValue already exists)
 -    \param theVarName is a name of the variable
 -    \param theVarName is a value of the variable.
 -*/
 -    void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
 +    Redoes all actions of the last command.
  
 -/*! \brief  Create string variable with Name theVarName and value theValue
 +\exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
  
 -    (or set if variable value into theValue already exists)
 -    \param theVarName is a name of the variable
 -    \param theVarName is a value of the variable.
 -*/
 -    void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
 +<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -/*! \brief  Set current value as double for string variable
  */
 -    void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
 +    void Redo() raises (LockProtection);
 +/*!
 +    Returns True if at this moment there are any actions which can be canceled.
  
 -/*! \brief Get value of a real variable
 +<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    \param theVarName is a name of the variable.
  */
 -    double GetReal( in string theVarName ) raises(StudyInvalidReference);
 +    boolean GetAvailableUndos();
 +/*!
 +    Returns True if at this moment there are any actions which can be redone.
  
 -/*! \brief Get value of an integer variable
 +<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -    \param theVarName is a name of the variable.
  */
 -    long GetInteger( in string theVarName ) raises(StudyInvalidReference);
 -
 -/*! \brief Get value of a boolean variable
 +    boolean GetAvailableRedos();
 +/*!
 +    Puts name attribute with the given string value to the given %SObject
  
 -    \param theVarName is a name of the variable.
 +    \param theSO Existing SObject to set name attribute.
 +    \param theValue The value to be set to the name attribute.
  */
 -    boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
 +    void SetName(in SObject theSO, in string theValue) raises (LockProtection);
  
 -/*! \brief Get value of a string variable
 +/*!
 +    Puts comment attribute with the given string value to the given %SObject
  
 -    \param theVarName is a name of the variable.
 +    \param theSO Existing SObject to set comment attribute.
 +    \param theValue The value to be set to the comment attribute.
  */
 -    string GetString( in string theVarName ) raises(StudyInvalidReference);
 -
 +    void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
  
 -/*! \brief Indicate if a variable is real
 +/*!
 +    Puts IOR attribute with the given string value to the given %SObject
  
 -    Return true if variable is real otherwise return false.
 -    \param theVarName is a name of the variable.
 +    \param theSO Existing SObject to set IOR attribute.
 +    \param theValue The value to be set to the IOR attribute.
  */
 -    boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
 +    void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
 +  };
  
 -/*! \brief Indicate if a variable is integer
 +  //===========================================================================
 + /*! \brief %Study Interface
  
 -    Return true if variable is integer otherwise return false.
 -    \param theVarName is a name of the variable.
 +    The purpose of the %Study is to manage the data produced by various components of %SALOME platform.
 +   Most of the %Study operations are handled by the StudyBuilder.
 +   What is left in the %Study interface are elementary inquiries.
 +   (Incidentally, we recall that a CORBA attribute is implemented as a pair of get
 +      and set methods.) A %Study is explored by a set of tools, mainly iterators
 +    , which are described further. Nevertheless, the %Study
 +     interface allows the search of an object by name or by ID.
 +     \note
 +     <BR><VAR>The Path </VAR>of an object in %SALOME application is much alike a standard path of a file.
 +    In general it's a string of names of directories divided by a slash '/'.
 +     <BR><VAR>The Context</VAR> is the current directory of an object.</P>
  */
 -    boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
  
 -/*! \brief Indicate if a variable is boolean
 +  interface Study
 +  {
  
 -    Return true if variable is boolean otherwise return false.
 -    \param theVarName is a name of the variable.
 +//! Invalid study reference
 +    exception StudyInvalidReference {};
 +//! Invalid study component
 +    exception StudyInvalidComponent {};
 +//! Invalid directory of the %study exception
 +    exception StudyInvalidDirectory {};
 +//! Exception pointing that this name of the study has already been used.
 +    exception StudyNameAlreadyUsed {};
 +//! study object already exists
 +    exception StudyObjectAlreadyExists {};
 +//! Invalid name of the %study exception
 +    exception StudyNameError {};
 +//! Invalid study comment
 +    exception StudyCommentError {};
 +    
 +/*!
 +    Determines whether the server has already been loaded or not.
  */
 -    boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
 -
 -/*! \brief Indicate if a variable is string
 +    void ping();
 +    void Shutdown();
 +/*!
 +    Returns the PID of the server
 +*/
 +    long getPID();
  
 -    Return true if variable is string otherwise return false.
 -    \param theVarName is a name of the variable.
 +/*!
 +    Shutdown the Study process.
  */
 -    boolean IsString( in string theVarName ) raises(StudyInvalidReference);
 +    oneway void ShutdownWithExit();
  
 -/*! \brief Indicate if a variable exists in the study
 +/*! \brief The name of the %Study
  
 -    Return true if variable exists in the study,
 -    otherwise return false.
 -    \param theVarName is a name of the variable.
 +   This is equivalent to the methods setName() & getName()
  */
-     readonly attribute string Name; // equivalent to getName()
 -    boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
++    attribute wstring Name; // equivalent to getName()
 -/*! \brief Get names of all variables from the study.
++/*! \brief  Indicate the file where the %study has been saved
+ */
 -    ListOfStrings GetVariableNames() raises(StudyInvalidReference);
  
 -/*! \brief Remove a variable
 +//! Sequence containing %SObjects
 +    typedef sequence<SObject> ListOfSObject;
 +//!  Get the persistent reference to the %Study.
 +    PersistentReference  GetPersistentReference() raises(StudyInvalidReference);
  
 -   Remove variable with the specified name from the study with substitution of its value.
 +/*! \brief indicate whether the %Study is empty
  
 -   \param theVarName Name of the variable.
 -   \return Status of operation.
 +    \return True if the %Study is empty
  */
 -    boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
 +    boolean IsEmpty() raises(StudyInvalidReference);
 +/*! \brief  Find a %SComponent by its name.
  
 -/*! \brief Rename a variable
 +   \param aComponentName    It's a string value in the Comment Attribute of the Component,
 +    which is looked for, defining the data type of this Component.
  
 -   Rename variable with the specified name within the study.
 +<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -   \param theVarName Name of the variable.
 -   \param theNewVarName New name for the variable.
 -   \return Status of operation.
  */
 -    boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
 -
 -/*! \brief Indicate whether variable is used
 -
 -   Check that variable is used in the study.
 +    SComponent FindComponent  (in string aComponentName) raises(StudyInvalidReference);
  
 -   \param theVarName Name of the variable.
 -   \return Variable usage.
 +/*! \brief  Find a %SComponent by ID of the according %SObject
  */
 -    boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
 +    SComponent FindComponentID(in ID aComponentID) raises(StudyInvalidReference);
 +/*! \brief  Find a %SObject by the Name Attribute of this %SObject
  
 -/*! \brief Parse variables used for object creation
 +    \param anObjectName String parameter defining the name of the object
 +    \return The obtained %SObject
  
 -   \param string with variables, separated by special symbol.
 -   \return Variables list.
 +<em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -    ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
 -
 -/*!
 -     Attach an observer to the Study
 +    SObject       FindObject      (in string anObjectName) raises(StudyInvalidReference);
 +/*! \brief  Find a %SObject by its ID
  
 -    \param theObserver observer being attached
 -    \param modify when \c true, observer receives any object's modification events;
 -           otherwise observer receives object's creation events only
 +    \param aObjectID This parameter defines the ID of the required object
 +    \return The obtained %SObject
  */
 -     void attach(in SALOMEDS::Observer theObserver, in boolean modify);
 -/*!
 -     Detach an observer from the Study
 +    SObject       FindObjectID    (in ID aObjectID) raises(StudyInvalidReference);
 +/*! \brief Create a %SObject by its ID
  
 -    \param theObserver observer to be detached
 +    \param aObjectID This parameter defines the ID of the required object
 +    \return The created %SObject
  */
 -     void detach(in SALOMEDS::Observer theObserver);
 -  };
 -
 -  //==========================================================================
 -/*! \brief %Study Builder Interface
 +    SObject       CreateObjectID    (in ID aObjectID) raises(StudyInvalidReference);
 +/*!  \brief Find a %SObject by IOR of the object belonging to this %SObject.
  
 -  The purpose of the Builder is to add and/or remove objects and attributes.
 -  A %StudyBuilder is linked to a %Study. A
 -  command management is provided for the undo/redo functionalities.
 -  \note
 -  <BR><VAR>The Tag</VAR> of an item in %SALOME application is a symbolic description of
 -  item's position in the tree-type structure of the browser. In general it has the following
 -  form: <TT>0:2:1:1</TT>
 +    \param anObjectName This parameter defines the IOR of the object
 +    \return The obtained %SObject
  */
 -  //==========================================================================
 -
 -  interface StudyBuilder
 -  {
 -/*! \brief %LockProtection Exception
 +    SObject       FindObjectIOR   (in ID aObjectIOR) raises(StudyInvalidReference);
 +/*! \brief  Find in the study all %SObjects produced by a given %Component.
  
 -    This exception is raised while attempting to modify a locked %study.
 +    \param anObjectName The Name Attribute of the searched %SObjects should correspond to <VAR>anObjectName</VAR>.
 +    \param aComponentName The name of the component, which objects are searched for.
  */
 -    exception LockProtection {};
 -/*! \brief Creation of a new %SComponent.
 -
 -   Creates a new %SComponent
 -   \param ComponentDataType    Data type of the %SComponent which will be created.
 -
 -<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
 +    ListOfSObject FindObjectByName(in string anObjectName, in string aComponentName) raises(StudyInvalidReference);
 +/*! \brief  Find a %SObject by the path to it.
  
 +    \param thePath The path to the required %SObject.
 +    \return The obtained %SObject.
  */
 -    SComponent NewComponent(in string ComponentDataType) raises(LockProtection);
 -/*! \brief Definition of the instance to the %SComponent
 -
 -    Defines the instance to the %SComponent.
 +    SObject FindObjectByPath(in string thePath) raises(StudyInvalidReference);
 +/*! \brief Get the path to the %SObject.
  */
 -    void       DefineComponentInstance (in SComponent aComponent,in Object ComponentIOR) raises(LockProtection);
 +    string GetObjectPath(in Object theObject) raises(StudyInvalidReference);
  
 -/*! \brief Deletion of a %SComponent
 +/*!  \brief Create a new iterator of child levels of the given %SObject.
  
 -  Removes a %SComponent.
 +    \param aSO The given %SObject
 +    \return A new iterator of child levels of the given %SObject.
  */
 -    void       RemoveComponent(in SComponent aComponent) raises(LockProtection);
 +    ChildIterator NewChildIterator(in SObject aSO) raises(StudyInvalidReference);
  
 -/*! \brief Creation of a new %SObject
 +/*!  \brief Create a new iterator of the %SComponents.
  
 -   Creates a new %SObject under a definite father %SObject.
 +    \return A new iterator of the %SComponents.
 +*/
 +    SComponentIterator NewComponentIterator() raises(StudyInvalidReference);
  
 -   \param theFatherObject The father %SObject under which this one should be created.
 -   \return New %SObject
 +/*! \brief  Create a new %StudyBuilder to add or modify an object in the study.
  
 -<em>See \ref example18 for an example of this method usage in batchmode of %SALOME application.</em>
 +   \return A new %StudyBuilder.
  
 +<em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 +    StudyBuilder NewBuilder() raises(StudyInvalidReference);
 +/*! \brief Labels dependency
  
 -    SObject NewObject      (in SObject theFatherObject) raises(LockProtection);
 +    Updates the map with IOR attribute. It's an inner method used for optimization.
 +*/
 +    void UpdateIORLabelMap(in string anIOR, in string anEntry) raises(StudyInvalidReference);
  
 -/*! \brief Creation of a new %SObject with a definite %tag
 +/*! \brief Getting properties of the study
  
 -   Creates a new %SObject with a definite %tag.
 +   Returns the attribute, which contains the properties of this study.
  
 -   \param atag Long value corresponding to the tag of the new %SObject.
 -   \return New %SObject
 +<em>See \ref example20 for an example of this method usage in batchmode of %SALOME application.</em>
  
  */
 -    SObject NewObjectToTag (in SObject theFatherObject, in long atag) raises(LockProtection);
 -/*! \brief Deletion of the %SObject
 -
 -  Removes a %SObject from the %StudyBuilder.
 -
 -  \param anObject The %SObject to be deleted.
 +    AttributeStudyProperties GetProperties() raises(StudyInvalidReference);
 +/*! \brief  Indicate whether the %study has been saved
  */
 -    void    RemoveObject   (in SObject anObject) raises(LockProtection);
 -/*! \brief Deletion of the %SObject with all his child objects.
 -
 -  Removes the %SObject with all his child objects.
 +    attribute boolean IsSaved;
 +/*! \brief  Indicate whether the %study has been modified and not saved.
  
 -  \param anObject The %SObject to be deleted with all child objects.
 +  Returns True if the %study has been modified and not saved.
  */
 -    void    RemoveObjectWithChildren(in SObject anObject) raises(LockProtection);
 -
 -/*!
 -   Loads a %SComponent.
 -
 -<em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
 +    boolean IsModified() raises(StudyInvalidReference);
  
 +/*! \brief  Mark the %study as being modified and not saved.
  */
 -    void  LoadWith (in SComponent sco, in Driver Engine) raises (SALOME::SALOME_Exception);
 -/*!
 -   Loads a %SObject.
 +    void Modified() raises(StudyInvalidReference);
  
 -   \param sco %SObject to be loaded.
 +/*! \brief  Indicate the file where the %study has been saved
  */
-     attribute string URL;
 -    void  Load (in SObject sco);
 -
 -/*! \brief Looking for or creating an attribute assigned to the %SObject
++    attribute wstring URL;
  
 -    Allows to find or create an attribute of a specific type which is assigned to the object.
 -    \param anObject        The %SObject corresponding to the attribute which is looked for.
 -    \param aTypeOfAttribute     Type of the attribute.
 +/*! \brief List of %SObjects
  
 -<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
 +    Returns the list of %SObjects which refers to %anObject.
  */
 +    ListOfSObject FindDependances(in SObject anObject) raises(StudyInvalidReference);
  
 -    GenericAttribute FindOrCreateAttribute(in  SObject        anObject,
 -                                         in  string         aTypeOfAttribute) raises(LockProtection);
 +/*! \brief The date of the last saving of the study
  
 -/*! \brief Looking for an attribute assigned to a %SObject
 +    Returns the date of the last saving of study with format: "DD/MM/YYYY HH:MM"
 +*/
 +    string GetLastModificationDate() raises(StudyInvalidReference);
 +/*! \brief The list of modification dates of the study
  
 -    Allows to find an attribute of a specific type which is assigned to the object.
 -    \param anObject        The %SObject corresponding to the attribute which is looked for.
 -    \param aTypeOfAttribute     Type of the attribute.
 -    \param anAttribute       Where the attribute is placed if it's found.
 -    \return True if it finds an attribute.
 - */
 +    Returns the list of modification dates (without creation date) with format "DD/MM/YYYY HH:MM".
 +      Note : the first modification begins the list.
 +*/
 +    ListOfDates GetModificationsDate() raises(StudyInvalidReference);
 +/*! \brief Object conversion.
  
 -    boolean FindAttribute(in  SObject        anObject,
 -                                 out GenericAttribute anAttribute,
 -                                 in  string         aTypeOfAttribute);
 -/*! \brief Deleting the attribute assigned to the %SObject
 +    Converts an object into IOR.
 +    \return    IOR
 +*/
 +    string ConvertObjectToIOR(in Object theObject);
 +/*! \brief Object conversion.
  
 -    Removes the attribute of a specific type which is assigned to the object.
 -    \param anObject        The %SObject corresponding to the attribute.
 -    \param aTypeOfAttribute     Type of the attribute.
 +    Converts IOR into an object.
 +    \return    An object
 +*/
 +    Object ConvertIORToObject(in string theIOR);
  
 -<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
 +/*! \brief Get a new %UseCaseBuilder.
  */
 -    void RemoveAttribute(in  SObject        anObject,
 -                         in  string         aTypeOfAttribute) raises(LockProtection);
 -/*!
 -    Adds a reference between %anObject and %theReferencedObject.
 -    \param anObject The %SObject which will get a reference
 -    \param theReferencedObject The %SObject having a reference
 +    UseCaseBuilder  GetUseCaseBuilder() raises(StudyInvalidReference);
 +    
 +/*! \brief Clear a study object
  */
 +    void Clear() raises(StudyInvalidReference);
  
 -    void Addreference(in SObject anObject,
 -                      in SObject theReferencedObject) ;
 -
 -/*!
 -    Removes a reference from %anObject to another object.
 -    \param anObject The %SObject which contains a reference
 +/*! \brief Initialization a study object
  */
 +    void Init() raises(StudyInvalidReference);
 +    
 +/*! \brief Open a study by url
  
 -    void RemoveReference(in SObject anObject) ;
 -
 -/*!
 -   Adds a directory in the %Study.
 -   \param theName String parameter defining the name of the directory.
 -
 -<em>See \ref example23 for an example of this method usage in batchmode of %SALOME application.</em>
 -
 +    Reads and activates the structure of the study %Objects.
 +    \param aStudyUrl The path to the study
  */
 -    void AddDirectory(in string theName) raises(LockProtection);
 -
 -/*! \brief Identification of the %SObject's substructure.
 +    boolean Open (in URLPath aStudyUrl) raises (SALOME::SALOME_Exception);
 +    
 +/*! \brief Saving the study in a file (or files).
  
 -      Identification of the %SObject's substructure by GUID.
 +    Saves a study.
 +    \param theMultiFile If this parameter is True the study will be saved in several files.
 +    \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
 +*/
 +    boolean Save(in boolean theMultiFile, in boolean theASCII) raises(StudyInvalidReference);
 +    
 +/*! \brief Saving the study in a specified file (or files).
  
 +    Saves the study in a specified file (or files).
 +    \param aUrl The path to the definite file in whcih the study will be saved
 +    \param theMultiFile If this parameter is True the study will be saved in several files.
 +    \param theASCII If this parameter is True the study will be saved in ASCII format, otherwise in HDF format.
  
 -      \param anObject The %SObject which will be identified
 -      \param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
 +<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
  */
 -
 -     void SetGUID(in SObject anObject, in string theGUID) raises(LockProtection);
 +    boolean  SaveAs(in URLPath aUrl, // if the file already exists
 +                    in boolean theMultiFile, // overwrite (as option)
 +                    in boolean theASCII) 
 +                    raises(StudyInvalidReference); 
  /*!
 -Searches for a definite %SObject with a definite GUID and returns True if it finds it.
 -
 -\param anObject A definite %SObject which will be identified
 -\param theGUID GUID has the following format "00000000-0000-0000-0000-000000000000"
 +    Returns True, if the given %SObject can be copied to the clipboard.
  */
 -     boolean IsGUID(in SObject anObject, in string theGUID);
 -
 -/*! \brief Creation of a new command
 -
 -   Creates a new command which can contain several different actions.
 -
 -<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
 -
 +    boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
 +/*!
 +    Returns True, if the given %SObject is copied to the clipboard.
 +    \param theObject The %SObject which will be copied
  */
 -    void NewCommand(); // command management
 -/*! \brief Execution of the command
 -
 -   Commits all actions declared within this command.
 -
 -   \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
 -
 -<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
 -
 +    boolean Copy(in SObject theObject) raises(StudyInvalidReference);
 +/*!
 +    Returns True, if the object from the clipboard can be pasted to the given %SObject.
 +    \param theObject The %SObject stored in the clipboard.
  */
 -    void CommitCommand() raises(LockProtection); // command management
 +    boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
  /*!
 -    Returns True if at this moment there is a command under execution.
 +    Returns the %SObject in which the object from the clipboard was pasted to.
 +    \param theObject The %SObject which will be pasted
 +    \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
 +    an object into a study, which is protected for modifications.
  */
 -    boolean HasOpenCommand();
 -/*! \brief Cancelation of the command
 -
 -    Cancels all actions declared within the command.
 +    SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
  
 -<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
 +/*! \brief  Enable (if isEnabled = True)/disable automatic addition of new %SObjects to the use case.
  */
 -    void AbortCommand(); // command management
 -/*! \brief Undolimit
 +    void EnableUseCaseAutoFilling(in boolean isEnabled) raises(StudyInvalidReference);
  
 -    The number of actions which can be undone
 +/*!
 +    Functions for internal usage only
  */
 -    attribute long  UndoLimit;
 -/*! \brief Undo method
 +    void AddPostponed(in string theIOR) raises(StudyInvalidReference);
  
 -    Cancels all actions of the last command.
 +    void AddCreatedPostponed(in string theIOR) raises(StudyInvalidReference);
  
 -    \exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
 +    void RemovePostponed(in long theUndoLimit) raises(StudyInvalidReference);
  
 -<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
 +    void UndoPostponed(in long theWay) raises(StudyInvalidReference);
  
 -*/
 -    void Undo() raises (LockProtection);
 -/*! \brief Redo method
 +    boolean DumpStudy(in string thePath,
 +                      in string theBaseName,
 +                      in boolean isPublished,
 +                      in boolean isMultiFile) raises(StudyInvalidReference);
  
 -    Redoes all actions of the last command.
 +/*! \brief  Get an AttributeParameter used to store common parameters for given %theSavePoint.
  
 -\exception LockProtection This exception is raised, when trying to perform this command a study, which is protected for modifications.
 +    \param theID identifies a common parameters set (Example: "Interface Applicative")
 +    \param theSavePoint is number of a set of parameters as there can be several sets
 +*/
 +    AttributeParameter GetCommonParameters(in string theID, in long theSavePoint) raises(StudyInvalidReference);
  
 -<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
 +/*! \brief  Get an AttributeParameter used to store parameters for given %theModuleName.
  
 +    \param theID identifies a common parameters set (Example: "Interface Applicative")
 +    \param theModuleName is a name of the module (Example: "Geometry")
 +    \param theSavePoint is number of a set of parameters as there can be several sets
  */
 -    void Redo() raises (LockProtection);
 -/*!
 -    Returns True if at this moment there are any actions which can be canceled.
 +    AttributeParameter GetModuleParameters(in string theID, in string theModuleName, in long theSavePoint) raises(StudyInvalidReference);
  
 -<em>See \ref example16 for an example of this method usage in batchmode of %SALOME application.</em>
  
 +/*! \brief Get a default Python script to restore visual parameters for given %theModuleName.
 +
 +    \param theModuleName is a name of the module (Example: "Geometry")
 +    \param indent is a string to use for script indentation
  */
 -    boolean GetAvailableUndos();
 +    string GetDefaultScript(in string theModuleName, in string indent) raises(StudyInvalidReference);
 +
  /*!
 -    Returns True if at this moment there are any actions which can be redone.
 +    Private method, returns an implementation of this Study.
 +   \param theHostname is a hostname of the caller
 +   \param thePID is a process ID of the caller
 +   \param isLocal is set True if the Study is launched locally with the caller
 +*/
 +    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
  
 -<em>See \ref example3 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -*/
 -    boolean GetAvailableRedos();
 -/*!
 -    Puts name attribute with the given string value to the given %SObject
 +/*! \brief  Mark this Study as being locked by the given locker.
  
 -    \param theSO Existing SObject to set name attribute.
 -    \param theValue The value to be set to the name attribute.
 +    The lock status can be checked by method IsStudyLocked
 +    \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that locks the study.
  */
 -    void SetName(in SObject theSO, in string theValue) raises (LockProtection);
 +    void SetStudyLock(in string theLockerID) raises(StudyInvalidReference);
  
 -/*!
 -    Puts comment attribute with the given string value to the given %SObject
 +/*! \brief Indicate if the Study is locked
  
 -    \param theSO Existing SObject to set comment attribute.
 -    \param theValue The value to be set to the comment attribute.
 +   Returns True if the Study was marked locked.
  */
 -    void SetComment(in SObject theSO, in string theValue) raises (LockProtection);
 +    boolean IsStudyLocked() raises(StudyInvalidReference);
  
 -/*!
 -    Puts IOR attribute with the given string value to the given %SObject
 +/*! \brief  Mark this Study as being unlocked by the given locker.
  
 -    \param theSO Existing SObject to set IOR attribute.
 -    \param theValue The value to be set to the IOR attribute.
 +     The lock status can be checked by method IsStudyLocked
 +    \param theLockerID identifies a locker of the study can be for ex. IOR of the engine that unlocks the study.
  */
 -    void SetIOR(in SObject theSO, in string theValue) raises (LockProtection);
 -  };
 -
 -  //==========================================================================
 -/*! \brief %Study Manager interface
 +    void UnLockStudy(in string theLockerID) raises(StudyInvalidReference);
  
 -    The purpose of the Manager is to manipulate the %Studies. You will find in this
 -    interface the methods to create, open,
 -    close, and save a %Study. Since a %SALOME session is multi-document, you will
 -    also find the methods allowing to navigate
 -    through the collection of studies present in a session.
 +/*! \brief  Get the list of IDs of the Study's lockers.
  */
 -  //==========================================================================
 +    ListOfStrings GetLockerID() raises(StudyInvalidReference);
  
 -  interface StudyManager
 -  {
 -/*!
 -    Determines whether the server has already been loaded or not.
 +/*! \brief  Create real variable with Name theVarName and value theValue
 +
 +    (or set if variable value into theValue already exists)
 +    \param theVarName is a name of the variable
 +    \param theVarName is a value of the variable.
  */
 -    void ping();
 +    void SetReal( in string theVarName, in double theValue ) raises(StudyInvalidReference);
  
 -    void Shutdown();
 +/*! \brief  Create integer variable with Name theVarName and value theValue
  
 -/*!
 -    Returns the PID of the server
 +    (or set if variable value into theValue already exists)
 +    \param theVarName is a name of the variable
 +    \param theVarName is a value of the variable.
  */
 -    long getPID();
 +    void SetInteger( in string theVarName, in long theValue ) raises(StudyInvalidReference);
 +/*! \brief  Create boolean variable with Name theVarName and value theValue
  
 -/*!
 -    Shutdown the StudyManager process.
 +    (or set if variable value into theValue already exists)
 +    \param theVarName is a name of the variable
 +    \param theVarName is a value of the variable.
  */
 -    oneway void ShutdownWithExit();
 +    void SetBoolean( in string theVarName, in boolean theValue ) raises(StudyInvalidReference);
  
 -/*! \brief Creation of a new study
 +/*! \brief  Create string variable with Name theVarName and value theValue
  
 -     Creates a new study with a definite name.
 +    (or set if variable value into theValue already exists)
 +    \param theVarName is a name of the variable
 +    \param theVarName is a value of the variable.
 +*/
 +    void SetString( in string theVarName, in string theValue ) raises(StudyInvalidReference);
  
 -     \param study_name String parameter defining the name of the study
 +/*! \brief  Set current value as double for string variable
 +*/
 +    void SetStringAsDouble( in string theVarName, in double theValue ) raises(StudyInvalidReference);
  
 -<em>See \ref example17 for an example of this method usage in batchmode of %SALOME application.</em>
 +/*! \brief Get value of a real variable
  
 +    \param theVarName is a name of the variable.
  */
 -    Study NewStudy(in wstring study_name) raises (SALOME::SALOME_Exception);
 -
 -/*! \brief Open a study
 +    double GetReal( in string theVarName ) raises(StudyInvalidReference);
  
 -     Reads and activates the structure of the study %Objects.
 -     \param aStudyUrl The path to the study
 -    \warning This method doesn't activate the corba objects. Only a component can do it.
 +/*! \brief Get value of an integer variable
  
 -<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
 +    \param theVarName is a name of the variable.
  */
 -    Study Open (in URL aStudyUrl) raises (SALOME::SALOME_Exception);
 +    long GetInteger( in string theVarName ) raises(StudyInvalidReference);
  
 -/*! \brief Closing the study
 +/*! \brief Get value of a boolean variable
  
 -    Closes a study.
 +    \param theVarName is a name of the variable.
  */
 -    void  Close(in Study aStudy);
 -/*! \brief Saving the study in a HDF file (or files).
 +    boolean GetBoolean( in string theVarName ) raises(StudyInvalidReference);
  
 -    Saves a study.
 +/*! \brief Get value of a string variable
  
 -    \param theMultiFile If this parameter is True the study will be saved in several files.
 +    \param theVarName is a name of the variable.
 +*/
 +    string GetString( in string theVarName ) raises(StudyInvalidReference);
  
 -<em>See \ref example19 for an example of this method usage in batchmode of %SALOME application.</em>
  
 -*/
 -    boolean  Save(in  Study aStudy, in boolean theMultiFile);
 -/*! \brief Saving a study in a ASCII file (or files).
 +/*! \brief Indicate if a variable is real
  
 -    Saves a study in an ASCII format file (or files).
 -    \param theMultiFile If this parameter is True the study will be saved in several files.
 +    Return true if variable is real otherwise return false.
 +    \param theVarName is a name of the variable.
  */
 -    boolean  SaveASCII(in  Study aStudy, in boolean theMultiFile);
 -/*! \brief Saving the study in a specified HDF file (or files).
 +    boolean IsReal( in string theVarName ) raises(StudyInvalidReference);
  
 -    Saves the study in a specified file (or files).
 -    \param aUrl The path to the definite file in whcih the study will be saved
 -    \param aStudy The study which will be saved
 -    \param theMultiFile If this parameter is True the study will be saved in several files.
 +/*! \brief Indicate if a variable is integer
  
 -<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
 +    Return true if variable is integer otherwise return false.
 +    \param theVarName is a name of the variable.
  */
 -    boolean  SaveAs(in URL   aUrl, // if the file already exists
 -                in Study aStudy,
 -                in boolean theMultiFile); // overwrite (as option)
 -/*! \brief Saving the study in a specified ASCII file (or files).
 +    boolean IsInteger( in string theVarName ) raises(StudyInvalidReference);
  
 -    Saves the study in a specified ASCII file (or files).
 +/*! \brief Indicate if a variable is boolean
  
 -    \param aUrl The path to the definite file in whcih the study will be saved
 -    \param aStudy The study which will be saved
 -    \param theMultiFile If this parameter is True the study will be saved in several files.
 +    Return true if variable is boolean otherwise return false.
 +    \param theVarName is a name of the variable.
  */
 -    boolean  SaveAsASCII(in URL   aUrl, // if the file already exists
 -                      in Study aStudy,
 -                      in boolean theMultiFile); // overwrite (as option)
 +    boolean IsBoolean( in string theVarName ) raises(StudyInvalidReference);
  
 +/*! \brief Indicate if a variable is string
  
 -/*! \brief List of open studies.
 +    Return true if variable is string otherwise return false.
 +    \param theVarName is a name of the variable.
 +*/
 +    boolean IsString( in string theVarName ) raises(StudyInvalidReference);
  
 -Gets the list of open studies
 +/*! \brief Indicate if a variable exists in the study
  
 -    \return A list of open studies in the current session.
 +    Return true if variable exists in the study,
 +    otherwise return false.
 +    \param theVarName is a name of the variable.
  */
 -    ListOfOpenStudies GetOpenStudies();
 -
 -/*! \brief Getting a particular %Study picked by name
 +    boolean IsVariable( in string theVarName ) raises(StudyInvalidReference);
  
 -    Activates a particular %Study
 -    among the session collection picking it by name.
 -    \param aStudyName The name of the study
 +/*! \brief Get names of all variables from the study.
  */
 -    Study GetStudyByName  (in URL aStudyName);
 +    ListOfStrings GetVariableNames() raises(StudyInvalidReference);
  
 -/*! \brief Getting a particular %Study picked by ID
 +/*! \brief Remove a variable
 +
 +   Remove variable with the specified name from the study with substitution of its value.
  
 -    Activates a particular %Study
 -    among the session collection picking it by ID.
 -    \param aStudyID The ID of the study
 +   \param theVarName Name of the variable.
 +   \return Status of operation.
  */
 -    Study GetStudyByID  (in short aStudyID);
 +    boolean RemoveVariable( in string theVarName ) raises(StudyInvalidReference);
  
 -    // copy/paste methods
 +/*! \brief Rename a variable
  
 -/*!
 -    Returns True, if the given %SObject can be copied to the clipboard.
 -*/
 -    boolean CanCopy(in SObject theObject);
 -/*!
 -    Returns True, if the given %SObject is copied to the clipboard.
 -    \param theObject The %SObject which will be copied
 -*/
 -    boolean Copy(in SObject theObject);
 -/*!
 -    Returns True, if the object from the clipboard can be pasted to the given %SObject.
 -    \param theObject The %SObject stored in the clipboard.
 -*/
 -    boolean CanPaste(in SObject theObject);
 -/*!
 -    Returns the %SObject in which the object from the clipboard was pasted to.
 -    \param theObject The %SObject which will be pasted
 -    \exception SALOMEDS::StudyBuilder::LockProtection This exception is raised, when trying to paste
 -    an object into a study, which is protected for modifications.
 +   Rename variable with the specified name within the study.
 +
 +   \param theVarName Name of the variable.
 +   \param theNewVarName New name for the variable.
 +   \return Status of operation.
  */
 -    SObject Paste(in SObject theObject) raises (SALOMEDS::StudyBuilder::LockProtection);
 +    boolean RenameVariable( in string theVarName, in string theNewVarName ) raises(StudyInvalidReference);
  
 -/*! \brief Object conversion.
 +/*! \brief Indicate whether variable is used
  
 -    Converts an object into IOR.
 -    \return    IOR
 +   Check that variable is used in the study.
 +
 +   \param theVarName Name of the variable.
 +   \return Variable usage.
  */
 -    string ConvertObjectToIOR(in Object theObject);
 -/*! \brief Object conversion.
 +    boolean IsVariableUsed( in string theVarName ) raises(StudyInvalidReference);
  
 -    Converts IOR into an object.
 -    \return    An object
 +/*! \brief Parse variables used for object creation
 +
 +   \param string with variables, separated by special symbol.
 +   \return Variables list.
  */
 -    Object ConvertIORToObject(in string theIOR);
 +    ListOfListOfStrings ParseVariables( in string theVars ) raises(StudyInvalidReference);
  
  /*!
 -    Private method, returns an implementation of this StudyManager.
 -   \param theHostname is a hostname of the caller
 -   \param thePID is a process ID of the caller
 -   \param isLocal is set True if the StudyManager is launched locally with the caller
 +     Attach an observer to the Study
 +
 +    \param theObserver observer being attached
 +    \param modify when \c true, observer receives any object's modification events;
 +           otherwise observer receives object's creation events only
  */
 -    long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal);
 +     void attach(in SALOMEDS::Observer theObserver, in boolean modify);
 +/*!
 +     Detach an observer from the Study
  
 +    \param theObserver observer to be detached
 +*/
 +     void detach(in SALOMEDS::Observer theObserver);
    };
  
 -
    //==========================================================================
  /*! \brief %SObject interface
  
index be6d72f2932813be3890a65822f28c816087d088,4f62a413910f634cc1db0905824d00ed3267c015..5626aecdf8b13c3722364f03b1a79d6014d43d8e
@@@ -291,20 -386,37 +291,22 @@@ def salome_study_init(theStudyPath=None
      global orb, lcc, naming_service, cm
  
      if verbose(): print("theStudyPath:", theStudyPath)
 -    if not myStudyManager:
 +    if not myStudy:
          orb, lcc, naming_service, cm = salome_kernel.salome_kernel_init()
  
 -        # get Study Manager reference
 -        if verbose(): print("looking for studyManager ...")
 -        obj = naming_service.Resolve('myStudyManager')
 -        myStudyManager = obj._narrow(SALOMEDS.StudyManager)
 -        if verbose(): print("studyManager found")
 +        # get Study reference
 +        if verbose(): print("looking for study...")
 +        obj = naming_service.Resolve('/Study')
 +        myStudy = obj._narrow(SALOMEDS.Study)
 +        if verbose(): print("Study found")
          pass
  
 -    # get active study Id, ref and name
 -    myStudy = None
 -    myStudyId = getActiveStudy()
 -    if myStudyId == None :
 -        if theStudyPath and isinstance(theStudyPath, (str, bytes)):
 -            if isinstance(theStudyPath, bytes):
 -                theStudyPath = str(theStudyPath, 'UTF8')
 -            myStudyId = openStudy(theStudyPath)
 -        else:
 -            myStudyId = createNewStudy()
 -    if verbose(): print("myStudyId", myStudyId)
 -
 -    if myStudy == None:
 -        myStudy = myStudyManager.GetStudyByID(myStudyId)
 -    myStudyName = myStudy._get_Name()
 +    import types
-     if theStudyPath and type(theStudyPath) == types.StringType:
++    if theStudyPath and isinstance(theStudyPath, (str, bytes)):
++        if isinstance(theStudyPath, bytes):
++            theStudyPath = str(theStudyPath, 'UTF8')
 +        openStudy(theStudyPath)
  
 -    return myStudyManager, myStudyId, myStudy, myStudyName
 +    myStudyName = myStudy._get_Name()
  
 -def salome_study_close():
 -    global salome_study_ID
 -    global myStudyId, myStudy, myStudyName
 -    salome_study_ID = -1
 -    myStudyId, myStudy, myStudyName = None, None, None
 -    pass
 +    return myStudy, myStudyName
index 12662b5f1890af59745057ad31cfa99044d718b6,31fe34be3f31ed7c55ed1272420bdcc6fe71ecfc..db0f0e245137dd402820f221519ff99754ed7ec0
@@@ -28,8 -28,9 +28,9 @@@
  //
  #include <SALOMEconfig.h>
  #include CORBA_SERVER_HEADER(SALOMEDS)
 -#include "SALOMEDS_StudyManager_i.hxx"
  #include "SALOMEDS_AttributeName_i.hxx"
 +#include "SALOME_KernelServices.hxx"
+ #include "Basics_Utils.hxx"
  #include "utilities.h"
  #include "HDFOI.hxx"
  
@@@ -189,17 -195,39 +190,17 @@@ static void Test(
  
    StudyBuild->Undo();
    // Study should have no trace of object mesh_cylinder
 -  DumpStudy(myStudy);
 -
 - 
 -  //myStudyMgr->Open ((char*)name);
 -  //MESSAGE("Name " << name);
 -
 -  // GetOpenStudies
 -  MESSAGE("GetOpenStudies list");
 -  SALOMEDS::ListOfOpenStudies_var _list_open_studies =  myStudyMgr->GetOpenStudies();
 -
 -  for (unsigned int ind = 0; ind < _list_open_studies->length();ind++)
 -    {
 -      MESSAGE("Open studies list : " << Kernel_Utils::encode(_list_open_studies[ind]));
 -    }
 -
 -
 -  // GetStudyByName
 -  SALOMEDS::Study_var myStudy1 =myStudyMgr->GetStudyByName(_list_open_studies[0]);
 -  MESSAGE("GetStudyByName done");
 +  DumpStudy();
    
    // Save as
-   myStudy->SaveAs("/home/edeville/Study1.hdf", false, false);
 -  myStudyMgr->SaveAs(L"/home/edeville/Study1.hdf",myStudy1, false);
++  myStudy->SaveAs(Kernel_Utils::decode("/home/edeville/Study1.hdf"), false, false);
  
    // Get Persistent Reference of the study test
 -  name = myStudy1->GetPersistentReference();
 +  name = myStudy->GetPersistentReference();
    MESSAGE("Persitent Reference of the study " << name);
  
 -  // Get Transient Reference of the study test
 -  name = myStudy1->GetTransientReference();
 -  MESSAGE("Transient Reference of the study " << name);
 -
    // FindComponent Test
 -  SALOMEDS::SComponent_var compo = myStudy1->FindComponent("GEOM");
 +  SALOMEDS::SComponent_var compo = myStudy->FindComponent("GEOM");
    // Get ComponentDataType test
    MESSAGE("Find ComponentDataType of compo");
    name = compo->ComponentDataType();
index 0583c10cacbac8fc165140fbcb3cd25b51b0a0f5,9a1f7a16e3ae67e516cd38387d921e231addee82..86629e27142cfb4d9cb0a410b318bbf2327ff5ff
@@@ -98,156 -96,18 +98,157 @@@ SALOMEDS_Study::~SALOMEDS_Study(
  {
  }
  
 -std::string SALOMEDS_Study::GetPersistentReference()
 +void SALOMEDS_Study::InitORB()
  {
 -  std::string aRef;
 +  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
 +  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
 +  _orb = init(0 , 0 ) ;
 +}
 +
 +void SALOMEDS_Study::Init()
 +{
 +  if(CORBA::is_nil(_corba_impl))
 +    return;
 +
 +  _corba_impl->Init();
 +}
 +
 +void SALOMEDS_Study::Clear()
 +{
 +  if(CORBA::is_nil(_corba_impl))
 +    return;
 +
 +  _corba_impl->Clear();
 +}
 +
 +bool SALOMEDS_Study::Open(const std::string& theStudyUrl)
 +{
 +  if(CORBA::is_nil(_corba_impl))
 +    return false;
-   if (!_corba_impl->Open(theStudyUrl.c_str()))
++  std::wstring wtheStudyUrl = std::wstring(theStudyUrl.begin(), theStudyUrl.end());
++  
++  if (!_corba_impl->Open( (wchar_t*)wtheStudyUrl.c_str() ) )
 +    return false;
 +
 +  return true;
 +}
 +
 +bool SALOMEDS_Study::Save(bool theMultiFile, bool theASCII)
 +{
 +  if(CORBA::is_nil(_corba_impl))
 +    return false;
 +
 +  return _corba_impl->Save(theMultiFile, theASCII);
 +}
 +
 +bool SALOMEDS_Study::SaveAs(const std::string& theUrl, bool theMultiFile, bool theASCII)
 +{
 +  if(CORBA::is_nil(_corba_impl))
 +    return false;
 +
-   return _corba_impl->SaveAs((char*)theUrl.c_str(), theMultiFile, theASCII);
++  return _corba_impl->SaveAs(Kernel_Utils::decode_s(theUrl), theMultiFile, theASCII);
 +}
 +
 +SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb)
 +{
 +  SALOMEDS_Driver_i* driver = NULL;
 +
 +  SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
 +  if(!aSCO.IsNull()) {
 +    std::string IOREngine = aSCO.GetIOR();
 +    if(!IOREngine.empty()) {
 +      CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
 +      Engines::EngineComponent_var Engine = Engines::EngineComponent::_narrow(obj) ;
 +      driver = new SALOMEDS_Driver_i(Engine, orb);
 +    }
 +  }
 +
 +  return driver;
 +}
 +
 +bool SALOMEDS_Study::CanCopy(const _PTR(SObject)& theSO)
 +{
 +  SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
 +  bool ret;
 +
    if (_isLocal) {
      SALOMEDS::Locker lock;
 -    aRef = _local_impl->GetPersistentReference();
 +
 +    SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
 +    SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
 +    ret = _local_impl->CanCopy(aSO_impl, aDriver);
 +    delete aDriver;
    }
 -  else aRef = (CORBA::String_var)_corba_impl->GetPersistentReference();
 -  return aRef;
 +  else {
 +    ret = _corba_impl->CanCopy(aSO->GetCORBAImpl());
 +  }
 +
 +  return ret;
  }
  
 -std::string SALOMEDS_Study::GetTransientReference()
 +bool SALOMEDS_Study::Copy(const _PTR(SObject)& theSO)
 +{
 +  SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
 +  bool ret;
 +  if (_isLocal) {
 +    SALOMEDS::Locker lock;
 +
 +    SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
 +    SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
 +    ret = _local_impl->Copy(aSO_impl, aDriver);
 +    delete aDriver;
 +  }
 +  else {
 +    ret = _corba_impl->Copy(aSO->GetCORBAImpl());
 +  }
 +  return ret;
 +}
 +
 +bool SALOMEDS_Study::CanPaste(const _PTR(SObject)& theSO)
 +{
 +  SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
 +  bool ret;
 +
 +  if (_isLocal) {
 +    SALOMEDS::Locker lock;
 +
 +    SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
 +    SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
 +    ret = _local_impl->CanPaste(aSO_impl, aDriver);
 +    delete aDriver;
 +  }
 +  else {
 +    ret = _corba_impl->CanPaste(aSO->GetCORBAImpl());
 +  }
 +
 +  return ret;
 +}
 +
 +_PTR(SObject) SALOMEDS_Study::Paste(const _PTR(SObject)& theSO)
 +{
 +  SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
 +  SALOMEDSClient_SObject* aResult = NULL;
 +
 +  if (_isLocal) {
 +    SALOMEDS::Locker lock;
 +
 +    SALOMEDSImpl_SObject aSO_impl = *(aSO->GetLocalImpl());
 +    SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb);
 +    SALOMEDSImpl_SObject aNewSO = _local_impl->Paste(aSO_impl, aDriver);
 +    delete aDriver;
 +    if(aNewSO.IsNull()) return _PTR(SObject)(aResult);
 +    aResult = new SALOMEDS_SObject(aNewSO);
 +  }
 +  else {
 +    SALOMEDS::SObject_ptr aNewSO = _corba_impl->Paste(aSO->GetCORBAImpl());
 +    if(CORBA::is_nil(aNewSO)) return _PTR(SObject)(aResult);
 +    aResult = new SALOMEDS_SObject(aNewSO);
 +  }
 +
 +  return _PTR(SObject)(aResult);
 +}
 +
 +std::string SALOMEDS_Study::GetPersistentReference()
  {
    std::string aRef;
    if (_isLocal) {
@@@ -559,9 -514,29 +570,9 @@@ void SALOMEDS_Study::URL(const std::str
      SALOMEDS::Locker lock;
      _local_impl->URL(url);
    }
-   else _corba_impl->URL((char*)url.c_str());
+   else _corba_impl->URL(Kernel_Utils::decode_s(url));
  }
  
 -int SALOMEDS_Study::StudyId()
 -{
 -  int anID;
 -  if (_isLocal) {
 -    SALOMEDS::Locker lock;
 -    anID = _local_impl->StudyId();
 -  }
 -  else anID = _corba_impl->StudyId();
 -  return anID;
 -}
 - 
 -void SALOMEDS_Study::StudyId(int id) 
 -{
 -  if (_isLocal) {
 -    SALOMEDS::Locker lock;
 -    _local_impl->StudyId(id);
 -  }
 -  else _corba_impl->StudyId(id);  
 -}
 -
  std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& theSO)
  {
    std::vector<_PTR(SObject)> aVector;
Simple merge
index 1ac5ee0a3123f6eafcf71cd408c019e6745d09b1,8b23183ff50e32f4fc6ca9e1a52e81eac857c1e5..19abf1b64cd4e0a6278636dc4c9590f72c802073
@@@ -362,175 -269,29 +362,178 @@@ void SALOMEDS_Study_i::Clear(
    _impl->setNotifier(0);
    delete _notifier;
    delete _genObjRegister;
 -  //delete implementation
 -  delete _impl;
 -  _mapOfStudies.erase(_impl);
 -}  
 +  _notifier = NULL;
 +
 +  _closed = true;
 +}
  
  //============================================================================
 -/*! Function : GetPersistentReference
 - *  Purpose  : Get persistent reference of study (idem URL())
 +/*! Function : Open
 + *  Purpose  : Open a Study from it's persistent reference
   */
  //============================================================================
- bool SALOMEDS_Study_i::Open(const char* aUrl)
 -char* SALOMEDS_Study_i::GetPersistentReference()
++bool SALOMEDS_Study_i::Open(const wchar_t* aWUrl)
 +  throw(SALOME::SALOME_Exception)
  {
 -  SALOMEDS::Locker lock; 
 +  if (!_closed)
 +    Clear();
 +  Init();
 +  SALOMEDS::Locker lock;
 +
 +  Unexpect aCatch(SalomeException);
 +  MESSAGE("Begin of SALOMEDS_Study_i::Open");
++  
++  std::string aUrl = Kernel_Utils::encode_s(aWUrl);
 +  bool res = _impl->Open(std::string(aUrl));
 +
 +  // update desktop title with new study name
 +  NameChanged();
 +
 +  if ( !res )
 +    THROW_SALOME_CORBA_EXCEPTION("Impossible to Open study from file", SALOME::BAD_PARAM)
 +  return res;
 +}
 +
 +//============================================================================
 +/*! Function : Save
 + *  Purpose  : Save a Study to it's persistent reference
 + */
 +//============================================================================
 +CORBA::Boolean SALOMEDS_Study_i::Save(CORBA::Boolean theMultiFile, CORBA::Boolean theASCII)
 +{
 +  SALOMEDS::Locker lock;
    if (_closed)
 -    throw SALOMEDS::Study::StudyInvalidReference();  
 -  return CORBA::string_dup(_impl->GetPersistentReference().c_str());
 +    throw SALOMEDS::Study::StudyInvalidReference();
 +  return _impl->Save(_factory, theMultiFile, theASCII);
 +}
 +
 +//=============================================================================
 +/*! Function : SaveAs
 + *  Purpose  : Save a study to the persistent reference aUrl
 + */
 +//============================================================================
- CORBA::Boolean SALOMEDS_Study_i::SaveAs(const char* aUrl, CORBA::Boolean theMultiFile, CORBA::Boolean theASCII)
++CORBA::Boolean SALOMEDS_Study_i::SaveAs(const wchar_t* aWUrl, CORBA::Boolean theMultiFile, CORBA::Boolean theASCII)
 +{
 +  SALOMEDS::Locker lock;
 +  if (_closed)
 +    throw SALOMEDS::Study::StudyInvalidReference();
++  
++  std::string aUrl = Kernel_Utils::encode_s(aWUrl);
 +  return _impl->SaveAs(std::string(aUrl), _factory, theMultiFile, theASCII);
 +}
 +
 +//============================================================================
 +/*! Function : CanCopy
 + *  Purpose  :
 + */
 +//============================================================================
 +CORBA::Boolean SALOMEDS_Study_i::CanCopy(SALOMEDS::SObject_ptr theObject)
 +{
 +  SALOMEDS::Locker lock;
 +  if (_closed)
 +    throw SALOMEDS::Study::StudyInvalidReference();
 +
 +  CORBA::String_var anID = theObject->GetID();
 +  SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
 +
 +  SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
 +  bool ret = _impl->CanCopy(anObject, aDriver);
 +  delete aDriver;
 +  return ret;
 +}
 +
 +//============================================================================
 +/*! Function : Copy
 + *  Purpose  :
 + */
 +//============================================================================
 +CORBA::Boolean SALOMEDS_Study_i::Copy(SALOMEDS::SObject_ptr theObject)
 +{
 +  SALOMEDS::Locker lock;
 +  if (_closed)
 +    throw SALOMEDS::Study::StudyInvalidReference();
 +
 +  CORBA::String_var anID = theObject->GetID();
 +  SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
 +
 +  SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
 +  bool ret = _impl->Copy(anObject, aDriver);
 +  delete aDriver;
 +  return ret;
 +}
 +
 +//============================================================================
 +/*! Function : CanPaste
 + *  Purpose  :
 + */
 +//============================================================================
 +CORBA::Boolean SALOMEDS_Study_i::CanPaste(SALOMEDS::SObject_ptr theObject)
 +{
 +  SALOMEDS::Locker lock;
 +  if (_closed)
 +    throw SALOMEDS::Study::StudyInvalidReference();
 +
 +  CORBA::String_var anID = theObject->GetID();
 +  SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
 +
 +  SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
 +  bool ret = _impl->CanPaste(anObject, aDriver);
 +  delete aDriver;
 +  return ret;
 +}
 +
 +//============================================================================
 +/*! Function : Paste
 + *  Purpose  :
 + */
 +//============================================================================
 +SALOMEDS::SObject_ptr SALOMEDS_Study_i::Paste(SALOMEDS::SObject_ptr theObject)
 +     throw(SALOMEDS::StudyBuilder::LockProtection)
 +{
 +  SALOMEDS::Locker lock;
 +
 +  Unexpect aCatch(LockProtection);
 +
 +  CORBA::String_var anID = theObject->GetID();
 +  SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
 +  SALOMEDSImpl_SObject aNewSO;
 +
 +  try {
 +    SALOMEDS_Driver_i* aDriver = GetDriver(anObject, _orb);
 +    aNewSO =  _impl->Paste(anObject, aDriver);
 +    delete aDriver;
 +  }
 +  catch (...) {
 +    throw SALOMEDS::StudyBuilder::LockProtection();
 +  }
 +
 +  SALOMEDS::SObject_var so = SALOMEDS_SObject_i::New (aNewSO, _orb);
 +  return so._retn();
  }
 +
 +SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb)
 +{
 +  SALOMEDS_Driver_i* driver = NULL;
 +
 +  SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
 +  if(!aSCO.IsNull()) {
 +    std::string IOREngine = aSCO.GetIOR();
 +    if(!IOREngine.empty()) {
 +      CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
 +      Engines::EngineComponent_var Engine = Engines::EngineComponent::_narrow(obj) ;
 +      driver = new SALOMEDS_Driver_i(Engine, orb);
 +    }
 +  }
 +
 +  return driver;
 +}
 +
  //============================================================================
 -/*! Function : GetTransientReference
 - *  Purpose  : Get IOR of the Study (registred in OCAF document in doc->Root)
 +/*! Function : GetPersistentReference
 + *  Purpose  : Get persistent reference of study (idem URL())
   */
  //============================================================================
 -char* SALOMEDS_Study_i::GetTransientReference()
 +char* SALOMEDS_Study_i::GetPersistentReference()
  {
    SALOMEDS::Locker lock; 
    if (_closed)
@@@ -915,10 -839,21 +930,10 @@@ void SALOMEDS_Study_i::URL(const wchar_
  {
    SALOMEDS::Locker lock; 
    // URL is specified as IDL attribute: user exception cannot be raised
-   _impl->URL(std::string((char*)url));
+   _impl->URL(Kernel_Utils::encode_s(wurl));
 -}
  
 -CORBA::Short SALOMEDS_Study_i::StudyId()
 -{
 -  SALOMEDS::Locker lock; 
 -  // StudyId is specified as IDL attribute: user exception cannot be raised
 -  return _impl->StudyId();
 -}
 -
 -void SALOMEDS_Study_i::StudyId(CORBA::Short id)
 -{ 
 -  SALOMEDS::Locker lock; 
 -  // StudyId is specified as IDL attribute: user exception cannot be raised
 -  _impl->StudyId(id);
 +  // update desktop title with new study name
 +  NameChanged();
  }
  
  void SALOMEDS_Study_i::UpdateIORLabelMap(const char* anIOR, const char* anEntry) 
index 232b0fb4cadfaaae13362c299e5f5bd91402d9fe,2edf8382500c5dbe9cd4455ebe425da47bc0f845..d1c3d7f22eb546f915d980acaa785fa7aba609cb
@@@ -63,43 -60,11 +63,43 @@@ private
  public:
  
    //! standard constructor
 -  SALOMEDS_Study_i(SALOMEDSImpl_Study*, CORBA::ORB_ptr);
 +  SALOMEDS_Study_i(CORBA::ORB_ptr);
    
    //! standard destructor
 -  virtual ~SALOMEDS_Study_i(); 
 +  virtual ~SALOMEDS_Study_i();
    
-   virtual bool Open(const char* aStudyUrl) throw (SALOME::SALOME_Exception);
 +  virtual void Init();
 +  virtual void Clear();
 +
 +  //! method to Open a Study
 +  /*!
 +    \param char* arguments, the study URL
 +    \return Study_ptr arguments
 +  */
-   virtual CORBA::Boolean SaveAs(const char* aUrl, CORBA::Boolean theMultiFile, CORBA::Boolean theASCII);
++  virtual bool Open(const wchar_t* aStudyUrl) throw (SALOME::SALOME_Exception);
 +
 +  //! method to save a Study
 +  virtual CORBA::Boolean Save(CORBA::Boolean theMultiFile, CORBA::Boolean theASCII);
 +
 +  //! method to save a Study to the persistent reference aUrl
 +  /*!
 +    \param char* arguments, the new URL of the study
 +  */
++  virtual CORBA::Boolean SaveAs(const wchar_t* aUrl, CORBA::Boolean theMultiFile, CORBA::Boolean theASCII);
 +
 +  //! method to copy the object
 +  /*!
 +    \param theObject object to copy
 +  */
 +  virtual CORBA::Boolean Copy(SALOMEDS::SObject_ptr theObject);
 +  virtual CORBA::Boolean CanCopy(SALOMEDS::SObject_ptr theObject);
 +  //! method to paste the object in study
 +  /*!
 +    \param theObject object to paste
 +  */
 +  virtual SALOMEDS::SObject_ptr Paste(SALOMEDS::SObject_ptr theObject) throw(SALOMEDS::StudyBuilder::LockProtection);
 +  virtual CORBA::Boolean CanPaste(SALOMEDS::SObject_ptr theObject);
 +
    //! method to Get persistent reference of study (idem URL())
    /*!
      \sa URL()
    /*!
      \return char* arguments, the study name
    */
-   virtual char* Name();
+   virtual wchar_t* Name();
+   //! method to set study name
+   /*!
+     \param name char* arguments, the study name
+   */
 -  virtual void  Name(const wchar_t* name);
++  virtual void Name(const wchar_t* name);
  
    //! method to get if study has been saved
    /*!
    /*!
      \param url char* arguments, the study URL
    */
-   virtual void  URL(const char* url);
 -  virtual void  URL(const wchar_t* url);
 -
 -  virtual CORBA::Short StudyId();
 -  virtual void  StudyId(CORBA::Short id);
 -
 -  static SALOMEDS::Study_ptr GetStudy(const DF_Label& theLabel, CORBA::ORB_ptr orb);
 -  static SALOMEDS_Study_i* GetStudyServant(SALOMEDSImpl_Study*, CORBA::ORB_ptr orb);
++  virtual void URL(const wchar_t* url);
  
    static void IORUpdated(SALOMEDSImpl_AttributeIOR* theAttribute);
  
index 455bde6b1ff39e48cb77bfc9633208a6c92afd05,9c57a7d10b808ecd75d774c79ed9a2cc6822ce53..07f9e976b68ea663a9c9eb480024dca83fa36ba0
   * Use code of SALOMEDS_AttributeComment.cxx
   */
  
+ //#include "Basics_Utils.hxx"
  void SALOMEDSTest::testAttributeComment()
  {
 -  //Create or find the Study manager
 -  _PTR(StudyManager) sm(new SALOMEDS_StudyManager(_sm));
 -
 -  CPPUNIT_ASSERT(sm);
 -
 -  //Create a new study
 -  std::vector<std::string> ost(sm->GetOpenStudies());
 -  _PTR(Study) study;
 -  if(ost.empty())
 -    study = sm->NewStudy("Test");
 -  else
 -    study = sm->GetStudyByName(ost[0]);
 -//  study = sm->GetStudyByName(Kernel_Utils::decode_s(ost[0]));
 +  //Create Study
 +  _PTR(Study) study(new SALOMEDS_Study(_study));
  
    CPPUNIT_ASSERT(study);
  
index c76daf90883852431f1c47723b37a2dab274b1a9,c04961aa27d5ec3f42dea3c27f40e826d6221ace..773f16e5fa3354676d9a6a6fa3fac726c5c572c6
@@@ -1580,9 -733,20 +1580,20 @@@ SALOMEDSImpl_StudyBuilder* SALOMEDSImpl
  std::string SALOMEDSImpl_Study::Name()
  {
    _errorCode = "";
 -  return _name;
 +  return Kernel_Utils::GetBaseName( _name, false );
  }
  
+ //============================================================================
+ /*! Function : Name
+  *  Purpose  : set study name
+  */
+ //============================================================================
+ void SALOMEDSImpl_Study::Name(const std::string& name)
+ {
+   _errorCode = "";
+   _name = name;
+ }
  //============================================================================
  /*! Function : IsSaved
   *  Purpose  : get if study has been saved