OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Reason not to show archive info when no records harvested?

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.

Reason not to show archive info when no records harvested?

Postby sfkeller » Thu Oct 12, 2006 1:00 pm

When in browsing dialog, repositories without records aren't hyperlinked. This means that their record list and thus the archive info can't be seen either. Is there a reason for this?

-- Stefan

P.S. After some testing I found out that it's possible to look at the info nonetheless if you guess the internal archive id, like this (replace nnn with a number):
* http://yourdomain.org/harvester2/index. ... /index/nnn
* http://yourdomain.org/harvester2/index. ... veInfo/nnn
sfkeller
 
Posts: 11
Joined: Mon Oct 09, 2006 5:17 pm

Postby asmecher » Fri Oct 13, 2006 1:33 am

Hi Stefan,

This behavior is easy to change -- edit templates/browse/index.php and change the lines reading:
Code: Select all
        {if $archive->getRecordCount() != 0}
                 <li>» <a href="{url path=$archive->getArchiveId()}">{$archive->getTitle()|escape}</a> {translate key="browse.recordCount" count=$archive->getRecordCount()}</li>         {else}
                <li>» {$archive->getTitle()|escape} {translate key="browse.recordCount" count=$archive->getRecordCount()}</li>
        {/if}
...to:
Code: Select all
<li>» <a href="{url path=$archive->getArchiveId()}">{$archive->getTitle()|escape}</a> {translate key="browse.recordCount" count=$archive->getRecordCount()}</li>
Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Postby sfkeller » Sun Oct 15, 2006 10:55 am

Many thanks. I assume you mean index.tpl?

I'm still curious was this implementation was for or if one can change that in the next release?

-- Stefan

BTW. How do you wish to get contributed code? A diff to which e-mail? CVS?
sfkeller
 
Posts: 11
Joined: Mon Oct 09, 2006 5:17 pm

Postby asmecher » Mon Oct 16, 2006 1:47 am

Hi Stefan,

Yes, I meant index.tpl; I'll commit this change to CVS and it'll be included in the next release. If you'd like to contribute code, please submit it to pkp-support@sfu.ca as a unified diff, either against the last release or against the current CVS tree. What are you working on?

Regards,
Alec Smecher
Open Journal Systems Team
asmecher
 
Posts: 7717
Joined: Wed Aug 10, 2005 12:56 pm

Postby sfkeller » Mon Oct 16, 2006 7:04 am

For a start I'm trying to add this "Display hyperlink in record fields if 'http://' matches" as mentioned in another post.

I now see that's not so easy to start within this clever templating code. That's an idea of the function I'd like to inject before any field is displayed:

Code: Select all
// In: A plain text string
// Out: Same text string but with <a href/> inserted
// Remarks: Untested function.
function insert_hrefs_in_text ( $text ) {
  return preg_replace(
    array(
      "/[^\"'=]((http|ftp|https):\/\/[^\s\"']+)/i"
    ),
    array(
      "<a href=\"\\1\">\\1</a>"
    ),
    $text
  );
}


A bigger extension would be to link to web maps directly e.g. from search results, so "View Record" would have a link added called "Show or Locate Record on Map" if it's a geo-referenced record (dc:coverage).
sfkeller
 
Posts: 11
Joined: Mon Oct 09, 2006 5:17 pm

Option to add archive record but not show it

Postby mjordan » Mon Oct 16, 2006 1:00 pm

On the topic of showing archives in the harvester, another option we should consider is a "published" or similar attribute in the archive record that would allow admins to toggle inclusion on the browse page (and records in the search). "Off" would also exclude from cronned or other harvests. Might be useful if there is a problem with the archive, or if it needs to be removed temporarily for some reason.
mjordan
 
Posts: 21
Joined: Wed Mar 17, 2004 10:59 pm
Location: Vancouver, BC, Canada


Return to Open Harvester Systems Support and Development

Who is online

Users browsing this forum: Bing [Bot] and 2 guests