Skip to content

Commit a4fc8ab

Browse files
author
Mario David
committed
added information about mainwindow options
1 parent a119510 commit a4fc8ab

File tree

6 files changed

+34
-8
lines changed

6 files changed

+34
-8
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff 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

5756
To 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+

modules/web/src/de/diedavids/cuba/userinbox/web-screens.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
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"

modules/web/src/de/diedavids/cuba/userinbox/web/screens/ExtAppMainWindow.java renamed to modules/web/src/de/diedavids/cuba/userinbox/web/screens/AppMainWindowWithMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.haulmont.cuba.gui.WindowManager;
44
import 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() {

modules/web/src/de/diedavids/cuba/userinbox/web/screens/SideExtMainwindow.java renamed to modules/web/src/de/diedavids/cuba/userinbox/web/screens/SideMainwindowWithMessages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import javax.inject.Inject;
1212
import java.util.Map;
1313

14-
public class SideExtMainwindow extends AbstractMainWindow {
14+
public class SideMainwindowWithMessages extends AbstractMainWindow {
1515

1616
@Inject
1717
private FtsField ftsField;

modules/web/src/de/diedavids/cuba/userinbox/web/screens/ext-mainwindow.xml renamed to modules/web/src/de/diedavids/cuba/userinbox/web/screens/mainwindow-with-messages.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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">

modules/web/src/de/diedavids/cuba/userinbox/web/screens/side-ext-mainwindow.xml renamed to modules/web/src/de/diedavids/cuba/userinbox/web/screens/side-mainwindow-with-messages.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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>

0 commit comments

Comments
 (0)