Skip to content

Commit a202095

Browse files
authored
Merge pull request #468 from ec-jrc/develop
v2.6.1rc-1
2 parents 359290b + c040caa commit a202095

97 files changed

Lines changed: 1811 additions & 1350 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

documentation/administrator-manual.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,5 @@ You can change some of the variables of the different email templates, such as t
221221
To change those, you can access the[configuration.properties](https://github.com/ec-jrc/re3gistry/blob/master/sources/Re3gistry2/src/main/resources/configurations_files/configuration.properties) file, where you can search the mail template variables by searching the "mail.text" variables.
222222
You can see the different subjects and text that you can change. Consider that some of these may need some proper code changing in their respective java classes.
223223
App's default name is Re3gistry2; this variable is used in email templates showing the instance name. The property that manages this name is called "application.default.name". This variable can be found in the same [configuration.properties](https://github.com/ec-jrc/re3gistry/blob/master/sources/Re3gistry2/src/main/resources/configurations_files/configuration.properties) file.
224+
225+
Please configure an email server to handle notifications and ensure proper delivery of emails.

documentation/developer-manual.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ To modify the URL where the page icons (favicons) and images point, navigate to
185185

186186
Once you've made changes to the **web.cdn_url** property, it will be used in `sources\Re3gistry2\src\main\webapp\jsp\includes\head.inc.jsp` to generate the final URLs for the page icons and images, enabling you to customize their paths as necessary.
187187

188+
## Webapp Icons
189+
By default, the site header logo image is configured to display a different picture for each language. When you change the language using the language selector, the logo will automatically update to match the selected language.
190+
191+
![Site HeaderLogo](images/site-header-logo.png)
192+
193+
If you prefer to use a single logo for all languages, you can modify the configuration file located at `dist/webapp/public_html/conf/conf.js` Set the **registryApp.multiLogo** variable to false. Below this variable, you will find **registryApp.singleLogoPath**, where you should specify the path to the single logo.
188194

189195

190196

21.1 KB
Loading

documentation/user-manual.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,8 @@ Depending on the type of installation, using an external authentication provider
544544

545545
Users can receive different email notifications to inform them about statuses and actions done to the items and actions they have taken part in. These notifications indicate the status of the items (Items been submitted, published etc.) and some of the actions done in the instance, such as permissions and roles given to a user.
546546

547+
Please ensure that an email server is configured to handle notifications and proper delivery of emails.
548+
547549
## Bulk Import and Bulk Edit
548550

549551
This feature allows the user to make modifications to multiple existing items.

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ActionDetail.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import eu.europa.ec.re3gistry2.crudimplementation.RegActionManager;
3131
import eu.europa.ec.re3gistry2.model.RegAction;
3232
import java.io.IOException;
33+
import java.util.logging.Level;
3334
import javax.persistence.EntityManager;
3435
import javax.persistence.NoResultException;
3536
import javax.servlet.ServletException;
@@ -62,7 +63,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
6263
try {
6364
regAction = regActionManager.get(actionUUID);
6465
} catch (NoResultException e) {
65-
logger.error(e.getMessage(), e);
66+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within ActionDetail class. Please check the details: " + e.getMessage(), e.getMessage());
6667
}
6768

6869
// Setting the RegAction parameter

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/AddItem.java

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@
5858
import javax.servlet.http.HttpServlet;
5959
import javax.servlet.http.HttpServletRequest;
6060
import javax.servlet.http.HttpServletResponse;
61+
import org.apache.logging.log4j.LogManager;
6162
import org.apache.logging.log4j.Logger;
63+
import java.util.logging.Level;
6264

6365
@WebServlet(WebConstants.PAGE_URINAME_ADDITEM)
6466
public class AddItem extends HttpServlet {
6567

6668
private void processRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
6769
// Init logger
68-
Logger logger = Configuration.getInstance().getLogger();
70+
Logger logger = Configuration.getInstance().getLogger();
6971

7072
// Init frontend servlet
7173
Configuration.getInstance().initServlet(request, response, false, false);
@@ -93,20 +95,19 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
9395
RegRelationpredicate regRelationpredicateRegister = regRelationpredicateManager.get(BaseConstants.KEY_PREDICATE_REGISTER);
9496

9597
// Getting parameters
96-
//String languageUuid = request.getParameter(BaseConstants.KEY_REQUEST_LANGUAGEUUID);
98+
String languageUuid = request.getParameter(BaseConstants.KEY_REQUEST_LANGUAGEUUID);
9799
String itemUuid = request.getParameter(BaseConstants.KEY_REQUEST_ITEMUUID);
98100
String formNewItemCheck = request.getParameter(BaseConstants.KEY_REQUEST_NEWITEMINSERT);
99101
String newItemItemclassUuid = request.getParameter(BaseConstants.KEY_FORM_FIELD_NAME_NEWITEMREGITEMCLASSUUID);
100102
String formRegItemContainerUuid = request.getParameter(BaseConstants.KEY_FORM_FIELD_NAME_REGITEMCONTAINERUUID);
101103
String externalItem = request.getParameter(BaseConstants.KEY_FORM_FIELD_NAME_EXTERNAL_ITEM);
102-
103-
//languageUuid = (languageUuid != null) ? InputSanitizerHelper.sanitizeInput(languageUuid) : null;
104+
105+
languageUuid = (languageUuid != null) ? InputSanitizerHelper.sanitizeInput(languageUuid) : null;
104106
itemUuid = (itemUuid != null) ? InputSanitizerHelper.sanitizeInput(itemUuid) : null;
105107
formNewItemCheck = (formNewItemCheck != null) ? InputSanitizerHelper.sanitizeInput(formNewItemCheck) : null;
106108
newItemItemclassUuid = (newItemItemclassUuid != null) ? InputSanitizerHelper.sanitizeInput(newItemItemclassUuid) : null;
107109
formRegItemContainerUuid = (formRegItemContainerUuid != null) ? InputSanitizerHelper.sanitizeInput(formRegItemContainerUuid) : null;
108-
externalItem = (externalItem != null) ? InputSanitizerHelper.sanitizeInput(externalItem) : null;
109-
110+
externalItem = (externalItem != null) ? InputSanitizerHelper.sanitizeInput(externalItem) : null;
110111

111112
if (itemUuid == null || itemUuid.length() < 1) {
112113
itemUuid = formRegItemContainerUuid;
@@ -123,7 +124,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
123124

124125
// Getting the language by parameter (if not available the master language is used)
125126
RegLanguagecode regLanguagecode = null;
126-
127+
127128
// Adding a new item it always add in the masterLanguage
128129
/*if (languageUuid != null && languageUuid.length() == 2) {
129130
try {
@@ -132,7 +133,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
132133
regLanguagecode = masterLanguage;
133134
}
134135
} else {*/
135-
regLanguagecode = masterLanguage;
136+
regLanguagecode = masterLanguage;
136137
//}
137138
request.setAttribute(BaseConstants.KEY_REQUEST_CURRENTLANGUAGE, regLanguagecode);
138139

@@ -153,6 +154,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
153154
try {
154155
regItemRegistry = regRelationRegistries.get(0).getRegItemObject();
155156
} catch (Exception e) {
157+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.INFO, e.getMessage(), e.getMessage());
156158
regItemRegistry = null;
157159
}
158160
}
@@ -164,6 +166,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
164166
try {
165167
regItemRegister = regRelationRegisters.get(0).getRegItemObject();
166168
} catch (Exception e) {
169+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.INFO, e.getMessage(), e.getMessage());
167170
regItemRegister = null;
168171
}
169172
}
@@ -224,18 +227,19 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
224227

