Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 58
Registered: ‎02-13-2009
My Device: Not Specified
Accepted Solution

Register your webworks application as a search provider

Hi,

 

My webworks app is corporate employee search & discover application tapping into LDAP. The app is almost 100% built. I would like to utilize the amazing type and go functionality of BlackBerry 10 especially using a Q10 device. To accomplish this I have been trying to register my app as a search provider so that all the user has to do is to simply start typing the name of the person and my application should appear as one of the apps in the Extend Search area so the user can click on my app icon from there and provide an entry into my app for further search apart from traditional way of launching the app and then do a search.

 

I have read the documentation and have followed the steps to enable this. The stripped out parts of my application so as to focus on the problem are as follows:

 

config.xml changes:

 

Add the following to register my app as a target from search

 

<invoke-targetid="com.xxx.yyy.search">

<invoke-target-type>APPLICATION</invoke-target-type>

<filter>

<action>bb.action.SEARCH.EXTENDED</action>

<mime-type>application/vnd.bb.search.criteria</mime-type>

</filter>

</invoke-target>

 

Add the following feature id

 

<featureid="blackberry.invoked"/>

 

 

In the index.html (starting point of my app) add the following in the webworksready event

 

document.addEventListener('webworksready', function(e) {

if (webworksreadyFired) {

return;

} else {

webworksreadyFired = true;

}

 

blackberry.event.addEventListener("invoked", function (invocationInfo){

        if (invocationInfo.target) {

           //currently commented out

        }

        if (invocationInfo.type) {

             //currently commented out

        }

        if (invocationInfo.action) {

            //currently commented out

        }

        if (invocationInfo.data) {

            //currently commented out

        }

        });

}, false);

 

 Now when I try this out after signing my app and deploying on the Q10, I tried to search "Bob" for example and my application does not appear under the Extend Search as per the documentation.

 

Is there anything I am missing out here. Can anyone please advise. I would treat this as a one of the most important feature displaying the power of BlackBerry 10 that would be a distinguisher and set it apart from other platforms and I would very much like to incorporate this into my corporate app.

 

Thanks & Regards.

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Register your webworks application as a search provider

Hello,

 

Tim Windsor published a sample that demonstrates how to integrate your app with Extended Search:

https://github.com/blackberry/BB10-WebWorks-Community-Samples/tree/master/Extended%20Search

 

Is this the documentation you refered to?  Does it work as designed on your Q10?

 

Cheers,

Adam

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Developer
Posts: 1,280
Registered: ‎03-03-2011
My Device: Playbook, Z10, Q10, Z30 with Files & Folders and Orbit of course

Re: Register your webworks application as a search provider

And here's the blog post explaining it:

 

http://devblog.blackberry.com/2013/06/extended-search-integration-in-webworks/

Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands
Developer
Posts: 58
Registered: ‎02-13-2009
My Device: Not Specified

Re: Register your webworks application as a search provider

Thanks Adam I did not see this sample for webworks but saw it for cascades. But the idea is the same. I will try out this sample and will provide the feedback. If this sample works then I will try to hunt down what's wrong in my code. Thanks for your timely suggestion. This greatly helps.!!

Developer
Posts: 58
Registered: ‎02-13-2009
My Device: Not Specified

Re: Register your webworks application as a search provider

Thanks for your help. I made a change below and it worked but I am puzzled why it needs this.

 

All I did was made some changes in the config.xml

 

To this 

 

<featureid="blackberry.invoked" version="1.0.0" required="true"/>

<featureid="blackberry.invoke" version="1.0.0" required="true"/>

 

From this (non-working)

 

<featureid="blackberry.invoked">

<featureid="blackberry.invoke">

 

Can anyone explain why this is needed and the significance of required?

 

BlackBerry Development Advisor
Posts: 834
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Register your webworks application as a search provider

The required parameter should make the build fail if the feature is not present, but shouldn't otherwise impact this. Could there have been a typo or something in the name?

 

The other thing I'd note is that you need to wait until the webworksready event before you set up the listener for the  invoke event.

Tim Windsor
Open Source Technical Lead
Developer
Posts: 58
Registered: ‎02-13-2009
My Device: Not Specified

Re: Register your webworks application as a search provider

Thanks for your response. The only change I did is as explained above. You can very easily test it.
BlackBerry Development Advisor
Posts: 834
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Register your webworks application as a search provider

I just tried it and it worked without the "required" bit. However, did you use closing brackets on your features, or leave it open like in your example above? That would cause a problem.

 

This is what I used: 

<feature id="blackberry.invoked" />
<feature id="blackberry.invoke" />

 

but your's appears to be:

<feature id="blackberry.invoked">
<feature id="blackberry.invoke">

 

Those would require a closing tag as well like so (or using the shorthand that I did):

<feature id="blackberry.invoked"></feature>
<feature id="blackberry.invoke"></feature>

Tim Windsor
Open Source Technical Lead
Developer
Posts: 58
Registered: ‎02-13-2009
My Device: Not Specified

Re: Register your webworks application as a search provider

Thanks Tim, this helps..I did not notice that and it was my silly mistake. Sorry for that.

However one interesting point, I was wondering why the build succeeded and I am sure it does some validation checking and not sure why it did not catch this.

End result: The build succeeded and installed fine on the device but the feature did not work.
BlackBerry Development Advisor
Posts: 834
Registered: ‎07-15-2008
My Device: Passport
My Carrier: Bell

Re: Register your webworks application as a search provider

Yeah it is strange. It seems like it must be hiding the error, or the DTD evaluation of the file is not happening properly. Glad that you've got it working now.

Tim Windsor
Open Source Technical Lead