DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7713>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7713 Optional Implicit precondtion checking in matchers Summary: Optional Implicit precondtion checking in matchers Product: Cocoon 2 Version: Current CVS Platform: All OS/Version: All Status: NEW Severity: Enhancement Priority: Other Component: core AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] While writing a large c2 based application we have come across the need for matchers with built-in *implicit* checks. For Example, instead of using a "valid session checker action" in *every* single pipeline in the sitemap to secure against clients who do not have sessions, we simply configure a matcher with a "session-exists precondition". That way, we simplify sitemap pipelines, which we find are already too large and complex. There are several advantages with implicit matcher checking including, simplified sitemaps,scalablity, easier development with developers not having to remember to always include certian actions, hiding of unnecessary and repetitive information, etc Of course precondition matchers are not useful in every situation, but are of best advantage when ones finds themselves using the same general actions in a lot of the sitemap pipelines. In this patch we have implemented flexiable matcher precondition checking which can easly be extended by the developer. Any matcher can now be configured to use certain specified preconditions when they are declared in the sitemap, and these in turn may be overridden in the actual matcher pipelines with "map:parameter". AbstractMatcher.java has been introduced which facilitates this new functionality. All other matchers now directly or indirectly extend AbstractMatcher.java. Note: All new macthers written must extend AbsractMatcher.java to inherit this functionality.Also super.match() or super.perparedmatch() or super.configure() must be invoked in all new matchers which implement these methods and extend from AbstractMatcher. A conditions directory has been introduced, namely cocoon/matching/conditions which contains:- 1. Condtional.java (Interface) 2. UnConditional.java (boring concrete implementation) 3. SessionConditional.java (concrete implementation which checks for session) Developers can add there own matcher conditions as long they implement the Conditional interface. (Note: Conditional implementations must have zero parameter constructors.) In sitemap one configures a matcher by using the following tags <conditonal>some.class.name</conditional>to set a precondition, or <map:parameter name="conditional" value="some.class.name"/> in the actual matcher pipeline to override default matcher precondition. When no conditonal is set, then no precondtions are checked and the matcher proceeds as normal. (This means existing cocoon-apps will still function as per normal with this patch) This patch also includes example usage of this new matcher functionaltiy in the cocoon sample webapp, under the webapps section. (Click on "Implicit Session Checking") newfiles.tgz contains the new files for this patch. c2matching.diff contains the diff to be applied. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]