PDA

View Full Version : Cerb as a searchable "External Knowledge Resource" to another app


todd999
09-28-2007, 11:48 PM
In cerb 4 it is cool to be able to Add External Knowledge Resource with a :
"Search Adapter URL"

However we really need to be able to do the reverse and use a URL string to search Cerb4 for any Tix from the email address in question...

for example I am in my Order Manager App and viewing an order from joe@shmo.com I want to click a button in the Order Manager app that will send a url to my browser such as:

mydomain.com/cerb4/search-email=joe@shmo.com

this will open my browser with a list of all tix from joe@shmo.com

perhaps even:

mydomain.com/cerb4/search-email-active=joe@shmo.com
for only active tix...

I was told a few months ago (on the phone) this would be part of v4 but can not find the syntax to trigger a search...

We are looking forward to a full featured v4 it look GREAT!

-Todd

jstanden
10-02-2007, 09:53 PM
Hey Todd!

I actually thought about this feature a while back so we could use one Cerb4 instance as an F&R resource for another (e.g., having an archive helpdesk).

It definitely makes sense to be able to do this for outbound integration as well. Currently we do something very similar with the ticket list RSS -- except we end up wish a hashed URL for security reasons.

I'd love to do an open-ended URL so info could be pulled out of the helpdesk procedurally (reverse F&R). We'd just need to come up with a way to lock this plug-in down so people can't just guess your URL and start reading customer ticket headers.

I've added this to the roadmap:
http://www.wgmdev.com/jira/browse/CHD-195

Thanks!

todd999
10-06-2007, 02:16 AM
this is not complex... IF you are not loged in it will just drop you on the login page.

If you are logged in you will see the ticket...

Just like a link to a ticket does in v3....

jstanden
10-07-2007, 06:58 AM
Hey Todd,

Yeah, that's exactly what the RSS links do already in Cerb4. ;)

I was simply talking about securing the data you're exposing with the link in your Reverse F&R.

Our RSS feeds just give the subject, with the feed content like "Customer reply for Jeff" (no actual e-mail content). The mask is exposed in the RSS content link (the same kind of direct link you're talking about).

You can imagine knowing a subject and mask is a compromise enough that somebody could call you up and do some social-engineering. Our RSS feeds don't expose e-mail addresses for this reason. They also randomize each feed URL so they aren't predictable.

I was just saying with the 'Reverse F&R' feature we'd need to do the same things, which also limit how useful the data returned by the search is. If all you needed was a direct link to a ticket and a subject, then that's easy to accommodate. However we'd still need to secure the URL by not standardizing it (making it not predictable) so people couldn't find your helpdesk URL and pull any info out of it (even subjects).

docweathers
10-24-2007, 11:11 PM
More crudly, we just wrote some SQL to access parts of the Cerberus 3.4 knowledge base from one of my outside programs. Until you get something fancier going, I would like to transfer this to 4. So, is the data structure for the knowlegebase in 4.0 the same as 3.4? If not how do they compare?

Thanks Larry

Hildy
10-26-2007, 02:39 PM
No, the data structure's not the same... In 4, you're gonna want to just check out the kb_article table. I think that should have everything you need.

todd999
10-28-2007, 08:25 PM
all we want is to be able to use a url such as:
mydomain.com/cerb4/search-email=joe@shmo.com

and if we are not logged in it will ONLY show the login screen... no other info at all...

many other sites do this...

no security issue at all...

if you want to see the data you must be logged in..

neenach2002
10-28-2007, 10:33 PM
As for locking it down, you could setup some sort of key that has to be passed via the query string (from the app to cerb). The user shouldn't ever see that URL so they shouldn't be able to detect the query string..

jstanden
11-03-2007, 04:46 AM
Hey Todd,

What you want to do is really simple.

In Cerb4 code you'd just make sure you have an active worker:

$active_worker = CerberusApplication::getActiveWorker();
if(empty($active_worker))
die("I'm not supposed to talk to strangers!");


Give me a bit to go through some other posts, and I can come back and write the code for you to do what you want using our API.

todd999
11-03-2007, 01:17 PM
that looks like it would solve the security issue... Thanks Jeff!

then all we would need is a "Search Adapter URL" syntax to trigger the search.

This would be HUGE for any non-php/mysql app to be able to trigger a lookup in cerb at the press of a button.

I know I have talked a lot of Stone Edge Customers into Cerb and this would be the missing link for all of us.

Thanks again for all the great work and the willingness to listen to users before the final launch.

-Todd

mfogg
02-25-2008, 08:51 PM
I added a task for this to the project portal so we have a record of the request and it can be evaluated:

http://wgmdev.com/jira/browse/CHD-536

acorley.awl
03-12-2008, 12:41 AM
This should be an easy fix of changing explicit _POST variables to be less restrictive _REQUEST variables.....

for example:

To enable URL Query Results for Searching Tickets, change the following code in the file plugins/cerberus.core/classes.php

Inside of function doQuickSearchAction()

@$type = DevblocksPlatform::importGPC($_POST['type'],'string');
@$query = DevblocksPlatform::importGPC($_POST['query'],'string');

to:

@$type = DevblocksPlatform::importGPC($_REQUEST['type'],'string');
@$query = DevblocksPlatform::importGPC($_REQUEST['query'],'string');


Now you may.....
http://cerberus.validurl.com/index.php?c=tickets&a=doQuickSearch&type=sender&query=email@address.com

etc... with all the different form options.

You should be able to apply this theory to all the other different searches...

Discuss amongst yourselves.

jstanden
03-13-2008, 11:00 AM
@acorley.awl

Nice work! That's easily the least number of moves possible to get that request working.

It'd be a little more work to have it produce RSS results, but not much more. The current Quick Search feature already loads up the active search using C4_AbstractViewLoader. You'd just need to iterate those results and build RSS output using Zend_Feed::importArray() [http://framework.zend.com/manual/en/zend.feed.importing.html] (http://framework.zend.com/manual/en/zend.feed.importing.html%5D).

You'd obviously want to ignore the HTML border/header/footer around the content from /cerb4/tickets/search (aka. c=tickets&a=search). We built pluggable controllers into Devblocks for that purpose (that's what the ?c= stands for in GET/POSTs, &a= is optionally action/method to handle the request, otherwise the controller gets to choose how to digest the rest of the URL in the response). There are several examples of controllers defined in cerberusweb.core (/cron, /update, /rss, etc.)

I'd have put this in /rss already, except it doesn't require authorization and that's likely something people would have an issue with allowing free-form searches.

The absolute best way to pull Cerb4 data into other apps (for mashups, fun or profit) would be the REST gateway. Unfortunately it's not very well undocumented, but that's what it's there for. Once you authenticate you can manipulate most objects in Cerb as XML or JSON (get, list, search, put, delete, create -- as well as parse, etc.)

todd999
08-23-2008, 08:16 PM
Any update on this?

was it added in one of the builds? IF so I missed it...

joegeck
08-26-2008, 02:45 AM
Any update on this?

was it added in one of the builds? IF so I missed it...

Not that I know, I don't think there's been an official implementation of either of the two requests mentioned, CHD-195 or CHD-536.

Maybe you should look into acorley.awl's suggestion for the time being. He also added his code to CHD-536 in the comments section, so I take it that will at least partially enable it:

Add a URL syntax for performing mail searches
http://wgmdev.com/jira/browse/CHD-536