Prateek Kaul

 

The process for registering a protocol handler has changed from WDS 2.x to 3.x

 

For WDS 2.x we used the following process:

    This was a two step process:

  1. A protocol handler must be added via the ISearchManager AddProtocol method, as follows:

    ISearchManager->AddProtocol(LPCOLESTR pszProtocolName, LPCOLESTR pszProgId);

    This would show allow WDS to pick our plug-in DLL mapped to the pszProgId
    .

  2. Call ISearchCrawlScopeManager interface to set default crawling rules to include and exclude particular URLs and child URLsThe method is as follows:

    ISearchCrawlScopeManager->AddDefaultUrl(LPCWSTR pszUrl, BOOL fInclude);

    This would make our location available as a checkbox in the WDS Search Options.

 

For WDS 3.x it seems to have changed to as follows:

  1. ISearchManager->GetCatalog(í░systemí▒) to get a ISearchCatalogManager.
  2. ISearchCatalogManager->GetCrawlScopeManager() to get a ISearchCrawlscopeManager
  3.  ISearchCrawlscopeManager->AddDefaultScopeRule()
    This seems to be same as what was in 2.x as,
    ISearchCrawlscopeManager->AddDefaultURL()


Now the question I have is, how do I call an equivalent of the ISearchManager->AddProtocol()

(WDS 2.x, Step 1), which will allow WDS 3.0 to pick by plug-in DLL

 

ISearchManager does not have the AddProtocol method and all other documented interfaces for WDS 3.0 at

http://msdn2.microsoft.com/en-gb/library/aa936319.aspx do not seem to have an equivalent method of AddProtocol

for registering my Protocol Handler.

 

Any pointers




Re: Windows Desktop Search Development WDS 3.0 Protocol Handler Registration (How to do?)

Martin Koppmann

I asked the same question in the thread below - no answers.

But have a look at my code. It executes but the PH does no startcrawling.
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=921915&SiteID=1

Maybe we have to wait for the the new SDK.

Martin





Re: Windows Desktop Search Development WDS 3.0 Protocol Handler Registration (How to do?)

Mahesh Immanni

Hi Prateek,

you can use the

ISearchCrawlscopeManager->AddRoot() for the Dummy URL representing the root of all the URLs for your protocol for eg.

let your protocol be "myprotocol"

then your root URL will become "myprotocol:\\{SID}\"

After you do ISearchCrawlscopeManager->AddRoot() for the above url do ISearchCrawlscopeManager->AddHierarchicalScope() for the same url.

hope this does what you were looking for in WDS 3.x

Regards

Mahesh





Re: Windows Desktop Search Development WDS 3.0 Protocol Handler Registration (How to do?)

Martin Koppmann

Hello Mahesh,

Thanks for replying to this old thread! These days I resumed my PH project and first created fully working namespace extension (IShellFolder, IPropertyStore, Icon). Now I am trying to register my PH properly, but I am getting EventID 3036 (The specified address was excluded from the index. The site path rules may have to be modified to include this address. (0x80040d07))

My root URL is "webresearch://{SID}/" and I want that everything gets indexed below this URL without messing around with indexing options. Do you think this is the right way

ISearchRoot->put_RootURL(pszURL);

ISearchCrawlScopeManager->AddRoot(ISearchRoot)

ISearchCrawlScopeManager->AddHierarchicalScope(pszURL, TRUE, TRUE, FALSE);

ISearchCrawlScopeManager->SaveAll()

I do not understand the meaning of the third parameter fDefault in AddHierarchicalScope

You are writing back-slashes (\) in the URL. Is there any problem using slashes (/)

Thank you

Martin





Re: Windows Desktop Search Development WDS 3.0 Protocol Handler Registration (How to do?)

Mahesh Immanni

Hi Martin,

It was my mistake .... i intended to mention "/" instead of "\".

As for the third param of AddHierarchicalScope I am also not very clear about that but what I can tell you is I have used

pszULR = L"myprotocol://{s-1-5-21-333653013-2304839960-3876203932-35955}/"

ISearchRoot->put_RootURL(pszURL);

ISearchCrawlScopeManager->AddRoot(ISearchRoot)

ISearchCrawlScopeManager->AddHierarchicalScope(pszURL, TRUE, FALSE, TRUE);

ISearchCrawlScopeManager->SaveAll()

where {s-1-5-21-333653013-2304839960-3876203932-35955} is SID for my current logged in user.

which seemed to work well.

What I do is add a root representing my root url which will appear in the selection pane of the indexing options dialog and then set the options indicating that This url is included for indexing and all the child rules are overridden.

I would like to mention here that adding of this root is done through a seperate monitor application which runs in current user context.

mind that the SID should be valid and should be enclosed in "{}" and the root URL should be terminated by "/" ie URL should be of the form

<protocol name>://<{SID}>/<item identifier>

Can you tell me at what point / function call are you getting the error that you have mentioned.

You can also varify if you get a call to your PH or not. (ie

ISearchProtocol::Init and then

ISearchProtocol::CreateAccessor )

Regards

Mahesh





Re: Windows Desktop Search Development WDS 3.0 Protocol Handler Registration (How to do?)

Martin Koppmann

Mahesh,

Im usings a SID in my URL, too.

I changed the parameters for AddHierarchicalScope like you.

ISearchProtocol::Init is called but no ISearchProtocol::CreateAccessor is called so far.

My s problem is that WDS behaves very strange when it starts indexing a new URL Items.

Its related to this:

http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2119365&SiteID=1

I need to do more tests and reset WDS.

Martin