1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.client.enduser.commons;
20
21 import org.apache.syncope.client.enduser.SyncopeWebApplication;
22 import org.apache.syncope.client.enduser.pages.Dashboard;
23 import org.apache.syncope.client.ui.commons.Constants;
24 import org.apache.wicket.Component;
25 import org.apache.wicket.request.mapper.parameter.PageParameters;
26
27 public final class ProvisioningUtils {
28
29 public static PageParameters managePageParams(
30 final Component component,
31 final String section,
32 final boolean isSuccess) {
33
34 PageParameters parameters = new PageParameters();
35 parameters.add(EnduserConstants.STATUS,
36 isSuccess
37 ? Constants.OPERATION_SUCCEEDED
38 : Constants.OPERATION_ERROR);
39 parameters.add(Constants.NOTIFICATION_TITLE_PARAM,
40 isSuccess
41 ? component.getString("self." + section + ".success.msg")
42 : component.getString("self." + section + ".error.msg"));
43 parameters.add(Constants.NOTIFICATION_MSG_PARAM,
44 isSuccess
45 ? component.getString("self." + section + ".success")
46 : component.getString("self." + section + ".error"));
47 parameters.add(EnduserConstants.LANDING_PAGE,
48 SyncopeWebApplication.get().getPageClass("profile", Dashboard.class).getName());
49 return parameters;
50 }
51
52 private ProvisioningUtils() {
53
54 }
55 }