After server-side customisation, user cannot customise.

User a200fcbc5e

20-03-2012 13:06:48

Hi,


I have removed the "view-> open MarvinSpace" menu option by using a customization.xml file in a specified location (not in $USER_HOME/chemaxon/{MarvinSketch_version}/customization.xml)


This causes


1) the "view->configurations" menu option to be disabled permanently after hovering over it.


2) the "view->customize..." option has disappeared completely.


 


I want the user to still have access to these 2 menu options.


 


In the documentation ( http://www.chemaxon.com/marvin/help/developer/sketchman.html#parameters.menuconfig )


it states (in reference to the 'menuconfig' parameter) :


"Please note that if this parameter is used, the customizationEnabled parameter is automatically set to false."


which I assume is what is causing this behaviour. I'm trying to revert this 'customizationEnabled' parameter to 'true'. Printing out the value shows it is set to 'true', but behaviours 1) and 2) are still showing.


Is there any way to achieve what I want? Am I using the API correctly?


Source code and customization.xml file below - thanks:


 



package toy;


import java.awt.Dimension;


import javax.swing.JFrame;


import javax.swing.SwingUtilities;


import chemaxon.marvin.beans.MSketchPane;


import chemaxon.marvin.beans.MarvinPane;


import chemaxon.marvin.common.UserSettings;


import chemaxon.marvin.sketch.SketchParameterConstants;






public class Customization


{


static MSketchPane sketchPane;



public static void main( String[] args )


{


SwingUtilities.invokeLater( new Runnable(){


public void run() {


displayMSketchPane();


}


});


}



private static void displayMSketchPane()


{


JFrame baseFrame = new JFrame();


baseFrame.setPreferredSize( new Dimension(400,400) );


baseFrame.add( getSketchPane() );


baseFrame.pack();


baseFrame.setVisible( true );


}



private static MarvinPane getSketchPane() 


{


UserSettings userSettings=new UserSettings();



userSettings.setProperty( SketchParameterConstants.MENU_CUSTOMIZATION_FILE, "C:/Users/bconnor.WIN/workspace/ToyJChem_customGUI/src/toy/customization.xml");


userSettings.setProperty( SketchParameterConstants.CUSTOMIZATION_ENABLED, "true" );


        sketchPane = new MSketchPane( userSettings );



        //check the property values are set to expected values


        System.out.println( "custEnabled=" + userSettings.getProperty( SketchParameterConstants.CUSTOMIZATION_ENABLED ) );


        System.out.println( "custFile=" + userSettings.getProperty( SketchParameterConstants.MENU_CUSTOMIZATION_FILE) );


return sketchPane;


}


}


===================================



<?xml version="1.0" encoding="UTF-8"?>

<customization active="classic">

  <scheme id="default">

    <remove path="menubar/view-menu/marvinSpace"/>

    <modify path="toolbar/atoms" row="0"/>

    <modify path="toolbar/tools" row="0"/>

    <modify path="toolbar/templates" row="0"/>

    <modify path="toolbar/chemical" row="0"/>

    <modify path="toolbar/markush" row="0"/>

    <modify path="toolbar/mytemplates" row="0"/>

    <modify path="toolbar/general" row="0"/>

    <modify path="toolbar/edit3D" row="0"/>

  </scheme>

  <scheme id="classic">

    <remove path="menubar/view-menu/marvinSpace"/>

    <modify path="toolbar/templates" row="0"/>

    <modify path="toolbar/chemical" row="0"/>

    <modify path="toolbar/config3_1" row="2"/>

    <modify path="toolbar/markush" row="0"/>

    <modify path="toolbar/config3_4" row="2"/>

    <modify path="toolbar/config3_2" row="3"/>

    <modify path="toolbar/mytemplates" row="1"/>

    <modify path="toolbar/config3_3" row="1"/>

    <modify path="toolbar/edit3D" row="0"/>

  </scheme>

  <scheme id="config2">

    <remove path="menubar/view-menu/marvinSpace"/>

    <modify path="toolbar/config2_3" row="1"/>

    <modify path="toolbar/config2_1" row="0"/>

    <modify path="toolbar/config2_2" row="0"/>

    <modify path="toolbar/mytemplates" row="0"/>

  </scheme>

  <scheme id="config1">

    <remove path="menubar/view-menu/marvinSpace"/>

    <modify path="toolbar/config1_1" row="0"/>

    <modify path="toolbar/config1_2" row="0"/>

    <modify path="toolbar/mytemplates" row="0"/>

  </scheme>

  <scheme id="viewmode">

    <remove path="menubar/view-menu/marvinSpace"/>

    <modify path="toolbar/tools" row="1"/>

    <modify path="toolbar/templates" row="0"/>

    <modify path="toolbar/chemical" row="0"/>

    <modify path="toolbar/view" row="1"/>

    <modify path="toolbar/markush" row="0"/>

    <modify path="toolbar/general" row="1"/>

    <modify path="toolbar/mytemplates" row="1"/>

    <modify path="toolbar/edit3D" row="0"/>

  </scheme>

</customization>





 



ChemAxon 5433b8e56b

21-03-2012 21:52:40

Hi,


this is unfortunatelly an issue in our documentation, the setting of customization files this way disables the further customization possibility, because the configuration files stored in one place, and a configuration from outside mixed with the user local customization can mix up the customizations for all locally used instances, so when a 3rd party customization file is present and loaded into Marvin programaticcaly, then the further customizations are disabled.


If you want to let the user to customize Marvin further, then you can do the following:
create a customization file in Marvin, add a new configuration to it, and disable the MarvinSpace related menu points. Make the new configuration the default configuration, and overwrite the file in the home directory of the user at the specified location.
In this case the user still can change the configuration, or customize the current active configuration, that is in this case yours, further.
Note that, this change in the configuration files will affect all MarvinSketch instances that can be started on the actual machine except applets.


Currently there is no other way to achive this, is this suitable for you?


Regards,
Istvan

User a200fcbc5e

22-03-2012 11:00:54

Hi,


Thanks for the quick response.


I was expecting that to be the case ( i.e using an external customisation file disables any further user-customisation ). For the moment, this is fine and we can work with the current situation.


Thanks,


Barry