Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin Framework #158

Merged
merged 7 commits into from
Nov 28, 2012
Merged

Plugin Framework #158

merged 7 commits into from
Nov 28, 2012

Conversation

nickethier
Copy link
Contributor

How to write a plugin:

Example:

public class MyPlugin extends ProductIdentificationPlugin {

    public MyPlugin(ProductIdentificationPlugin successor) {
        super(successor); // <--- Just do it.
    }

    public String identify(String barcode) {
        //Implement plugin and return the item description here
        //You can also call handoff and pass the barcode to the next plugin.
        return handoff(barcode);
    }

}

You also have to add it to the plugins.json file.

{
 "plugins" : [
    {
      "name" : "Google Plugin",
      "className" : "model.productidentifier.ProductIdentifierGoogle",
      "description" : "Product UPC Identifier plugin that works with google's api"
    },
    {
      "name" : "My Awesome Plugin",
      "className" : "third.party.package.MyPlugin",
      "description" : "this plugin is awesome!"
    }
  ]
}

nickethier added a commit that referenced this pull request Nov 28, 2012
@nickethier nickethier merged commit 3eb617a into master Nov 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant