OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



About Dynamic Galleys

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

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

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

About Dynamic Galleys

Postby damnpoet » Tue Mar 02, 2010 8:29 pm

Hi there,

I'm trying to display some dynamic galleys on OJS, but nothing happens. This is the code I'm using:

I made this on my plugin.inc.php file:

Code: Select all
<?
$this->import('ArticleDynamicGalleyDAO');
$dynamicGalleyDao = new ArticleDynamicGalleyDAO();
DAORegistry::registerDAO('ArticleDynamicGalleyDAO', $dynamicGalleyDao);
HookRegistry::register('ArticleGalleyDAO::getArticleGalleys', array(&$dynamicGalleyDao, 'appendDynamicGalleys') );
?>


and then on my ArticleDynamicGalleyDao.inc.php file, i wrote this:
Code: Select all
<?
/**
    * Append Dynamic galleys (eg. PDF) to the list of galleys for an article
    */
   function appendDynamicGalleys($hookName, $args) {
                $galleys =& $args[0];
      $articleId =& $args[1];

           
                // get derived galleys from DB for this article
                $result = &$this->retrieve(
                        'SELECT dynamic_galley_id
                        FROM article_dynamic_galleys x
                        WHERE x.article_id = ? ORDER BY dynamic_galley_id',
                        array($articleId)
                );

                $dynamicGalleyPlugin = &PluginRegistry::getPlugin('generic', 'DynamicGalleysPlugin');
                $journal = &Request::getJournal();

                while (!$result->EOF) {
                        $row = $result->GetRowAssoc(false);
                        $dynamicGalley = $this->_getDynamicGalleyFromId($row['dynamic_galley_id'], $articleId);
                        $dynamicGalley->setGalleyId($row['dynamic_galley_id']);

                        array_push($galleys, $dynamicGalley);

                        $result->moveNext();
                }

      return true;
   }
?>


but nothing happend, no even if i try to debug... is like the it's never calling my appendDynamicGalleys($hookName, $args)

Any ideas?? i'm loosing my mind over this! is this the right way to overload a function on the OJS model?

regards,
Richard
damnpoet
 
Posts: 20
Joined: Tue Jul 15, 2008 5:48 pm
Location: Cuba

Re: About Dynamic Galleys

Postby asmecher » Wed Mar 03, 2010 1:10 am

Hi Richard,

Are you using the XMLGalleys plugin as a model? That code recently got a few fixes -- try searching Bugzilla for closed bugs against 2.3.2 (to be released soon) and you'll find a couple of patches to that code that should help.

The XMLGalleys plugin is not the best example at the moment because it's got a few known bugs (i.e. having multiple galleys derive from one XML is not currently working, though a 1:1 relationship goes OK).

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

Re: About Dynamic Galleys

Postby damnpoet » Wed Mar 03, 2010 6:32 am

Hi Alec,

Yes i did... ok i'll try that. But with the fixes proposed... does it work now?
damnpoet
 
Posts: 20
Joined: Tue Jul 15, 2008 5:48 pm
Location: Cuba

Re: About Dynamic Galleys

Postby damnpoet » Wed Mar 03, 2010 12:09 pm

okay i made it, it works ... but now i have another problem. Galley shows fine but the link goes to http://localhost/ojs-2.2.4/index.php/me ... view/266/1 and i need it to go to http://localhost/ojs-2.2.4/index.php/me ... 266/1/html.
Any ideas on how can i do that?

regards :D
damnpoet
 
Posts: 20
Joined: Tue Jul 15, 2008 5:48 pm
Location: Cuba


Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest