[TYPO3-ect] TS Action chains for SPL objects
Elmar Hinz
elmar07 at googlemail.com
Sat Aug 4 14:24:42 CEST 2007
Hello,
it's a while ago, that we had an big thread about the possibility to specify
action chains by TS. Either the solutions where limited or complex. I want
to make a next attemt for such a design.
Instead of placing the object into a numbered order, each object has a
pointer to the next object. You overwrite pointers, to place new objects
into the chain. But the mayor reason for this model is, that a linear chain
of objects doesn't cover all needs. Think of the cases of validation where
a different processing is required if validation fails.
Don't be shocked. The example runs validation and a captcha. It't probably
one of the longest that is possible. Other actions are comparingly simple.
You discover a numberd order for function calls on objects and for
parameters of functions.
actions {
...
editAction {
...
}
submitAction {
START = sessionLoad
sessionLoad = tx_my_sessionClass
sessionLoad.do.1 = loadFromSession
sessionLoad.go.next = request
request = tx_my_requestClass
request.do.1 = mergeParameters
request.go.next = validation
validation = tx_my validationClass
validation.set.configurations < temp.validatorConfigurations
validation.do.1 = validate
validation.go.invalid = editAction
validation.go.valid = captcha
captcha = tx_my_captchaClass
captcha.do.1.run
captcha.go.display= render
captcha.go.passed = transform
render = tx_my_engineClass
render.do.1 = render
render.do.1.1 = captchaTemplate
render.go.next = translate
translate = tx_my_translatorClass
translate.do.1.translate
translate.do.1.1 = content
translate.next.sessionStore
sessionStore = tx_my_sessionClass
sessionStore.do.1 = loadToSession
sessionStore.go.next = RETURN content
transform = tx_my_updateTransformer
transform.next = update
update = tx_my_modelClass
update.do.1.update
update.go.next = redirect
redirect = tx_my_redirectorClass
redirect.do.1 = redirect
redirect.do.1.1 = listAction
}
...
}
We later could add general entry and exit hooks to tx_lib_object, so that
each still more flexibility can be added.
Regards
Elmar
More information about the TYPO3-team-extension-coordination
mailing list