Spectra Tips and Tricks - PowerPoint PPT Presentation

About This Presentation
Title:

Spectra Tips and Tricks

Description:

Spectra is an application that runs under Cold Fusion 4.5 and ... reason, the Create' method is a misnomer a better description for it would be an initializer' ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 18
Provided by: cfu2
Category:

less

Transcript and Presenter's Notes

Title: Spectra Tips and Tricks


1
Spectra Tips and Tricks
  • John Fendrick, President and CTO
  • Kent Lynch
  • Woodbourne Solutions, Inc

2
Cold Fusion and Spectra
  • Spectra is an application that runs under Cold
    Fusion 4.5 and above on Solaris and NT
  • Need advanced securities option
  • Need a real database (LDAP on Solaris)
  • Need a lot of CPU
  • Need patience
  • Desire a background in OOP

3
Spectra Structure
  • C/allaire/spectra/ handlers, customtags, PLP,
    rules, collections, database, pagetemplates
  • Sub level by project for each system, webtop
  • C/inetpub/wwwroot/allaire/spectra mediastore,
    webtop, documentation

4
Spectra Change your thinking
  • Design Phase
  • Plan for common functions (Methods)
  • Plan for functions with steps (PLPs)
  • Plan for automation (Rules)
  • Plan for nested tags (Customtags)
  • Slower start but worth it
  • Go in Handlers directory by project
  • Go in PLP directory methods get created
  • Go in rules, database, or customtags
  • Go in customtags

5
Internal vs. External Tables
  • Decided on an object level
  • Internal
  • for apps built from ground-up in Spectra that do
    not need to share data
  • for content thats used and maintained on the
    website
  • for objects that requires little if any sorting
    for display.
  • External
  • re-using corporate data
  • faster access
  • more flexible data manipulation

6
Nomenclature Methods Handlers
  • Methods
  • All actions that can be performed on a
    ContentObject are called methods.
  • Each method has an associated label/name
    (create, display, delete etc)
  • And each method has an associated handler
    (create_object.cfm, displayall.cfm,
    deletearticle.cfm etc)
  • You create one method for each action.

7
Nomenclature Methods Handlers
  • Handlers
  • The actual template with ColdFusion code.
  • Saved in
  • \allaire\spectra\handlers\project\object\
  • create_object.cfm,
  • displayall.cfm,
  • deletearticle.cfm etc

8
Custom Create Handler
  • By the time the server processes the Create
    Handler, Spectra has already created the content
    item.
  • You therefore will always have access to the
    objectID it just created (cfa_handler tag is used
    for this purpose)
  • For this reason, the Create method is a
    misnomer a better description for it would be an
    initializer.
  • Never place a cfa_contentobjectcreate tag on a
    handler whose method is called create.

9
Custom Display Handler
  • ltcfa_handler objectgt
  • You can give the object attribute any value.
  • This gives developers a scope for all the
    properties of the content item.
  • If you dont create a Display handler spectra
    ships with a default display method and handler.

10
Custom Edit Handler
  • Basically a form submit
  • More advanced a PLP (process logic path).
  • Note, the returnto form field.
  • On a Spectra site, you can call the any handler
    from any page.
  • Update both the internal (Spectra) database and
    the external database table.

11
Custom Delete Handler
  • If your handlers Method is called delete
  • by the time the server processes the page the
    content item is already deleted from Spectra.
  • All thats left is to delete from the external
    table.
  • Therefore never place a cfa_contentobjectdelete
    tag on the handler.
  • If your handlers Method is not named delete
  • place the cfa_contentobjectdelete tag
  • then delete from the external table.

12
Invoking A Method
  • Extremely simple and powerful.
  • Only one tag required
  • ltcfa_contentobject
  • method
  • objectid
  • datasourcegt

13
Tips 1 General Lessons
  • This will be a big undertaking more moving
    parts like databases, collections, scopes
  • Distributed code leads to larger headaches if you
    have never done OOP
  • This is a Version 1 product
  • Longer to setup and program
  • Good content management tool
  • No E-commerce despite the hype
  • More expensive than just Cold Fusion to scale
  • Ver. 1 Better suited for small / medium sized
    sites

14
Tip 2 Before You Start
  • Know your resources Allaire.com/developer/spectrar
    eferencedesk/ techdocs.cfm
  • Tutorials on Handlers, Pages, Containers
  • Papers on Tips and Tricks
  • Migrate the cfaobjects and userdirectory
    databases
  • Modify the HKEY-Local-Software-Allaire-Customtags
  • Configure Cold Fusion with more cache

15
Tip 3 Managing the Project
  • Plan all the objects
  • Repetitive Functions need Properties (the data)
    and Methods (what you do with the data)
  • Cfaobjects holds the mappings and list of
    Properties and Methods but code is in the files
  • Create, edit, and delete are used by default if
    you create new ones then rename yours
  • Initialize the application but get the templates
    set prior to entering data

16
Tip 4 Managing the Project
  • Build and test one object at a time
  • Put reusable code in customtags
  • Test each object
  • Personalize last but plan ahead
  • Only use the minimum number of page containers
  • Keep complex navigation simple
  • Cache at the container level unless the page is
    all static
  • Page overrides the container

17
Questions
Write a Comment
User Comments (0)
About PowerShow.com