Skip to content

Commit 3e46aec

Browse files
committed
Update the client-side code of the web module for Silverpeas 6.4. Update the README.md with the details about the code in the web module. Clean up all of the unused code from the previous versions.
1 parent 87dcd0b commit 3e46aec

34 files changed

+1117
-743
lines changed

README.md

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The web layer is usually composed of two parts:
118118
* The Web front-end which is also made up of two parts:
119119
* The server-side to answer the request coming from the client-side and which is built atop of
120120
the Silverpeas MVC framework;
121-
* The client-side which provides the user with web UI to interact with the application and
121+
* The client-side to provide the user with web UI to interact with the application and
122122
which is made up of JSP pages, Javascript files, and CSS and pictures resources.
123123

124124
### The REST-based web services
@@ -141,18 +141,20 @@ tests like forbidden access, non-existing resource access, and so on.
141141

142142
The front-end in Silverpeas is made up of two sublayers:
143143

144-
* the Web pages with which the user interact with the application and running within a web browser;
145-
* the MVC framework listening for HTTP requests coming from the web pages to trigger the
146-
asked functions of the application
144+
* The Web pages with which the user interact with the application and running within a web browser;
145+
* The MVC framework listening for HTTP requests coming from the web pages to trigger the
146+
asked functions of the application and to redirect the user to the next web pages or on an
147+
updated part of the web page.
147148

148149
#### The Web pages
149150

150151
Web pages generation is based on the following approach:
151152

152153
* Silverpeas provides a canvas along with a look&feel for the applications web UI;
153-
* The HTML page is generated with an initial content from the business data on the server-side;
154+
* The HTML page is generated with possibly an initial content from the business data on the
155+
server-side;
154156
* The dynamic of the HTML pages is driven by Javascript on the client-side and the content is
155-
updated by AJAX.
157+
updated and possibly loaded by AJAX.
156158

157159
Silverpeas still uses the old JSP and JSTL technologies to generate the HTML pages because they
158160
are the mode efficient and flexible way for this purpose in the Java world. The counterpart of
@@ -166,31 +168,52 @@ and Javascript codes, and CSS/Javascript inclusion, satisfying by the way the co
166168
Silverpeas, several sets of custom JSTL are provided (`silverfunction`, `viewgenerator`, ...)
167169
along with the default JSTL.
168170

171+
The web pages generated for a given application are rendered within the layout of the Silverpeas
172+
main web page. According to the interaction of the user with some parts of the main web page,
173+
one or several parts within the layout can be updated (by requesting the corresponding web
174+
controllers (see later)).
175+
169176
The dynamic of Web pages is motorized by both plain Javascript, JQuery and VueJS. (Because
170177
previously the dynamic was driven by AngularJS, there is again some codes in Silverpeas using
171178
this old and deprecated Javascript framework.) Silverpeas provides a custom Javascript framework
172179
built atop of both plain Javascript, JQuery and VueJS in order to make the writing of UI
173180
interactions easier without having to worry about a lot of details peculiar to Silverpeas. The goal
174-
of the framework with VueJS code in the applications is to give them a more web component-oriented
175-
approach.
181+
of the framework with VueJS code in the applications is to give them a more web
182+
component-oriented and asynchronous approach. Therefore, a knowledge of the Silverpeas framework
183+
is required to profit of all of its capabilities.
184+
185+
In this project, the application is a single-page one, generated from the `home.jsp` JSP. The
186+
whole UI rendering and interaction in this web page is performed by a custom view plugin,
187+
`todolist_plugin`, that is defined and registered by the `TodolistJavascriptPluginRegistering` Java
188+
code, and that is declared in the single page of the application. This plugin defines the
189+
VueJS web component *todolist* dedicated to manage in the client side the todos of a todolist.
190+
It is made up of the following parts, all of them defined in the *todolist/jsp/javascript/vuejs*
191+
directory in the web root folder:
192+
193+
* `silverpeas-todolist-template.jsp` in which are defined the different view components of the
194+
web component *todolist*;
195+
* `silverpeas-todolist.css` in which are defined the look of the different view components and
196+
their inner parts;
197+
* `silverpeas-todolist.js` in which is defined the behavior (and hence the user interaction) of
198+
the web component *todolist*.
176199