225228
// Getting the request's parameters
226229
Map requestParameters = request.getParameterMap();
227-
230+
228231
// Dispatch the rerquest
229232
try {
230233
regItemproposedHandler.handleRegItemproposedAddition(requestParameters, regUser, localization);
231234
} catch (Exception e) {
232235
String operationResult = e.getMessage();
233236
request.setAttribute(BaseConstants.KEY_REQUEST_OPERATIONRESULT, operationResult);
234-
logger.error(e.getMessage(), e);
237+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + e.getMessage(), e.getMessage());
238+
235239
}
236240

237241
// Redirecting to the Item container page
238-
response.sendRedirect("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + formRegItemContainerUuid);
242+
request.getRequestDispatcher("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid + "&" + BaseConstants.KEY_REQUEST_LANGUAGEUUID + "=" + languageUuid).forward(request, response);
239243

240244
} else {
241245

@@ -287,6 +291,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
287291
request.getRequestDispatcher(WebConstants.PAGE_JSP_FOLDER + WebConstants.PAGE_PATH_ADDITEM + WebConstants.PAGE_URINAME_ADDITEM + WebConstants.PAGE_JSP_EXTENSION).forward(request, response);
288292

289293
} catch (Exception e) {
294+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + e.getMessage(), e.getMessage());
290295
// Redirecting to the Item container page
291296
response.sendRedirect("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid);
292297
}
@@ -296,10 +301,11 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
296301
response.sendRedirect("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid);
297302
}
298303
} catch (NoResultException e) {
304+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + e.getMessage(), e.getMessage());
299305
// Redirecting to the Item container page
300306
response.sendRedirect("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid);
301307
} catch (Exception e) {
302-
logger.error(e.getMessage(), e);
308+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + e.getMessage(), e.getMessage());
303309
}
304310
} else {
305311
response.sendRedirect("." + WebConstants.PAGE_URINAME_BROWSE);
@@ -312,7 +318,7 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) thro
312318
processRequest(request, response);
313319
} catch (Exception ex) {
314320
Logger logger = Configuration.getInstance().getLogger();
315-
logger.error(ex.getMessage(), ex);
321+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + ex.getMessage(), ex.getMessage());
316322
}
317323
}
318324

