OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



add new setspec

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

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, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

add new setspec

Postby cristianviza » Tue May 27, 2014 4:11 am

hello everybody.
Today my problem is add new setspec (snrd) in listRecord, I add code in /lib/pkp/classes/oai/OAI.inc.php in function ListRecords:
the xml output is, it seems correct, I think:

Code: Select all
<ListRecords>
      <record>
         <header>
            <identifier>oai:ojs.osiris.intranet.unl:article/996</identifier>
            <datestamp>2013-12-18T15:03:06Z</datestamp>
            <setSpec>AulaUniversitaria:ART</setSpec>
            <setSpec>snrd</setSpec>
         </header>
         <metadata>
<oai_dc:dc
.....................   
</oai_dc:dc>
         </metadata>
      </record>
      <record>


but when I execute :
..../index.php/AulaUniversitaria/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&set=snrd
return error:
Error Code noRecordsMatch
No matching records in this repository

how do I add a new set? A collector calls me I have to have set "SNRD" (http://repositorios.mincyt.gob.ar/)

Regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: add new setspec

Postby asmecher » Tue May 27, 2014 7:39 am

Hi Cristian,

Currently OJS provides a set for each journal section. Can you describe at a higher level what you want to do -- e.g. what kinds of articles will be included in the set? There are other functions you'll need to modify in order to accomplish this.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: add new setspec

Postby cristianviza » Tue May 27, 2014 11:06 am

Hello asmecher. well I explain because I need add this setEspec.
My organization is associated the mincyt.gob.ar/ associating a group of repositories of Argentina Republic, they have a collector calling the first validation set is that it has SNRD. image of a Flowchart of the validation as does the collector :
http://subefotos.com/ver/?e0177ceb3354f64ef2018fdeb1fedf65o.png#codigos.
pdf of full policy with all its requirements is very long in particular cut out a page of that pdf in which I explain what the set SNRD:
http://subefotos.com/ver/?0f09d7a7d1305a567158aaeb4a63d6eeo.png#codigos

Well, I explained this problem that I step in the implementation, when I add setSpec "snrd" -> Error.
suppose for example that I add in file /classes/oai/ojs/OAIDAO.inc.php:
Code: Select all
// FIXME Set descriptions
      $sets = array();
      foreach ($journals as $journal) {
         $title = $journal->getLocalizedTitle();
         $abbrev = $journal->getPath();
         array_push($sets, new OAISet(urlencode($abbrev), $title, ''));
         $sections =& $this->sectionDao->getJournalSections($journal->getId());
         foreach ($sections->toArray() as $section) {
array_push($sets, new OAISet(urlencode($abbrev) . ':' . urlencode($section->getLocalizedAbbrev()), $section->getLocalizedTitle(), ''));
         }
      }
array_push($sets, new OAISet(urlencode("snrd"), "Sistema Nacional de Repositorios", ''));

      if ($offset != 0) {
         $sets = array_slice($sets, $offset);
      }

in function &getJournalSets($journalId, $offset, &$total)
the output I get when running :
..../ojs/index.php/index/oai?verb=ListSets
is this http://subefotos.com/ver/?3f15c55c827621d9533083c780aeac97o.png#codigos

I would like I to click on Identifiers (index/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&set=snrd) or Records (index/oai?verb=ListRecords&metadataPrefix=oai_dc&set=snrd) return a list as when I do for example in FAVEAgrarias:ART (/index/oai?verb=ListIdentifiers&metadataPrefix=oai_dc&set=FAVEAgrarias:ART) I returns a list of all journals with <setSpec>FAVEAgrarias:ART</setSpec>
I want add set "snrd" for all kinds of articles and all journals in ojs.

I would like to try to understand a little of how oai like working with and be able to work alone after, I hope my explanation be clear.

regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: add new setspec

Postby asmecher » Thu May 29, 2014 8:07 am

Hi Cristian,

You'll have to change a number of functions to add this...

Currently, sets are used to identify sections within a journal. To add an additional set that doesn't behave this way, have a look at classes/oai/ojs/JournalOAI.inc.php (the "records" and "identifiers" functions, the "sets" function; and in classes/oai/ojs/OAIDAO.inc.php and lib/pkp/classes/oai/PKPOAIDAO.inc.php where the database queries are implemented).

There are plugins that modifies the set behavior of OJS which might also be useful: see plugins/generic/driver and plugins/generic/openAIRE.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: add new setspec

Postby cristianviza » Mon Jun 02, 2014 4:35 am

Hello Asmecher
I using ojs 2.3.7 and first try OpenAIRE (seem to have a prblem with translations) http://fotos.subefotos.com/96099fb65bdc ... 080eao.png
but i dom't see set EC_fundedresources could be that this version has problems as said in this topic? viewtopic.php?f=3&t=8683
where I could download the latest version and install it manually?

driver could not find it in my version of ojs

Regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: add new setspec

Postby asmecher » Tue Jun 03, 2014 11:11 am

Hi Cristian,

If it's possible to upgrade, I'd suggest doing that first. OJS 2.3.7 is pretty old.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: add new setspec

Postby cristianviza » Mon Jun 09, 2014 7:18 am

Hello Asmecher.

I'm still here with the problem, I was cheking during these day to OpenAire and Driver Plugins both in ojs 2.4.4-1 version (remember my ojs 2.3.7 has no driver), and they add a set but not in the desired location.
they add the set within a particular journal;for example when I execute
XXXXXXXXXX=name journal
http://osiris.intranet.unl/ojs-2.4.4-1/index.php/XXXXXXXXXX/oai?verb=ListSets
but not when I execute
http://osiris.intranet.unl/ojs-2.4.4-1/index.php/index/oai?verb=ListSets

In my ojs 2.3.7 version I review files OAI.inc.php, OAIStruct.inc.php, AOAUtils.inc.php in /lib/pkp/classes/oai/
and
JournalOAI.inc.php, OAIDAO.inc.php in classes/oai/ojs/
(lib/pkp/classes/oai/PKPOAIDAO.inc.php: not present in this version)

The problem is assigned ojs sets the journal for his patch name
(example: ),and I can not change that (OpenAire and Driver do but within a particular journal set), and it is fine, but I need see new set in the index.
I look function &records,function &identifiers, function &sets in classes/oai/ojs/JournalOAI.inc.php
(apparently are modified by reference), as you recommended me and try modify these fuctions to show the new set in the index, I should modify lib/pkp/classes/oai/OAIDAO.inc.php or should I keep trying from JournalOAI.inc.php? :/ .
Is difficult to insert a new set
Thanks very much for answering my queries asmecher :)

Regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina

Re: add new setspec

Postby asmecher » Mon Jun 09, 2014 8:25 am

Hi Cristian,

I'm not sure if I'm following, but it sounds like the problem is that you want to modify the set list without being in the context of a single journal? No plugins have done this yet, but OTOH it should be possible; the $journalId will be null in the hook in this case. I'd suggest using debug outputs to track whether your code is being executed or not; then, once you're sure your plugin code is being called properly, start working with the reference objects to add your new set.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8869
Joined: Wed Aug 10, 2005 12:56 pm

Re: add new setspec

Postby cristianviza » Tue Jun 24, 2014 9:28 am

Hello community:
I cant slove add set in the "index page" :) .
For a new version of ojs: one could implement an option that makes easy to add a new set in the index?

Regards Cristian
cristianviza
 
Posts: 75
Joined: Tue Nov 06, 2012 10:22 am
Location: Argentina


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest