I've added a page to set the voicemail greeting from the phone but even 
though I perform the same steps as the MailboxPreferencesPage on saving 
the changes aren't saved. They are written to the disk, the projection 
happens but the setting doesn't actually change as far as the system is 
concerned, the old greeting still plays and the main web interface of 
sipXconfig still shows the old value. What am I doing wrong? I've 
checked, the value in the MailboxPreferences object is correct and the 
User points at the right one.



package org.sipfoundry.sipxconfig.microsite;

import org.apache.tapestry.annotations.InjectObject;
import org.apache.tapestry.event.PageBeginRenderListener;
import org.apache.tapestry.event.PageEvent;
import org.sipfoundry.sipxconfig.vm.MailboxManager;
import org.sipfoundry.sipxconfig.vm.MailboxPreferences;
import org.sipfoundry.sipxconfig.vm.MailboxPreferences.ActiveGreeting;

public abstract class Voicemail extends UserHandler implements 
PageBeginRenderListener {

     public static final ActiveGreeting STANDARD_GREETING = 
ActiveGreeting.NONE;
     public static final ActiveGreeting STANDARD = ActiveGreeting.STANDARD;
     public static final ActiveGreeting AWAY = ActiveGreeting.OUT_OF_OFFICE;
     public static final ActiveGreeting LONG_AWAY = 
ActiveGreeting.EXTENDED_ABSENCE;

     @InjectObject(value = "spring:mailboxManager")
     public abstract MailboxManager getMailboxManager();

     public ActiveGreeting getVmmode() {
         MailboxPreferences preferences = getMailboxPreferences();
         return preferences.getActiveGreeting();
     }

     public void setVmmode(ActiveGreeting mode) {
         MailboxPreferences preferences = getMailboxPreferences();
         preferences.setActiveGreeting(mode);
     }


     public void pageBeginRender(PageEvent event) {
         if (getMailboxPreferences() == null) {
             setMailboxPreferences(new MailboxPreferences(getUser()));
         }
     }


     public abstract void setMailboxPreferences(MailboxPreferences 
preferences);

     public abstract MailboxPreferences getMailboxPreferences();

     public String onApply() {
         getMailboxPreferences().updateUser(getUser());
         getCoreContext().saveUser(getUser());
         if(getMailboxManager().isEnabled()) {
             getMailboxManager().writePreferencesFile(getUser());
         }
         return "microsite/xhtmlVoicemail";
     }
}

_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/

Reply via email to