<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Thu May 23 22:44:49 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://www.couchbase.com/issues/si/jira.issueviews:issue-xml/SPY-57/SPY-57.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[SPY-57] view setKey and friends should be quoting/escaping Strings passed in</title>
                <link>http://www.couchbase.com/issues/browse/SPY-57</link>
                <project id="10047" key="SPY">Spymemcached Java Client</project>
                        <description>The current API forces the user to quote and encode the values that they&amp;#39;re passing as parameters to the view.  This should be simpler for the user, but it is not.&lt;br/&gt;
&lt;br/&gt;
For instance, if a user wanted the string asd&amp;quot;asd as their couch &amp;quot;key&amp;quot; start then they&amp;#39;d have to enter it &amp;quot;\&amp;quot;asd\&amp;quot;asd\&amp;quot;&amp;quot;, which is a big burden on the developer.</description>
                <environment></environment>
            <key id="15315">SPY-57</key>
            <summary>view setKey and friends should be quoting/escaping Strings passed in</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="4" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/minor.png">Minor</priority>
                    <status id="5" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/resolved.png">Resolved</status>
                    <resolution id="1">Fixed</resolution>
                    <security id="10011">Public</security>
                        <assignee username="mikew">Mike Wiederhold</assignee>
                                <reporter username="ingenthr">Matt Ingenthron</reporter>
                        <labels>
                    </labels>
                <created>Sat, 1 Oct 2011 12:25:07 -0500</created>
                <updated>Thu, 5 Apr 2012 12:34:40 -0500</updated>
                    <resolved>Wed, 14 Dec 2011 15:19:53 -0600</resolved>
                            <version>2.8.0-dp</version>
                <version>2.8.0-dp2</version>
                                                <component>library</component>
                                <votes>0</votes>
                        <watches>0</watches>
                                                    <comments>
                    <comment id="22330" author="mikew" created="Mon, 3 Oct 2011 12:28:25 -0500"  >This was filed incorrectly. On String arguments for query parameters I automatically add quotes.&lt;br/&gt;
&lt;br/&gt;
private String getArg(String key, Object value) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Special case&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (key.equals(STARTKEYDOCID)) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return key + &amp;quot;=&amp;quot; + value;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (value instanceof Boolean) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return key + &amp;quot;=&amp;quot; + ((Boolean) value).toString();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (value instanceof Integer) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return key + &amp;quot;=&amp;quot; + ((Integer) value).toString();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else if (value instanceof Stale) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return key + &amp;quot;=&amp;quot; + ((Stale) value).toString();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} else {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return key + &amp;quot;=\&amp;quot;&amp;quot; + value + &amp;quot;\&amp;quot;&amp;quot;;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&amp;nbsp;&amp;nbsp;}</comment>
                    <comment id="22331" author="ingenthr" created="Mon, 3 Oct 2011 12:54:18 -0500"  >This needs to url encode the string, not just quote it.  it will be an API change, but it&amp;#39;s the right thing to do.  We also need to document that we&amp;#39;re expecting the string to be in the platform&amp;#39;s default character encoding, just to match what is commonly done in the JDK[1].&lt;br/&gt;
&lt;br/&gt;
For example, someone could call setKey() with the following valid JSON:&lt;br/&gt;
[&amp;quot;val1&amp;quot;,&amp;quot;val2&amp;quot;]&lt;br/&gt;
And I think we just need to verify that we&amp;#39;re converting it to URL encoded before sending the HTTP GET to the sserver:&lt;br/&gt;
%5B%22val1%22%2C%22val2%22%5D&lt;br/&gt;
&lt;br/&gt;
The Java method call itself would look like: setKey(&amp;quot;[\&amp;quot;val1\&amp;quot;, \&amp;quot;val2\&amp;quot;]&amp;quot;);&lt;br/&gt;
&lt;br/&gt;
Or, more likely, they&amp;#39;re using a JSON library to generate the string that&amp;#39;s getting passed in to setKey().  In fact, our test should do that.&lt;br/&gt;
&lt;br/&gt;
I think this is the right behavior for setKey(String key) at the moment.  We may later want to add a setRawKey() or a setKey(String key, CouchbaseClient.encoding encoding), where that second param is some kind of encoding scheme we come up with if there&amp;#39;s not a good standard one to use.  That does bring up that we should probably have setKey() that takes a String and a Charset argument, since they may not supply UTF-8.&lt;br/&gt;
&lt;br/&gt;
[1]: &lt;a href=&quot;http://download.oracle.com/javase/6/docs/api/java/net/URLEncoder.html&quot;&gt;http://download.oracle.com/javase/6/docs/api/java/net/URLEncoder.html&lt;/a&gt;</comment>
                    <comment id="22341" author="mikew" created="Tue, 4 Oct 2011 18:19:09 -0500"  >Lowering priority because this isn&amp;#39;t the cause of a bug. It might be nice to add this in the future, but at the moment it is not a mandatory fix. Also, URLEncoder is deprecated so if this is fixed we should probably use something else for the encoding.</comment>
                    <comment id="23019" author="mikew" created="Wed, 14 Dec 2011 15:19:53 -0600"  >I&amp;#39;m going to close this issue because it appears that this is taken care of by the underlying http library.</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>9537</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10181" key="com.atlassian.jira.ext.charting:timeinstatus">
                <customfieldname>Time In Status</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                </customfields>
    </item>
</channel>
</rss>