settings - How do I override ODF Root RSID using the API -
i generating odt documents using openoffice/libreoffice api, , want files come out 100% identical every time (by md5 comparison).
at point can unzip 2 files generated @ different times , check files within zip file , match 100%, except settings.xml has 2 unique differences (both rsid related).
<config:config-item config:name="rsid" config:type="int">1835643</config:config-item>
and
<config:config-item config:name="rsidroot" config:type="int">1835643</config:config-item>
i learned purpose of merging , tracking original document, want them fixed value control, don't plan merge these anyway, can't locate set these properties.
i have tried few options (below) , outputting properties, been unable find far. there way override rsid, without me (coding) unzipping file, , modifying xml, have done now, feels bit awkward still looking this.
// looking rsid in wrong places - test 1 xpropertyset xsettings = (xpropertyset) xremoteservicemanager.createinstancewithcontext("com.sun.star.document.settings", componentcontext); // looking rsid in wrong places - test 2 object configprovider = xremoteservicemanager.createinstancewithcontext( "com.sun.star.configuration.configurationprovider", componentcontext); xmultiservicefactory xconfigprovider = (xmultiservicefactory) unoruntime.queryinterface( xmultiservicefactory.class, configprovider); propertyvalue[] lparams = new propertyvalue[1]; lparams[0] = new propertyvalue(); lparams[0].name = "nodepath"; lparams[0].value = "/"; object xaccess = xconfigprovider.createinstancewitharguments( "com.sun.star.configuration.configurationupdateaccess" , lparams); xnameaccess xnameaccess = (com.sun.star.container.xnameaccess) unoruntime.queryinterface(xnameaccess.class, xaccess);
the simple solution delete settings.xml part in package zip. implementation-dependent material , should not matter document generating.
if concerned still in manifest, although not in package, alternative replace settings.xml standard 1 of creation honors schema , least needed accomplish that.
note there conditions under different runs of openoffice/libreoffice may embed different uuids , uiid-based identifiers in content.xml , in names of package parts. appears generation via api not lead of those.
Comments
Post a Comment