On 7/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I feel boycotted :)
May be the problem is my email address?

<snip/>

No. Sometimes (or, often, it depends on many factors) it can take a
couple of days to get a response. Please be patient.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 9 luglio 2007 11.25
To: user@shale.apache.org
Subject: RE: Customizing Basic DialogContextManager

Another way I have tested is to extends directly
AbstractDialogContextManager overriding all public methods using the
wrapped
org.apache.shale.dialog.basic.BasicDialogManager.

Is this solution better then the first?

<snap/>

Generally, I'd discourage folks from customizing any of the dialog
impls provided for a couple of reasons (though I'd encourage them to
write brand new impls):

* Any custom impl means that you are no longer using the basic impl
as we all know it (some bets are off, its harder for anyone on this
list to help without reasonable background each time etc.).

* It should be possible to get a lot of things done leveraging some
of the features of the dialog framework (such as the various
listeners) before getting into customization. Also, if there are
things missing or value-adds to the dialog framework, then IMO its
better to push for those bits to be included in the API or impls
itself (as the case may be). Perhaps you have done this design
exercise already.

I won't claim to have completely understood what the end goal is for
this particular customization. Is this in any way related to:

http://issues.apache.org/struts/browse/SHALE-454

that you filed recently?

-Rahul



Regards
Mario

P.S. could be easier if org.apache.shale.dialog.basic.BasicDialogManager
is not final!

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 9 luglio 2007 10.56
To: user@shale.apache.org
Subject: Customizing Basic DialogContextManager

Hi, I need to customize the Basic DialogContextManager to just add some
futures in create method. What I need is create a dialog changing the
name passed when the user has some profile. What I'm doing is a
decorator (wrapper) of org.apache.shale.dialog.basic.BasicDialogManager.
My DialogContextManager (MyDialogContextManager.java ) does not extends
AbstractDialogContextManager but implements
org.apache.shale.dialog.DialogContextManager and uses a wrapped object
of org.apache.shale.dialog.basic.BasicDialogManager :



public class MyDialogContextManager implements DialogContextManager,

                        Serializable {



            private static final Log log =
LogFactory.getLog(MyDialogContextManager.class);



            DialogContextManager wrapped;



            public MyDialogContextManager() {

                        super();

                        wrapped = new BasicDialogManager();


FacesContext.getCurrentInstance().getExternalContext().getSessionMap().p
ut("mypipolo",wrapped);

            }



            public DialogContext create(FacesContext context, String
name) {

//this is what I need:

                        If (blablaba....) name="mydialogname";



                        return wrapped.create(context,name);

            }



            public DialogContext create(FacesContext context, String
name, DialogContext parent) {

                        return wrapped.create(context,name,parent);

            }



            public DialogContext get(String id) {

                        return wrapped.get(id);

            }



            public DialogContext getActiveDialogContext(FacesContext
context) {

                        return wrapped.getActiveDialogContext(context);

            }



            public void remove(DialogContext instance) {

                        wrapped.remove(instance);

            }



            public void
addDialogContextManagerListener(DialogContextManagerListener listener) {


wrapped.addDialogContextManagerListener(listener);

            }



            public DialogContextManagerListener[]
getDialogContextManagerListeners() {

                        return
wrapped.getDialogContextManagerListeners();

            }



            public void
removeDialogContextManagerListener(DialogContextManagerListener
listener) {


wrapped.removeDialogContextManagerListener(listener);

            }



}



In my faces-config I added:

      <managed-bean>


<managed-bean-name>org.apache.shale.dialog.MANAGER</managed-bean-name>


<managed-bean-class>prova.MyDialogContextManager</managed-bean-class>

            <managed-bean-scope>session</managed-bean-scope>

      </managed-bean>





If you analyze the constructor, you find this:


FacesContext.getCurrentInstance().getExternalContext().getSessionMap().p
ut("mypipolo",wrapped);



I need this because MyDialogContextManager does not extends
AbstractDialogContextManager and doing so does not implements
HttpSessionBindingListener needed for set DialogLifecycleListener.



So, doing in this way seems to work correctly but the question is:

Is this a correct way to customize the default implementation of
BasicDialogManager?



Reply via email to