Hi,
        I have been posting my problem and work through for the past 5 days and not 
even a single mail stating 
this is good or bad. so I am again banging with my implemented code. 
        This is just a positive approach to improve struts in a more comprehensive 
framework. I haven't done much in this code,
it follows a standard approach as like ActionServlet..

        Files:                  explanation
        ====================================

        ActionHook                      Standard Interface to trigger Hooked methods
        ActionHookMapping               similar tool like ActionMapping
        ActionHookServlet               Child class for ActionServlet which does 
hooking to a doPost and doGet
        ServiceThread           If the hook needs to be implemented in threaded 
environment 


        hook-struts-config.xml  configuration XML for action Hooks

        ChannelHook & WebTrendsHook     These are just a sample implementation tested 
class for this rule.


        Note:
        ======
                Some of the behaviors can be implemented through tags also. But my 
idea is not that. 
                The Subjective Goal is Doing an asynchronous job for a defined request.
                Let me know if there is any problem in that. 
        
        Things to be done.
        =================
                1. Authentication --            can be used a standard authentication
                2. Parameter passing through the hook-struts-config.xml and usuage
                3. Implement more comprehensive ServiceThread Class rather than 
ordinary thread reaper class
                4. Implement rich Cache behviour to this.
        
        Dis-Advantage:
        =============
                1. Depends upon the context and usauge Thread Hook might give some 
problem

        Please find the war file for further testing ( This was tested under resin 
environment ).       


        Hope Ted , criag or other senior person in apache foundation spend some time 
to replay this mail 
        both positive or negative. 
                if it is negative  i can stop my spaming and 
                if it is positive think about further.
        
        Still waiting for the 
replay......................................................................

Tnx and Regards
sadhas

-----Original Message-----
From: J, Sadhasivam (Cognizant) 
Sent: Friday, June 06, 2003 7:09 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Problem Statement for some standard e-Biz requirmentsf


Hi,
        
        Problem Statement
        =================
                As per my understanding towards the struts that it doesn't have the 
Trigger kind of mechanism to solve 
        some of the  typical e-Biz scnerios or standard requirments for example

                1. Log all the URIs with some custom format and give to some other 
serivces
                        This has to happen irrespective of regular flow.

                2. Standard channel behaviour in portal. Like Yahoo shows weather/ads 
etc to a User or User group. etc.

                Such kind of requirement is very common and not been taken in struts i 
belive. 

                I have come up with an approach to cater these problems. 
                I did a proof of concept also and i would like to know is its really a 
good approach 
                or is there any othere standard way to implement this in Struts.

                Hope apache/open source foundation people spent some time to give me 
                an indication whether this approach is correct or not.
                
        Approach Taken
        ==============
                Shall call this phenomenon as Hooking
                
                Step 0: Write a Standard Interface to perform this Hooking 
                ======
                        public interface ActionHook
                        {
                                public void prePerform(  HttpServletRequest request );
                        }


                Step 1: addition of XML Nodes in struts-config.xml
                ======
                Justification
                =============
                        Since these problems are pertainting to the problem space and
                         it should be configured at the runtime to pick up these data.

                struts-config.xml 
                        <action-hooks>
                                <action-hook  name="org.apache.hook.ActionHook" 
servlet="action"/>
                                <action-hook  name="org.apache.hook.ChannelHook" 
servlet="action"/>
                        </action-hooks>
        


                Step 2: Load ActionHook Object through digester.
                ======
                Justification
                =============
                        Configured classes are loaded by HookRuleBase and HookRule 
classes as a standard way from apache.


                Step 3: Changes in the ActionServlet to process ActionHooks
                ======
                Justification
                =============
                        Load the ActionHooks Object and process the ActionHooks before 
even start the form processing.
                        
                        processHook(ActionMapping mapping, HttpServletRequest request )
                        {
                                Iterator keySet = hookMap.keySet().iterator();
                                
                                while( keySet.next() )
                                {
                                        Object key = keySet.get( key );
                                        ActionHook hook = ( ActionHook )hookMap.get( 
key );
                                        hook.prePerform( request) ;
                                }
                        }

        
                Step 4: Write a custom ActionHook object to perform this.
                ======  
                        public class ChannelHook implements ActionHook
                        {
                        public void prePerform( ActionForward forward, 
HttpServletRequest request, HttpServletResponse response )
                        {
                                // TO DO 
                                // Required Busisess Logic and Set the Object Object 
in the mentioned Scope
                         }
                        }
        

                Tnx for the patient reading. About to hear more things from you guys.


regards
sadhas





-----Original Message-----
From: J, Sadhasivam (Cognizant) 
Sent: Wednesday, June 04, 2003 10:25 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: RE: Struts redirection problem


The doubt is can implement portal channel kind of behivour where in channels are 
dropped in my dynamic contents
and in the content area requalr CRUD operation will be followed.

-----Original Message-----
From: J, Sadhasivam (Cognizant) 
Sent: Wednesday, June 04, 2003 9:22 PM
To: 'Struts Users Mailing List'; '[EMAIL PROTECTED]'
Subject: RE: Struts redirection problem


in the problem statement i have mentioned that we are doing that but its not the right 
way to do as per my assumption.
because do the formvalidation if its invalid instead of going to the action.perform 
redirect to jsp directly
is the struts thumb rule and design. 

Ideally is it good to over look that and 
hypotheically if the user knows that action then get the view without doing form 
validation.. i don't think struts will allow this even thought its a good work around.



-----Original Message-----
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 9:13 PM
To: Struts Users Mailing List
Subject: RE: Struts redirection problem


Make the input attribute in the mapping point at the action (the one it goes
through before forwarding to that view if its different).


-----Original Message-----
From: J, Sadhasivam (Cognizant) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 4 June 2003 23:38
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Struts redirection problem


Hi,
        We are doing a portal in which we have a News Channel in the pages across
the site.
assume its just a corner html display area in the Site which frameless site.
with respect to site updation and new arrivals this content should be picked
and display the top 10 records.

        For better control i have wrote a wrapper to the struts action in which
perform method is implemented by having my own abstract method. for more
control i have created postPerform and prePerform event methods which gets
executed before perform.

  Problem statement:
        Since news item should be executed each and every page.
      i have hooked the News Action to postPerform or prePerform and set the
form data in request scope. The problem is
when there is form validation and input attribute is jsp the control won;t
go to the action level and bombs. right now we did most of our validation
are done in form with input attirbute point to action element which is wrong

Is there any way to implement a channel kind of portal behivour in struts ??

        Thx in advance
        sadhasivam.j


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

                Visit us at http://www.cognizant.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to