Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling internally-originated sherlock: dispatches



Never mind...

Calling BS on self: yes, everything works as advertised. A missing
quote in my code tripped up the URL:
		'<a href=sherlock://com.MyCompany.Search?go_to_url=Testing">' +
should have been
		'<a href="sherlock://com.MyCompany.Search?go_to_url=Testing">' +

This made the resulting HTML look like:

<a href='sherlock://com.MyCompany.Search?go_to_url=Testing"'>Route
sherlock: URL</a>

Lesson learned: verify that what's written out to htmlData really is
what one thought:

debug(XMLQuery.source(DataStore.Get("Internet.DetailHTMLView.htmlData"))
);

Apologies for the red herring.

Jussi-Pekka

On Friday, December 6, 2002, at 12:54 AM, Jussi-Pekka Mantere wrote:

> On Thursday, December 5, 2002, at 09:00 PM, Riley Howard wrote:
>
>> On Thursday, December 5, 2002, at 06:00  PM, Steingrmmur Arnason
>> wrote:
>>
>>> 2. HTML links
>>>
>>> HTML links open in an external web browser but I really would like to
>>> grab the request and use it to update my channels contents.
>>>
>>> Is this possible?
>> Hmmm... well there's no *easy* way [I will file a feature request for
>> this]. Here's something you can try: rerouting the URLs in the HTML so
>> they pass through Sherlock. Here's how:
>>
>> 1. Before giving the HTMLView the HTML data, prefix the URLs with
>> "sherlock://your.channel.identifier?actualURL=_the_original_URL" (of
>> course, the original URL would have to be escaped).
>> 2. When the user clicks on one of these URLs, the URL will be routed
>> through Sherlock and sent to your channel.
>> 3. Your channel will have to accept the URL, and handle it. At this
>> point, you can look through the URL parameters, pick out the
>> "actualURL" parameter, and pass it along to the HTMLView, etc.
>>
>> Again, I haven't tried this, but it should work
>
> Doesn't seem to. The URL data store entry appears to be populated only
> from an externally generated URL dispatch (from a browser, ...)
>
> With the MyChannel template:
>
> <trigger path="URL.go_to_url" language="JavaScript"
> 	inputs="go_to_url=URL.go_to_url">
> 	debug("----- URL.go_to_url -----");
> 	debug(go_to_url);
> </trigger>
>
> <trigger path="Internet.didInstall" language="JavaScript">
> 	debug("----- Internet.didInstall -----");
>
> 	DataStore.Set("Internet.DetailHTMLView.htmlData",
> '&lt;html&gt;&lt;head&gt;' +
> 		'&lt;META HTTP-EQUIV="Content-Type" CONTENT="text/html;
> charset=utf-8"&gt;' +
> 		'&lt;/head&gt;&lt;body&gt;&lt;BR&gt;' +
> 		'&lt;a href=sherlock://com.MyCompany.Search?go_to_url=Testing"&gt;' +
> 		'Test sherlock: URL dispatch&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;');
> </trigger>
>
> Clicking on the URL will fire the trigger but no data is accessible.
> Opening the URL in a browser will both fire the trigger and show input
> contents.
>
> Jussi-Pekka
_______________________________________________
sherlock-channel-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/sherlock-channel-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.