File tree Expand file tree Collapse file tree 6 files changed +34
-8
lines changed
modules/web/src/de/diedavids/cuba/userinbox Expand file tree Collapse file tree 6 files changed +34
-8
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,6 @@ to the system in order to notify the user about something changed in the system.
5151![ Screenshot overview of incoming messages] ( https://github.com/mariodavid/cuba-component-user-inbox/blob/master/img/messages-overview.png )
5252
5353
54-
5554## Sending messages
5655
5756To send messages to a particular user, there are two options available:
@@ -106,3 +105,26 @@ public interface MessageService {
106105` sendSystemMessage ` will add a message in the given receivers inbox with a subject, a text and an optional entity reference.
107106
108107
108+ ## Using predefined main window screens
109+
110+ This application component comes with two options for the main screens, that can be used in the final application.
111+
112+ * SideMainwindowWithMessages (side-mainwindow-with-messages.xml)
113+ * AppMainWindowWithMessages (mainwindow-with-messages.xml)
114+
115+ One of these two classes can be used as the mainwinow through the following definition in your web-screens.xml:
116+
117+ ````
118+ <!-- either the normal mainwindow with messages badge -->
119+ <screen id="mainWindow"
120+ template="de/diedavids/cuba/userinbox/web/screens/mainwindow-with-messages.xml"/>
121+
122+ <!-- or the side menu main window with messages badge -->
123+ <screen id="mainWindow"
124+ template="de/diedavids/cuba/userinbox/web/screens/side-mainwindow-with-messages.xml"/>
125+
126+ ````
127+
128+ You can also extend this screens, so that you can add your own (screen-) logic to the mainwindow.
129+
130+
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
22<screen-config xmlns =" http://schemas.haulmont.com/cuba/screens.xsd" >
33 <include file =" de/diedavids/cuba/userinbox/screens.xml" />
4+
45 <!--
6+
57 <screen id="mainWindow"
6- template="de/diedavids/cuba/userinbox/web/screens/ext- mainwindow.xml"/>
7- -->
8+ template="de/diedavids/cuba/userinbox/web/screens/mainwindow-with-messages .xml"/>
9+
810 <screen id="mainWindow"
9- template =" de/diedavids/cuba/userinbox/web/screens/side-ext-mainwindow.xml" />
11+ template="de/diedavids/cuba/userinbox/web/screens/side-mainwindow-with-messages.xml"/>
12+
13+ -->
1014 <screen id =" user-inbox"
1115 template =" de/diedavids/cuba/userinbox/web/message/user-inbox.xml" />
1216 <screen id =" send-message"
Original file line number Diff line number Diff line change 33import com .haulmont .cuba .gui .WindowManager ;
44import com .haulmont .cuba .web .app .mainwindow .AppMainWindow ;
55
6- public class ExtAppMainWindow extends AppMainWindow {
6+ public class AppMainWindowWithMessages extends AppMainWindow {
77
88
99 public void openMessages () {
Original file line number Diff line number Diff line change 1111import javax .inject .Inject ;
1212import java .util .Map ;
1313
14- public class SideExtMainwindow extends AbstractMainWindow {
14+ public class SideMainwindowWithMessages extends AbstractMainWindow {
1515
1616 @ Inject
1717 private FtsField ftsField ;
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
22<window xmlns =" http://schemas.haulmont.com/cuba/window.xsd"
3- class =" de.diedavids.cuba.userinbox.web.screens.ExtAppMainWindow "
3+ class =" de.diedavids.cuba.userinbox.web.screens.AppMainWindowWithMessages "
44 extends =" /com/haulmont/cuba/web/app/mainwindow/mainwindow.xml"
55 messagesPack =" de.diedavids.cuba.userinbox.web.screens"
66 xmlns : ext =" http://schemas.haulmont.com/cuba/window-ext.xsd" >
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" standalone =" no" ?>
22<window xmlns =" http://schemas.haulmont.com/cuba/window.xsd"
33 caption =" mainMsg://application.caption"
4- class =" de.diedavids.cuba.userinbox.web.screens.SideExtMainwindow "
4+ class =" de.diedavids.cuba.userinbox.web.screens.SideMainwindowWithMessages "
55 messagesPack =" de.diedavids.cuba.userinbox.web.screens"
66 xmlns : main =" http://schemas.haulmont.com/cuba/mainwindow.xsd" >
77 <timers >
You can’t perform that action at this time.
0 commit comments