Am 07.02.2011 20:26, schrieb Douglas Hubler:
On Mon, Feb 7, 2011 at 8:53 AM, David Becker<[email protected]> wrote:
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.
Can you provide a complete patch to test as description of how to test?
BTW: Are you planning to contribute this to sipXecs?
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/
The patch is attached, it's extremely unfinished of course.
Reproduction:
Set a Polycom SoundPoint's Microbrowser homepage to
sipxconfig/microsite/xhtmlLogin.html (using a regular webbrowser might
suffice too).
Login with your username and PIN.
Press "Home" in the browser functions if you end up on the main
SipXconfig page.
Select "Voicemail Einstellungen" in the main menu.
Select a different radiobutton and select "Anwenden".
This is supposed to change the mailbox greeting but it doesn't do that.
The greetings are in the same order as on the regular SipXconfig page
for that.
I'm not sure if it's suitable for contribution, it doesn't use the
plug-in system because it's meant to be deployed to production
relatively soon after completion and we don't expect the plug-in system
to hit the stable version for a long time.
>From a9786cab5f98eedc13eca3e5017443ad326a1177 Mon Sep 17 00:00:00 2001
From: David Becker <[email protected]>
Date: Tue, 8 Feb 2011 09:28:17 +0100
Subject: [PATCH] Microbrowser site for Polycom phones
---
sipXconfig/web/context/WEB-INF/microsite/Home.html | 10 +++
sipXconfig/web/context/WEB-INF/microsite/Home.page | 11 ++++
.../context/WEB-INF/microsite/xhtmlForward.html | 14 +++++
.../context/WEB-INF/microsite/xhtmlForward.page | 11 ++++
.../WEB-INF/microsite/xhtmlForwardEntry.html | 23 ++++++++
.../WEB-INF/microsite/xhtmlForwardEntry.page | 11 ++++
.../web/context/WEB-INF/microsite/xhtmlHome.html | 10 +++
.../web/context/WEB-INF/microsite/xhtmlHome.page | 8 +++
.../web/context/WEB-INF/microsite/xhtmlLogin.html | 14 +++++
.../web/context/WEB-INF/microsite/xhtmlLogin.page | 8 +++
.../context/WEB-INF/microsite/xhtmlVoicemail.html | 17 ++++++
.../context/WEB-INF/microsite/xhtmlVoicemail.page | 9 +++
.../sipfoundry/sipxconfig/microsite/Forward.java | 7 ++
.../sipxconfig/microsite/ForwardEntry.java | 7 ++
.../org/sipfoundry/sipxconfig/microsite/Home.java | 15 +++++
.../org/sipfoundry/sipxconfig/microsite/Login.java | 59 ++++++++++++++++++++
.../sipxconfig/microsite/UserHandler.java | 39 +++++++++++++
.../sipfoundry/sipxconfig/microsite/Voicemail.java | 50 +++++++++++++++++
18 files changed, 323 insertions(+), 0 deletions(-)
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/Home.html
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/Home.page
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.html
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.page
create mode 100644
sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.html
create mode 100644
sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.page
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.html
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.page
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.html
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.page
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.html
create mode 100644 sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.page
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Forward.java
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/ForwardEntry.java
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Home.java
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Login.java
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/UserHandler.java
create mode 100644
sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Voicemail.java
diff --git a/sipXconfig/web/context/WEB-INF/microsite/Home.html
b/sipXconfig/web/context/WEB-INF/microsite/Home.html
new file mode 100644
index 0000000..1f540b9
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/Home.html
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head><title>Hell-o-World</title></head>
+<body>
+<p>Hi there, Tapestry!</p>
+<p>Now is <span jwcid="now">8:27, the 1st of April 2007</span>.</p>
+<p>Say something:</p>
+<input type="text"/>
+<input type="submit" value="bla" />
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/Home.page
b/sipXconfig/web/context/WEB-INF/microsite/Home.page
new file mode 100644
index 0000000..362a367
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/Home.page
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.sipfoundry.sipxconfig.microsite.Home">
+
+<component id="now" type="Insert">
+ <binding name="value" value="currentDate"/>
+</component>
+
+</page-specification>
\ No newline at end of file
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.html
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.html
new file mode 100644
index 0000000..d2b185b
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.html
@@ -0,0 +1,14 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--Homepage for XHTML-compliant microbrowsers, e.g. Polycom-->
+<head><title>Anrufweiterleitung</title></head>
+<body>
+ <form action="xhtmlForward.html" method="post">
+ <p>Dieses Telefon klingelt für <input type="text"
name="mainduration" value="30" size="3" /> Sekunden.</p>
+ <p><a href="xhtmlForwardEntry.html?id=1">Gleichzeitig klingelt
die Rufnummer 300 für 30 Sekunden (Aktiv).</a></p>
+ <p><a href="xhtmlForwardEntry.html?id=2">Neuer Eintrag</a></p>
+ <p>Wenn keines der Telefone den Anruf annimmt wird er dann auf
den Anrufbeantworter gesendet.</p>
+ <p><input type="submit" value="Anwenden " /></p>
+ <p><a href="xhtmlHome.html">Zurück</a></p>
+ </form>
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.page
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.page
new file mode 100644
index 0000000..5eebe7a
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForward.page
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.sipfoundry.sipxconfig.microsite.Forward">
+
+<!--<component id="now" type="Insert">
+ <binding name="value" value="currentDate"/>
+</component>-->
+
+</page-specification>
\ No newline at end of file
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.html
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.html
new file mode 100644
index 0000000..aaac9e5
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.html
@@ -0,0 +1,23 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--Homepage for XHTML-compliant microbrowsers, e.g. Polycom-->
+<head><title>Anrufweiterleitung</title></head>
+<body>
+ <form action="xhtmlForward.html" method="post">
+ <input type="hidden" value="id" />
+ <p><input type="checkbox" name="active"
checked="checked">Aktiv</input></p>
+ <p><input type="radio" name="progression" value="0"
checked="checked">Nachfolgend</input>
+ <input type="radio" name="progression"
value="1">Gleichzeitig</input></p>
+ <p>klingelt die Rufnummer <input name="number" type="text" />
für <input name="duration" type="text" value="30" size="3" /> Sekunden.</p>
+ <input type="submit" value="Ok " />
+ </form>
+ <form action="xhtmlForward.html">
+ <!--Workaround for Polycom Microbrowser not supporting regular
buttons-->
+ <input type="submit" value="Abbrechen " />
+ </form>
+ <form action="xhtmlForward.html" method="post">
+ <input type="submit" value="Eintrag Löschen " />
+ <input type="hidden" value="id" />
+ <input type="hidden" value="delete" />
+ </form>
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.page
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.page
new file mode 100644
index 0000000..c64e142
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlForwardEntry.page
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.sipfoundry.sipxconfig.microsite.ForwardEntry">
+
+<!--<component id="now" type="Insert">
+ <binding name="value" value="currentDate"/>
+</component>-->
+
+</page-specification>
\ No newline at end of file
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.html
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.html
new file mode 100644
index 0000000..b12dbb3
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.html
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--Homepage for XHTML-compliant microbrowsers, e.g. Polycom-->
+<head><title>Benutzerfunktionen</title></head>
+<body>
+<p><a href="xhtmlVoicemail.html">Voicemail Einstellungen</a></p>
+<p><a href="xhtmlForward.html">Anrufweiterleitung einstellen</a></p>
+<p><a href="xhtmlSpeeddials.html">Kurzwahlnummern bearbeiten</a></p>
+<p><a href="xhtmlPhonebook.html">Telefonbuch bearbeiten</a></p>
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.page
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.page
new file mode 100644
index 0000000..0d0be2f
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlHome.page
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.apache.tapestry.html.BasePage">
+
+
+</page-specification>
\ No newline at end of file
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.html
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.html
new file mode 100644
index 0000000..6d09b74
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.html
@@ -0,0 +1,14 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--Log-in Page for XHTML-compliant microbrowsers, e.g. Polycom-->
+<head><title>Anmeldung</title></head>
+<body>
+<form action="/sipxconfig/j_acegi_security_check" method="post">
+ Benutzername<br />
+ <input type="text" jwcid="@Any" name="j_username" id="j_username"
value="ognl:userName" /><br />
+ PIN<br />
+ <input type="text" name="j_password" id="j_password" hidden="true"
/><br />
+ <input type="submit" value="Anmelden " />
+</form>
+ <p jwcid="@common/ErrorMsg" />
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.page
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.page
new file mode 100644
index 0000000..04d2c81
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlLogin.page
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.sipfoundry.sipxconfig.microsite.Login">
+
+
+</page-specification>
\ No newline at end of file
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.html
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.html
new file mode 100644
index 0000000..1b14b96
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.html
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<!--Homepage for XHTML-compliant microbrowsers, e.g. Polycom-->
+<head><title>Voicemail Einstellungen</title></head>
+<body>
+ <form jwcid="@Form" listener="listener:onApply" method="post">
+ <p>VoicemailbegrüÃung:</p>
+ <span jwcid="@RadioGroup" selected="ognl:vmmode"
validators="validators:required">
+ <input type="radio"
value="ognl:@org.sipfoundry.sipxconfig.microsite.Voicemail@STANDARD_GREETING"
jwcid="@Radio" />Standard BegrüÃungsnachricht<br />
+ <input type="radio"
value="ognl:@org.sipfoundry.sipxconfig.microsite.Voicemail@STANDARD"
jwcid="@Radio" />Standard<br />
+ <input type="radio"
value="ognl:@org.sipfoundry.sipxconfig.microsite.Voicemail@AWAY" jwcid="@Radio"
/>Nicht im Büro<br />
+ <input type="radio"
value="ognl:@org.sipfoundry.sipxconfig.microsite.Voicemail@LONG_AWAY"
jwcid="@Radio" />Lange Abwesend<br />
+ </span>
+ <p><input type="submit" value="Anwenden "/></p>
+ </form>
+ <a href="xhtmlHome.html">Zurück</a>
+</body>
+</html>
diff --git a/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.page
b/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.page
new file mode 100644
index 0000000..22bf8e8
--- /dev/null
+++ b/sipXconfig/web/context/WEB-INF/microsite/xhtmlVoicemail.page
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE page-specification PUBLIC
+"-//Apache Software Foundation//Tapestry Specification 4.0//EN"
+"http://tapestry.apache.org/dtd/Tapestry_4_0.dtd">
+<page-specification class="org.sipfoundry.sipxconfig.microsite.Voicemail">
+
+
+
+</page-specification>
\ No newline at end of file
diff --git
a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Forward.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Forward.java
new file mode 100644
index 0000000..01334e6
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Forward.java
@@ -0,0 +1,7 @@
+package org.sipfoundry.sipxconfig.microsite;
+
+import org.apache.tapestry.html.BasePage;
+
+public abstract class Forward extends UserHandler {
+
+}
diff --git
a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/ForwardEntry.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/ForwardEntry.java
new file mode 100644
index 0000000..08d8464
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/ForwardEntry.java
@@ -0,0 +1,7 @@
+package org.sipfoundry.sipxconfig.microsite;
+
+import org.apache.tapestry.html.BasePage;
+import org.apache.tapestry.record.PropertyChangeObserver;
+
+public abstract class ForwardEntry extends UserHandler {
+}
diff --git a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Home.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Home.java
new file mode 100644
index 0000000..ab9707b
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Home.java
@@ -0,0 +1,15 @@
+package org.sipfoundry.sipxconfig.microsite;
+
+import java.util.Date;
+
+import org.apache.tapestry.html.BasePage;
+import org.apache.tapestry.record.PropertyChangeObserver;
+
+public abstract class Home extends BasePage {
+ public Home() {
+ }
+
+ public Date getCurrentDate() {
+ return new Date();
+ }
+}
diff --git a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Login.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Login.java
new file mode 100644
index 0000000..60d7309
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Login.java
@@ -0,0 +1,59 @@
+package org.sipfoundry.sipxconfig.microsite;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.tapestry.PageRedirectException;
+import org.apache.tapestry.annotations.Bean;
+import org.apache.tapestry.annotations.InjectObject;
+import org.apache.tapestry.annotations.InjectState;
+import org.apache.tapestry.event.PageBeginRenderListener;
+import org.apache.tapestry.event.PageEvent;
+import org.apache.tapestry.event.PageValidateListener;
+import org.apache.tapestry.html.BasePage;
+import org.apache.tapestry.valid.ValidatorException;
+import org.apache.tapestry.web.WebRequest;
+import org.apache.tapestry.web.WebSession;
+import org.sipfoundry.sipxconfig.components.SipxValidationDelegate;
+import org.sipfoundry.sipxconfig.security.SipxAuthenticationProcessingFilter;
+import org.sipfoundry.sipxconfig.site.UserSession;
+
+public abstract class Login extends BasePage implements PageValidateListener,
PageBeginRenderListener {
+
+ @InjectObject("infrastructure:request")
+ public abstract WebRequest getHttpServletRequest();
+ @InjectObject(value = "service:tapestry.globals.WebRequest")
+ public abstract WebRequest getRequest();
+ @InjectState(value = "userSession")
+ public abstract UserSession getUserSession();
+
+ @Bean
+ public abstract SipxValidationDelegate getValidator();
+
+ public void setUserName(String user) {
+
+ }
+
+ public String getUserName() {
+ String username =
getHttpServletRequest().getParameterValue("username");
+ if (username == null) {
+ username = "";
+ }
+ return username;
+ }
+ public void pageValidate(PageEvent event) {
+ if(getUserSession().isLoggedIn()) {
+ throw new PageRedirectException("microsite/xhtmlHome");
+ }
+ }
+
+ public void pageBeginRender(PageEvent event) {
+ if
(StringUtils.isNotEmpty(getRequest().getParameterValue("error"))) {
+ getValidator().record(new
ValidatorException(getMessages().getMessage("message.loginError")));
+ // save original http referer in session so we can later
redirect to
+ WebSession session = getRequest().getSession(false);
+ if
(session.getAttribute(SipxAuthenticationProcessingFilter.ORIGINAL_REFERER) ==
null) {
+
session.setAttribute(SipxAuthenticationProcessingFilter.ORIGINAL_REFERER,
getRequest().getHeader(
+ "Referer"));
+ }
+ }
+ }
+}
diff --git
a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/UserHandler.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/UserHandler.java
new file mode 100644
index 0000000..52594b2
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/UserHandler.java
@@ -0,0 +1,39 @@
+package org.sipfoundry.sipxconfig.microsite;
+
+import org.apache.tapestry.PageRedirectException;
+import org.apache.tapestry.annotations.InjectObject;
+import org.apache.tapestry.annotations.InjectState;
+import org.apache.tapestry.event.PageEvent;
+import org.apache.tapestry.event.PageValidateListener;
+import org.apache.tapestry.html.BasePage;
+import org.sipfoundry.sipxconfig.common.CoreContext;
+import org.sipfoundry.sipxconfig.common.User;
+import org.sipfoundry.sipxconfig.site.UserSession;
+/**
+ * Really simple utility class, by deriving a page class from this it
automatically ensures that
+ * there is a user logged in and otherwise redirects to the login page.
+ * @author David Becker
+ *
+ */
+public abstract class UserHandler extends BasePage implements
+ PageValidateListener {
+
+ @InjectState(value = "userSession")
+ public abstract UserSession getUserSession();
+
+ @InjectObject(value = "spring:coreContext")
+ public abstract CoreContext getCoreContext();
+
+ public User getUser() {
+ return getUserSession().getUser(getCoreContext());
+ }
+
+ public void pageValidate(PageEvent event) {
+ UserSession user = getUserSession();
+ if (!user.isLoggedIn()) {
+ throw new PageRedirectException("microsite/xhtmlLogin");
+ }
+ }
+
+
+}
diff --git
a/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Voicemail.java
b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Voicemail.java
new file mode 100644
index 0000000..41f762a
--- /dev/null
+++ b/sipXconfig/web/src/org/sipfoundry/sipxconfig/microsite/Voicemail.java
@@ -0,0 +1,50 @@
+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";
+ }
+}
--
1.5.5.6
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev/