Download Class Summary

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Database model wikipedia , lookup

Transcript
Class Summary
●
What is an Asset?
●
Asset Anatomy 101
●
Plugging into WebGUI
●
Asset Construction
●
Advanced Topics
●
Asset Packaging
●
Q&A
What is an Asset?
●
Everything in WebGUI is an Asset
●
Core Assets
●
Functional Assets
●
●
Definition: A functional asset produces something
simple that has no style and can be served up by
itself
Examples
●
●
●
Images
Files
HTTP Level Functions
● HTTP Redirect
● Shortcuts
What is an Asset? (Cont)
●
Sub-Level Assets
●
●
Definition: A sub-level asset produces a function of a
larger process that can be served up by itself
Examples
●
●
●
Events
Posts
Application Level Assets
●
●
Application level assets inherit asset properties to
provide core level functionality to large scale
applications
Wobjects are Application Level Assets
Asset Anatomy 101
●
How do we begin writing an asset?
●
Basic Design
●
●
●
●
●
●
Is it necessary?
What do I want it to do?
Can I borrow or reuse existing source?
What data do I need to store?
What should I call it?
Set up the Database
●
Write a create script
●
assetId and revisonDate must be a joint primary key
Asset Anatomy 101 (Cont)
●
●
Write a drop script
Build an Asset Shell
●
Declaration statements
●
Package Statement
●
Use Statements
●
is-a relationship Statement
Asset Anatomoy 101 (Cont)
●
Add Foundation Methods
●
addRevision – specifies how to save revisions of your asset
●
definition – specifies asset properties required by WebGUI
●
●
●
●
asset name
database table name
class name
custom asset properties
Asset Anatomy 101 (Cont)
●
duplicate – specifies how to copy your asset
Asset Anatomy 101 (Cont)
●
getEditForm – called by www_edit container class to generate the
tabform on the user facing edit page
●
getIcon – returns the location of the icons related to your asset
Asset Anatomy 101 (Cont)
●
processPropertiesFromFormPost – called by www_editSave
to process properties from the form post.
●
purge – specifies how to purge asset data from the system
●
purgeRevision – specifies how to purge individual revisions of an asset
Asset Anatomy 101 (Cont)
●
view - called by the www_view container class to generate the
main user
facing view of the asset.
●
www_edit – Web exposed method responsible for generating the user
facing edit screen for assets.
Asset Anatomy 101 (Cont)
●
www_view – Web exposed method responsible for generation the main user
facing screen of the asset
Plugging Into WebGUI
●
Put your asset in the proper location
●
<webguiroot>/lib/WebGUI/Asset/...
●
Create your database table
●
Create your templates
●
You can do this manually for development purposes
●
Add your Asset to the WebGUI config file
●
Restart Apache
Asset Construction
●
●
Planning
●
Modularize
●
Stay Object Oriented!
Error Handling
●
●
If you allow users to use your application incorrectly, they
will
Security
●
Make sure you fill all the gaps
●
www methods are special
Asset Packaging
●
The WebGUI Asset Installer / Uninstaller
●
●
●
Removes the need to create install/uninstall scripts for your asset
Keeps track of the asset version making it simple to write upgrades
for your asset
Fully Installs or Upgrades an asset with a single command.
●
Creates / Updates all templates with a proper lineage
●
Creates / Updates all database tables
●
Updates the asset version table
●
Updates the WebGUI config file
●
●
Copies all files and collateral to the proper locations under the root WebGUI
folder.
Fully Uninstalls an asset with a single command
●
Removes all templates
●
Removes all database tables and installed assets
●
Updates the WebGUI config file
●
Removes all files and collateral from the root WebGUI folder
Asset Packaging (Cont)
●
Using the Asset Installer
●
Installer Setup
●
Create the file tree
●
bin folder
meta.wg – contains meta data about the asset including version, class
name, author, and author email
●
setup.pl – generalized script for installing assets. Not to be modified
●
setup.sql – sql script containing the assetVersion table if the user has never
used the installer
●
readme.txt – readme file which explains how to install assets for the users
●
uninstall.pl – generalized script for uninstalling assets. Not to be modified
docs folder
●
●
install folder – contains your create scripts
●
template folder – contains your templates
●
uninstall – contains your drop scripts
●
upgrade – contains your upgrade scripts
lib folder
●
●
●
WebGUI folder – contains a WebGUI tree clone with your asset files in their
proper location.
Asset Packaging (Cont)
●
Update the meta file
●
●
Move your create script into docs/install
●
●
Your create script should begin with create-
Move your drop script into docs/uninstall
●
●
Use the meta file to set the version and class of your asset as well as to take
credit for your work
Your drop script should begin with drop-
Create your template files in docs/template
●
Create your templates in text files ending in .tmpl
●
Add the appropriate meta data to the beginning of your template
●
Meta data begins with a #, so be careful when crafting your templates.
Asset Packaging (Cont)
●
Move your asset and all it's collateral to the lib folder
●
●
●
The WebGUI folder should mirror the WebGUI root folder, not the
root/WebGUI/lib/WebGUI folder
Anything under this tree will be copied (overwritten if the file exists) to the
WebGUI tree in the exact folder it displays under.
A note about upgrades
●
To upgrade your asset, simply include upgrade scripts (both sql and pl) which
are named appropriately
●
upgrade_x.x.x-y.y.y where x.x.x is the currently installed version and y.y.y is
the version to upgrade to. y.y.y should match the version number in the
meta.wg file.
Q&A
●
Questions?