Object oConfigUpdate = xProv.createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationUpdateAccess",
aArgs );
XNameReplace xNameReplace = (XNameReplace)UnoRuntime.queryInterface(
XNameReplace.class, oConfigUpdate );
XChangesBatch xChangesBatch = (XChangesBatch)UnoRuntime.queryInterface(
XChangesBatch.class, oConfigUpdate );
Object[] aSecureURLs;
if (secureURLs == null) {
aSecureURLs = new Object[0];
}
else {
aSecureURLs = new Object[1];
aSecureURLs[0] = secureURLs;
}
log.println("setting SecureURL");
xNameReplace.replaceByName( "SecureURL", aSecureURLs );
log.println("setting OfficeBasic");
xNameReplace.replaceByName( "OfficeBasic", new Integer(officeBasic) );
Boolean bConfirm = null;
if( ( confirm != null ) && ( confirm.equals("true") ) )
{
bConfirm = new Boolean( true );
}
else
{
bConfirm = new Boolean( false );
}
log.println("setting Confirmation");
xNameReplace.replaceByName( "Confirmation", bConfirm );
Boolean bWarning = null;
if( ( warning != null ) && ( warning.equals("true") ) )
{
bWarning = new Boolean( true );
}
else
{
bWarning = new Boolean( false );
}
log.println("setting Warning");
xNameReplace.replaceByName( "Warning", bWarning );
// and now commit the changes
xChangesBatch.commitChanges();
success=true;
} catch (Exception e) {
log.println("Error updating security settings: " +
e.getMessage() );
}