Skip to content

Plugin Framework#158

Merged
nickethier merged 7 commits intomasterfrom
nick
Nov 28, 2012
Merged

Plugin Framework#158
nickethier merged 7 commits intomasterfrom
nick

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.

1 participant