Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-2009, 09:23 AM
New Member
 
Posts: 4
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 09:26 AM..
Reply With Quote
  #2 (permalink)  
Old 01-15-2009, 10:04 AM
Zimlet Guru & Moderator
 
Posts: 265
Default

Hi,

Could you please show us the code you use to print the values?
Reply With Quote
  #3 (permalink)  
Old 01-16-2009, 01:28 AM
New Member
 
Posts: 4
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>");
Reply With Quote
  #4 (permalink)  
Old 01-19-2009, 04:00 AM
Zimlet Guru & Moderator
 
Posts: 265
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.
Reply With Quote
  #5 (permalink)  
Old 01-20-2009, 08:53 AM
New Member
 
Posts: 4
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 ?
Reply With Quote
  #6 (permalink)  
Old 01-20-2009, 10:05 AM
Zimlet Guru & Moderator
 
Posts: 265
Default

Quote:
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.
Reply With Quote
  #7 (permalink)  
Old 01-30-2009, 07:08 AM
Active Member
 
Posts: 29
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?
Reply With Quote
  #8 (permalink)  
Old 02-06-2009, 02:12 AM
New Member
 
Posts: 4
Default

Posted this bug report - bug id 35147
I hope it would be helpful.
Reply With Quote
  #9 (permalink)  
Old 02-06-2009, 03:26 AM
Zimlet Guru & Moderator
 
Posts: 265
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.