[Building Sakai] EntityBroker. Spaces in custom action entity ids

Aaron Zeckoski azeckoski at unicon.net
Mon Aug 2 10:57:28 PDT 2010


I would say most devs would consider spaces and special chars in IDs
to be a bad practice so I would recommend you investigate how this
situation came to be in your local installation and try to fix it
there.

For now I would guess you can try changing TemplateParseUtil and the
various VALID_*_CHARS sets to include spaces. I have a feeling that
might not work because of other places where spaces are used in
parsing the URLs but it's worth a shot.

-AZ


On Mon, Aug 2, 2010 at 1:40 PM, Adrian Fish <a.fish at lancaster.ac.uk> wrote:
> Okay, that means that the entire site provider will not work against any
> sites with spaces in their ids. This effectively screws up all of my code
> under our deployment as we have hundreds of sites with spaced site ids.
>
> Is there a workaround? Can I patch this locally so that spaces are allowed?
>
> Cheers,
>
> Adrian.
>
> Aaron Zeckoski wrote:
>>
>> I understand that. However, EB does not allow spaces in IDs (currently).
>> -AZ
>>
>>
>> On Mon, Aug 2, 2010 at 1:26 PM, Adrian Fish <a.fish at lancaster.ac.uk>
>> wrote:
>>
>>>
>>> But spaces are allowed in site ids and site ids can be entity ids. Using
>>> the
>>> sites tool you can specify a site id with spaces in it.
>>>
>>> Adrian.
>>>
>>> Aaron Zeckoski wrote:
>>>
>>>>
>>>> OK, then the issue is that it expects IDs to conform to the limits I
>>>> sent earlier as far as characters. Spaces are not allowed as part of
>>>> an ID.
>>>>
>>>> -AZ
>>>>
>>>>
>>>> On Mon, Aug 2, 2010 at 12:56 PM, Adrian Fish <a.fish at lancaster.ac.uk>
>>>> wrote:
>>>>
>>>>
>>>>>
>>>>> It does. I tested that :)
>>>>>
>>>>> Aaron Zeckoski wrote:
>>>>>
>>>>>
>>>>>>
>>>>>> I am assuming it works fine for ones without spaces?
>>>>>> -AZ
>>>>>>
>>>>>>
>>>>>> On Mon, Aug 2, 2010 at 12:48 PM, Adrian Fish <a.fish at lancaster.ac.uk>
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>
>>>>>>> Hi Aaron,
>>>>>>>
>>>>>>> I'm using 1.3.9 plus the !site.helper patch to the userPerms action
>>>>>>> in
>>>>>>> the
>>>>>>> site provider.
>>>>>>>
>>>>>>> Hitting a url like this:
>>>>>>> http://btc224000006.lancs.ac.uk/direct/site/a%20b%20c/pages.json ...
>>>>>>>
>>>>>>> ... yields this in the logs:
>>>>>>>
>>>>>>> INFO Could not process entity: /site (400)[null]: Cannot execute
>>>>>>> custom
>>>>>>> action (pages) for request method GET, The custom action view key
>>>>>>> (show)
>>>>>>> must match the request view key (list)
>>>>>>>
>>>>>>> Adrian.
>>>>>>>
>>>>>>> Aaron Zeckoski wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>> An ID with a space in it? I am guessing the system is seeing it as a
>>>>>>>> divider of some kind. IDs are pretty limited and the parser will
>>>>>>>> expect them to only contain the following chars
>>>>>>>> (A-Za-z0-9()+*.-_=,:;!~@%). You might try encoding the space as %20.
>>>>>>>>
>>>>>>>> Can you paste in the message from the logs? It should have more
>>>>>>>> information (I hope). Also, what version of EB?
>>>>>>>> -AZ
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Aug 2, 2010 at 12:30 PM, Adrian Fish
>>>>>>>> <a.fish at lancaster.ac.uk>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>>
>>>>>>>>> Hi All,
>>>>>>>>>
>>>>>>>>> Has anybody encountered this with entity broker before? If you pass
>>>>>>>>> a
>>>>>>>>> site
>>>>>>>>> id with spaces to any of the site entity custom actions you get
>>>>>>>>> this
>>>>>>>>> returned:
>>>>>>>>>
>>>>>>>>> Could not process entity: /site (400)[null]: Cannot execute custom
>>>>>>>>> action
>>>>>>>>> (pages) for request method GET, The custom action view key (show)
>>>>>>>>> must
>>>>>>>>> match
>>>>>>>>> the request view key (list)
>>>>>>>>>
>>>>>>>>> How can I fix this? It's urgent, so if somebody can point me to the
>>>>>>>>> right
>>>>>>>>> place in the code and I'll sort it.
>>>>>>>>>
>>>>>>>>> Cheers,
>>>>>>>>>
>>>>>>>>> Adrian.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> ==================================
>>>>>>>>> Adrian Fish
>>>>>>>>> Software Engineer
>>>>>>>>> Centre for e-Science
>>>>>>>>> Bowland Tower South C Floor
>>>>>>>>> Lancaster University
>>>>>>>>> Lancaster
>>>>>>>>> LA1 4YW
>>>>>>>>> email: a.fish at lancaster.ac.uk
>>>>>>>>>
>>>>>>>>> http://confluence.sakaiproject.org/display/YAFT/Yaft
>>>>>>>>> http://confluence.sakaiproject.org/display/CLOG/Home
>>>>>>>>> http://confluence.sakaiproject.org/display/BBB/Home
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> sakai-dev mailing list
>>>>>>>>> sakai-dev at collab.sakaiproject.org
>>>>>>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>>>>>>>
>>>>>>>>> TO UNSUBSCRIBE: send email to
>>>>>>>>> sakai-dev-unsubscribe at collab.sakaiproject.org
>>>>>>>>> with a subject of "unsubscribe"
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> ==================================
>>>>>>> Adrian Fish
>>>>>>> Software Engineer
>>>>>>> Centre for e-Science
>>>>>>> Bowland Tower South C Floor
>>>>>>> Lancaster University
>>>>>>> Lancaster
>>>>>>> LA1 4YW
>>>>>>> email: a.fish at lancaster.ac.uk
>>>>>>>
>>>>>>> http://confluence.sakaiproject.org/display/YAFT/Yaft
>>>>>>> http://confluence.sakaiproject.org/display/CLOG/Home
>>>>>>> http://confluence.sakaiproject.org/display/BBB/Home
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> ==================================
>>>>> Adrian Fish
>>>>> Software Engineer
>>>>> Centre for e-Science
>>>>> Bowland Tower South C Floor
>>>>> Lancaster University
>>>>> Lancaster
>>>>> LA1 4YW
>>>>> email: a.fish at lancaster.ac.uk
>>>>>
>>>>> http://confluence.sakaiproject.org/display/YAFT/Yaft
>>>>> http://confluence.sakaiproject.org/display/CLOG/Home
>>>>> http://confluence.sakaiproject.org/display/BBB/Home
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>> --
>>> ==================================
>>> Adrian Fish
>>> Software Engineer
>>> Centre for e-Science
>>> Bowland Tower South C Floor
>>> Lancaster University
>>> Lancaster
>>> LA1 4YW
>>> email: a.fish at lancaster.ac.uk
>>>
>>> http://confluence.sakaiproject.org/display/YAFT/Yaft
>>> http://confluence.sakaiproject.org/display/CLOG/Home
>>> http://confluence.sakaiproject.org/display/BBB/Home
>>>
>>>
>>>
>>
>>
>>
>>
>
> --
> ==================================
> Adrian Fish
> Software Engineer
> Centre for e-Science
> Bowland Tower South C Floor
> Lancaster University
> Lancaster
> LA1 4YW
> email: a.fish at lancaster.ac.uk
>
> http://confluence.sakaiproject.org/display/YAFT/Yaft
> http://confluence.sakaiproject.org/display/CLOG/Home
> http://confluence.sakaiproject.org/display/BBB/Home
>
>



-- 
Aaron Zeckoski - Software Engineer - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list