OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Creating new tables in the database

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.

Creating new tables in the database

Postby mike » Tue Oct 31, 2006 3:19 pm

Hi, I recently started working on a journal application plugin for the OJS. I am not very familiar with the OJS system so I was wondering if there is any plugin that adds custom tables to the database and such. That would be a great reference to what I am working on. thx
mike
 
Posts: 7
Joined: Thu Oct 26, 2006 2:35 pm

Postby asmecher » Wed Nov 01, 2006 5:52 am

Hi Mike,

As always, we're refining our plugin structure, so things might change a little with future releases; however, you can currently add database tables for plugins using the schema XML descriptors. The thesis plugin currently does this; look at it for an example.

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

Postby mike » Thu Nov 02, 2006 8:24 am

thank you, it is indeed a very good example.

got one more question, currently is there a way to make certain plugin available to admin only? or does it have to be a per journal based?
mike
 
Posts: 7
Joined: Thu Oct 26, 2006 2:35 pm

Postby asmecher » Fri Nov 03, 2006 1:50 am

Hi Mike,

See the Plugin::isSitePlugin() function. While plugins are only available through the Journal Manager's interface, this will make sure that the Journal Manager is also a site administrator -- effectively the same thing. Note that you can also use template hooks to add administration links to e.g. the Site Administrator's home.

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

Postby mike » Fri Nov 17, 2006 9:07 am

I am having some trouble with the hook callback functions.

A simple example would be I display a headerlink with a hook for one plugin, and another plugin that adds another link will not show up.

I read the technical reference that I should return false for the call back function. That is what i am doing :? , some insights would be appreciated.
mike
 
Posts: 7
Joined: Thu Oct 26, 2006 2:35 pm

Hook callbacks

Postby ramon » Mon Nov 27, 2006 11:59 am

Mike,

Be ware when adding links to Navigation and Menu bar.
The Thesis Plugin had a bug, which prevented any other plugin to add further links.

The variable $output in the following functions has to concatenate with the previous values sent ($output .= '<li><a href="http://pkp.sfu.ca">Example Plugin</a></li>';) or else, no other plugin will be able to add links anywhere.


Code: Select all
function displayHeaderLink($hookName, $params) {
      if($this->getEnabled()){
         $smarty =& $params[1];
         $output =& $params[2];
         $output .= '<li><a href="http://pkp.sfu.ca">Example Plugin</a></li>';   
      }   
      return false;
   }
   function displayManagerLink($hookName, $params) {
      if($this->getEnabled()){
         $smarty =& $params[1];
         $output =& $params[2];
         $output .= '<li>» <a href="http://pkp.sfu.ca">Example Plugin</a></li>';   
      }   
      return false;
   }
ramon
 
Posts: 926
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Postby mike » Tue Nov 28, 2006 7:38 am

lol, thx a million, got it working now :lol:
mike
 
Posts: 7
Joined: Thu Oct 26, 2006 2:35 pm


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest