You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2012/03/15 11:17:24 UTC
svn commit: r1300882 [4/22] - in /incubator/syncope/trunk:
build-tools/src/main/java/org/syncope/buildtools/
client/src/main/java/org/syncope/annotation/
client/src/main/java/org/syncope/client/
client/src/main/java/org/syncope/client/http/ client/src/...
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/DisplayAttributesModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/DisplayAttributesModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/DisplayAttributesModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/DisplayAttributesModalPage.java Thu Mar 15 10:17:12 2012
@@ -60,9 +60,8 @@ public class DisplayAttributesModalPage
*/
private static final int MAX_SELECTIONS = 9;
- private List<String> ATTRIBUTES_NOTINCLUDED = Arrays.asList(new String[]{
- "attributes", "derivedAttributes", "virtualAttributes",
- "serialVersionUID", "memberships", "resources", "password"});
+ private List<String> ATTRIBUTES_NOTINCLUDED = Arrays.asList(new String[] { "attributes", "derivedAttributes",
+ "virtualAttributes", "serialVersionUID", "memberships", "resources", "password" });
@SpringBean
private PreferenceManager prefMan;
@@ -73,90 +72,82 @@ public class DisplayAttributesModalPage
@SpringBean
private SchemaRestClient schemaRestClient;
- final private IModel<List<String>> dnames =
- new LoadableDetachableModel<List<String>>() {
+ final private IModel<List<String>> dnames = new LoadableDetachableModel<List<String>>() {
- private static final long serialVersionUID = 5275935387613157437L;
+ private static final long serialVersionUID = 5275935387613157437L;
- @Override
- protected List<String> load() {
+ @Override
+ protected List<String> load() {
- final List<String> details = new ArrayList<String>();
+ final List<String> details = new ArrayList<String>();
- Class<?> clazz = UserTO.class;
+ Class<?> clazz = UserTO.class;
- // loop on class and all superclasses searching for field
- while (clazz != null && clazz != Object.class) {
- for (Field field : clazz.getDeclaredFields()) {
- if (!ATTRIBUTES_NOTINCLUDED.contains(field.getName())) {
- details.add(field.getName());
- }
- }
- clazz = clazz.getSuperclass();
+ // loop on class and all superclasses searching for field
+ while (clazz != null && clazz != Object.class) {
+ for (Field field : clazz.getDeclaredFields()) {
+ if (!ATTRIBUTES_NOTINCLUDED.contains(field.getName())) {
+ details.add(field.getName());
}
-
- Collections.reverse(details);
- return details;
}
- };
+ clazz = clazz.getSuperclass();
+ }
- final private IModel<List<String>> names =
- new LoadableDetachableModel<List<String>>() {
+ Collections.reverse(details);
+ return details;
+ }
+ };
- private static final long serialVersionUID =
- 5275935387613157437L;
+ final private IModel<List<String>> names = new LoadableDetachableModel<List<String>>() {
- @Override
- protected List<String> load() {
+ private static final long serialVersionUID = 5275935387613157437L;
- List<String> schemas =
- schemaRestClient.getSchemaNames(AttributableType.USER);
+ @Override
+ protected List<String> load() {
- if (schemas == null) {
- schemas = new ArrayList<String>();
- }
+ List<String> schemas = schemaRestClient.getSchemaNames(AttributableType.USER);
- return schemas;
- }
- };
+ if (schemas == null) {
+ schemas = new ArrayList<String>();
+ }
- final private IModel<List<String>> dsnames =
- new LoadableDetachableModel<List<String>>() {
+ return schemas;
+ }
+ };
- private static final long serialVersionUID =
- 5275935387613157437L;
+ final private IModel<List<String>> dsnames = new LoadableDetachableModel<List<String>>() {
- @Override
- protected List<String> load() {
+ private static final long serialVersionUID = 5275935387613157437L;
- List<String> schemas = schemaRestClient.getDerivedSchemaNames(AttributableType.USER);
+ @Override
+ protected List<String> load() {
- if (schemas == null) {
- schemas = new ArrayList<String>();
- }
+ List<String> schemas = schemaRestClient.getDerivedSchemaNames(AttributableType.USER);
- return schemas;
- }
- };
+ if (schemas == null) {
+ schemas = new ArrayList<String>();
+ }
- final private IModel<List<String>> vsnames =
- new LoadableDetachableModel<List<String>>() {
+ return schemas;
+ }
+ };
- private static final long serialVersionUID =
- 5275935387613157437L;
+ final private IModel<List<String>> vsnames = new LoadableDetachableModel<List<String>>() {
- @Override
- protected List<String> load() {
+ private static final long serialVersionUID = 5275935387613157437L;
- List<String> schemas = schemaRestClient.getVirtualSchemaNames(AttributableType.USER);
+ @Override
+ protected List<String> load() {
- if (schemas == null) {
- schemas = new ArrayList<String>();
- }
+ List<String> schemas = schemaRestClient.getVirtualSchemaNames(AttributableType.USER);
- return schemas;
- }
- };
+ if (schemas == null) {
+ schemas = new ArrayList<String>();
+ }
+
+ return schemas;
+ }
+ };
private final List<String> userDetails;
@@ -166,171 +157,131 @@ public class DisplayAttributesModalPage
private final List<String> selectedDerSchemas;
- public DisplayAttributesModalPage(
- final PageReference callerPageRef,
- final ModalWindow window) {
+ public DisplayAttributesModalPage(final PageReference callerPageRef, final ModalWindow window) {
super();
final Form form = new Form("form");
form.setModel(new CompoundPropertyModel(this));
- userDetails = prefMan.getList(
- getRequest(), Constants.PREF_USERS_DETAILS_VIEW);
+ userDetails = prefMan.getList(getRequest(), Constants.PREF_USERS_DETAILS_VIEW);
- selectedSchemas = prefMan.getList(
- getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW);
+ selectedSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_ATTRIBUTES_VIEW);
- selectedVirSchemas = prefMan.getList(
- getRequest(), Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW);
+ selectedVirSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW);
- selectedDerSchemas = prefMan.getList(
- getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW);
+ selectedDerSchemas = prefMan.getList(getRequest(), Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW);
- final CheckGroup dgroup = new CheckGroup(
- "dCheckGroup", new PropertyModel(this, "userDetails"));
+ final CheckGroup dgroup = new CheckGroup("dCheckGroup", new PropertyModel(this, "userDetails"));
form.add(dgroup);
- final ListView<String> details =
- new ListView<String>("details", dnames) {
+ final ListView<String> details = new ListView<String>("details", dnames) {
- private static final long serialVersionUID = 9101744072914090143L;
+ private static final long serialVersionUID = 9101744072914090143L;
- @Override
- protected void populateItem(ListItem<String> item) {
- item.add(new Check("dcheck", item.getModel()));
- item.add(new Label("dname", new ResourceModel(
- item.getModelObject(),
- item.getModelObject())));
- }
- };
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("dcheck", item.getModel()));
+ item.add(new Label("dname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
dgroup.add(details);
if (names.getObject() != null && !names.getObject().isEmpty()) {
- final Fragment fragment =
- new Fragment("schemas", "sfragment", form);
+ final Fragment fragment = new Fragment("schemas", "sfragment", form);
form.add(fragment);
- final CheckGroup sgroup = new CheckGroup(
- "sCheckGroup", new PropertyModel(this, "selectedSchemas"));
+ final CheckGroup sgroup = new CheckGroup("sCheckGroup", new PropertyModel(this, "selectedSchemas"));
fragment.add(sgroup);
- final ListView<String> schemas =
- new ListView<String>("schemas", names) {
+ final ListView<String> schemas = new ListView<String>("schemas", names) {
- private static final long serialVersionUID = 9101744072914090143L;
+ private static final long serialVersionUID = 9101744072914090143L;
- @Override
- protected void populateItem(ListItem<String> item) {
- item.add(new Check("scheck", item.getModel()));
- item.add(new Label("sname", new ResourceModel(
- item.getModelObject(),
- item.getModelObject())));
- }
- };
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("scheck", item.getModel()));
+ item.add(new Label("sname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
sgroup.add(schemas);
} else {
- final Fragment fragment =
- new Fragment("schemas", "emptyFragment", form);
+ final Fragment fragment = new Fragment("schemas", "emptyFragment", form);
form.add(fragment);
selectedSchemas.clear();
}
if (vsnames.getObject() != null && !vsnames.getObject().isEmpty()) {
- final Fragment fragment =
- new Fragment("vschemas", "vsfragment", form);
+ final Fragment fragment = new Fragment("vschemas", "vsfragment", form);
form.add(fragment);
- final CheckGroup vsgroup = new CheckGroup(
- "vsCheckGroup",
- new PropertyModel(this, "selectedVirSchemas"));
+ final CheckGroup vsgroup = new CheckGroup("vsCheckGroup", new PropertyModel(this, "selectedVirSchemas"));
fragment.add(vsgroup);
- final ListView<String> virSchemas =
- new ListView<String>("virSchemas", vsnames) {
+ final ListView<String> virSchemas = new ListView<String>("virSchemas", vsnames) {
- private static final long serialVersionUID = 9101744072914090143L;
+ private static final long serialVersionUID = 9101744072914090143L;
- @Override
- protected void populateItem(ListItem<String> item) {
- item.add(new Check("vscheck", item.getModel()));
- item.add(new Label("vsname", new ResourceModel(
- item.getModelObject(),
- item.getModelObject())));
- }
- };
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("vscheck", item.getModel()));
+ item.add(new Label("vsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
vsgroup.add(virSchemas);
} else {
- final Fragment fragment =
- new Fragment("vschemas", "emptyFragment", form);
+ final Fragment fragment = new Fragment("vschemas", "emptyFragment", form);
form.add(fragment);
selectedVirSchemas.clear();
}
if (dsnames.getObject() != null && !dsnames.getObject().isEmpty()) {
- final Fragment fragment =
- new Fragment("dschemas", "dsfragment", form);
+ final Fragment fragment = new Fragment("dschemas", "dsfragment", form);
form.add(fragment);
- final CheckGroup dsgroup = new CheckGroup(
- "dsCheckGroup",
- new PropertyModel(this, "selectedDerSchemas"));
+ final CheckGroup dsgroup = new CheckGroup("dsCheckGroup", new PropertyModel(this, "selectedDerSchemas"));
fragment.add(dsgroup);
- final ListView<String> derSchemas =
- new ListView<String>("derSchemas", dsnames) {
+ final ListView<String> derSchemas = new ListView<String>("derSchemas", dsnames) {
- private static final long serialVersionUID = 9101744072914090143L;
+ private static final long serialVersionUID = 9101744072914090143L;
- @Override
- protected void populateItem(ListItem<String> item) {
- item.add(new Check("dscheck", item.getModel()));
- item.add(new Label("dsname", new ResourceModel(
- item.getModelObject(),
- item.getModelObject())));
- }
- };
+ @Override
+ protected void populateItem(ListItem<String> item) {
+ item.add(new Check("dscheck", item.getModel()));
+ item.add(new Label("dsname", new ResourceModel(item.getModelObject(), item.getModelObject())));
+ }
+ };
dsgroup.add(derSchemas);
} else {
- final Fragment fragment =
- new Fragment("dschemas", "emptyFragment", form);
+ final Fragment fragment = new Fragment("dschemas", "emptyFragment", form);
form.add(fragment);
selectedDerSchemas.clear();
}
- final IndicatingAjaxButton submit = new IndicatingAjaxButton(
- "submit", new ResourceModel("submit")) {
+ final IndicatingAjaxButton submit = new IndicatingAjaxButton("submit", new ResourceModel("submit")) {
private static final long serialVersionUID = -4804368561204623354L;
@Override
- protected void onSubmit(final AjaxRequestTarget target,
- final Form<?> form) {
+ protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- if (userDetails.size()
- + selectedSchemas.size()
- + selectedVirSchemas.size()
- + selectedDerSchemas.size() > MAX_SELECTIONS) {
+ if (userDetails.size() + selectedSchemas.size() + selectedVirSchemas.size() + selectedDerSchemas.size() > MAX_SELECTIONS) {
error(getString("tooMuchSelections"));
onError(target, form);
} else {
- final Map<String, List<String>> prefs =
- new HashMap<String, List<String>>();
+ final Map<String, List<String>> prefs = new HashMap<String, List<String>>();
- prefs.put(Constants.PREF_USERS_DETAILS_VIEW,
- userDetails);
+ prefs.put(Constants.PREF_USERS_DETAILS_VIEW, userDetails);
- prefs.put(Constants.PREF_USERS_ATTRIBUTES_VIEW,
- selectedSchemas);
+ prefs.put(Constants.PREF_USERS_ATTRIBUTES_VIEW, selectedSchemas);
- prefs.put(Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW,
- selectedVirSchemas);
+ prefs.put(Constants.PREF_USERS_VIRTUAL_ATTRIBUTES_VIEW, selectedVirSchemas);
- prefs.put(Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW,
- selectedDerSchemas);
+ prefs.put(Constants.PREF_USERS_DERIVED_ATTRIBUTES_VIEW, selectedDerSchemas);
prefMan.setList(getRequest(), getResponse(), prefs);
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/EditUserModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/EditUserModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/EditUserModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/EditUserModalPage.java Thu Mar 15 10:17:12 2012
@@ -43,10 +43,7 @@ public class EditUserModalPage extends U
private UserTO initialUserTO = null;
- public EditUserModalPage(
- final PageReference callerPageRef,
- final ModalWindow window,
- final UserTO userTO) {
+ public EditUserModalPage(final PageReference callerPageRef, final ModalWindow window, final UserTO userTO) {
super(callerPageRef, window, userTO, Mode.ADMIN, true);
@@ -58,31 +55,25 @@ public class EditUserModalPage extends U
if (userTO.getId() != 0) {
final List<StatusBean> statuses = new ArrayList<StatusBean>();
- form.addOrReplace(new StatusPanel(
- "statuspanel", userTO, statuses, false));
+ form.addOrReplace(new StatusPanel("statuspanel", userTO, statuses, false));
- form.addOrReplace(
- new AccountInformationPanel("accountinformation", userTO));
+ form.addOrReplace(new AccountInformationPanel("accountinformation", userTO));
}
}
- public EditUserModalPage(
- final ModalWindow window,
- final UserTO userTO) {
+ public EditUserModalPage(final ModalWindow window, final UserTO userTO) {
super(window, userTO, Mode.ADMIN);
}
@Override
- protected void submitAction(
- final AjaxRequestTarget target, final Form form) {
+ protected void submitAction(final AjaxRequestTarget target, final Form form) {
final UserTO updatedUserTO = (UserTO) form.getModelObject();
if (updatedUserTO.getId() == 0) {
userTO = userRestClient.create(updatedUserTO);
} else {
- final UserMod userMod = AttributableOperations.diff(
- updatedUserTO, initialUserTO);
+ final UserMod userMod = AttributableOperations.diff(updatedUserTO, initialUserTO);
// update user just if it is changed
if (!userMod.isEmpty()) {
@@ -93,8 +84,7 @@ public class EditUserModalPage extends U
}
@Override
- protected void closeAction(
- final AjaxRequestTarget target, final Form form) {
+ protected void closeAction(final AjaxRequestTarget target, final Form form) {
setResponsePage(new EditUserModalPage(window, userTO));
}
}
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ErrorPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ErrorPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ErrorPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ErrorPage.java Thu Mar 15 10:17:12 2012
@@ -33,10 +33,8 @@ public class ErrorPage extends BasePage
public ErrorPage(final PageParameters parameters) {
super(parameters);
- add(new Label("errorTitle", new Model<String>(
- parameters.get("errorTitle").toString())));
- add(new Label("errorMessage", new Model<String>(
- parameters.get("errorMessage").toString())));
+ add(new Label("errorTitle", new Model<String>(parameters.get("errorTitle").toString())));
+ add(new Label("errorMessage", new Model<String>(parameters.get("errorMessage").toString())));
add(new BookmarkablePageLink("home", getApplication().getHomePage()));
}
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ExecMessageModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ExecMessageModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ExecMessageModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ExecMessageModalPage.java Thu Mar 15 10:17:12 2012
@@ -26,8 +26,7 @@ public class ExecMessageModalPage extend
private static final long serialVersionUID = 3163146190501510888L;
public ExecMessageModalPage(final String message) {
- final Label dialogContent =
- new Label("message", new Model<String>(message));
+ final Label dialogContent = new Label("message", new Model<String>(message));
add(dialogContent.setOutputMarkupId(true));
}
}
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Login.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Login.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Login.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Login.java Thu Mar 15 10:17:12 2012
@@ -64,8 +64,7 @@ public class Login extends WebPage {
/**
* Logger.
*/
- private static final Logger LOG = LoggerFactory.getLogger(
- Login.class);
+ private static final Logger LOG = LoggerFactory.getLogger(Login.class);
private static final long serialVersionUID = -3744389270366566218L;
@@ -100,20 +99,17 @@ public class Login extends WebPage {
passwordField.setMarkupId("password");
form.add(passwordField);
- languageSelect = new LocaleDropDown("language", Arrays.asList(
- new Locale[]{Locale.ENGLISH, Locale.ITALIAN}));
+ languageSelect = new LocaleDropDown("language", Arrays.asList(new Locale[] { Locale.ENGLISH, Locale.ITALIAN }));
form.add(languageSelect);
- Button submitButton = new Button("submit", new Model(
- getString("submit"))) {
+ Button submitButton = new Button("submit", new Model(getString("submit"))) {
private static final long serialVersionUID = 429178684321093953L;
@Override
public void onSubmit() {
- String[] entitlements = authenticate(
- userIdField.getRawInput(), passwordField.getRawInput());
+ String[] entitlements = authenticate(userIdField.getRawInput(), passwordField.getRawInput());
if (entitlements == null) {
error(getString("login-error"));
@@ -134,8 +130,7 @@ public class Login extends WebPage {
add(new FeedbackPanel("feedback"));
// Modal window for self registration
- final ModalWindow editProfileModalWin =
- new ModalWindow("selfRegModal");
+ final ModalWindow editProfileModalWin = new ModalWindow("selfRegModal");
editProfileModalWin.setCssClassName(ModalWindow.CSS_CLASS_GRAY);
editProfileModalWin.setInitialHeight(SELF_REG_WIN_HEIGHT);
editProfileModalWin.setInitialWidth(SELF_REG_WIN_WIDTH);
@@ -144,63 +139,50 @@ public class Login extends WebPage {
Fragment selfRegFrag;
if (isSelfRegistrationAllowed()) {
- selfRegFrag =
- new Fragment("selfRegistration", "selfRegAllowed", this);
+ selfRegFrag = new Fragment("selfRegistration", "selfRegAllowed", this);
AjaxLink selfRegLink = new IndicatingAjaxLink("link") {
- private static final long serialVersionUID =
- -7978723352517770644L;
+ private static final long serialVersionUID = -7978723352517770644L;
@Override
public void onClick(final AjaxRequestTarget target) {
- editProfileModalWin.setPageCreator(
- new ModalWindow.PageCreator() {
+ editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {
- private static final long serialVersionUID =
- -7834632442532690940L;
+ private static final long serialVersionUID = -7834632442532690940L;
- @Override
- public Page createPage() {
- return new UserRequestModalPage(
- Login.this.getPageReference(),
- editProfileModalWin,
- new UserTO());
- }
- });
+ @Override
+ public Page createPage() {
+ return new UserRequestModalPage(Login.this.getPageReference(), editProfileModalWin,
+ new UserTO());
+ }
+ });
editProfileModalWin.show(target);
}
};
- selfRegLink.add(
- new Label("linkTitle", getString("selfRegistration")));
+ selfRegLink.add(new Label("linkTitle", getString("selfRegistration")));
- Panel panel = new LinkPanel("selfRegistration",
- new ResourceModel("selfRegistration"));
+ Panel panel = new LinkPanel("selfRegistration", new ResourceModel("selfRegistration"));
panel.add(selfRegLink);
selfRegFrag.add(panel);
} else {
- selfRegFrag =
- new Fragment("selfRegistration", "selfRegNotAllowed", this);
+ selfRegFrag = new Fragment("selfRegistration", "selfRegNotAllowed", this);
}
add(selfRegFrag);
}
private String[] authenticate(final String userId, final String password) {
// 1. Set provided credentials to check
- PreemptiveAuthHttpRequestFactory requestFactory =
- ((PreemptiveAuthHttpRequestFactory) restTemplate.
- getRequestFactory());
- ((DefaultHttpClient) requestFactory.getHttpClient()).
- getCredentialsProvider().setCredentials(
- requestFactory.getAuthScope(),
- new UsernamePasswordCredentials(userId, password));
+ PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+ .getRequestFactory());
+ ((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().setCredentials(
+ requestFactory.getAuthScope(), new UsernamePasswordCredentials(userId, password));
// 2. Search authorizations for user specified by credentials
String[] entitlements = null;
try {
- entitlements = restTemplate.getForObject(
- baseURL + "auth/entitlements.json", String[].class);
+ entitlements = restTemplate.getForObject(baseURL + "auth/entitlements.json", String[].class);
} catch (HttpClientErrorException e) {
LOG.error("While fetching user's entitlements", e);
}
@@ -211,19 +193,19 @@ public class Login extends WebPage {
private boolean isSelfRegistrationAllowed() {
Boolean result = null;
try {
- result = restTemplate.getForObject(
- baseURL + "user/request/create/allowed", Boolean.class);
+ result = restTemplate.getForObject(baseURL + "user/request/create/allowed", Boolean.class);
} catch (HttpClientErrorException e) {
LOG.error("While seeking if self registration is allowed", e);
}
- return result == null ? false : result.booleanValue();
+ return result == null
+ ? false
+ : result.booleanValue();
}
private String getCoreVersion() {
- PreemptiveAuthHttpRequestFactory requestFactory =
- ((PreemptiveAuthHttpRequestFactory) restTemplate.
- getRequestFactory());
+ PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) restTemplate
+ .getRequestFactory());
String version = "";
try {
@@ -255,8 +237,7 @@ public class Login extends WebPage {
}
}
- public LocaleDropDown(final String id,
- final List<Locale> supportedLocales) {
+ public LocaleDropDown(final String id, final List<Locale> supportedLocales) {
super(id, supportedLocales);
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/MembershipModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/MembershipModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/MembershipModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/MembershipModalPage.java Thu Mar 15 10:17:12 2012
@@ -41,16 +41,12 @@ public class MembershipModalPage extends
private AjaxButton submit;
- public MembershipModalPage(
- final PageReference pageRef,
- final ModalWindow window,
- final MembershipTO membershipTO,
+ public MembershipModalPage(final PageReference pageRef, final ModalWindow window, final MembershipTO membershipTO,
final boolean templateMode) {
final Form form = new Form("MembershipForm");
- final UserTO userTO =
- ((UserModalPage) pageRef.getPage()).getUserTO();
+ final UserTO userTO = ((UserModalPage) pageRef.getPage()).getUserTO();
form.setModel(new CompoundPropertyModel(membershipTO));
@@ -59,8 +55,7 @@ public class MembershipModalPage extends
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(
- final AjaxRequestTarget target, final Form form) {
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
userTO.removeMembership(membershipTO);
userTO.addMembership(membershipTO);
@@ -71,8 +66,7 @@ public class MembershipModalPage extends
}
@Override
- protected void onError(
- final AjaxRequestTarget target, final Form form) {
+ protected void onError(final AjaxRequestTarget target, final Form form) {
target.add(feedbackPanel);
}
@@ -81,16 +75,14 @@ public class MembershipModalPage extends
String allowedRoles = userTO.getId() == 0
? xmlRolesReader.getAllAllowedRoles("Users", "create")
: xmlRolesReader.getAllAllowedRoles("Users", "update");
- MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
- allowedRoles);
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, allowedRoles);
form.add(submit);
//--------------------------------
// Attributes panel
//--------------------------------
- form.add(new AttributesPanel("attributes", membershipTO, form,
- templateMode));
+ form.add(new AttributesPanel("attributes", membershipTO, form, templateMode));
//--------------------------------
//--------------------------------
@@ -102,8 +94,7 @@ public class MembershipModalPage extends
//--------------------------------
// Virtual attributes container
//--------------------------------
- form.add(new VirtualAttributesPanel("virtualAttributes", membershipTO,
- templateMode));
+ form.add(new VirtualAttributesPanel("virtualAttributes", membershipTO, templateMode));
//--------------------------------
add(form);
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationModalPage.java Thu Mar 15 10:17:12 2012
@@ -49,13 +49,10 @@ class NotificationModalPage extends Base
@SpringBean
private NotificationRestClient restClient;
- public NotificationModalPage(final PageReference callPageRef,
- final ModalWindow window,
- final NotificationTO notificationTO,
- final boolean createFlag) {
+ public NotificationModalPage(final PageReference callPageRef, final ModalWindow window,
+ final NotificationTO notificationTO, final boolean createFlag) {
- Form form = new Form("form", new CompoundPropertyModel(
- notificationTO));
+ Form form = new Form("form", new CompoundPropertyModel(notificationTO));
form.setModel(new CompoundPropertyModel(notificationTO));
final AjaxTextFieldPanel sender = new AjaxTextFieldPanel("sender", getString("sender"),
@@ -91,18 +88,16 @@ class NotificationModalPage extends Base
final UserSearchPanel recipients = new UserSearchPanel("recipients", notificationTO.getRecipients());
form.add(recipients);
- final AjaxCheckBoxPanel selfAsRecipient = new AjaxCheckBoxPanel("selfAsRecipient", getString("selfAsRecipient"),
- new PropertyModel(notificationTO, "selfAsRecipient"));
+ final AjaxCheckBoxPanel selfAsRecipient = new AjaxCheckBoxPanel("selfAsRecipient",
+ getString("selfAsRecipient"), new PropertyModel(notificationTO, "selfAsRecipient"));
form.add(selfAsRecipient);
- AjaxButton submit = new IndicatingAjaxButton(
- "apply", new Model<String>(getString("submit"))) {
+ AjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target,
- final Form form) {
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
notificationTO.setAbout(about.buildSearchCond());
notificationTO.setRecipients(recipients.buildSearchCond());
@@ -115,8 +110,7 @@ class NotificationModalPage extends Base
}
info(getString("operation_succeded"));
- Configuration callerPage =
- (Configuration) callPageRef.getPage();
+ Configuration callerPage = (Configuration) callPageRef.getPage();
callerPage.setModalResult(true);
window.close(target);
@@ -127,8 +121,7 @@ class NotificationModalPage extends Base
}
@Override
- protected void onError(final AjaxRequestTarget target,
- final Form form) {
+ protected void onError(final AjaxRequestTarget target, final Form form) {
target.add(feedbackPanel);
}
@@ -137,8 +130,7 @@ class NotificationModalPage extends Base
String allowedRoles = createFlag
? xmlRolesReader.getAllAllowedRoles("Notification", "create")
: xmlRolesReader.getAllAllowedRoles("Notification", "update");
- MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE,
- allowedRoles);
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, allowedRoles);
form.add(submit);
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationTaskModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationTaskModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationTaskModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/NotificationTaskModalPage.java Thu Mar 15 10:17:12 2012
@@ -38,8 +38,7 @@ public class NotificationTaskModalPage e
sender.setEnabled(false);
profile.add(sender);
- final ListMultipleChoice<String> recipients =
- new ListMultipleChoice<String>("recipients",
+ final ListMultipleChoice<String> recipients = new ListMultipleChoice<String>("recipients",
new ArrayList<String>(((NotificationTaskTO) taskTO).getRecipients()));
recipients.setMaxRows(5);
recipients.setEnabled(false);
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/PolicyModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/PolicyModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/PolicyModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/PolicyModalPage.java Thu Mar 15 10:17:12 2012
@@ -51,8 +51,7 @@ public class PolicyModalPage<T extends P
@SpringBean
private PolicyRestClient policyRestClient;
- public PolicyModalPage(
- final ModalWindow window, final T policyTO) {
+ public PolicyModalPage(final ModalWindow window, final T policyTO) {
super();
@@ -63,15 +62,13 @@ public class PolicyModalPage<T extends P
final AjaxTextFieldPanel policyid = new AjaxTextFieldPanel("id", "id",
new PropertyModel<String>(policyTO, "id"));
policyid.setEnabled(false);
- policyid.setStyleShet(
- "ui-widget-content ui-corner-all short_fixedsize");
+ policyid.setStyleShet("ui-widget-content ui-corner-all short_fixedsize");
form.add(policyid);
final AjaxTextFieldPanel description = new AjaxTextFieldPanel("description", "description",
new PropertyModel<String>(policyTO, "description"));
description.addRequiredLabel();
- description.setStyleShet(
- "ui-widget-content ui-corner-all medium_dynamicsize");
+ description.setStyleShet("ui-widget-content ui-corner-all medium_dynamicsize");
form.add(description);
final AjaxDropDownChoicePanel<PolicyType> type = new AjaxDropDownChoicePanel<PolicyType>("type", "type",
@@ -80,20 +77,17 @@ public class PolicyModalPage<T extends P
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
- type.setChoices(Arrays.asList(new PolicyType[]{
- PolicyType.GLOBAL_ACCOUNT, PolicyType.ACCOUNT}));
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_ACCOUNT, PolicyType.ACCOUNT }));
break;
case GLOBAL_PASSWORD:
case PASSWORD:
- type.setChoices(Arrays.asList(new PolicyType[]{
- PolicyType.GLOBAL_PASSWORD, PolicyType.PASSWORD}));
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_PASSWORD, PolicyType.PASSWORD }));
break;
case GLOBAL_SYNC:
case SYNC:
- type.setChoices(Arrays.asList(new PolicyType[]{
- PolicyType.GLOBAL_SYNC, PolicyType.SYNC}));
+ type.setChoices(Arrays.asList(new PolicyType[] { PolicyType.GLOBAL_SYNC, PolicyType.SYNC }));
default:
}
@@ -107,15 +101,12 @@ public class PolicyModalPage<T extends P
form.add(new PolicyBeanPanel("panel", policy));
- final IndicatingAjaxButton submit = new IndicatingAjaxButton(
- "apply", new ResourceModel("apply")) {
+ final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(
- final AjaxRequestTarget target,
- final Form form) {
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
setPolicySpecification(policyTO, policy);
@@ -136,8 +127,7 @@ public class PolicyModalPage<T extends P
}
@Override
- protected void onError(final AjaxRequestTarget target,
- final Form form) {
+ protected void onError(final AjaxRequestTarget target, final Form form) {
target.add(getPage().get("feedback"));
}
@@ -175,26 +165,22 @@ public class PolicyModalPage<T extends P
return spec;
}
- private void setPolicySpecification(
- final PolicyTO policyTO, final AbstractPolicySpec specification) {
+ private void setPolicySpecification(final PolicyTO policyTO, final AbstractPolicySpec specification) {
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
- ((AccountPolicyTO) policyTO).setSpecification(
- (AccountPolicySpec) specification);
+ ((AccountPolicyTO) policyTO).setSpecification((AccountPolicySpec) specification);
break;
case GLOBAL_PASSWORD:
case PASSWORD:
- ((PasswordPolicyTO) policyTO).setSpecification(
- (PasswordPolicySpec) specification);
+ ((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) specification);
break;
case GLOBAL_SYNC:
case SYNC:
- ((SyncPolicyTO) policyTO).setSpecification(
- (SyncPolicySpec) specification);
+ ((SyncPolicyTO) policyTO).setSpecification((SyncPolicySpec) specification);
default:
}
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportExecResultDownloadModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportExecResultDownloadModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportExecResultDownloadModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportExecResultDownloadModalPage.java Thu Mar 15 10:17:12 2012
@@ -32,11 +32,9 @@ public class ReportExecResultDownloadMod
private static final long serialVersionUID = 3163146190501510888L;
- public ReportExecResultDownloadModalPage(final ModalWindow window,
- final PageReference callerPageRef) {
+ public ReportExecResultDownloadModalPage(final ModalWindow window, final PageReference callerPageRef) {
- final AjaxDropDownChoicePanel<ReportExecExportFormat> format =
- new AjaxDropDownChoicePanel<ReportExecExportFormat>(
+ final AjaxDropDownChoicePanel<ReportExecExportFormat> format = new AjaxDropDownChoicePanel<ReportExecExportFormat>(
"format", "format", new Model<ReportExecExportFormat>());
format.setChoices(Arrays.asList(ReportExecExportFormat.values()));
@@ -51,23 +49,19 @@ public class ReportExecResultDownloadMod
}
@Override
- public String getIdValue(final ReportExecExportFormat object,
- final int index) {
+ public String getIdValue(final ReportExecExportFormat object, final int index) {
return object.name();
}
});
- format.getField().add(new AjaxFormComponentUpdatingBehavior(
- "onchange") {
+ format.getField().add(new AjaxFormComponentUpdatingBehavior("onchange") {
- private static final long serialVersionUID =
- -1107858522700306810L;
+ private static final long serialVersionUID = -1107858522700306810L;
@Override
protected void onUpdate(final AjaxRequestTarget target) {
- ((ReportModalPage) callerPageRef.getPage()).setExportFormat(
- format.getField().getInput());
+ ((ReportModalPage) callerPageRef.getPage()).setExportFormat(format.getField().getInput());
window.close(target);
}
});
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportModalPage.java Thu Mar 15 10:17:12 2012
@@ -119,8 +119,8 @@ public class ReportModalPage extends Bas
setupProfile();
setupExecutions();
- final CrontabContainer crontab = new CrontabContainer("crontab",
- new PropertyModel<String>(reportTO, "cronExpression"), reportTO.getCronExpression());
+ final CrontabContainer crontab = new CrontabContainer("crontab", new PropertyModel<String>(reportTO,
+ "cronExpression"), reportTO.getCronExpression());
form.add(crontab);
final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {
@@ -131,7 +131,8 @@ public class ReportModalPage extends Bas
protected void onSubmit(final AjaxRequestTarget target, final Form form) {
ReportTO reportTO = (ReportTO) form.getModelObject();
reportTO.setCronExpression(StringUtils.hasText(reportTO.getCronExpression())
- ? crontab.getCronExpression() : null);
+ ? crontab.getCronExpression()
+ : null);
try {
if (reportTO.getId() > 0) {
@@ -156,13 +157,12 @@ public class ReportModalPage extends Bas
}
};
-
if (reportTO.getId() > 0) {
- MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
- xmlRolesReader.getAllAllowedRoles("Reports", "update"));
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
+ "update"));
} else {
- MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER,
- xmlRolesReader.getAllAllowedRoles("Reports", "create"));
+ MetaDataRoleAuthorizationStrategy.authorize(submit, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
+ "create"));
}
form.add(submit);
@@ -208,16 +208,16 @@ public class ReportModalPage extends Bas
final Label idLabel = new Label("idLabel", new ResourceModel("id"));
profile.add(idLabel);
- final AjaxTextFieldPanel id = new AjaxTextFieldPanel("id", getString("id"),
- new PropertyModel<String>(reportTO, "id"));
+ final AjaxTextFieldPanel id = new AjaxTextFieldPanel("id", getString("id"), new PropertyModel<String>(reportTO,
+ "id"));
id.setEnabled(false);
profile.add(id);
final Label nameLabel = new Label("nameLabel", new ResourceModel("name"));
profile.add(nameLabel);
- final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"),
- new PropertyModel<String>(reportTO, "name"));
+ final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
+ reportTO, "name"));
profile.add(name);
final AjaxTextFieldPanel lastExec = new AjaxTextFieldPanel("lastExec", getString("lastExec"),
@@ -234,8 +234,7 @@ public class ReportModalPage extends Bas
new PropertyModel<List<? extends ReportletConf>>(reportTO, "reportletConfs"),
new IChoiceRenderer<ReportletConf>() {
- private static final long serialVersionUID =
- 1048000918946220007L;
+ private static final long serialVersionUID = 1048000918946220007L;
@Override
public Object getDisplayValue(final ReportletConf object) {
@@ -275,8 +274,8 @@ public class ReportModalPage extends Bas
public Page createPage() {
modalReportletConfOldName = reportlets.getSelectedItem().getName();
modalReportletConf = null;
- return new ReportletConfModalPage(reportlets.getSelectedItem(),
- reportletConfWin, ReportModalPage.this.getPageReference());
+ return new ReportletConfModalPage(reportlets.getSelectedItem(), reportletConfWin,
+ ReportModalPage.this.getPageReference());
}
});
reportletConfWin.show(target);
@@ -297,8 +296,8 @@ public class ReportModalPage extends Bas
public Page createPage() {
modalReportletConfOldName = null;
modalReportletConf = null;
- return new ReportletConfModalPage(null,
- reportletConfWin, ReportModalPage.this.getPageReference());
+ return new ReportletConfModalPage(null, reportletConfWin, ReportModalPage.this
+ .getPageReference());
}
});
reportletConfWin.show(target);
@@ -320,8 +319,7 @@ public class ReportModalPage extends Bas
@Override
public CharSequence preDecorateScript(final CharSequence script) {
- return script
- + reportlets.getEditOnClickJS();
+ return script + reportlets.getEditOnClickJS();
}
};
}
@@ -342,10 +340,8 @@ public class ReportModalPage extends Bas
@Override
public CharSequence preDecorateScript(final CharSequence script) {
- return "if (confirm('" + getString("confirmDelete") + "')) {"
- + script
- + reportlets.getRemoveOnClickJS()
- + "}";
+ return "if (confirm('" + getString("confirmDelete") + "')) {" + script
+ + reportlets.getRemoveOnClickJS() + "}";
}
};
}
@@ -370,13 +366,12 @@ public class ReportModalPage extends Bas
reportExecExportWin.setInitialWidth(EXEC_EXPORT_WIN_WIDTH);
reportExecExportWin.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
- private static final long serialVersionUID =
- 8804221891699487139L;
+ private static final long serialVersionUID = 8804221891699487139L;
@Override
public void onClose(final AjaxRequestTarget target) {
- AjaxExportDownloadBehavior behavior = new AjaxExportDownloadBehavior(
- ReportModalPage.this.exportFormat, ReportModalPage.this.exportExecId);
+ AjaxExportDownloadBehavior behavior = new AjaxExportDownloadBehavior(ReportModalPage.this.exportFormat,
+ ReportModalPage.this.exportExecId);
executions.add(behavior);
behavior.initiate(target);
}
@@ -398,9 +393,7 @@ public class ReportModalPage extends Bas
}
@Override
- public void populateItem(
- final Item<ICellPopulator<ReportExecTO>> cellItem,
- final String componentId,
+ public void populateItem(final Item<ICellPopulator<ReportExecTO>> cellItem, final String componentId,
final IModel<ReportExecTO> model) {
final ReportExecTO taskExecutionTO = model.getObject();
@@ -424,37 +417,33 @@ public class ReportModalPage extends Bas
});
reportExecMessageWin.show(target);
}
- }, ActionLink.ActionType.EDIT, "Reports", "read",
- StringUtils.hasText(model.getObject().getMessage()));
+ }, ActionLink.ActionType.EDIT, "Reports", "read", StringUtils.hasText(model.getObject().getMessage()));
panel.add(new ActionLink() {
- private static final long serialVersionUID =
- -3722207913631435501L;
+ private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
- reportExecExportWin.setPageCreator(
- new ModalWindow.PageCreator() {
+ reportExecExportWin.setPageCreator(new ModalWindow.PageCreator() {
- private static final long serialVersionUID = -7834632442532690940L;
+ private static final long serialVersionUID = -7834632442532690940L;
- @Override
- public Page createPage() {
- ReportModalPage.this.exportExecId = model.getObject().getId();
- return new ReportExecResultDownloadModalPage(
- reportExecExportWin, ReportModalPage.this.getPageReference());
- }
- });
+ @Override
+ public Page createPage() {
+ ReportModalPage.this.exportExecId = model.getObject().getId();
+ return new ReportExecResultDownloadModalPage(reportExecExportWin, ReportModalPage.this
+ .getPageReference());
+ }
+ });
reportExecExportWin.show(target);
}
- }, ActionLink.ActionType.EXPORT, "Reports", "read",
- ReportExecStatus.SUCCESS.name().equals(model.getObject().getStatus()));
+ }, ActionLink.ActionType.EXPORT, "Reports", "read", ReportExecStatus.SUCCESS.name().equals(
+ model.getObject().getStatus()));
panel.add(new ActionLink() {
- private static final long serialVersionUID =
- -3722207913631435501L;
+ private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
@@ -477,8 +466,7 @@ public class ReportModalPage extends Bas
}
});
- final AjaxFallbackDefaultDataTable table =
- new AjaxFallbackDefaultDataTable("executionsTable", columns,
+ final AjaxFallbackDefaultDataTable table = new AjaxFallbackDefaultDataTable("executionsTable", columns,
new ReportExecutionsProvider(reportTO), 10);
executions.add(table);
}
@@ -506,8 +494,7 @@ public class ReportModalPage extends Bas
}
@Override
- public Iterator<ReportExecTO> iterator(final int first,
- final int count) {
+ public Iterator<ReportExecTO> iterator(final int first, final int count) {
List<ReportExecTO> list = reportTO.getExecutions();
@@ -555,8 +542,7 @@ public class ReportModalPage extends Bas
private void createResourceStream() {
StringBuilder urlBuilder = new StringBuilder();
- urlBuilder.append(baseURL).
- append("report/execution/export/").append(exportExecId);
+ urlBuilder.append(baseURL).append("report/execution/export/").append(exportExecId);
if (exportFormat != null) {
urlBuilder.append("?fmt=").append(exportFormat);
}
@@ -576,7 +562,9 @@ public class ReportModalPage extends Bas
@Override
protected String getFileName() {
createResourceStream();
- return stream == null ? null : stream.getFilename();
+ return stream == null
+ ? null
+ : stream.getFilename();
}
@Override
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportletConfModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportletConfModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportletConfModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ReportletConfModalPage.java Thu Mar 15 10:17:12 2012
@@ -72,8 +72,8 @@ public class ReportletConfModalPage exte
private static final long serialVersionUID = 3910027601200382958L;
- private static final String[] EXCLUDE_PROPERTIES = new String[]{
- "serialVersionUID", "class", "name", "reportletClassName"};
+ private static final String[] EXCLUDE_PROPERTIES = new String[] { "serialVersionUID", "class", "name",
+ "reportletClassName" };
@SpringBean
private ReportRestClient restClient;
@@ -89,8 +89,8 @@ public class ReportletConfModalPage exte
private ListView<String> propView;
- public ReportletConfModalPage(final ReportletConf reportletConf,
- final ModalWindow window, final PageReference callerPageRef) {
+ public ReportletConfModalPage(final ReportletConf reportletConf, final ModalWindow window,
+ final PageReference callerPageRef) {
this.reportletConf = reportletConf;
@@ -101,38 +101,40 @@ public class ReportletConfModalPage exte
propertiesContainer.setOutputMarkupId(true);
form.add(propertiesContainer);
- name = new AjaxTextFieldPanel("name", "name",
- this.reportletConf == null ? new Model() : new PropertyModel<String>(this.reportletConf, "name"));
+ name = new AjaxTextFieldPanel("name", "name", this.reportletConf == null
+ ? new Model()
+ : new PropertyModel<String>(this.reportletConf, "name"));
name.setOutputMarkupId(true);
name.addRequiredLabel();
form.add(name);
- final AjaxDropDownChoicePanel<String> reportletClass = new AjaxDropDownChoicePanel<String>(
- "reportletClass", "reportletClass", new IModel<String>() {
+ final AjaxDropDownChoicePanel<String> reportletClass = new AjaxDropDownChoicePanel<String>("reportletClass",
+ "reportletClass", new IModel<String>() {
- private static final long serialVersionUID = -2316468110411802130L;
+ private static final long serialVersionUID = -2316468110411802130L;
- @Override
- public String getObject() {
- return ReportletConfModalPage.this.reportletConf == null
- ? null : ReportletConfModalPage.this.reportletConf.getClass().getName();
- }
+ @Override
+ public String getObject() {
+ return ReportletConfModalPage.this.reportletConf == null
+ ? null
+ : ReportletConfModalPage.this.reportletConf.getClass().getName();
+ }
- @Override
- public void setObject(final String object) {
- try {
- Class reportletClass = Class.forName(object);
- ReportletConfModalPage.this.reportletConf = (ReportletConf) reportletClass.newInstance();
- propertiesContainer.replace(buildPropView());
- } catch (Exception e) {
- LOG.error("Cannot find or initialize {}", object, e);
- }
- }
+ @Override
+ public void setObject(final String object) {
+ try {
+ Class reportletClass = Class.forName(object);
+ ReportletConfModalPage.this.reportletConf = (ReportletConf) reportletClass.newInstance();
+ propertiesContainer.replace(buildPropView());
+ } catch (Exception e) {
+ LOG.error("Cannot find or initialize {}", object, e);
+ }
+ }
- @Override
- public void detach() {
- }
- });
+ @Override
+ public void detach() {
+ }
+ });
reportletClass.setStyleShet("long_dynamicsize");
reportletClass.setChoices(restClient.getReportletConfClasses());
((DropDownChoice) reportletClass.getField()).setNullValid(true);
@@ -158,8 +160,8 @@ public class ReportletConfModalPage exte
@Override
protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
- final BeanWrapper wrapper =
- PropertyAccessorFactory.forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
+ final BeanWrapper wrapper = PropertyAccessorFactory
+ .forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
wrapper.setPropertyValue("name", name.getField().getInput());
// Iterate over properties in order to find UserSearchPanel instances and manually update
@@ -174,8 +176,8 @@ public class ReportletConfModalPage exte
}
}
- ((ReportModalPage) callerPageRef.getPage()).setModalReportletConf(
- ReportletConfModalPage.this.reportletConf);
+ ((ReportModalPage) callerPageRef.getPage())
+ .setModalReportletConf(ReportletConfModalPage.this.reportletConf);
window.close(target);
}
@@ -192,16 +194,15 @@ public class ReportletConfModalPage exte
PropertyModel model = new PropertyModel(ReportletConfModalPage.this.reportletConf, fieldName);
if (Boolean.TYPE.equals(type) || Boolean.class.equals(type)) {
result = new AjaxCheckBoxPanel(id, fieldName, model);
- } else if (Integer.TYPE.equals(type) || Integer.class.equals(type)
- || Long.TYPE.equals(type) || Long.class.equals(type)
- || Double.TYPE.equals(type) || Double.class.equals(type)) {
+ } else if (Integer.TYPE.equals(type) || Integer.class.equals(type) || Long.TYPE.equals(type)
+ || Long.class.equals(type) || Double.TYPE.equals(type) || Double.class.equals(type)) {
result = new AjaxNumberFieldPanel(id, fieldName, model, ClassUtils.resolvePrimitiveIfNecessary(type));
} else if (Date.class.equals(type)) {
result = new DateTimeFieldPanel(id, fieldName, model, SyncopeConstants.DEFAULT_DATE_PATTERN);
} else if (type.isEnum()) {
- result = new AjaxDropDownChoicePanel(id, fieldName, model).setChoices(
- Arrays.asList(type.getEnumConstants()));
+ result = new AjaxDropDownChoicePanel(id, fieldName, model).setChoices(Arrays
+ .asList(type.getEnumConstants()));
}
// treat as String if nothing matched above
@@ -247,15 +248,15 @@ public class ReportletConfModalPage exte
try {
field = ReportletConfModalPage.this.reportletConf.getClass().getDeclaredField(fieldName);
} catch (Exception e) {
- LOG.error("Could not find field {} in class {}",
- new Object[]{fieldName, ReportletConfModalPage.this.reportletConf.getClass(), e});
+ LOG.error("Could not find field {} in class {}", new Object[] { fieldName,
+ ReportletConfModalPage.this.reportletConf.getClass(), e });
}
if (field == null) {
return;
}
- BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(
- ReportletConfModalPage.this.reportletConf);
+ BeanWrapper wrapper = PropertyAccessorFactory
+ .forBeanPropertyAccess(ReportletConfModalPage.this.reportletConf);
Panel panel;
@@ -270,8 +271,7 @@ public class ReportletConfModalPage exte
Class listItemType = String.class;
if (field.getGenericType() instanceof ParameterizedType) {
- listItemType =
- (Class) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
+ listItemType = (Class) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
}
FormAttributeField annotation = field.getAnnotation(FormAttributeField.class);
@@ -320,20 +320,20 @@ public class ReportletConfModalPage exte
}
panel = new AjaxPalettePanel("value", new PropertyModel<List<String>>(
- ReportletConfModalPage.this.reportletConf, fieldName),
- new ListModel<String>(choices), true);
+ ReportletConfModalPage.this.reportletConf, fieldName), new ListModel<String>(choices),
+ true);
} else if (listItemType.isEnum()) {
- panel = new CheckBoxMultipleChoiceFieldPanel("value",
- new PropertyModel(ReportletConfModalPage.this.reportletConf, fieldName),
- new ListModel(Arrays.asList(listItemType.getEnumConstants())));
+ panel = new CheckBoxMultipleChoiceFieldPanel("value", new PropertyModel(
+ ReportletConfModalPage.this.reportletConf, fieldName), new ListModel(Arrays
+ .asList(listItemType.getEnumConstants())));
} else {
if (((List) wrapper.getPropertyValue(fieldName)).isEmpty()) {
((List) wrapper.getPropertyValue(fieldName)).add(null);
}
- panel = new MultiValueSelectorPanel("value",
- new PropertyModel<List>(ReportletConfModalPage.this.reportletConf, fieldName),
- buildSinglePanel(field.getType(), fieldName, "panel"));
+ panel = new MultiValueSelectorPanel("value", new PropertyModel<List>(
+ ReportletConfModalPage.this.reportletConf, fieldName), buildSinglePanel(
+ field.getType(), fieldName, "panel"));
}
} else {
panel = buildSinglePanel(field.getType(), fieldName, "value");
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Reports.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Reports.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Reports.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/Reports.java Thu Mar 15 10:17:12 2012
@@ -96,27 +96,18 @@ public class Reports extends BasePage {
reportContainer = new WebMarkupContainer("reportContainer");
setWindowClosedCallback(window, reportContainer);
- MetaDataRoleAuthorizationStrategy.authorize(
- reportContainer, RENDER,
- xmlRolesReader.getAllAllowedRoles("Reports", "list"));
+ MetaDataRoleAuthorizationStrategy.authorize(reportContainer, RENDER, xmlRolesReader.getAllAllowedRoles(
+ "Reports", "list"));
- paginatorRows = prefMan.getPaginatorRows(getRequest(),
- Constants.PREF_REPORT_PAGINATOR_ROWS);
+ paginatorRows = prefMan.getPaginatorRows(getRequest(), Constants.PREF_REPORT_PAGINATOR_ROWS);
List<IColumn> columns = new ArrayList<IColumn>();
- columns.add(new PropertyColumn(new ResourceModel("id"),
- "id", "id"));
- columns.add(new PropertyColumn(new ResourceModel("name"),
- "name", "name"));
- columns.add(new DatePropertyColumn(
- new ResourceModel("lastExec"), "lastExec", "lastExec"));
- columns.add(new DatePropertyColumn(
- new ResourceModel("nextExec"), "nextExec", "nextExec"));
- columns.add(new PropertyColumn(
- new ResourceModel("latestExecStatus"),
- "latestExecStatus", "latestExecStatus"));
- columns.add(new AbstractColumn<ReportTO>(
- new ResourceModel("actions", "")) {
+ columns.add(new PropertyColumn(new ResourceModel("id"), "id", "id"));
+ columns.add(new PropertyColumn(new ResourceModel("name"), "name", "name"));
+ columns.add(new DatePropertyColumn(new ResourceModel("lastExec"), "lastExec", "lastExec"));
+ columns.add(new DatePropertyColumn(new ResourceModel("nextExec"), "nextExec", "nextExec"));
+ columns.add(new PropertyColumn(new ResourceModel("latestExecStatus"), "latestExecStatus", "latestExecStatus"));
+ columns.add(new AbstractColumn<ReportTO>(new ResourceModel("actions", "")) {
private static final long serialVersionUID = 2054811145491901166L;
@@ -126,34 +117,27 @@ public class Reports extends BasePage {
}
@Override
- public void populateItem(
- final Item<ICellPopulator<ReportTO>> cellItem,
- final String componentId,
+ public void populateItem(final Item<ICellPopulator<ReportTO>> cellItem, final String componentId,
final IModel<ReportTO> model) {
final ReportTO reportTO = model.getObject();
- final ActionLinksPanel panel =
- new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
panel.add(new ActionLink() {
- private static final long serialVersionUID =
- -3722207913631435501L;
+ private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
window.setPageCreator(new ModalWindow.PageCreator() {
- private static final long serialVersionUID =
- -7834632442532690940L;
+ private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
- return new ReportModalPage(
- window, reportTO,
- Reports.this.getPageReference());
+ return new ReportModalPage(window, reportTO, Reports.this.getPageReference());
}
});
@@ -163,8 +147,7 @@ public class Reports extends BasePage {
panel.add(new ActionLink() {
- private static final long serialVersionUID =
- -3722207913631435501L;
+ private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
@@ -182,8 +165,7 @@ public class Reports extends BasePage {
panel.add(new ActionLink() {
- private static final long serialVersionUID =
- -3722207913631435501L;
+ private static final long serialVersionUID = -3722207913631435501L;
@Override
public void onClick(final AjaxRequestTarget target) {
@@ -202,8 +184,7 @@ public class Reports extends BasePage {
}
});
- final AjaxFallbackDefaultDataTable reportTable =
- new AjaxFallbackDefaultDataTable("reportTable", columns,
+ final AjaxFallbackDefaultDataTable reportTable = new AjaxFallbackDefaultDataTable("reportTable", columns,
new ReportProvider(), paginatorRows);
reportContainer.add(reportTable);
@@ -213,12 +194,10 @@ public class Reports extends BasePage {
Form paginatorForm = new Form("paginatorForm");
- MetaDataRoleAuthorizationStrategy.authorize(
- paginatorForm, RENDER,
- xmlRolesReader.getAllAllowedRoles("Reports", "list"));
+ MetaDataRoleAuthorizationStrategy.authorize(paginatorForm, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
+ "list"));
- final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser",
- new PropertyModel(this, "paginatorRows"),
+ final DropDownChoice rowsChooser = new DropDownChoice("rowsChooser", new PropertyModel(this, "paginatorRows"),
prefMan.getPaginatorChoices());
rowsChooser.add(new AjaxFormComponentUpdatingBehavior("onchange") {
@@ -227,10 +206,8 @@ public class Reports extends BasePage {
@Override
protected void onUpdate(final AjaxRequestTarget target) {
- prefMan.set(getRequest(),
- getResponse(),
- Constants.PREF_REPORT_PAGINATOR_ROWS,
- String.valueOf(paginatorRows));
+ prefMan.set(getRequest(), getResponse(), Constants.PREF_REPORT_PAGINATOR_ROWS, String
+ .valueOf(paginatorRows));
reportTable.setItemsPerPage(paginatorRows);
target.add(reportContainer);
@@ -248,13 +225,11 @@ public class Reports extends BasePage {
public void onClick(final AjaxRequestTarget target) {
window.setPageCreator(new ModalWindow.PageCreator() {
- private static final long serialVersionUID =
- -7834632442532690940L;
+ private static final long serialVersionUID = -7834632442532690940L;
@Override
public Page createPage() {
- return new ReportModalPage(window, new ReportTO(),
- Reports.this.getPageReference());
+ return new ReportModalPage(window, new ReportTO(), Reports.this.getPageReference());
}
});
@@ -262,14 +237,13 @@ public class Reports extends BasePage {
}
};
- MetaDataRoleAuthorizationStrategy.authorize(createLink, RENDER,
- xmlRolesReader.getAllAllowedRoles("Reports", "create"));
+ MetaDataRoleAuthorizationStrategy.authorize(createLink, RENDER, xmlRolesReader.getAllAllowedRoles("Reports",
+ "create"));
add(createLink);
}
- private class ReportProvider
- extends SortableDataProvider<ReportTO> {
+ private class ReportProvider extends SortableDataProvider<ReportTO> {
private static final long serialVersionUID = -2311716167583335852L;
@@ -278,16 +252,13 @@ public class Reports extends BasePage {
public ReportProvider() {
//Default sorting
setSort("key", SortOrder.ASCENDING);
- comparator =
- new SortableDataProviderComparator<ReportTO>(this);
+ comparator = new SortableDataProviderComparator<ReportTO>(this);
}
@Override
- public Iterator<ReportTO> iterator(final int first,
- final int count) {
+ public Iterator<ReportTO> iterator(final int first, final int count) {
- List<ReportTO> list = reportRestClient.list(
- (first / paginatorRows) + 1, paginatorRows);
+ List<ReportTO> list = reportRestClient.list((first / paginatorRows) + 1, paginatorRows);
Collections.sort(list, comparator);
@@ -304,8 +275,7 @@ public class Reports extends BasePage {
return new AbstractReadOnlyModel<ReportTO>() {
- private static final long serialVersionUID =
- 4921104837546595602L;
+ private static final long serialVersionUID = 4921104837546595602L;
@Override
public ReportTO getObject() {
Modified: incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ResourceModalPage.java
URL: http://svn.apache.org/viewvc/incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ResourceModalPage.java?rev=1300882&r1=1300881&r2=1300882&view=diff
==============================================================================
--- incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ResourceModalPage.java (original)
+++ incubator/syncope/trunk/console/src/main/java/org/syncope/console/pages/ResourceModalPage.java Thu Mar 15 10:17:12 2012
@@ -46,10 +46,7 @@ public class ResourceModalPage extends B
@SpringBean
private ResourceRestClient resourceRestClient;
- public ResourceModalPage(
- final PageReference pageref,
- final ModalWindow window,
- final ResourceTO resourceTO,
+ public ResourceModalPage(final PageReference pageref, final ModalWindow window, final ResourceTO resourceTO,
final boolean createFlag) {
super();
@@ -81,17 +78,14 @@ public class ResourceModalPage extends B
form.add(new ResourceSecurityPanel("security", resourceTO));
//--------------------------------
- final AjaxButton submit = new IndicatingAjaxButton(
- "apply", new ResourceModel("submit", "submit")) {
+ final AjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit", "submit")) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(
- final AjaxRequestTarget target, final Form form) {
+ protected void onSubmit(final AjaxRequestTarget target, final Form form) {
- final ResourceTO resourceTO =
- (ResourceTO) form.getDefaultModelObject();
+ final ResourceTO resourceTO = (ResourceTO) form.getDefaultModelObject();
int accountIdCount = 0;
@@ -102,9 +96,7 @@ public class ResourceModalPage extends B
}
if (accountIdCount == 0 || accountIdCount > 1) {
- error(new ResourceModel(
- "accountIdValidation", "accountIdValidation").
- getObject());
+ error(new ResourceModel("accountIdValidation", "accountIdValidation").getObject());
target.add(feedbackPanel);
} else {
try {
@@ -120,16 +112,14 @@ public class ResourceModalPage extends B
} catch (Exception e) {
LOG.error("Failuer managing resource {}", resourceTO);
- error(new ResourceModel("error", "error").getObject()
- + ":" + e.getMessage());
+ error(new ResourceModel("error", "error").getObject() + ":" + e.getMessage());
target.add(feedbackPanel);
}
}
}
@Override
- protected void onError(final AjaxRequestTarget target,
- final Form form) {
+ protected void onError(final AjaxRequestTarget target, final Form form) {
target.add(feedbackPanel);
}
@@ -138,9 +128,10 @@ public class ResourceModalPage extends B
form.add(submit);
add(form);
- MetaDataRoleAuthorizationStrategy.authorize(
- submit, ENABLE, xmlRolesReader.getAllAllowedRoles(
- "Resources", createFlag ? "create" : "update"));
+ MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Resources",
+ createFlag
+ ? "create"
+ : "update"));
}
/**