@@ -322,7 +328,7 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr
322328
processRequest(request, response);
323329
} catch (Exception ex) {
324330
Logger logger = Configuration.getInstance().getLogger();
325-
logger.error(ex.getMessage(), ex);
331+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddItem class. Please check the details: " + ex.getMessage(), ex.getMessage());
326332
}
327333
}
328334
}

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/AddRegister.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import java.nio.charset.StandardCharsets;
4949
import java.util.HashMap;
5050
import java.util.ResourceBundle;
51+
import java.util.logging.Level;
5152
import javax.persistence.EntityManager;
5253
import javax.persistence.NoResultException;
5354
import javax.servlet.ServletException;
@@ -178,7 +179,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
178179
}
179180

180181
} catch (NoResultException e) {
181-
logger.error(e.getMessage(), e);
182+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within AddRegister class. Please check the details: " + e.getMessage(), e.getMessage());
182183
// Setting the operation success attribute
183184
operationResult = localization.getString("error.generic");
184185
request.setAttribute(BaseConstants.KEY_REQUEST_OPERATIONRESULT, operationResult);

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/Browse.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import java.util.List;
5959
import java.util.Map;
6060
import java.util.Properties;
61+
import java.util.logging.Level;
6162
import javax.persistence.EntityManager;
6263
import javax.persistence.NoResultException;
6364
import javax.servlet.ServletException;
@@ -90,7 +91,8 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
9091
mainRegistryItemclassLocalId = properties.getProperty("application.multiregistry.mainregistryitemclasslocalid");
9192
mainRegistryLocalId = properties.getProperty("application.multiregistry.mainregistrylocalid");
9293
} catch (Exception e) {
93-
logger.error(e.getMessage(), e);
94+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within Browse class. Please check the details: " + e.getMessage(), e.getMessage());
95+
9496
}
9597

9698
// Setup the entity manager
@@ -310,7 +312,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
310312
try {
311313
regItemproposedHandler.handleRegItemproposedSave(requestParameters, regUser);
312314
} catch (Exception e) {
313-
logger.error(e.getMessage(), e);
315+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within Browse class. Please check the details: " + e.getMessage(), e.getMessage());
314316
saveError = true;
315317
}
316318
} else if (regItemproposed != null && ( // Permission to edit Registers and items
@@ -328,7 +330,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
328330
try {
329331
regItemproposedHandler.handleRegItemproposedNewSave(requestParameters, regUser);
330332
} catch (Exception e) {
331-
logger.error(e.getMessage(), e);
333+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within Browse class. Please check the details: " + e.getMessage(), e.getMessage());
332334
saveError = true;
333335
}
334336
}
@@ -385,7 +387,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
385387
}
386388
}
387389
} catch (Exception e) {
388-
logger.error(e.getMessage(), e);
390+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within Browse class. Please check the details: " + e.getMessage(), e.getMessage());
389391
response.sendRedirect(".");
390392
} finally {
391393
if (entityManager.isOpen()) {

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/BulkImport.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ protected void processRequest(HttpServletRequest request, HttpServletResponse re
100100
request.getRequestDispatcher("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid + "&" + BaseConstants.KEY_REQUEST_LANGUAGEUUID + "=" + languageUuid).forward(request, response);
101101
}
102102
} catch (Exception ex) {
103+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within BulkImport class. Please check the details: " + ex.getMessage(), ex.getMessage());
103104
// request.setAttribute(BaseConstants.KEY_REQUEST_BULK_ERROR, ex.getMessage());
104105
request.getRequestDispatcher("." + WebConstants.PAGE_URINAME_BROWSE + "?" + BaseConstants.KEY_REQUEST_ITEMUUID + "=" + itemUuid + "&" + BaseConstants.KEY_REQUEST_LANGUAGEUUID + "=" + languageUuid).forward(request, response);
105106
}

sources/Re3gistry2/src/main/java/eu/europa/ec/re3gistry2/web/controller/ControlBody.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import java.util.List;
6767
import java.util.Optional;
6868
import java.util.ResourceBundle;
69+
import java.util.logging.Level;
6970
import javax.mail.internet.InternetAddress;
7071
import javax.persistence.EntityManager;
7172
import javax.persistence.NoResultException;
@@ -272,6 +273,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
272273
}
273274

274275
} catch (NoResultException e) {
276+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within ControlBody class. Please check the details: " + e.getMessage(), e.getMessage());
275277
}
276278
}
277279

@@ -295,6 +297,7 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp
295297

296298
} catch (Exception e) {
297299
// Redirecting to the RegItemclasses list page
300+
java.util.logging.Logger.getLogger(RegisterManager.class.getName()).log(Level.SEVERE, "Error encountered within ControlBody class. Please check the details: " + e.getMessage(), e.getMessage());
298301
response.sendRedirect("." + WebConstants.PAGE_PATH_INDEX + WebConstants.PAGE_URINAME_INDEX);
299302
}
300303
} else {

0 commit comments

Comments
 (0)