Results 1 to 9 of 9

Thread: Strings with # or & symbols in zimlet properties

  1. #1
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    6

    Default Strings with # or & symbols in zimlet properties

    Hi guys ,

    I have came across a frustrating problem when working with the SaveInAlfresco zimlet.

    If a zimlet parameter value contains "#" or "&" sign , the parameter gets truncated at that point.
    Also all parameters after it simply "disappear" from the request.

    It seams that the properties are correctly stored in zimbra user database

    Code:
    #  zmprov ga user | grep "zimbraZimletUserProperties: com_starxpert_savealfresco"
    zimbraZimletUserProperties: com_starxpert_savealfresco:user:test12
    zimbraZimletUserProperties: com_starxpert_savealfresco:password:test#1234
    zimbraZimletUserProperties: com_starxpert_savealfresco:conv:true
    ....
    but when I print their values from within the zimlet I get :
    user : test12
    password : test
    conv: null

    Also when editing the zimlet properties in the web interface all values are displayed correctly.

    I am guessing that these symbols garble the ServletRequest data ...
    Unfortunately my java programming knowledge is not enough to solve this riddle
    Any clues you might have will come in handy.

    Regards,
    Last edited by dl_yo; 01-15-2009 at 08:26 AM.

  2. #2
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Hi,

    Could you please show us the code you use to print the values?

  3. #3
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    6

    Default

    I have hardcoded a valid alfresco username and password in order to make a valid session and print the values in the dialog window

    Code:
                    // Start the session
                    // AuthenticationUtils.startSession(user,password);
                    AuthenticationUtils.startSession("test1","test123#");
    
                    out.println("User: " + user + " End User <br>" );
                    out.println(" Pass: " + password + " aConv: " + aConv +"<br>" );
    
                    out.println( CHAINES[lang][CHOOSE_FOLDER] + "<br>");

  4. #4
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    I looked at the problem. It doesn't come from the jsp but from the xml :
    The jsp is opened in a dialog box with this url :
    Code:
    <actionUrl target="/service/zimlet/com_starxpert_savealfresco/saveAlfresco.jsp">
    				<param name="id">${obj.id}</param>
    				<param name="type">${obj.TYPE}</param>
    				<param name="servAl">${prop.servAl}</param>
    				<param name="user">${prop.user}</param>
    				<param name="password">${prop.password}</param>
    				<param name="pref">${prop.pref}</param>
    				<param name="conv">${prop.conv}</param>
    				<param name="from">${prop.from}</param>
    				<param name="to">${prop.to}</param>
    				<param name="cc">${prop.cc}</param>
    				<param name="bcc">${prop.bcc}</param>
    				<param name="date">${prop.date}</param>
    				<param name="subject">${prop.subject}</param>
    			</actionUrl>
    Infortunately, the params are not encoded when you use this method.
    So URL unsafe characters like # and & will give you problems.

    You should fill a bug in the bugzilla about it.

    The solution for now is to use another method to open the dialog box.
    You can do it by using a js file to handle the drag'n'drop that would create the url, encode all the parameters, and open the jsp in a dialog box.
    Then, modify the jsp file to decode the parameters you receive.

    I'll add this correction for the next version of the zimlet.

  5. #5
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    6

    Default

    Thank you for your help.

    At some point I also tried to encode / decode these parameters, but my knowledge of how zimbra and java work was not enough.

    Do you think I should file a bug report in Bugzilla Main Page ?

  6. #6
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Do you think I should file a bug report in Bugzilla Main Page ?
    Yes, of course.
    It is not normal that the params are not encoded.

  7. #7
    yyovkov Guest

    Default Error while reading 100 directories

    Hi tdesorbaix,

    We have problem with saveInAlfresco plugin while trying to save email into Alfresco Space where there are more than 100 subSpaces. While I am trying to browse the content of the Space, from all 110 subSpaces on the plugin window displays only one space name. Few days ago when the spaces where less than 100 there were no such spaces.

    Do you have any idea if there is any timeout or any other limitations for the plugin?

  8. #8
    Join Date
    Jan 2009
    Posts
    4
    Rep Power
    6

    Default

    Posted this bug report - bug id 35147
    I hope it would be helpful.

  9. #9
    Join Date
    Apr 2007
    Location
    Paris, France
    Posts
    367
    Rep Power
    8

    Default

    Quote Originally Posted by yyovkov View Post
    Hi tdesorbaix,

    We have problem with saveInAlfresco plugin while trying to save email into Alfresco Space where there are more than 100 subSpaces. While I am trying to browse the content of the Space, from all 110 subSpaces on the plugin window displays only one space name. Few days ago when the spaces where less than 100 there were no such spaces.

    Do you have any idea if there is any timeout or any other limitations for the plugin?
    I'm not aware of any limitations with the search of alfresco webservice.
    If you delete some subspaces in alfresco, can you see again your subspaces in the plugin?

Similar Threads

  1. Replies: 21
    Last Post: 02-04-2010, 09:06 AM
  2. Outlook 2007 Beta error
    By bersrker in forum Zimbra Connector for Outlook
    Replies: 13
    Last Post: 07-17-2008, 07:38 AM
  3. Replies: 5
    Last Post: 01-11-2008, 04:34 AM
  4. Replies: 6
    Last Post: 08-21-2007, 09:51 PM
  5. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •