Problem in MDX Edit with Chinese

Help
Anonymous
2003-12-05
2013-04-29
  • Anonymous

    Anonymous - 2003-12-05

    A cube with chinese dimension name, it works well in Mondrian. But it does not run in Jpivot MDX Edit.

    thanks in advance 

     
    • spiritsailor

      spiritsailor - 2005-03-02

      yes,I found the problems too,so I think the mdxquery sevlet must add some encode methods to accept the kind of code ,any tips ?

       
    • Ati Rosselet

      Ati Rosselet - 2005-03-02

      ok.. in your web.xml, you need to add
          <init-param>
            <param-name>encoding</param-name>
            <param-value>ISO-8859-2</param-value>
            <description>Set the encoding for the system</description>
          </init-param>

      to the JPivot controller filter.  Substitute your ecoding for param-value.

      oh.. sorry.. this fix isnt in th release:
      com.tonbeller.wcf.controller.RequestFilter.java

      to class add:
         /**
           * The default character encoding to set for requests that pass through
           * this filter.
           */
          protected String encoding = null;
          /**
           * Should a character encoding specified by the client be ignored?
           */
          protected boolean ignore = true;

      to the init procedure ADD:
             encoding = config.getInitParameter("encoding");
              String value = config.getInitParameter("ignore");
              if (value == null)
                  this.ignore = true;
              else if (value.equalsIgnoreCase("true"))
                  this.ignore = true;
              else if (value.equalsIgnoreCase("yes"))
                  this.ignore = true;
              else
                  this.ignore = false;

      and further down, in doFilter,
      add the following before Config.set();

      if (ignore || (request.getCharacterEncoding() == null)) {
                  String encoding = selectEncoding(request);
                  if (encoding != null)
                      request.setCharacterEncoding(encoding);           
              }

      make sure to back up your original file. 
      good luck

       
    • spiritsailor

      spiritsailor - 2005-03-03

      can you send me the amended jpivot.jar to me?
      my mail is liuhan95121@hotmail.com
      because use the ant to build the jpivot source can't work correctly.thx a lot.

       
    • spiritsailor

      spiritsailor - 2005-03-03

      I tried to amend the source,but use the jpivot-src.zip in cvs, put it in my eclipse ide,the source have a lot of errors.
      Severity    Description    Resource    In Folder    Location    Creation Time
      2    Unreachable catch block for ResultLimitExceeded. This exception is never thrown from the try statement body    MondrianMemberTree.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 56    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    The method getSchemaReader() in the type Query is not applicable for the arguments (boolean)    MondrianMemberTree.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 69    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    mondrian.olap.Property.PROPERTY_VISIBLE cannot be resolved    MondrianMemberTree.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 76    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    mondrian.olap.Property.PROPERTY_VISIBLE cannot be resolved    MondrianMemberTree.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 93    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    Unreachable catch block for ResultLimitExceeded. This exception is never thrown from the try statement body    MondrianMemberTree.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 173    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    The method getConnection(String, ServletContext, boolean) in the type DriverManager is not applicable for the arguments (Util.PropertyList, ServletContext, DataSource, boolean)    MondrianModel.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 325    2005&#24180;3&#26376;3&#26085; 12:57:33
      2    The method lookupCompound(Dimension, String[], boolean, int) is undefined for the type SchemaReader    MondrianUtil.java    jpivot/src/java/com/tonbeller/jpivot/mondrian    line 118    2005&#24180;3&#26376;3&#26085; 12:57:32
      2    The type parser collides with a package    parser.java    jpivot/src/java/com/tonbeller/jpivot/olap/mdxparse    line 17    2005&#24180;3&#26376;3&#26085; 12:57:32
      2    parser cannot be resolved (or is not a valid type) for the field CUP$parser$actions.parser    parser.java    jpivot/src/java/com/tonbeller/jpivot/olap/mdxparse    line 538    2005&#24180;3&#26376;3&#26085; 12:57:32
      2    parser cannot be resolved (or is not a valid type) for the parameter parser of the method CUP$parser$actions    parser.java    jpivot/src/java/com/tonbeller/jpivot/olap/mdxparse    line 541    2005&#24180;3&#26376;3&#26085; 12:57:32
      2    parser cannot be resolved or is not a field    parser.java    jpivot/src/java/com/tonbeller/jpivot/olap/mdxparse    line 542    2005&#24180;3&#26376;3&#26085; 12:57:32
      2    Only a type can be imported. com.tonbeller.jpivot.olap.mdxparse.parser resolves to a package    XMLA_Model.java    jpivot/src/java/com/tonbeller/jpivot/xmla    line 42    2005&#24180;3&#26376;3&#26085; 12:57:31
      2    parser cannot be resolved or is not a type    XMLA_Model.java    jpivot/src/java/com/tonbeller/jpivot/xmla    line 643    2005&#24180;3&#26376;3&#26085; 12:57:31
      2    parser cannot be resolved or is not a type    XMLA_Model.java    jpivot/src/java/com/tonbeller/jpivot/xmla    line 645    2005&#24180;3&#26376;3&#26085; 12:57:31

      something like mismach,but I put the .jars(except the jpivot.jar) form jpivot.war to the lib,anything wrong?

       
      • Ati Rosselet

        Ati Rosselet - 2005-03-03

        oh.. I'm not using the cvs version... sometimes it may not compile.. :)  I'm still using the 1.3.0 version.. with changes as I go - sometimes integrating parts from cvs. Speaking of which... I should check the cvs before I post..

         
    • spiritsailor

      spiritsailor - 2005-03-03

      related classes is
      com.tonbeller.jpivot.olap.mdxparse.parser
      com.tonbeller.jpivot.mondrian.MondrianMemberTree
      com.tonbeller.jpivot.mondrian.MondrianModel
      com.tonbeller.jpivot.mondrian.MondrianUtil
      com.tonbeller.jpivot.xmla.XMLA_Model

       
    • spiritsailor

      spiritsailor - 2005-03-03

      now I used the latest mondrian.jar in cvs,there is tow classes have errors
      com.tonbeller.jpivot.olap.mdxparse.parser
      The type parser collides with a package
      parser.java jpivot/src/java/com/tonbeller/jpivot/olap/mdxparse line 17   

      com.tonbeller.jpivot.xmla.XMLA_Model
      Only a type can be imported. com.tonbeller.jpivot.olap.mdxparse.parser resolves to a package   
      XMLA_Model.java
      jpivot/src/java/com/tonbeller/jpivot/xmla    line 42   

       
    • spiritsailor

      spiritsailor - 2005-03-03

      String encoding = selectEncoding(request);

      where is the selectEncoding method?

       
    • Ati Rosselet

      Ati Rosselet - 2005-03-03

      I just use netbeans and the included ant script (changed to indicate where my directories are etc.. some small local changes - nothing important). Check that you have all the libs etc.. and run ant.   should work fine.  I've never sen the kind of errors you mention..  Try ANT! :)

       
    • Ati Rosselet

      Ati Rosselet - 2005-03-03

      /**
           * Select an appropriate character encoding to be used, based on the
           * characteristics of the current request and/or filter initialization
           * parameters.  If no character encoding should be set, return
           * <code>null</code>.
           * <p>
           * The default implementation unconditionally returns the value
      configured
           * by the <strong>encoding</strong> initialization parameter for this
           * filter.
           *
           * @param request The servlet request we are processing
           */
          protected String selectEncoding(ServletRequest request) {

              return (this.encoding);

          }

       
    • spiritsailor

      spiritsailor - 2005-03-04

      thx Ati Rosselet  it works fine now. you are so kind.
      the version in cvs have problems.I use the 1.3.0's source it compile  correctly.
      hope the cvs having the strong capability
      good luck

       
    • ponpo

      ponpo - 2005-03-05

      A multilingual input problem leaf must be successful with change (UTF-8) of a filter.
      However, it is bad whether the definition of WEB.XML is changed.

      public class RequestFilter extends com.tonbeller.wcf.controller.RequestFilter {

      public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
      throws IOException, ServletException {
      //only here
      req.setCharacterEncoding("utf-8");
      super.doFilter(req,res,chain);
      }
      }

       
      • Ati Rosselet

        Ati Rosselet - 2005-03-07

        I'm sorry.. I don't understand.  If you change the filter to read values (init0 from web.xml, then it will.  (see my previous post on changes to the filter class).  What is the problem?

         
        • ponpo

          ponpo - 2005-03-09

          I am sorry here.
          Although it has noticed after writing, countermeasures had appeared in
          https://sourceforge.net/forum/message.php?msg_id=3025484.

           
          • Ati Rosselet

            Ati Rosselet - 2005-03-10

            no problem.. I can't test in chinese or anything, so I'm glad someone can.  Any problems, or does the patch work for you properly for Chinese

             

Log in to post a comment.