177200
#### The MVC framework
178201

179202
Since its inception, Silverpeas provides a custom MVC framework. The first one was developed at
180203
the time Struts didn't yet existed. It was composed of two bricks:
181204

182-
* The request router whose goal is to translate the incoming user request to a function to
183-
invoke on the controller;
184-
* The controller whose goal is to delegate the invoked function to one or more calls on
185-
the business layers of the application and of Silverpeas. The controller is user session
186-
life-scoped; this is why it is also named *session controller*.
205+
* The request router whose goal is to translate the incoming user request to an application
206+
function on the controller;
207+
* The controller whose goal is to delegate the application function requested by the user from the
208+
UI to one or more calls on the business layers of the application and of Silverpeas. The
209+
controller is user session life-scoped; this is why it is also named *session controller*.
187210

188211
Currently, Silverpeas provides a second version of the MVC framework, based upon the first one,
189212
but providing some facilities and with a more modern programming approach :
190213

191-
* No need to write a request router, the generic one, `WebComponentRequestRouter`, is used and
192-
for this requires to be declared, with the web controller with which it is mapped, within the
193-
`web.xml` web descriptor of the application;
214+
* No need to write a request router: the generic one, `WebComponentRequestRouter`, is used and
215+
for this it requires to be declared as serving the root URL of the application, with the
216+
web controller with which it has to be mapped, in the `web.xml` web descriptor of the application;
194217
* The web component request context which provides useful methods (like, for example, getting the
195218
highest roles the user play in the application instance) and access to the HTTP request and
196219
response. The request context is always passed as the single parameter to the session
@@ -207,8 +230,7 @@ but providing some facilities and with a more modern programming approach :
207230
invoke before or after a controller's function or the next navigation step in the current
208231
request processing flow.
209232

210-
211-
212-
213-
233+
In this tutorial, the web controller, `TodoListWebController` is only used to redirect to the home
234+
page `home.jsp` of the application. All the interaction and the todolist rendering is performed by
235+
specific VueJS components in an asynchronous way.
214236

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2000 - 2014 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -9,26 +9,30 @@
99
# As a special exception to the terms and conditions of version 3.0 of
1010
# the GPL, you may redistribute this Program in connection with Free/Libre
1111
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
12+
# FLOSS exception. You should have received a copy of the text describing
1313
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
14+
# "https://www.silverpeas.org/legal/floss_exception.html"
1515
#
1616
# This program is distributed in the hope that it will be useful,
1717
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
# GNU Affero General Public License for more details.
2020
#
2121
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2323
#
24+
custom.st.notification.subject=Nouvelle todo
2425

