Solr
  1. Solr
  2. SOLR-2490

PropertiesRequestHandler; encode line.separator

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: web gui
    • Labels:
      None

      Description

      Currently, the XML looks like this:

      <!-- .. -->
      <str name="java.io.tmpdir">/tmp</str>
      <str name="line.separator">
      </str>
      <str name="java.vm.specification.vendor">Sun Microsystems Inc.</str>
      <!-- .. -->

      would be good to have this instead:

      <!-- .. -->
      <str name="java.io.tmpdir">/tmp</str>
      <str name="line.separator">\n</str>
      <str name="java.vm.specification.vendor">Sun Microsystems Inc.</str>
      <!-- .. -->

      afterwords we will be able to display to used line seperator

        Issue Links

          Activity

          Hide
          Hoss Man added a comment -

          hmmm...

          i don't think we should do this.

          the request handler as written is total agnostic to what the properties are or how they are being written out – it just builds up the response and lets the writer take care of it. As noted the XmlResponseWriter does in fact output the newline.

          if PropertiesRequestHandler tried to specially encode any (or all) properties with whitespace in them, that would screw up clients that were treating the whitespace as significant when parsing the xml – and worse it would royally screw up clients using other response writers where whitespace is always significant.

          Show
          Hoss Man added a comment - hmmm... i don't think we should do this. the request handler as written is total agnostic to what the properties are or how they are being written out – it just builds up the response and lets the writer take care of it. As noted the XmlResponseWriter does in fact output the newline. if PropertiesRequestHandler tried to specially encode any (or all) properties with whitespace in them, that would screw up clients that were treating the whitespace as significant when parsing the xml – and worse it would royally screw up clients using other response writers where whitespace is always significant.
          Hide
          Stefan Matheis (steffkes) added a comment -

          i don't think we should do this.

          okay – but, then there is no chance to show any difference between \n, \r or \r\n in the interface, because it's just a linebreak in the xml-source.

          if PropertiesRequestHandler tried to specially encode any (or all) properties with whitespace in them ...

          what about especially (and only) this one? That's a common problem for displaying linebreaks.

          Show
          Stefan Matheis (steffkes) added a comment - i don't think we should do this. okay – but, then there is no chance to show any difference between \n , \r or \r\n in the interface, because it's just a linebreak in the xml-source. if PropertiesRequestHandler tried to specially encode any (or all) properties with whitespace in them ... what about especially (and only) this one? That's a common problem for displaying linebreaks.
          Hide
          Mike Sokolov added a comment - - edited

          I would recommend using entities for this: &#13;&#10; for CRLF, just &#10; for LF?

          If this is processed by an XML parser, that'll already work for free anyway.

          Show
          Mike Sokolov added a comment - - edited I would recommend using entities for this: &#13;&#10; for CRLF, just &#10; for LF? If this is processed by an XML parser, that'll already work for free anyway.
          Hide
          Stefan Matheis (steffkes) added a comment -

          Just FYI – I've created an hacky workaround for the admin-ui - using an regex to extract the line.seperator-value from the raw response (which still contains the \n): https://github.com/steffkes/solr-admin/commit/c68427da9791b1f758c4185853ca8735dc47ec84#diff-0

          Show
          Stefan Matheis (steffkes) added a comment - Just FYI – I've created an hacky workaround for the admin-ui - using an regex to extract the line.seperator -value from the raw response (which still contains the \n ): https://github.com/steffkes/solr-admin/commit/c68427da9791b1f758c4185853ca8735dc47ec84#diff-0
          Hide
          Stefan Matheis (steffkes) added a comment -

          according to the comment of hoss, we don't change that - the ui gets this information from the raw response and is already able to display that to the user

          Show
          Stefan Matheis (steffkes) added a comment - according to the comment of hoss, we don't change that - the ui gets this information from the raw response and is already able to display that to the user

            People

            • Assignee:
              Stefan Matheis (steffkes)
              Reporter:
              Stefan Matheis (steffkes)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development