<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Martin,<br>
    <br>
    I supose it is already cross platform and environment independent,
    neve tested it but interesting to know.<br>
    <br>
    <br>
    <blockquote
cite="mid:CAOEXP8jascxTciXr4nCm+37=Nws1V6jFrBTNzGB=XBCN86=+uQ@mail.gmail.com"
      type="cite">Hi Fernand,<br>
      <br>
      Thank you for your response, it may help indeed.<br>
      <br>
      It seems that you create your own xcs file from scratch and store
      it in a custom location. I think that in my case, I will need to
      find a way to make it cross platform and environment independent.
      <br>
      <br>
      Cheers<br>
      <br>
      <div class="gmail_quote">2012/1/24 Fernand Vanrie <span dir="ltr">&lt;<a
            moz-do-not-send="true" href="mailto:sos@pmgroup.be">sos@pmgroup.be</a>&gt;</span><br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div bgcolor="#FFFFFF" text="#000000">
            <div>
              <div class="h5"> 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 moz-do-not-send="true">"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
                  moz-do-not-send="true"
                  href="http://openoffice.org/2001/registry"
                  target="_blank">"http://openoffice.org/2001/registry"</a>"
                " ) <br>
                &nbsp; oOutText.WriteString("xmlns:xs="<a
                  moz-do-not-send="true"
                  href="http://www.w3.org/2001/XMLSchema"
                  target="_blank">"http://www.w3.org/2001/XMLSchema"</a>"
                " ) <br>
                &nbsp; oOutText.WriteString("xmlns:xsi="<a
                  moz-do-not-send="true"
                  href="http://www.w3.org/2001/XMLSchema-instance"
                  target="_blank">"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>
              </div>
            </div>
            <blockquote type="cite">Hi everybody,
              <div>
                <div class="h5"><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></fieldset>
                  <br>
                </div>
              </div>
              <div class="im">
                <pre>_______________________________________________
LibreOffice mailing list
<a moz-do-not-send="true" href="mailto:LibreOffice@lists.freedesktop.org" target="_blank">LibreOffice@lists.freedesktop.org</a>
<a moz-do-not-send="true" href="http://lists.freedesktop.org/mailman/listinfo/libreoffice" target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a>
</pre>
              </div>
            </blockquote>
            <br>
            <br>
          </div>
          <br>
          _______________________________________________<br>
          LibreOffice mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:LibreOffice@lists.freedesktop.org">LibreOffice@lists.freedesktop.org</a><br>
          <a moz-do-not-send="true"
            href="http://lists.freedesktop.org/mailman/listinfo/libreoffice"
            target="_blank">http://lists.freedesktop.org/mailman/listinfo/libreoffice</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      Martin Richard<br>
      <a moz-do-not-send="true" href="http://www.martiuweb.net"
        target="_blank">www.martiusweb.net</a><br>
      <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>
  </body>
</html>