<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Unfortunately I'm now in the situation
      that I have this incomplete csv file and only one site running,
      which still has the<br>
      complete user-base stored in it (MySQL). <br>
      <br>
      I also have no means to compile or rebuild parts of OpenCMS (the
      site is some kind of Opencms 7.x) and hacking the OpenCMS classes<br>
      is probably not a way to go.<br>
      <br>
      Would be exporting the user tables from MySQL into a dump and
      import that into the target system  a possible alternate solution?<br>
      Or is the 9.5.0 user structure different? <br>
      <br>
      Or maybe use opencmsshell for this?<br>
      <br>
      <br>
      Am 19.06.2014 um 09:59 schrieb Stephan Schrader:<br>
    </div>
    <blockquote
cite="mid:CAJgCXq7O4jrWUuLtUd6dhpR7K3ThcdtYUe2mhbnWEcsBt4fNXw@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div dir="ltr">
        <div>Spooky, we faced the same issue 2 week ago. But hadn't have
          the time to investigate.</div>
        <div><br>
        </div>
        <div>The original problem is during export, the downloaded CSV
          is not complete. To confirm, open the file with a texteditor
          and at the and you will see that the data stops somewhere and
          not all columns are written.</div>
        <div><br>
        </div>
        <div>The bug is in
          "org.opencms.workplace.tools.accounts.CmsUsersCsvDownloadDialog"
          line: 194. There the Content-Length header must not be count
          of characters, it must be the count of bytes. For a quick fix:</div>
        <div><br>
        </div>
        <div>1. Copy the class into a different packacke, eg.
          "org.opencms.fix.workplace.tools.accounts"</div>
        <div>2. Remove line 194 or replace with (which works for me):</div>
        <div>        Charset defaultEncoding =
          Charset.forName(OpenCms.getSystemInfo().getDefaultEncoding());</div>
        <div>       
res.setContentLength(buffer.toString().getBytes(defaultEncoding).length);</div>
        <div>        </div>
        <div>3. Deploy and replace the original class with your version
          in:
          /system/workplace/admin/accounts/imexport_user_data/csvdownload.jsp</div>
        <div><br>
        </div>
        <div>Because of the wrong header, there might be some browser
          which ignores the Content-Length and downloads the complete
          content. I only tested with Chrome, maybe you can downlaod the
          full content without the fix in Firefox or IE.</div>
        <div><br>
        </div>
        <div>We have also seen another problem with the user import,
          during the import all special character, like ä, ü, ... are
          not correct decoded. </div>
        <div><br>
        </div>
        <div>As before copy the class:
          org.opencms.workplace.tools.accounts.CmsUserDataImportList and
          replace in line: 549, 550 </div>
        <div><br>
        </div>
        <div>            fileReader = new FileReader(m_uploadFile);</div>
        <div>            bufferedReader = new
          BufferedReader(fileReader);</div>
        <div>            </div>
        <div>with</div>
        <div>            FileInputStream fileInputStream = new
          FileInputStream(m_uploadFile);</div>
        <div>            Charset defaultEncoding =
          Charset.forName(OpenCms.getSystemInfo().getDefaultEncoding());</div>
        <div>            Reader reader = new
          InputStreamReader(fileInputStream, defaultEncoding);</div>
        <div>            bufferedReader = new BufferedReader(reader);</div>
        <div>            </div>
        <div>Replace the original version in:
          /system/workplace/admin/accounts/imexport_user_data/import_csv_list.jsp 
                    </div>
        <div><br>
        </div>
        <div>Hope this helps</div>
        <div>Stephan            </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2014-06-17 13:05 GMT+02:00 Filip
          Kratochvil <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:filip.kratochvil@nelasoft.cz" target="_blank">filip.kratochvil@nelasoft.cz</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="white" link="blue" vlink="purple" lang="CS">
              <div>
                <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi
                    Chris,</span></p>
                <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
                <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">it
                    will be nice, if you can show us full Error message
                    by <b>Details…</b> button</span><span
                    style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">J</span><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">
                    As so as i had a similar problems with import
                    because i had some whitespaces or invisible
                    characters in CSV file. So you can try to check it.</span></p>
                <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
                <div>
                  <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--<br>
                      Regards<br>
                      Filip Kratochvil<br>
                      ------------------------------------------------<br>
                      NELASOFT Technologies, s.r.o.<br>
                      E-mail: <a moz-do-not-send="true"
                        href="mailto:filip.kratochvil@nelasoft.cz"
                        target="_blank"><span style="color:blue">filip.kratochvil@nelasoft.cz</span></a><br>
                      Web: <a moz-do-not-send="true"
                        href="http://www.nelasoft.cz" target="_blank"><span
                          style="color:blue">www.nelasoft.cz</span></a></span><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"></span></p>
                </div>
                <p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> </span></p>
                <div>
                  <div style="border:none;border-top:solid #b5c4df
                    1.0pt;padding:3.0pt 0cm 0cm 0cm">
                    <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
                        <a moz-do-not-send="true"
                          href="mailto:opencms-dev-bounces@opencms.org"
                          target="_blank">opencms-dev-bounces@opencms.org</a>
                        [mailto:<a moz-do-not-send="true"
                          href="mailto:opencms-dev-bounces@opencms.org"
                          target="_blank">opencms-dev-bounces@opencms.org</a>]
                        <b>On Behalf Of </b>Christoph Kukulies<br>
                        <b>Sent:</b> Tuesday, June 17, 2014 12:50 PM<br>
                        <b>To:</b> The OpenCms mailing list<br>
                        <b>Subject:</b> [opencms-dev] error during user
                        import (CSV)</span></p>
                  </div>
                </div>
                <div>
                  <div class="h5">
                    <p class="MsoNormal">
                       </p>
                    <p class="MsoNormal" style="margin-bottom:12.0pt">I'm
                      trying to copy users from one OpenCMS to another.
                      When reading the CSV export into the other system
                      I'm getting <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      (Error while filling the list "Import Users".
                      Reason: Index: 9, Size: 2)<br>
                      <br>
                      Any ideas?<br>
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de
    </div>
  </body>
</html>