Vivvo Plug-in Generator Wizard

Description

This tool is used to automatically generate (scaffold) a complete set of PHP classes needed for a basic Vivvo plug-in. Tool offers a number of options to control what features will be available to plug-in, and how the generated code will look like. The purpose of the tool is to save you time when creating a new plug-in, and to give you a solid code base you can start working with. However, please note that generated code doesn’t do anything itself, it’s just a programming frame, and you will have to modify and expand it with your own code to make the plug-in do something meaningful.

Installation

  1. Download and unzip the Vivvo Plug-in Generator Wizard package, if you haven't already.
  2. On your hosting server create a new sub-folder that will be used to hold this tool. For example, let’s say you’ve named it “vpg”.
  3. Using your favorite FTP program upload all files and folders extracted from Vivvo Plug-in Generator package to folder created in the previous step. After these steps the uploaded folders structure on your server should look like this:
  4. Locate folder named “plugins” and set it’s access permissions to 777.

Usage

To start using the tool, point your browser to folder where you’ve uploaded files. In our example folder was named “vpg”, so you would go to URL: http://www.example.com/vpg/

You will be presented with the following form:

Description of form fields:

  • Plugin descriptive name: This is the plain English name for the plug-in that will be used in plug-in description. Field is required.
  • Name for plugin class: This is the name that will be used for plug-in’s classes, methods and variables. It is required, and has to follow the naming rules for PHP methods, meaning it can contain only ASCII letters, numbers and underscores, and has to start with a letter or an underscore.
  • Plugin has a page in admin panel: If selected, additional scripts will be created to handle showing of admin pages for plug-in.
  • Plugin has a frontend page: If checked, additional scripts will be created to provide plug-in page(s) accessible from web site’s front end.
  • Include extra help: Select this option if you want generator wizard to insert (lots of) additional comments that will better explain the important parts of code, and mark the spots where your editing is required. Very useful option for learning, and if you are already experienced Vivvo plug-in developer you can uncheck it, to make the generated code cleaner.

Once you are happy with selected options click on Continue button to proceed to step 2:

On this form you’ve got option to define modules, URL handlers, action handlers and custom fields (for Articles DB table), that you want to be supported by plug-in:

* Register modules: The name of the module (e.g. box_example). This name will used for naming classes and appropriate scripts according to the general naming rules used in Vivvo, and it’s value has to be a valid PHP function name.

  • Register handler for url: The specific part of the URL that you wish to handle, for example if you want to register handler for http://your-site.com/example you should enter value “example”. Value has to be valid URL path, that is only letters, numbers or dashes are allowed.
  • Register action handler: Name of the action you want to register handler for. Action name has to be valid PHP function name.
  • Custom field for Articles: name of the field to add to Articles table in Vivvo database. Code to support basic operation with this custom field is automatically generated. Value has to be a valid name for mysql table field.

For each group you can define unlimited number of values by clicking on “Add more” after entering each value, and if you wish to remove one of them, just click on red X next to the value.

Once you’ve entered all required options, click ”Generate plugin” button, and you will be prompted to download the code generated for you.

Next step

Generated classes provide you with fully structured plug-in, with all basic scripts and classes that you will need. It is the base that you will need to expand with your own code in order to give the plug-in a required functionality. Even if you never wrote a Vivvo plug-in before, we hope that by using this tool, and exploring existing Vivvo plug-ins and how-to’s for reference, you will be able to start writing your own Vivvo code fast and easy.

We also recommend reading more on developing Vivvo Modules:

  1. Developing Vivvo Modules (white paper, .pdf)
 
devdoc/css.txt · Last modified: 2010/05/05 17:08 by damir
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki