OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Display archive name along with each match

Open Harvester Systems support questions and answers, bug reports, and development issues.

Moderators: jmacgreg, michael, John

Forum rules
Developer Resources:

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome.

Display archive name along with each match

Postby wallyg » Fri Feb 23, 2007 9:11 am

A simple answer (I hope) but I haven't been able to figure it out. I would like to list the repository/archive/source name along with each matching record that's displayed in the "results" set after a search. Out-of-the-box it shows <title><creator><date> and the view record/view original option. I'd like to add a line to show which harvesting provider the record came from.

What file should I be looking in to make this sort of modification?

-wally / fairfax, va
wallyg
 
Posts: 2
Joined: Fri Feb 23, 2007 9:04 am

Postby asmecher » Fri Feb 23, 2007 2:13 pm

Hi wallyg,

The template in question depends on the metadata format you're talking about; if you're talking about records from a Dublin Core source, you'll need to modify plugins/schemas/dc/summary.tpl. You can get the archive object from the record object using the $record->getArchive() function call -- but be warned that you may need to look into caching or a little bit of code optimization, because that function call introduces an additional query per result displayed.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8833
Joined: Wed Aug 10, 2005 12:56 pm

Display provider name in results list

Postby wallyg » Fri Feb 23, 2007 2:26 pm

Yes, I'm talking Dublin Core.

So you're saying at the point where the results screen is being drawn, the record object doesn't contain the name of the archive object (or to be more precise, the "display name" of the archive) so I can't just add a bit of code to display it. I have to do a query to get that info so I'll be introducing a performance hit?

I think I get what you're telling me and thanks for the quick response. PKP Harvester's a great piece of software, btw.

-- wally
wallyg
 
Posts: 2
Joined: Fri Feb 23, 2007 9:04 am

Postby asmecher » Fri Feb 23, 2007 2:38 pm

Hi Wally,

Yes, you're correct; the Archive object (containing the archive title) is not available to the template that's displaying the results. It's undoubtedly been fetched in the process of getting search results -- briefly turning on debugging in config.inc.php would verify that, query-by-query -- but for the moment you'll need to do a little hacking to expose it to the template if you don't want to incur the additional queries.

Regards,
Alec Smecher
Public Knowledge Project Team
---
Don't miss the First International PKP Scholarly Publishing Conference
July 11 - 13, 2007, Vancouver, BC, Canada
http://ocs.sfu.ca/pkp2007/
asmecher
 
Posts: 8833
Joined: Wed Aug 10, 2005 12:56 pm


Return to Open Harvester Systems Support and Development

Who is online

Users browsing this forum: No registered users and 1 guest