[OJS] Dev Question: force PID-Plugins to generate programmaticcally

Sorry for bothering you with these kinds of questions. Since the code of OJS is very large and thick, it’s quite hard to find out everything yourself, although I found out a lot. So I would appreciate every little hint a lot! I think this Forum should definitely have dev-section for this kind of stuff.

So my newest Question is: How can I force the System to generate PIDs for a new galley at the moment I insert it with
$galleyDao->insertGalley
So the very same thing, which would happen when the thing is watched the first time. In ArticleGalleyDAO I find mtehods like deleteAllPubIds, deletePubId, changePubId but nothing like “createPubIds” which I would have Expected.

Any hint for me?

(OJS 2.4.8)

BTW since I am diving deeper and deeper in this stuff, at one point I might be able to contribute to the main code and help fix some stuff or something.

OK i found out, that

$galley->getPubId('blub');

creates the new ones… to get them all I wrote a function

    function createPubIds($galley, $article, $preview = false) {
        $pubIdPlugins =& PluginRegistry::loadCategory('pubIds', true, $article->getJournalId());
        $pubIds = array();
        foreach ($pubIdPlugins as $pubIdPlugin) {
            $pubIdType = $pubIdPlugin->getPubIdType();
            $pubIds[$pubIdType] = $pubIdPlugin->getPubId($galley, $preview);
        }
        return $pubIds;
    }

Now it works.

Public Identifiers are created on-demand for newly published objects (if possible and depending on configuration). This is why a call to ->getPubId() creates a new public identifier (if $preview is not turned on). See for example the DOI plugin:

It is the specific PubId plugin which has the methods for generating/storing the pubid.