OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Basic Help for plugin development

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

Moderators: jmacgreg, michael

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page. While these are OJS-specific, the OCS codebase is similar enough to OJS they should be of help. There is also an [url=http://pkp.sfu.ca/ocs_documentation[/url]OCS Documentation[/url] page with some more general documentation that might also be of interest.

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 OCS Conference Support and Discussion subforum; if you have a technical support question, try the OCS Technical Support subforum.

Basic Help for plugin development

Postby davew » Mon Feb 28, 2011 10:55 am

Hi,

I'm writing a plugin (based on the PayPal plugin) for Bean Stream's hosted pay form. I seem to have everything working except the processing is kicking out a text line saying that the result is Unpaid. We are running Open Conference Systems 2.3.3.1, and I have a couple questions:

1. How can I do a simple debug output to figure out where in the process flow of my plugin the issue is occurring. Obviously a simple echo does not work. Is there a a simple method for finding where in the application flow things are failing?

2. When I install the plugin with the tar.gz it asks for a version.xml or rather a Version.xml, I have included one but to no avail. What should the directory structure of a plugin look like? What files are mandatory? Is there documentation on this somewhere?

3. How can I tell what standards are for what versions of OCS? I see a number of notes about plugins being built against older versions, and so I'm having trouble figuring out what code I can use as a guide.

Thanks in advance for your help.

Dave W
davew
 
Posts: 2
Joined: Mon Feb 28, 2011 10:03 am

Re: Basic Help for plugin development

Postby mcrider » Mon Feb 28, 2011 4:44 pm

Hi Dave,

davew wrote:1. How can I do a simple debug output to figure out where in the process flow of my plugin the issue is occurring. Obviously a simple echo does not work. Is there a a simple method for finding where in the application flow things are failing?


Why won't an echo work? You could also try writing data to your PHP log. And though the learning curve is a bit steep, I highly recommend using Eclipse to step through your code--Once you get used to it, its much more efficient than putting echo's throughout your code. Also, if your plugin is submitting anything via AJAX, or you're posting to a remote server, you'll want to use FireBug or something similar to inspect server responses.

davew wrote:2. When I install the plugin with the tar.gz it asks for a version.xml or rather a Version.xml, I have included one but to no avail. What should the directory structure of a plugin look like? What files are mandatory? Is there documentation on this somewhere?

All the files should be in the root folder, along with the version.xml file. There is an example of a dummy plugin here.

davew wrote:3. How can I tell what standards are for what versions of OCS? I see a number of notes about plugins being built against older versions, and so I'm having trouble figuring out what code I can use as a guide.

There isn't really concise documentation on these types of changes--Your best bet is to compare plugins in post and pre-2.3 version of OCS. Many plugins that were written before OCS 2.3 only have some surface changes e.g. in the function names.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Basic Help for plugin development

Postby davew » Mon Feb 28, 2011 5:04 pm

mcrider wrote:Why won't an echo work? You could also try writing data to your PHP log. And though the learning curve is a bit steep, I highly recommend using Eclipse to step through your code--Once you get used to it, its much more efficient than putting echo's throughout your code. Also, if your plugin is submitting anything via AJAX, or you're posting to a remote server, you'll want to use FireBug or something similar to inspect server responses.


Echo did not seem to work, I figured it was the templating, maybe we are not even getting into the function where I put them. I use eclipse for development, but I have just come in to help on this project so it's not setup with a debugger or anything. How do I set where the application logs to? I could not see a setting. And do you have some quick syntax for that?


Thanks

Dave
davew
 
Posts: 2
Joined: Mon Feb 28, 2011 10:03 am

Re: Basic Help for plugin development

Postby mcrider » Mon Feb 28, 2011 5:24 pm

Hi Dave,

If you're in a template, echo won't work.. You can echo (or var_dump) in the php file that calls the template, and that should spit the value out at the top of the page, but if you want to display a variable in a template, you'll just print it like html, e.g. <h1>{$someVariable}</h1>. If you want to print to the log, and again this has to be in a php file and not a .tpl file, you can just call error_log($variable) and it should print to your standard php log.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC


Return to OCS Development

Who is online

Users browsing this forum: No registered users and 0 guests

cron