<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Martin ,<br>
    <br>
    i use folowed BASIC code to make a "path" consitent , maybe&nbsp; it
    helps ?<br>
    <br>
    public sElementnaam , sfotopath as string<br>
    public oParameter as object<br>
    <br>
    sub addFotoPath()<br>
    sRegisterPath = "/org.openoffice.OpmaakMacro.FotoPath/Parameters/" <br>
    CreateRegistrySchemaPathIfNotPresent(sRegisterPath)<br>
    aSettings = GetConfigSettings(sRegisterPath)<br>
    sElementNaam = "FOTO"<br>
    sParaNaam = "FotoPath"<br>
    sParameter = "c:\test"<br>
    <br>
    call addParameter(aSettings, sParaNaam, sParaMeter) <br>
    <br>
    end sub<br>
    sub getFotoPath<br>
    &nbsp;&nbsp;&nbsp; sRegisterPath =
    "/org.openoffice.OpmaakMacro.FotoPath/Parameters/" <br>
    &nbsp;&nbsp;&nbsp; aSettings = GetConfigSettings(sRegisterPath)<br>
    &nbsp;&nbsp;&nbsp; asElNames = aSettings.ElementNames <br>
    &nbsp;&nbsp;&nbsp; if aSettings.hasByName("FOTO") then<br>
    &nbsp;&nbsp;&nbsp; oParameter = aSettings.getByName("FOTO") <br>
    &nbsp;<br>
    &nbsp;&nbsp; sFOTOpath = oParameter.getByName("ParameterString")<br>
    &nbsp;&nbsp; else<br>
    &nbsp;&nbsp; sFOTOpath = ""<br>
    &nbsp;&nbsp; endif <br>
    end sub<br>
    <br>
    <br>
    function GetConfigSettings(sRegisterPath as String) as Object 'Taken
    from DannyB <br>
    Dim args(1) As new com.sun.star.beans.PropertyValue <br>
    aConfProv =
    createUnoService("com.sun.star.configuration.ConfigurationProvider")
    <br>
    args(1).Name = "nodepath" <br>
    args(1).Value = sRegisterPath&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
    args(0).Name = "EnableAsync" <br>
    args(0).Value = false <br>
    GetConfigSettings =
    aConfProv.createInstanceWithArguments("com.sun.star.configuration.ConfigurationUpdateAccess",

    args()) <br>
    end function <br>
    <br>
    sub CreateRegistrySchemaPathIfNotPresent(sRegisterPath as String) <br>
    oPathSettings = CreateUnoService( "com.sun.star.util.PathSettings" )<br>
    xray oPathSettings <br>
    sPathConfig = oPathSettings.Work 'Config <br>
    <br>
    asPath1 = split(sRegisterPath, "/") <br>
    sFullDotPath = asPath1(1) <br>
    asPath2 = Split(sFullDotPath,".") <br>
    sFolder = join(asPath2,"/") <br>
    <br>
    <br>
    sRegistrySchemaPath = <a class="moz-txt-link-rfc2396E"
      href="file:///H:/">"file:///H:/"</a> &amp; sFolder &amp; ".xcs" <br>
    <br>
    sFileName = asPath2(UBound(asPath2)) <br>
    sPackage = left(sFullDotPath, len(sFullDotPath)-len(sFileName)-1) <br>
    <br>
    oSFA = createUNOService ("com.sun.star.ucb.SimpleFileAccess") <br>
    if not oSFA.exists(sRegistrySchemaPath) then 'See the chapter 15 of
    the dev guide for some explanation <br>
    print sRegistrySchemaPath<br>
    &nbsp; oOutStream = oSFA.openFileWrite(sRegistrySchemaPath) <br>
    &nbsp; oOutText = createUNOService ("com.sun.star.io.TextOutputStream") <br>
    &nbsp; oOutText.setOutputStream(oOutStream) <br>
    &nbsp; <br>
    &nbsp; oOutText.WriteString("&lt;?xml version='1.0'
    encoding='UTF-8'?&gt;" &amp; Chr(10)) <br>
    <br>
    &nbsp; oOutText.WriteString("&lt;oor:component-schema oor:name=""" &amp;
    sFileName &amp; """ oor:package=""" &amp; sPackage &amp; """ " ) <br>
    &nbsp; oOutText.WriteString("xml:lang=""en-US"" xmlns:oor="<a
      class="moz-txt-link-rfc2396E"
      href="http://openoffice.org/2001/registry">"http://openoffice.org/2001/registry"</a>"
    " ) <br>
    &nbsp; oOutText.WriteString("xmlns:xs="<a class="moz-txt-link-rfc2396E"
      href="http://www.w3.org/2001/XMLSchema">"http://www.w3.org/2001/XMLSchema"</a>"
    " ) <br>
    &nbsp; oOutText.WriteString("xmlns:xsi="<a class="moz-txt-link-rfc2396E"
      href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>"&gt;"

    &amp; Chr(10)) <br>
    <br>
    &nbsp; oOutText.WriteString("&lt;templates&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&nbsp; &lt;group oor:name=""Parameter""&gt;"
    &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&nbsp;&nbsp;&nbsp; &lt;prop oor:name=""ParameterName""
    oor:type=""xs:string""/&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&nbsp;&nbsp;&nbsp; &lt;prop oor:name=""ParameterString""
    oor:type=""xs:string""/&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&nbsp; &lt;/group&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&lt;/templates&gt;" &amp; Chr(10)) <br>
    <br>
    &nbsp; oOutText.WriteString("&lt;component&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&nbsp; &lt;set oor:name=""Parameters""
    oor:node-type=""Parameter""/&gt;" &amp; Chr(10)) <br>
    &nbsp; oOutText.WriteString("&lt;/component&gt;" &amp; Chr(10)) <br>
    <br>
    &nbsp; oOutText.WriteString("&lt;/oor:component-schema&gt;" &amp;
    Chr(10)) <br>
    <br>
    &nbsp; oOutText.closeOutput() <br>
    &nbsp; oOutStream.closeOutput <br>
    &nbsp; endif <br>
    <br>
    end sub <br>
    <br>
    sub addParameter(aSettings as Object, ParameterName as String,
    ParameterString as String) <br>
    <br>
    &nbsp; Dim arParameters1(0) As new com.sun.star.beans.PropertyValue <br>
    &nbsp; arParameters1(0).Name = ParameterName <br>
    &nbsp; arParameters1(0).Value = ParameterString <br>
    &nbsp; call setParameters(aSettings, arParameters1(0)) <br>
    <br>
    end sub <br>
    <br>
    function getParameterCount(aSettings as Object) as long <br>
    getParameterCount = UBound(aSettings.ElementNames)+1 <br>
    end function <br>
    <br>
    <br>
    <br>
    sub setParameters(aSettings as Object, aNewValue as Object) <br>
    &nbsp; if aSettings.hasbyName(sElementnaam) then<br>
    'print aNewvalue.name<br>
    &nbsp;&nbsp; oParameter = aSettings.createInstance() <br>
    &nbsp; oParameter.ParameterName = aNewValue.Name <br>
    &nbsp; oParameter.ParameterString = aNewValue.Value <br>
    <br>
    &nbsp; aSettings.ReplaceByName(sElementNaam , oParameter) <br>
    <br>
    &nbsp; aSettings.commitChanges() <br>
    &nbsp; else<br>
    &nbsp;&nbsp; oParameter =&nbsp; aSettings.createInstance() <br>
    &nbsp; oParameter.ParameterName = aNewValue.Name <br>
    &nbsp; oParameter.ParameterString = aNewValue.Value <br>
    &nbsp;<br>
    &nbsp; aSettings.insertByName(sElementNaam , oParameter) <br>
    &nbsp;&nbsp; aSettings.commitChanges() <br>
    &nbsp;&nbsp; endif<br>
    &nbsp; <br>
    end sub <br>
    <blockquote
cite="mid:CAOEXP8h+Zmpu3fGcjyCiJtUr0AXpbZ-KF+mbeOYn8VROcfEvtQ@mail.gmail.com"
      type="cite">Hi everybody,<br>
      <br>
      I'm hacking the cross-platform filepicker (in
      fpicker/source/office). I added a "Places" (bookmarks) list on the
      left and I would like to save the entries that the user bookmarked
      .<br>
      <br>
      Cedric Bosdonnat told me to look at xcu and xcs files, but I'm a
      bit lost. I'm looking for a code sample where user's persistent
      configuration is manipulated (read and written) and/or anything
      that can be usefull, like search keywords, links to old threads in
      the mailing list, which would help me to identify some good
      practices (naming conventions, for instance).<br>
      <br>
      Cheers,<br>
      Martin Richard<br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LibreOffice mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
    </blockquote>
    <br>
    <br>
  </body>
</html>