aDocProperties[2] = Properties.createProperty("URL", sPath);
aDocProperties[3] = Properties.createProperty("DocumentTitle", basename);
if (_bcreateTemplate)
aDocProperties[4] = Properties.createProperty("AsTemplate", new Boolean(_bcreateTemplate));
XMultiServiceFactory xDocMSF = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, _xDocNameAccess);
Object oDBDocument = xDocMSF.createInstanceWithArguments("com.sun.star.sdb.DocumentDefinition", aDocProperties);
XHierarchicalNameContainer xHier = (XHierarchicalNameContainer) UnoRuntime.queryInterface(XHierarchicalNameContainer.class, _xDocNameAccess);
String sdocname = Desktop.getUniqueName(_xDocNameAccess, basename);
xHier.insertByHierarchicalName(sdocname, oDBDocument);
XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);