25-
todolist.menu.item.subscribe = S'abonner \u00e0 todolist
26-
todolist.menu.item.unsubscribe = Se d\u00e9sabonner de todolist
27-
todolist.label.delete=Supprimer la todo
28-
todolist.label.addTodo = Ajouter une todo
29-
todolist.label.allTodos = Toutes les todos
30-
todolist.label.newTodo = Nouvelle todo
31-
todolist.message.deletionConfirmation = Voulez-vous vraiment supprimer cette todo ?
32-
todolist.message.newTodoAdded = Une nouvelle todo a \u00e9t\u00e9 rajout\u00e9e
33-
todolist.label.creator=Ajout\u00e9e par
26+
todolist.label.todoTitle=Intitul\u00e9 du todo
27+
todolist.label.todoDescription=Description du todo
28+
todolist.label.noTodos=Aucun todo
29+
todolist.label.updateTodo=Mettre \u00e0 jour la todo
30+
todolist.label.allTodos=Toutes les todos
31+
todolist.label.newTodo=Nouvelle todo
32+
todolist.label.addTodo=Ajouter une todo
33+
todolist.message.deletionConfirmation=Voulez-vous vraiment supprimer cette todo ?
34+
todolist.error.invalidMinLengthTitle=Le todo doit avoir un intitul\u00e9 !
35+
todolist.error.invalidMaxLengthTitle=L'intitul\u00e9 du todo ne doit pas d\u00e9passer 100 caract\u00e8res !
36+
todolist.error.invalidMinLengthText=Le todo doit avoir une description !
37+
todolist.error.invalidMaxLengthText=La description du todo ne doit pas d\u00e9passer 2000 caract\u00e8res !
3438

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2000 - 2014 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -9,24 +9,29 @@
99
# As a special exception to the terms and conditions of version 3.0 of
1010
# the GPL, you may redistribute this Program in connection with Free/Libre
1111
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
12+
# FLOSS exception. You should have received a copy of the text describing
1313
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
14+
# "https://www.silverpeas.org/legal/floss_exception.html"
1515
#
1616
# This program is distributed in the hope that it will be useful,
1717
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
# GNU Affero General Public License for more details.
2020
#
2121
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2323
#
24-
todolist.menu.item.subscribe = Abonnieren Sie todolist
25-
todolist.menu.item.unsubscribe = Abbestellen todolist
26-
todolist.label.delete=Die todo löschen
27-
todolist.label.allTodos=Alle todos
28-
todolist.label.newTodo=New todo
29-
todolist.message.deletionConfirmation=Sind Sie sicher, dass Sie diese todo löschen?
30-
todolist.message.newTodoAdded=Eine neue todo hinzugefügt wurde
31-
todolist.label.addTodo=Fügen Sie eine todo
32-
todolist.label.creator=Hinzugefügt von
24+
custom.st.notification.subject=Neue ToDo
25+
26+
todolist.label.todoTitle=Titel der ToDo
27+
todolist.label.todoDescription=Beschreibung der ToDo
28+
todolist.label.noTodos=Keine ToDp
29+
todolist.label.updateTodo=Aktualisieren Sie die ToDo
30+
todolist.label.allTodos=Alle ToDo
31+
todolist.label.newTodo=Neue ToDo
32+
todolist.message.deletionConfirmation=Sind Sie sicher, dass Sie diese ToDo l\u00f6schen?
33+
todolist.label.addTodo=F\u00fcgen Sie eine ToDo
34+
todolist.error.invalidMinLengthTitle=Die ToDo muss einen Titel haben!
35+
todolist.error.invalidMaxLengthTitle=Der Titel der ToDo darf 100 Zeichen nicht \u00fcberschreiten!
36+
todolist.error.invalidMinLengthText=Das ToDo muss eine Beschreibung haben!
37+
todolist.error.invalidMaxLengthText=Die ToDo-Beschreibung darf 2000 Zeichen nicht \u00fcberschreiten!
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2000 - 2014 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -9,24 +9,30 @@
99
# As a special exception to the terms and conditions of version 3.0 of
1010
# the GPL, you may redistribute this Program in connection with Free/Libre
1111
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
12+
# FLOSS exception. You should have received a copy of the text describing
1313
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
14+
# "https://www.silverpeas.org/legal/floss_exception.html"
1515
#
1616
# This program is distributed in the hope that it will be useful,
1717
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
# GNU Affero General Public License for more details.
2020
#
2121
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2323
#
24-
todolist.menu.item.subscribe = Subscribe to todolist
25-
todolist.menu.item.unsubscribe = Unsubscribe from todolist
26-
todolist.label.delete=Delete todo
24+
custom.st.notification.subject=New todo
25+
26+
todolist.label.todoTitle=Title of the todo
27+
todolist.label.todoDescription=Description of the todo
28+
todolist.label.noTodos=No todos
29+
todolist.label.updateTodo=Update the todo
2730
todolist.label.allTodos=All the todos
2831
todolist.label.newTodo=New todo
2932
todolist.message.deletionConfirmation=Are you sure you want to delete this todo?
30-
todolist.message.newTodoAdded=A new todo has been added
3133
todolist.label.addTodo=Add a todo
32-
todolist.label.creator=Added by
34+
todolist.error.invalidMinLengthTitle=The todo must have a title!
35+
todolist.error.invalidMaxLengthTitle=The title of the todo must not exceed 100 characters!
36+
todolist.error.invalidMinLengthText=The todo must have a description!
37+
todolist.error.invalidMaxLengthText=The description of the todo must not exceed 2000 characters!
38+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2000 - 2014 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -9,27 +9,31 @@
99
# As a special exception to the terms and conditions of version 3.0 of
1010
# the GPL, you may redistribute this Program in connection with Free/Libre
1111
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
12+
# FLOSS exception. You should have received a copy of the text describing
1313
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
14+
# "https://www.silverpeas.org/legal/floss_exception.html"
1515
#
1616
# This program is distributed in the hope that it will be useful,
1717
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
# GNU Affero General Public License for more details.
2020
#
2121
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2323
#
24-
custom.st.notification.subject = Nouvelle todo
24+
custom.st.notification.subject=Nouvelle todo
2525

