Shiny Red Apples

Shiny Red Apples (Personal Blog of Harald Ponce de Leon)

182 notes &

OSCOM v3.0 Application Actions

What Application Actions Do

Application Actions allows functionality to be added to Applications in a flexible manner without needing to edit core source code files. Actions typically define what page content is presented in a given situation and can load nested actions for further processing of data.

Actions are loaded through the page request in the following manner:

index.php?Shop&Account&AddressBook

This initializes the Shop Site, loads the Account Application, and executes the AddressBook Action. The files executed as part of this page request are located in:

Shop Site
osCommerce/OM/Site/Shop/Controller.php

Account Application
osCommerce/OM/Site/Shop/Application/Account/Controller.php

AddressBook Action
osCommerce/OM/Site/Shop/Application/Account/Action/AddressBook.php

Nested Actions

The AddressBook Action only presents the address book page to the customer and contains no data processing logic whatsoever. As the address book should provide functionality to create, edit, and delete address book entries, these operations are properly handled through nested Actions in the following manner:

index.php?Shop&Account&AddressBook&Create
index.php?Shop&Account&AddressBook&Create&Process
index.php?Shop&Account&AddressBook&Edit=1
index.php?Shop&Account&AddressBook&Edit=1&Process
index.php?Shop&Account&AddressBook&Delete=1
index.php?Shop&Account&AddressBook&Delete=1&Process

The files executed as part of these page requests are located in (from the Shop Site directory):

Create and Process Actions
Application/Account/Action/AddressBook/Create.php
Application/Account/Action/AddressBook/Create/Process.php

Edit and Process Actions
Application/Account/Action/AddressBook/Edit.php
Application/Account/Action/AddressBook/Edit/Process.php

Delete and Process Actions
Application/Account/Action/AddressBook/Delete.php
Application/Account/Action/AddressBook/Delete/Process.php

Security And Protection

All Actions in the page request are executed in order. This allows control logic to be defined in the main Action class and affects nested Actions as they are executed. An example is having a customer log-in check in the main Action class and not needing to perform the same check in the nested Actions.

As the dynamic nature of Actions allows great flexibility and ease in adding features and functions to a Sites Application, the order of Actions executed as defined in the page request is halted as soon as an Action does not exist or if the name of the Action is the same as the Session name.

Nested Actions also take priority over parameters in the page request that share the same name.

For example, product information pages are loaded in the following manner with the product keyword:

index.php?Shop&Products&oscommerce-tshirt

The Products Application has the following Actions which therefore cannot be used as product keywords:

  • All
  • Images
  • Reviews
  • Specials
  • TellAFriend

Community Feedback

Feedback to this blog entry can be posted on the following topic in the community support forums:

http://forums.oscommerce.com/topic/358932-oscom-v30-framework-optimized-for-php-v53/

Filed under oscom30

  1. filmes-no reblogged this from oscommerce
  2. alythebird reblogged this from oscommerce
  3. btx91 reblogged this from oscommerce
  4. nervous-noodle reblogged this from oscommerce
  5. aeg-lavamat-w-1020 reblogged this from haraldpdl
  6. cainidevanzare reblogged this from oscommerce
  7. maquinas-de-coser-singer-precios reblogged this from haraldpdl
  8. samsung-writer-touch-prezzo reblogged this from haraldpdl
  9. samsung-wave-s8500-prezzo reblogged this from haraldpdl
  10. truthabout-6packabs reblogged this from oscommerce
  11. hd-beamer-test-2012 reblogged this from haraldpdl
  12. haraldpdl posted this