[kune-commits] r1234 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/public src/main/java/cc/kune/common/client/noti src/main/java/cc/kune/common/public src/main/java/cc/kune/core/client/resources/icons src/main/java/cc/kune/core/public src/main/java/org/ourproject/kune/chat/client src/main/webapp/WEB-INF
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sat Feb 5 23:25:09 CET 2011
Author: vjrj_
Date: 2011-02-05 23:25:09 +0100 (Sat, 05 Feb 2011)
New Revision: 1234
Added:
trunk/src/main/java/cc/kune/chat/client/ChatOptions.java
trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java
trunk/src/main/java/cc/kune/core/client/resources/icons/e-icon-a.gif
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/chat/client/ChatClient.java
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/chat/public/kune-chat.css
trunk/src/main/java/cc/kune/common/client/noti/NotifyUser.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/client/resources/icons/IconResources.java
trunk/src/main/java/cc/kune/core/client/resources/icons/kicon.css
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/public/ws.html
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
trunk/src/main/webapp/WEB-INF/web.xml
Log:
CLOSED - # 17: emite chat update
http://kune.ourproject.org/issues/ticket/17
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/.classpath 2011-02-05 22:25:09 UTC (rev 1234)
@@ -25,6 +25,7 @@
<classpathentry kind="var" path="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0.jar" sourcepath="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA.jar" sourcepath="M2_REPO/org/hibernate/ejb3-persistence/1.0.2.GA/ejb3-persistence-1.0.2.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite/r1694/emite-r1694.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite-proxy/0.1/emite-proxy-0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3.jar" sourcepath="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/>
<classpathentry kind="var" path="M2_REPO/com/googlecode/gwt/inject/gin/r137/gin-r137.jar"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/pom.xml 2011-02-05 22:25:09 UTC (rev 1234)
@@ -307,6 +307,11 @@
</dependency>
<dependency>
<groupId>com.calclab.emite</groupId>
+ <artifactId>emite-proxy</artifactId>
+ <version>0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>com.calclab.emite</groupId>
<artifactId>hablar</artifactId>
<version>r1694</version>
</dependency>
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClient.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClient.java 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClient.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -6,14 +6,8 @@
void addNewBuddie(String shortName);
- //
- // void addOnRosterChanged(Listener0 slot);
-
void chat(XmppURI jid);
- //
- // ChatConnectionOptions getChatOptions();
-
boolean isBuddie(String localUserName);
boolean isBuddie(XmppURI jid);
@@ -24,7 +18,7 @@
void joinRoom(String roomName, String subject, String userAlias);
- void login(String jid, String passwd);
+ void login(XmppURI uri, String passwd);
void logout();
@@ -32,6 +26,4 @@
void show();
- void stop();
-
}
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -1,5 +1,7 @@
package cc.kune.chat.client;
+import java.util.Date;
+
import cc.kune.chat.client.ShowChatDialogEvent.ShowChatDialogHandler;
import cc.kune.chat.client.ToggleShowChatDialogEvent.ToggleShowChatDialogHandler;
import cc.kune.common.client.actions.AbstractExtendedAction;
@@ -11,9 +13,14 @@
import cc.kune.common.client.actions.ui.descrip.IconLabelDescriptor;
import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor;
import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor.Type;
+import cc.kune.common.client.noti.NotifyUser;
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.common.client.ui.PopupTopPanel;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.client.utils.WindowUtils;
import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.init.AppStopEvent;
+import cc.kune.core.client.logs.Log;
import cc.kune.core.client.resources.icons.IconResources;
import cc.kune.core.client.sitebar.SitebarActionsPresenter;
import cc.kune.core.client.state.Session;
@@ -21,10 +28,19 @@
import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
import cc.kune.core.client.state.UserSignOutEvent;
import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
+import cc.kune.core.shared.dto.UserInfoDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.calclab.emite.browser.client.PageAssist;
+import com.calclab.emite.core.client.xmpp.session.XmppSession;
import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+import com.calclab.emite.im.client.chat.ChatManager;
+import com.calclab.emite.im.client.roster.XmppRoster;
+import com.calclab.emite.reconnect.client.SessionReconnect;
+import com.calclab.emite.xep.avatar.client.AvatarManager;
+import com.calclab.emite.xep.muc.client.Room;
+import com.calclab.emite.xep.muc.client.RoomManager;
+import com.calclab.emite.xep.muc.client.subject.RoomSubject;
import com.calclab.hablar.HablarComplete;
import com.calclab.hablar.HablarConfig;
import com.calclab.hablar.console.client.HablarConsole;
@@ -36,8 +52,8 @@
import com.calclab.hablar.icons.ie6gif.client.IE6GifIcons;
import com.calclab.hablar.login.client.HablarLogin;
import com.calclab.hablar.login.client.LoginConfig;
+import com.calclab.suco.client.Suco;
import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
@@ -46,11 +62,16 @@
public static class ChatClientAction extends AbstractExtendedAction {
private final EventBus eventBus;
+ private final IconResources res;
@Inject
- public ChatClientAction(final EventBus eventBus) {
+ public ChatClientAction(final EventBus eventBus, final IconResources res) {
super();
this.eventBus = eventBus;
+ this.res = res;
+ res.css().ensureInjected();
+ putValue(Action.SMALL_ICON, res.chatBlink());
+
}
@Override
@@ -58,46 +79,56 @@
eventBus.fireEvent(new ToggleShowChatDialogEvent());
}
+ public void setBlink(final boolean blink) {
+ putValue(Action.SMALL_ICON, blink ? res.chatBlink() : res.chat());
+ }
+
}
protected static final String CHAT_CLIENT_ICON_ID = "k-chat-icon-id";
private final ChatClientAction action;
protected IconLabelDescriptor chatIcon;
+ private final ChatManager chatManager;
+ private final ChatOptions chatOptions;
private final I18nTranslationService i18n;
-
private PopupTopPanel popup;
-
- private final IconResources res;
-
+ private final RoomManager roomManager;
+ private final XmppRoster roster;
private final Session session;
-
private final GlobalShortcutRegister shorcutRegister;
-
private final SitebarActionsPresenter siteActions;
+ private final XmppSession xmppSession;
@Inject
public ChatClientDefault(final EventBus eventBus, final I18nTranslationService i18n, final ChatClientAction action,
- final SitebarActionsPresenter siteActions, final IconResources res, final Session session,
- final GlobalShortcutRegister shorcutRegister) {
+ final SitebarActionsPresenter siteActions, final Session session,
+ final GlobalShortcutRegister shorcutRegister, final ChatOptions chatOptions) {
this.i18n = i18n;
this.action = action;
this.siteActions = siteActions;
- this.res = res;
this.session = session;
this.shorcutRegister = shorcutRegister;
+ this.chatOptions = chatOptions;
+ roster = Suco.get(XmppRoster.class);
+ xmppSession = Suco.get(XmppSession.class);
+ chatManager = Suco.get(ChatManager.class);
+ roomManager = Suco.get(RoomManager.class);
+ Suco.get(SessionReconnect.class);
eventBus.addHandler(AppStartEvent.getType(), new AppStartEvent.AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
+ chatOptions.domain = event.getInitData().getChatDomain();
+ chatOptions.httpBase = event.getInitData().getChatHttpBase();
+ chatOptions.roomHost = event.getInitData().getChatRoomHost();
+ checkChatDomain(chatOptions.domain);
if (session.isLogged()) {
- createActionIfNeeded();
+ doLogin(session.getCurrentUserInfo());
}
eventBus.addHandler(UserSignInEvent.getType(), new UserSignInHandler() {
@Override
public void onUserSignIn(final UserSignInEvent event) {
- createActionIfNeeded();
- createDialogIfNeeded();
- chatIcon.setVisible(true);
+ doLogin(event.getUserInfo());
}
});
eventBus.addHandler(UserSignOutEvent.getType(), new UserSignOutHandler() {
@@ -105,6 +136,7 @@
public void onUserSignOut(final UserSignOutEvent event) {
createActionIfNeeded();
chatIcon.setVisible(false);
+ logout();
}
});
eventBus.addHandler(ShowChatDialogEvent.getType(), new ShowChatDialogHandler() {
@@ -122,29 +154,41 @@
});
}
});
+ eventBus.addHandler(AppStopEvent.getType(), new AppStopEvent.AppStopHandler() {
+ @Override
+ public void onAppStop(final AppStopEvent event) {
+ logout();
+ }
+ });
}
@Override
public void addNewBuddie(final String shortName) {
- // TODO Auto-generated method stub
-
+ roster.requestAddItem(XmppURI.jid(shortName + "@" + chatOptions.domain), shortName, "");
}
@Override
public void chat(final XmppURI jid) {
- // TODO Auto-generated method stub
+ chatManager.open(jid);
}
+ // Put this in Panel object
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will cause problems with the chat functionality. "
+ + "Please check kune.properties on the server.");
+ }
+ }
+
private void createActionIfNeeded() {
if (chatIcon == null) {
- res.css().ensureInjected();
chatIcon = new IconLabelDescriptor(action);
- // chatIcon.setParent(SitebarActionsPresenter.LEFT_TOOLBAR);
- chatIcon.putValue(Action.SMALL_ICON, res.chat());
- chatIcon.putValue(Action.NAME, i18n.t("Chat ;)"));
chatIcon.setId(CHAT_CLIENT_ICON_ID);
chatIcon.setStyles("k-no-backimage, k-btn-sitebar, k-chat-icon");
- action.putValue(Action.SHORT_DESCRIPTION, i18n.t("Show/hide the chat window"));
+ chatIcon.putValue(Action.NAME, i18n.t("Chat ;)"));
+ chatIcon.putValue(Action.SHORT_DESCRIPTION, i18n.t("Show/hide the chat window"));
final KeyStroke shortcut = Shortcut.getShortcut(false, true, true, false, Character.valueOf('C'));
shorcutRegister.put(shortcut, action);
action.setShortcut(shortcut);
@@ -160,28 +204,39 @@
}
private void createDialog(final HablarWidget widget, final HtmlConfig htmlConfig) {
- // popup.setSize(htmlConfig.width, htmlConfig.height);
widget.addStyleName("k-chat-panel");
setSize(widget, htmlConfig);
popup.add(widget);
}
- private DialogBox createDialog2(final HablarWidget widget, final HtmlConfig htmlConfig) {
- final DialogBox dialog = new DialogBox();
- dialog.setText("Hablar");
- setSize(dialog, htmlConfig);
- dialog.show();
- dialog.center();
- return dialog;
- }
-
private void createDialogIfNeeded() {
if (popup == null) {
popup = new PopupTopPanel();
+ popup.setStyleName("k-popup-top-centered");
+ popup.addStyleName("k-bottom-10corners");
+ popup.addStyleName("k-box-10shadow");
+ popup.addStyleName("k-chat-window");
initEmite();
}
}
+ private boolean dialogVisible() {
+ return popup != null && popup.isShowing();
+ }
+
+ private void doLogin(final UserInfoDTO user) {
+ createActionIfNeeded();
+ createDialogIfNeeded();
+ chatOptions.username = user.getChatName();
+ chatOptions.passwd = user.getChatPassword();
+ chatOptions.resource = "emite-" + new Date().getTime() + "-kune";
+ chatOptions.useruri = XmppURI.uri(chatOptions.username, chatOptions.domain, chatOptions.resource);
+ createActionIfNeeded();
+ createDialogIfNeeded();
+ chatIcon.setVisible(true);
+ login(chatOptions.useruri, chatOptions.passwd);
+ }
+
private void initEmite() {
final String icons = PageAssist.getMeta("hablar.icons");
if ("alt".equals(icons)) {
@@ -194,12 +249,11 @@
final HablarConfig config = HablarConfig.getFromMeta();
final HtmlConfig htmlConfig = HtmlConfig.getFromMeta();
- htmlConfig.hasLogger = true;
final HablarWidget widget = new HablarWidget(config.layout, config.tabHeaderSize);
final Hablar hablar = widget.getHablar();
HablarComplete.install(hablar, config);
-
+ new KuneHablarSignals(hablar, action);
if (htmlConfig.hasLogger) {
new HablarConsole(hablar);
}
@@ -212,50 +266,60 @@
@Override
public boolean isBuddie(final String localUserName) {
- // TODO Auto-generated method stub
- return false;
+ return isBuddie(XmppURI.jid(localUserName + "@" + chatOptions.domain));
}
@Override
public boolean isBuddie(final XmppURI jid) {
- // TODO Auto-generated method stub
+ if (roster.isRosterReady()) {
+ if (roster.getItemByJID(jid) != null) {
+ return true;
+ }
+ }
return false;
}
@Override
public boolean isLoggedIn() {
- // TODO Auto-generated method stub
- return false;
+ return xmppSession.isReady();
}
@Override
public void joinRoom(final String roomName, final String userAlias) {
- // TODO Auto-generated method stub
-
+ joinRoom(roomName, null, userAlias);
}
@Override
public void joinRoom(final String roomName, final String subject, final String userAlias) {
- // TODO Auto-generated method stub
-
+ if (xmppSession.isReady()) {
+ final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/" + chatOptions.username);
+ final Room room = roomManager.open(roomURI, roomManager.getDefaultHistoryOptions());
+ if (TextUtils.notEmpty(subject)) {
+ RoomSubject.requestSubjectChange(room, subject);
+ }
+ } else {
+ NotifyUser.error(i18n.t("Error"), i18n.t("To join a chatroom you need to be 'online'"), true);
+ }
}
@Override
- public void login(final String jid, final String passwd) {
- // TODO Auto-generated method stub
-
+ public void login(final XmppURI uri, final String passwd) {
+ xmppSession.login(uri, passwd);
}
@Override
public void logout() {
- // TODO Auto-generated method stub
-
+ if (dialogVisible()) {
+ popup.hide();
+ }
+ if (isLoggedIn()) {
+ xmppSession.logout();
+ }
}
@Override
public void setAvatar(final String photoBinary) {
- // TODO Auto-generated method stub
-
+ Suco.get(AvatarManager.class).setVCardAvatar(photoBinary);
}
private void setSize(final Widget widget, final HtmlConfig htmlConfig) {
@@ -265,14 +329,11 @@
if (htmlConfig.height != null) {
widget.setHeight(htmlConfig.height);
}
- widget.setWidth("450px");
- widget.setHeight("300px");
}
@Override
public void show() {
- // TODO Auto-generated method stub
-
+ showDialog(true);
}
private void showDialog(final boolean show) {
@@ -286,14 +347,7 @@
}
}
- @Override
- public void stop() {
- // TODO Auto-generated method stub
-
- }
-
private void toggleShowDialog() {
showDialog(popup == null ? true : !popup.isShowing());
}
-
}
Added: trunk/src/main/java/cc/kune/chat/client/ChatOptions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatOptions.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/ChatOptions.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -0,0 +1,13 @@
+package cc.kune.chat.client;
+
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+
+public class ChatOptions {
+ public String domain;
+ public String httpBase;
+ public String passwd;
+ public String resource;
+ public String roomHost;
+ public String username;
+ public XmppURI useruri;
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/chat/client/ChatOptions.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -0,0 +1,24 @@
+package cc.kune.chat.client;
+
+import cc.kune.common.client.noti.NotifyUser;
+
+import com.calclab.hablar.signals.client.notifications.HablarNotifier;
+
+public class KuneChatNotifier implements HablarNotifier {
+
+ @Override
+ public String getDisplayName() {
+ return "Bottom notifier";
+ }
+
+ @Override
+ public String getId() {
+ return "kuneChatNotifier";
+ }
+
+ @Override
+ public void show(final String userMessage, final String messageType) {
+ NotifyUser.info(userMessage);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -0,0 +1,89 @@
+package cc.kune.chat.client;
+
+import cc.kune.chat.client.ChatClientDefault.ChatClientAction;
+
+import com.calclab.emite.core.client.xmpp.session.XmppSession;
+import com.calclab.emite.xep.storage.client.PrivateStorageManager;
+import com.calclab.hablar.core.client.Hablar;
+import com.calclab.hablar.core.client.browser.BrowserFocusHandler;
+import com.calclab.hablar.core.client.mvp.HablarEventBus;
+import com.calclab.hablar.signals.client.SignalMessages;
+import com.calclab.hablar.signals.client.SignalPreferences;
+import com.calclab.hablar.signals.client.browserfocus.BrowserFocusManager;
+import com.calclab.hablar.signals.client.notifications.NotificationManager;
+import com.calclab.hablar.signals.client.preferences.SignalsPreferencesPresenter;
+import com.calclab.hablar.signals.client.preferences.SignalsPreferencesWidget;
+import com.calclab.hablar.signals.client.unattended.UnattendedPagesManager;
+import com.calclab.hablar.signals.client.unattended.UnattendedPresenter;
+import com.calclab.hablar.user.client.UserContainer;
+import com.calclab.suco.client.Suco;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.HasText;
+
+/**
+ * Install the signals module into Hablar
+ */
+public class KuneHablarSignals {
+
+ public static SignalMessages signalMessages;
+
+ /**
+ * Gets the {@link SignalMessages} object containing the internationalised
+ * messages
+ *
+ * @return the SignalMessages object containing the internationalised
+ * messages
+ */
+ public static SignalMessages i18n() {
+ return signalMessages;
+ }
+
+ /**
+ * Sets the {@link SignalMessages} object containing the internationalised
+ * messages
+ *
+ * @param t
+ * the messages object
+ */
+ public static void setMessages(final SignalMessages t) {
+ KuneHablarSignals.signalMessages = t;
+ }
+
+ // FIXME: move to gin
+ @SuppressWarnings("deprecation")
+ public KuneHablarSignals(final Hablar hablar, final ChatClientAction action) {
+ final HablarEventBus eventBus = hablar.getEventBus();
+ final XmppSession session = Suco.get(XmppSession.class);
+ final PrivateStorageManager storageManager = Suco.get(PrivateStorageManager.class);
+
+ final HasText titleDisplay = new HasText() {
+ @Override
+ public String getText() {
+ return Window.getTitle();
+ }
+
+ @Override
+ public void setText(final String text) {
+ Window.setTitle(text);
+ }
+ };
+ final SignalPreferences preferences = new SignalPreferences();
+
+ final UnattendedPagesManager manager = new UnattendedPagesManager(eventBus, BrowserFocusHandler.getInstance());
+ new BrowserFocusManager(eventBus, manager, BrowserFocusHandler.getInstance());
+ new UnattendedPresenter(eventBus, preferences, manager, titleDisplay);
+ new KuneUnattendedPresenter(eventBus, preferences, manager, action);
+ final NotificationManager notificationManager = new NotificationManager(eventBus, preferences);
+
+ // notificationManager.addNotifier((BrowserPopupHablarNotifier)
+ // GWT.create(BrowserPopupHablarNotifier.class),
+ // true);
+ notificationManager.addNotifier((KuneChatNotifier) GWT.create(KuneChatNotifier.class), true);
+
+ final SignalsPreferencesPresenter preferencesPage = new SignalsPreferencesPresenter(session, storageManager,
+ eventBus, preferences, new SignalsPreferencesWidget(), notificationManager);
+ hablar.addPage(preferencesPage, UserContainer.ROL);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -0,0 +1,35 @@
+package cc.kune.chat.client;
+
+import cc.kune.chat.client.ChatClientDefault.ChatClientAction;
+
+import com.calclab.hablar.core.client.mvp.HablarEventBus;
+import com.calclab.hablar.signals.client.SignalPreferences;
+import com.calclab.hablar.signals.client.unattended.UnattendedChatsChangedEvent;
+import com.calclab.hablar.signals.client.unattended.UnattendedChatsChangedHandler;
+import com.calclab.hablar.signals.client.unattended.UnattendedPagesManager;
+
+/**
+ * Handles the presentation of unattended chats
+ */
+public class KuneUnattendedPresenter {
+ private boolean active;
+
+ public KuneUnattendedPresenter(final HablarEventBus hablarEventBus, final SignalPreferences preferences,
+ final UnattendedPagesManager unattendedManager, final ChatClientAction action) {
+ active = false;
+ hablarEventBus.addHandler(UnattendedChatsChangedEvent.TYPE, new UnattendedChatsChangedHandler() {
+ @Override
+ public void handleUnattendedChatChange(final UnattendedChatsChangedEvent event) {
+ final int unattendedChatsCount = unattendedManager.getSize();
+ if (unattendedChatsCount > 0 && active == false) {
+ active = true;
+ action.setBlink(true);
+ } else if (unattendedChatsCount == 0 && active == true) {
+ action.setBlink(false);
+ active = false;
+ }
+ }
+
+ });
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/chat/client/KuneUnattendedPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/public/kune-chat.css
===================================================================
--- trunk/src/main/java/cc/kune/chat/public/kune-chat.css 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/chat/public/kune-chat.css 2011-02-05 22:25:09 UTC (rev 1234)
@@ -1,3 +1,63 @@
+/* hablar: Examples.css */
+/* html {border: 0; padding: 0; height: 100%; width: 100%; overflow: hidden;} */
+
+#center {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+}
+
+#playground {
+ position: absolute;
+ width: 900px;
+ height: 500px;
+ left: -450px;
+ top: -250px;
+ background-color: #e9e9e9;
+ border: 1px solid #bbbbbb;
+ padding: 5px;
+}
+
+.hablar {
+ padding: 1px;
+ background-color: #bBBBBB;
+}
+
+#vertical_div {
+ position: absolute;
+ left: -150px;
+ width: 300px;
+ top: 5%;
+ height: 90%;
+}
+
+#hablar_complete {
+ position: fixed; overflow: hidden;
+ left: 5px;
+ top: 5px;
+ right: 5px;
+ bottom: 5px;
+ background-color: #BBBBBB;
+}
+
+#vertical_dock_div {
+ position: absolute;
+ left: -250px;
+ width: 500px;
+ top: 5%;
+ height: 90%;
+}
+
+#horizontal_div {
+ position: absolute;
+ left: -350px;
+ width: 700px;
+ top: 15%;
+ height: 70%;
+}
+
+/* End of hablar: Examples.css */
+
.k-chat-icon {
}
@@ -2,4 +62,84 @@
+.k-chat-window {
+ background-color: #FFF;
+}
+
.k-chat-panel {
- margin: 10px;
-}
\ No newline at end of file
+ margin: 5px;
+ background-color: #FFF; /* !important;*/
+ /* kfilter: alpha(opacity = 88) !important;*/
+ /* -moz-opacity: 0.88 !important;*/
+ /* -khtml-opacity: 0.88 !important;*/ /* opacity: 0.88 !important;*/
+}
+
+.hablar-HablarWidget {
+ background-color: #888;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.gwt-Button {
+ text-shadow: 1px 1px 1px #FFFFFF;
+ font-weight: bold;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.gwt-TextBox,.gwt-TextArea {
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+}
+
+.hablar-defaultBackground,.hablar-UserWidget,.hablar-defaultBordered {
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border-radius: 5px;
+}
+
+.hablar-Header {
+/* -webkit-border-top-right-radius: 5px;*/
+/* -moz-border-radius-topright: 5px;*/
+/* border-top-right-radius: 5px;*/
+/* -webkit-border-top-left-radius: 5px;*/
+/* -moz-border-radius-topleft: 5px;*/
+/* border-top-left-radius: 5px;*/
+}
+
+.hablar-errorColor {
+ line-height: 2.5em;
+}
+
+.form h2 {
+ font-size: 22px;
+ font-weight: bold;
+}
+
+.gwt-TabLayoutPanel,.gwt-TabLayoutPanelTab,.hablar-TabsHeaderWidget {
+ -webkit-border-top-right-radius: 5px;
+ -moz-border-radius-topright: 5px;
+ border-top-right-radius: 5px;
+ -webkit-border-top-left-radius: 5px;
+ -moz-border-radius-topleft: 5px;
+ border-top-left-radius: 5px;
+}
+
+.hablar-ChatWidget {
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-right-radius: 5px;
+}
+
+.ellipsis {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ -o-text-overflow: ellipsis;
+ -ms-text-overflow: ellipsis;
+ -moz-binding: url('/ws/ellipsis.xml#ellipsis');
+ width: 100%
+}
+
+
Modified: trunk/src/main/java/cc/kune/common/client/noti/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/noti/NotifyUser.java 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/common/client/noti/NotifyUser.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -19,10 +19,16 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, closeable));
}
- public static void error(final String message, final String id, final boolean closeable) {
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, id, closeable));
+ public static void error(final String message, final String title, final boolean closeable) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
}
+ public static void error(final String message, final String title, final String id, final boolean closeable) {
+ final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.error, message, id, closeable);
+ event.setId(id);
+ eventBus.fireEvent(event);
+ }
+
public static void hideProgress() {
eventBus.fireEvent(new ProgressHideEvent());
}
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-02-05 22:25:09 UTC (rev 1234)
@@ -126,11 +126,11 @@
padding: 22px 4px 3px 4px;
}
-.k-dialog-title {
+.k-dialog-title span {
color: #552200;
font-size: 20px;
font-weight: bold;
- margin: 5px 0 0 12px;
+ margin: 0 0 0 6px;
}
.k-dialog-innerp {
Modified: trunk/src/main/java/cc/kune/core/client/resources/icons/IconResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/icons/IconResources.java 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/core/client/resources/icons/IconResources.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -14,8 +14,10 @@
@Source("e-icon.gif")
ImageResource chat();
+ @Source("e-icon-a.gif")
+ ImageResource chatBlink();
+
@Source("kicon.css")
- // @Strict
IconBorrarCssResource css();
@Source("del-green.png")
Added: trunk/src/main/java/cc/kune/core/client/resources/icons/e-icon-a.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/icons/e-icon-a.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/cc/kune/core/client/resources/icons/kicon.css
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/icons/kicon.css 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/core/client/resources/icons/kicon.css 2011-02-05 22:25:09 UTC (rev 1234)
@@ -1,41 +1,44 @@
@external k-icon-info,k-icon-language,k-icon-kuneIcon16,k-icon-bug,k-icon-prefs,k-icon-groupHome,k-icon-addGreen,k-icon-maximize,k-icon-minimize,k-*;
-
@sprite div .k-icon-info {
- gwt-image: "info";
+ gwt-image: "info";
}
@sprite div .k-icon-language {
- gwt-image: "language";
+ gwt-image: "language";
}
@sprite div .k-icon-kuneIcon16 {
- gwt-image: "kuneIcon16";
+ gwt-image: "kuneIcon16";
}
@sprite div .k-icon-bug {
- gwt-image: "bug";
+ gwt-image: "bug";
}
@sprite div .k-icon-prefs {
- gwt-image: "prefs";
+ gwt-image: "prefs";
}
@sprite div .k-icon-groupHome {
- gwt-image: "groupHome";
+ gwt-image: "groupHome";
}
@sprite div .k-icon-addGreen {
- gwt-image: "addGreen";
+ gwt-image: "addGreen";
}
@sprite div .k-icon-maximize {
- gwt-image: "maximize";
+ gwt-image: "maximize";
}
+ at sprite div .k-icon-chatBlink {
+ gwt-image: "chatBlink";
+}
+
@sprite div .k-icon-chat {
- gwt-image: "chat";
+ gwt-image: "chat";
}
@sprite div .k-icon-minimize {
- gwt-image: "minimize";
+ gwt-image: "minimize";
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2011-02-05 22:25:09 UTC (rev 1234)
@@ -713,4 +713,14 @@
-moz-opacity: 0.78 !important;
-khtml-opacity: 0.78 !important;
opacity: 0.78 !important;
-}
\ No newline at end of file
+}
+
+.x-form-item-label {
+ font-size: 16px;
+ font-weight: bold;
+}
+
+.x-form-text {
+ font-size: 14px;
+}
+
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/public/ws.html
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.html 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/cc/kune/core/public/ws.html 2011-02-05 22:25:09 UTC (rev 1234)
@@ -5,21 +5,24 @@
<title>Kune</title>
<script type="text/javascript" language="javascript"
src="/ws/ws.nocache.js"></script>
-<meta name="emite.httpBase" content="/http-bind" />
+<meta name="emite.httpBase" content="/http-bind/" />
<meta name="emite.host" content="localhost" />
<meta name="emite.searchHost" content="search.localhost" />
<meta name="emite.session" content="login" />
-<meta name="emite.user" content="admin at localhost" />
-<meta name="emite.password" content="easyeasy" />
<meta name="hablar.roomService" content="rooms.localhost" />
<meta name="hablar.login" content="false" />
+<meta name="hablar.hasVCard" content="false" />
+<meta name="hablar.search" content="false" />
+<meta name="hablar.hasCopyToClipboard" content="false" />
+<meta name="hablar.hasLogger" content="true" />
+<meta name="hablar.hasSignals" content="false" />
<meta name="hablar.roster" content="true" />
<meta name="hablar.dockRoster" content="left" />
<meta name="hablar.icons" content="alt" />
<meta name="hablar.layout" content="tabs" />
<meta name="hablar.inline" content="vertical_dock_div" />
-<meta name="hablar.width" content="100%" />
-<meta name="hablar.height" content="100%" />
+<meta name="hablar.width" content="550px" />
+<meta name="hablar.height" content="300px" />
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" type="text/css"
href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
@@ -49,8 +52,8 @@
rel='stylesheet' type='text/css'> -->
<link type="text/css" rel="stylesheet" href="gxt/css/gxt-all.css">
<link type="text/css" rel="stylesheet" href="gxt/css/gxt-gray.css">
+<link type="text/css" rel="stylesheet" href="kune-hablar.css">
<link type="text/css" rel="stylesheet" href="kune-chat.css">
-<link type="text/css" rel="stylesheet" href="kune-hablar.css">
<link type="text/css" rel="stylesheet" href="kune-common.css">
<link type="text/css" rel="stylesheet"
href="fontface/ubuntufontface.css">
@@ -70,6 +73,9 @@
margin: 30px;
}
</style>
+<!--[if IE 6]>
+ <link type="text/css" rel="stylesheet" href="ie6.css">
+<![endif]-->
</head>
<body>
<!-- Banner for wave errors -->
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2011-02-05 22:25:09 UTC (rev 1234)
@@ -19,103 +19,17 @@
*/
package org.ourproject.kune.chat.client;
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
-import com.calclab.suco.client.events.Listener0;
-
-class ChatEngineDefault implements ChatEngine {
-
- @Override
- public void addNewBuddie(final String shortName) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void addOnRosterChanged(final Listener0 slot) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void chat(final XmppURI jid) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public ChatConnectionOptions getChatOptions() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public boolean isBuddie(final String localUserName) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean isBuddie(final XmppURI jid) {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public boolean isLoggedIn() {
- // TODO Auto-generated method stub
- return false;
- }
-
- @Override
- public void joinRoom(final String roomName, final String userAlias) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void joinRoom(final String roomName, final String subject, final String userAlias) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void login(final String jid, final String passwd) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void logout() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void setAvatar(final String photoBinary) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void show() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void stop() {
- // TODO Auto-generated method stub
-
- }
+class ChatEngineDefault { // implements ChatEngine {
+ //
// private ChatConnectionOptions chatOptions;
- // private final I18nTranslationService i18n;
- // private final WorkspaceSkeleton wskel;
- // private ToolbarButton traybarButton;
+ // private final Provider<FileDownloadUtils> downloadUtils;
// private final Provider<EmiteUIDialog> emiteUIProvider;
- // private Collection<RosterItem> roster;
+ // private final I18nTranslationService i18n;
// private final Event0 onRosterChanged;
+ // private Collection<RosterItem> roster;
// private final KeyStroke shortcut;
- // private final Provider<FileDownloadUtils> downloadUtils;
+ // private ToolbarButton traybarButton;
+ // private final WorkspaceSkeleton wskel;
//
// public ChatEngineDefault(final I18nTranslationService i18n, final
// WorkspaceSkeleton wskel,
@@ -140,14 +54,6 @@
// }
// });
// session.onInitDataReceived(new Listener<InitDataDTO>() {
- // @Override
- // public void onEvent(final InitDataDTO initData) {
- // checkChatDomain(initData.getChatDomain());
- // chatOptions = new ChatConnectionOptions(initData.getChatHttpBase(),
- // initData.getChatDomain(),
- // initData.getChatRoomHost());
- // }
- //
// private void checkChatDomain(final String chatDomain) {
// final String httpDomain = WindowUtils.getLocation().getHostName();
// if (!chatDomain.equals(httpDomain)) {
@@ -157,6 +63,14 @@
// + "Please check kune.properties on the server.");
// }
// }
+ //
+ // @Override
+ // public void onEvent(final InitDataDTO initData) {
+ // checkChatDomain(initData.getChatDomain());
+ // chatOptions = new ChatConnectionOptions(initData.getChatHttpBase(),
+ // initData.getChatDomain(),
+ // initData.getChatRoomHost());
+ // }
// });
// session.onUserSignOut(new Listener0() {
// @Override
@@ -179,18 +93,18 @@
//
// @Override
// public void addNewBuddie(final String shortName) {
- // emiteUIProvider.get().addBuddie(getLocalUserJid(shortName), shortName,
+ // // emiteUIProvider.get().addBuddie(getLocalUserJid(shortName), shortName,
// "");
// }
//
// @Override
// public void addOnRosterChanged(final Listener0 slot) {
- // onRosterChanged.add(slot);
+ // // onRosterChanged.add(slot);
// }
//
// @Override
// public void chat(final XmppURI jid) {
- // emiteUIProvider.get().chat(jid);
+ // // emiteUIProvider.get().chat(jid);
// }
//
// @Override
@@ -198,6 +112,20 @@
// return chatOptions;
// }
//
+ // private XmppURI getLocalUserJid(final String shortName) {
+ // return XmppURI.jid(shortName + "@" + chatOptions.domain);
+ // }
+ //
+ // private UserChatOptions getUserChatOptions(final String jid, final String
+ // passwd) {
+ // final String resource = "emiteui-" + new Date().getTime() + "-kune"; // +
+ // // getGwtMetaProperty(GWT_PROPERTY_RELEASE);
+ // // FIXME, get this from user profile
+ // return new UserChatOptions(jid + "@" + chatOptions.domain, passwd,
+ // resource, "blue", SubscriptionMode.manual,
+ // true);
+ // }
+ //
// @Override
// public boolean isBuddie(final String shortName) {
// return isBuddie(getLocalUserJid(shortName));
@@ -216,12 +144,12 @@
// }
//
// public boolean isDialogStarted() {
- // return !emiteUIProvider.get().isDialogNotStarted();
+ // // return !emiteUIProvider.get().isDialogNotStarted();
// }
//
// @Override
// public boolean isLoggedIn() {
- // return emiteUIProvider.get().isLoggedIn();
+ // // return emiteUIProvider.get().isLoggedIn();
// }
//
// @Override
@@ -232,27 +160,27 @@
// @Override
// public void joinRoom(final String roomName, final String subject, final
// String userAlias) {
- // if (emiteUIProvider.get().isLoggedIn()) {
- // final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost
- // + "/"
- // + chatOptions.userOptions.getUserJid().getNode());
- // final Room room = (Room) emiteUIProvider.get().joinRoom(roomURI);
- // if (subject != null) {
- // Scheduler.get().scheduleDeferred(new ScheduledCommand() {
- // @Override
- // public void execute() {
- // final RoomUI roomUI = (RoomUI) room.getData(ChatUI.class);
- // if (roomUI != null) {
- // roomUI.setSubject(subject);
- // }
- // }
- // });
- // }
- // } else {
- // NotifyUser.showAlertMessage(i18n.t("Error"),
+ // // if (emiteUIProvider.get().isLoggedIn()) {
+ // // final XmppURI roomURI = XmppURI.uri(roomName + "@" +
+ // chatOptions.roomHost + "/"
+ // // + chatOptions.userOptions.getUserJid().getNode());
+ // // final Room room = (Room) emiteUIProvider.get().joinRoom(roomURI);
+ // // if (subject != null) {
+ // // Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ // // @Override
+ // // public void execute() {
+ // // final RoomUI roomUI = (RoomUI) room.getData(ChatUI.class);
+ // // if (roomUI != null) {
+ // // roomUI.setSubject(subject);
+ // // }
+ // // }
+ // // });
+ // // }
+ // // } else {
+ // // NotifyUser.showAlertMessage(i18n.t("Error"),
// i18n.t("To join a chatroom you need to be 'online'"));
+ // // }
// }
- // }
//
// @Override
// public void login(final String jid, final String passwd) {
@@ -369,18 +297,4 @@
// emiteUIProvider.get().show();
// }
// }
- //
- // private XmppURI getLocalUserJid(final String shortName) {
- // return XmppURI.jid(shortName + "@" + chatOptions.domain);
- // }
- //
- // private UserChatOptions getUserChatOptions(final String jid, final String
- // passwd) {
- // final String resource = "emiteui-" + new Date().getTime() + "-kune"; // +
- // // getGwtMetaProperty(GWT_PROPERTY_RELEASE);
- // // FIXME, get this from user profile
- // return new UserChatOptions(jid + "@" + chatOptions.domain, passwd,
- // resource, "blue", SubscriptionMode.manual,
- // true);
- // }
}
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2011-02-04 20:52:27 UTC (rev 1233)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-02-05 22:25:09 UTC (rev 1234)
@@ -4,6 +4,10 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
+
+ <!-- NOTE: if you modify this, cp for rapid testing: cp src/main/webapp/WEB-INF/web.xml
+ target/kune-PUT_HERE_VERSION/WEB-INF/web.xml -->
+
<!-- TODO: Add <servlet> tags for each servlet here. -->
<!-- TODO: Add <servlet-mapping> tags for each <servlet> here. -->
<!-- TODO: Optionally add a <welcome-file-list> tag to display a welcome
@@ -16,43 +20,43 @@
</welcome-file-list>
<!-- JRuby servlets ======================================================================================= -->
<!-- Note: this gives problems depending on the version of jetty or tomcat -->
- <!-- <context-param> -->
- <!-- <param-name>jruby.standalone</param-name> -->
- <!-- <param-value>true</param-value> -->
- <!-- </context-param> -->
- <!-- <context-param> -->
- <!-- <param-name>rails.root</param-name> -->
- <!-- <param-value>/WEB-INF/publicspace/ -->
- <!-- </param-value> -->
- <!-- </context-param> -->
- <!-- <context-param> -->
- <!-- <param-name>files.prefix</param-name> -->
- <!-- <param-value>/WEB-INF/publicspace/public -->
- <!-- </param-value> -->
- <!-- </context-param> -->
- <!-- <context-param> -->
- <!-- <param-name>rails.env</param-name> -->
- <!-- <param-value>production</param-value> -->
- <!-- </context-param> -->
- <!-- <context-param> -->
- <!-- <param-name>jruby.max.runtimes</param-name> -->
- <!-- <param-value>1</param-value> -->
- <!-- </context-param> -->
- <!-- <context-param> -->
- <!-- <param-name>public.root</param-name> -->
- <!-- <param-value>/public/</param-value> -->
- <!-- </context-param> -->
- <!-- <filter> -->
- <!-- <filter-name>RackFilter</filter-name> -->
- <!-- <filter-class>org.jruby.rack.RackFilter</filter-class> -->
- <!-- </filter> -->
- <!-- <filter-mapping> -->
- <!-- <filter-name>RackFilter</filter-name> -->
- <!-- <url-pattern>/public/*</url-pattern> -->
- <!-- </filter-mapping> -->
- <!-- <listener> -->
- <!-- <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class> -->
- <!-- </listener> -->
+ <context-param>
+ <param-name>jruby.standalone</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>rails.root</param-name>
+ <param-value>/WEB-INF/publicspace/
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>files.prefix</param-name>
+ <param-value>/WEB-INF/publicspace/public
+ </param-value>
+ </context-param>
+ <context-param>
+ <param-name>rails.env</param-name>
+ <param-value>production</param-value>
+ </context-param>
+ <context-param>
+ <param-name>jruby.max.runtimes</param-name>
+ <param-value>1</param-value>
+ </context-param>
+ <context-param>
+ <param-name>public.root</param-name>
+ <param-value>/public/</param-value>
+ </context-param>
+ <filter>
+ <filter-name>RackFilter</filter-name>
+ <filter-class>org.jruby.rack.RackFilter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>RackFilter</filter-name>
+ <url-pattern>/public/*</url-pattern>
+ </filter-mapping>
+ <listener>
+ <listener-class>org.jruby.rack.rails.RailsServletContextListener</listener-class>
+ </listener>
<!-- Kune normal guice configuration ======================================================================== -->
<filter>
<filter-name>rack</filter-name>
@@ -69,21 +73,42 @@
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- Emite xmpp proxy ======================================================================================= -->
+ <!-- <servlet> -->
+ <!-- <servlet-name>HttpBind</servlet-name> -->
+ <!-- <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class> -->
+ <!-- <init-param> -->
+ <!-- <param-name>ProxyTo</param-name> -->
+ <!-- <param-value>http://localhost:5280/</param-value> -->
+ <!-- </init-param> -->
+ <!-- <init-param> -->
+ <!-- <param-name>Prefix</param-name> -->
+ <!-- <param-value>/</param-value> -->
+ <!-- </init-param> -->
+ <!-- </servlet> -->
+ <!-- <servlet-mapping> -->
+ <!-- <servlet-name>HttpBind</servlet-name> -->
+ <!-- <url-pattern>/http-bind/</url-pattern> -->
+ <!-- </servlet-mapping> -->
<servlet>
- <servlet-name>HttpBind</servlet-name>
- <servlet-class>org.eclipse.jetty.servlets.ProxyServlet$Transparent</servlet-class>
+ <servlet-name>Proxy</servlet-name>
+ <servlet-class>de.spieleck.servlets.ProxyServlet</servlet-class>
<init-param>
- <param-name>ProxyTo</param-name>
- <param-value>http://localhost:5280/http-bind/</param-value>
+ <param-name>remotePath</param-name>
+ <param-value>/http-bind/</param-value>
</init-param>
<init-param>
- <param-name>Prefix</param-name>
- <param-value>/</param-value>
+ <param-name>remoteServer</param-name>
+ <param-value>localhost</param-value>
</init-param>
+ <init-param>
+ <param-name>remotePort</param-name>
+ <param-value>5280</param-value>
+ </init-param>
</servlet>
<servlet-mapping>
- <servlet-name>HttpBind</servlet-name>
- <url-pattern>/http-bind</url-pattern>
+ <servlet-name>Proxy</servlet-name>
+ <url-pattern>/http-bind/
+ </url-pattern>
</servlet-mapping>
<!-- Wave proxies with context / ====================================================================== -->
<servlet>
More information about the kune-commits
mailing list