26-
todolist.menu.item.subscribe = S'abonner \u00e0 todolist
27-
todolist.menu.item.unsubscribe = Se d\u00e9sabonner de todolist
28-
todolist.label.delete=Supprimer la todo
26+
todolist.label.todoTitle=Intitul\u00e9 du todo
27+
todolist.label.todoDescription=Description du todo
28+
todolist.label.noTodos=Aucun todo
29+
todolist.label.updateTodo=Mettre \u00e0 jour la todo
2930
todolist.label.allTodos=Toutes les todos
3031
todolist.label.newTodo=Nouvelle todo
31-
todolist.message.deletionConfirmation=Voulez-vous vraiment supprimer cette todo ?
32-
todolist.message.newTodoAdded=Une nouvelle todo a \u00e9t\u00e9 rajout\u00e9e
3332
todolist.label.addTodo=Ajouter une todo
34-
todolist.label.creator=Ajout\u00e9e par
33+
todolist.message.deletionConfirmation=Voulez-vous vraiment supprimer cette todo ?
34+
todolist.error.invalidMinLengthTitle=Le todo doit avoir un intitul\u00e9 !
35+
todolist.error.invalidMaxLengthTitle=L'intitul\u00e9 du todo ne doit pas d\u00e9passer 100 caract\u00e8res !
36+
todolist.error.invalidMinLengthText=Le todo doit avoir une description !
37+
todolist.error.invalidMaxLengthText=La description du todo ne doit pas d\u00e9passer 2000 caract\u00e8res !
38+
3539

Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (C) 2000 - 2011 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
@@ -9,15 +9,17 @@
99
# As a special exception to the terms and conditions of version 3.0 of
1010
# the GPL, you may redistribute this Program in connection with Free/Libre
1111
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
12+
# FLOSS exception. You should have received a copy of the text describing
1313
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
14+
# "https://www.silverpeas.org/legal/floss_exception.html"
1515
#
1616
# This program is distributed in the hope that it will be useful,
1717
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1818
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1919
# GNU Affero General Public License for more details.
2020
#
2121
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
22+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
2323
#
24+
25+
todolist.icon.newTodo = /util/icons/create-action/add-task.png
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
#
2-
# Copyright (C) 2000 - 2011 Silverpeas
2+
# Copyright (C) 2000 - 2024 Silverpeas
33
#
44
# This program is free software: you can redistribute it and/or modify
55
# it under the terms of the GNU Affero General Public License as
66
# published by the Free Software Foundation, either version 3 of the
77
# License, or (at your option) any later version.
8-
#
9-
# As a special exception to the terms and conditions of version 3.0 of
8+
#As a special exception to the terms and conditions of version 3.0 of
109
# the GPL, you may redistribute this Program in connection with Free/Libre
1110
# Open Source Software ("FLOSS") applications as described in Silverpeas's
12-
# FLOSS exception. You should have recieved a copy of the text describing
11+
# FLOSS exception. You should have received a copy of the text describing
1312
# the FLOSS exception, and it is also available here:
14-
# "http://www.silverpeas.com/legal/licensing"
15-
#
13+
# "https://www.silverpeas.org/legal/floss_exception.html"
1614
# This program is distributed in the hope that it will be useful,
15+
#
1716
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1817
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1918
# GNU Affero General Public License for more details.
20-
#
2119
# You should have received a copy of the GNU Affero General Public License
22-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20+
#
21+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
22+
#
2323
#

0 commit comments

Comments
 (0)