OJS 3.0/3.0.1: Browse plugin doesn't show

When I activate the Browse Plugin in OJS 3 nothing happens, i.e. it doesn’t show anywhere on the site, and is not available as a sidebar block in the appearance settings. Have I missed something simple or has it not been ported properly to OJS3? Tried both 3.0 and 3.0.1.

It was really hard to google for “Browse plugin” :slight_smile:

1 Like

Hi @simonmitternacht,

That plugin hasn’t yet been rewritten for the new OJS 3.x front-end and, as you’ve noticed, doesn’t do anything. It was mistakenly included in the OJS 3.0.1 build – I’ve marked it for suppression from the next build, unless we rewrite it by then. Are you just exploring, or is this a plugin that you’d like to add to your install?

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,
Ok, good to know. The editor of the journal I’m working on upgrading right now thinks this is an essential component, so it would be very nice to have. I could look into porting it myself, if you could give me some pointers on roughly what needs to be done.

There was also a request for the tag cloud plugin, I assume this has also not been ported yet?

Simon

Hi @simonmitternacht,

Yes, the Keyword Cloud plugin falls into the same category.

I’d suggest looking at the changesets for similar plugins to get an idea – e.g. by running…

 git diff ojs-dev-2_4..master plugins/generic/webFeed

You’ll see that aside from some modernization of calling conventions (reference use etc), the way the plugin interacts with the system to present the settings form got a fair amount of work. All interactions with the reader front-end will need rewriting too, as the user interface has changed completely.

You’re correct about the tag cloud plugin – it’s also not been rewritten.

Regards,
Alec Smecher
Public Knowledge Project Team

Ok, thanks @asmecher! I’ll see what I can do.

Sorry to resurrect an old thread, but the Browse plugin still shows in the list of plugins in 3.0.2-stable, but doesn’t appear to actually work or render. Should it be working in 3.0.2? My journal managers also find this useful.

Hi @verdonv,

If you’re working from the git stable branch, you’ll run into a number of plugins that haven’t yet been rewritten for the 3.x line of releases. We’re gradually working on these. Have a look at ojs/buildpkg.sh at ojs-3_0_2-0 · pkp/ojs · GitHub for the current list as of OJS 3.0.2. This list defines what gets excluded from build packages.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes

This plugin (Browse) was a very essential plugin for our environment and requirement, it was perfectly working with OJS 2.4.8 but I could not find it working in OJS 3.0.2, it was a browse plugin which should have been on the watchlist of ojs development team, as it makes approach towards information easier and systematic, if a reader is interested only in Medicine & Allied articles or only Case reports, it becomes much convenient for him to explore that specific area.

We have been suffering a lot due to non-availability of this plugin and I just want to know whether there will be any way to achieve the same functionality (browse by section) in ojs 3.0.2 and if yes, what would be the expected Timeline and if not, what else can be done to achieve the similar functionality.

Anxiously waiting for your response.

Kind Regards,
Farhan Abbas
Software Engineer
King Edward Medical University

1 Like

Hi @Farhan_Abbas,

We would like to get browsing by section out soon, but it probably won’t make it into OJS 3.1. To build something like this yourself, I’d recommend you create a plugin. Here’s a very quick example on how you could create a custom URL and deliver whatever you’d like to that.

First, you’ll need to create a new plugin. The theme guide includes useful information on necessary parts of a plugin, but you should put your plugin into the generic directory, not the theme directory.

In your plugin file, you need to hook into the LoadHandler hook to load your own page handler:

import('lib.pkp.classes.plugins.GenericPlugin');

class ExamplePlugin extends GenericPlugin {
	/**
	 * @copydoc Plugin::getDisplayName()
	 */
	public function getDisplayName() {
		return 'Example plugin';
	}

	/**
	 * @copydoc Plugin::getDescription()
	 */
	public function getDescription() {
		return 'Example plugin description';
	}

	/**
	 * @copydoc Plugin::register()
	 */
	public function register($category, $path) {
		$success = parent::register($category, $path);
		if (!Config::getVar('general', 'installed') || defined('RUNNING_UPGRADE')) return $success;
		if ($success && $this->getEnabled()) {
			HookRegistry::register('LoadHandler', array($this, 'setPageHandler'));
		}
		return $success;
	}

	/**
	 * Route requests for the citation styles to custom page handler
	 *
	 * @see PKPPageRouter::route()
	 * @param $hookName string
	 * @param $params array
	 */
	public function setPageHandler($hookName, $params) {
		$page = $params[0];
		if ($this->getEnabled() && $page === 'examplePage') {
			$this->import('ExamplePageHandler');
			define('HANDLER_CLASS', 'ExamplePageHandler');
			return true;
		}
		return false;
	}
}

You’ll be loading an ExamplePageHandler.inc.php class that you’ll create like this:

import('classes.handler.Handler');
class CitationStyleLanguageHandler extends Handler {

	/**
	 * @param $args array
	 * @param $request PKPRequest
	 * @return null|JSONMessage
	 */
	public function exampleOp($args, $request) {

		// Fetch the published articles in a section
		$publishedArticleDao = DAORegistry::getDAO('PublishedArticleDAO');
		$articles = $publishedArticleDao->getPublishedArticlesBySectionId($sectionId, $issueId);

		// Call your own template file
		$templateMgr = TemplateManager::getManager();
		$templateMgr->assign(array(
			'articles' => $articles
		));
		$templateMgr->display($this->getTemplatePath() . '/example-page-template.tpl');
	}
}

You can then create the URL to match this in templatess like this:

{url page="examplePage" op="exampleOp"}

You can look around at other examples to figure out how to pass additional args, like a section ID, then retrieve that information and pull it into the database. But hopefully that gets you started.

4 Likes

For future development of a browse-by-section feature, you can follow this issue:

1 Like

Thanks a lot for your detailed response. I will definitely give it a try and will get back to you if I face any problem. One more thing, when do you plan to include Browse by Section I mean in which version of ojs?

Kind Regards,

Farhan

1 Like

It definitely won’t make it into OJS 3.1, but we can’t necessarily promise it for OJS 3.2. All I can say is that it is a priority, but there are lots of high-priority items on-the-go.

2 Likes

Ok. Will try your solution. Hope it will work.

Regards,
Farhan

1 Like

Hi @NateWr,

we would be very happy about a browse plugin for ojs 3 to integrate it into our 6 journals. I just saw that work has already started last year. Do you think it will make it into the next release?

thanks a lot,
Anna

Hi @akku

The Browse By Section plugin has been in use for a while now, but we haven’t yet put it into the Plugin Gallery. That’s just been a delay on our end, but it should be ok to use.

I will see what I can do to get it added to the Plugin Gallery

Hi @NateWr

thanks a lot and sorry to ask for more, but do you also intend to offer a browsing function by author and keyword? As I remember this was possible in version2?

best regards,
Anna

We definitely intend to but we haven’t made any progress on these features yet.

When browsing by author is concerned I would take into consideration that some people due to privacy concerns do not want to be browsable by default.
Thanks

Hi @NateWr,

I found a workaround with a custom block plugin in this thread: [OJS 3.0.2] Search Filters - #14 by Gerwin

thanks,
Anna