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 2013/02/15 15:00:05 UTC
svn commit: r1446584 [1/6] - in /syncope/branches/1_0_X/console/src/main:
java/org/apache/syncope/console/pages/
java/org/apache/syncope/console/pages/panels/
java/org/apache/syncope/console/wicket/ajax/markup/html/
java/org/apache/syncope/console/wick...
Author: ilgrosso
Date: Fri Feb 15 14:00:02 2013
New Revision: 1446584
URL: http://svn.apache.org/r1446584
Log:
[SYNCOPE315] Introducing ClearIndicatingAjaxButton and ClearIndicatingAjaxLink for clearing feedback messages before taking action
Added:
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/ajax/markup/html/ClearIndicatingAjaxButton.java (with props)
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/ajax/markup/html/ClearIndicatingAjaxLink.java (with props)
Modified:
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BaseModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BasePage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DerivedSchemaModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DisplayAttributesModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Login.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/MembershipModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/PolicyModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Resources.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Schema.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/SchemaModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/StatusModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/TaskModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Tasks.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Todo.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/UserModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Users.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/VirtualSchemaModalPage.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/NotificationTasks.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/PoliciesPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/PropagationTasks.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/ResourceMappingPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/ResultSetPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleAttributesPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleSummaryPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/RoleTabPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/RolesPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/SchedTasks.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/SyncTasks.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserManagementResultPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/UserSearchPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/ajax/markup/html/IndicatingDeleteOnConfirmAjaxLink.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/form/ActionLinksPanel.java
syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.java
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/BaseModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/BasePage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Configuration.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/ConfigurationModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/ConnectorModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/DerivedSchemaModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/DisplayAttributesModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/DisplayAttributesModalPage.properties
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/DisplayAttributesModalPage_it.properties
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Login.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/MembershipModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/NotificationModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/ReportModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/ReportletConfModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Reports.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Resources.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/RoleModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Schema.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/SchemaModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/StatusModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Tasks.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/UserModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/Users.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/VirtualSchemaModalPage.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/DerivedAttributesPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/NotificationTasks.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/PoliciesPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/PropagationTasks.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceConnConfPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/ResourceMappingPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/ResultSetPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/RoleAttributesPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/RoleSummaryPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/RoleTabPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/RolesPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/SchedTasks.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/SyncTasks.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/UserManagementResultPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/UserSearchPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/pages/panels/VirtualAttributesPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/MultiValueSelectorPanel.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/form/NonI18nPalette.html
syncope/branches/1_0_X/console/src/main/resources/org/apache/syncope/console/wicket/markup/html/tree/TreeActionLinkPanel.html
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/AbstractSchedTaskModalPage.java Fri Feb 15 14:00:02 2013
@@ -18,21 +18,22 @@
*/
package org.apache.syncope.console.pages;
+import org.apache.syncope.client.to.SchedTaskTO;
+import org.apache.syncope.client.to.SyncTaskTO;
+import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.commons.DateFormatROModel;
+import org.apache.syncope.console.markup.html.CrontabContainer;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;
import org.springframework.util.StringUtils;
-import org.apache.syncope.client.to.SchedTaskTO;
-import org.apache.syncope.client.to.SyncTaskTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
-import org.apache.syncope.console.commons.DateFormatROModel;
-import org.apache.syncope.console.markup.html.CrontabContainer;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
/**
* Modal window with Task form (to stop and start execution).
@@ -44,7 +45,7 @@ public abstract class AbstractSchedTaskM
protected CrontabContainer crontab;
public AbstractSchedTaskModalPage(final ModalWindow window, final SchedTaskTO taskTO,
- final PageReference callerPageRef) {
+ final PageReference pageRef) {
super(taskTO);
@@ -62,13 +63,12 @@ public abstract class AbstractSchedTaskM
nextExec.setEnabled(false);
profile.add(nextExec);
- final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("apply"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
SchedTaskTO taskTO = (SchedTaskTO) form.getModelObject();
taskTO.setCronExpression(!StringUtils.hasText(taskTO.getCronExpression())
? null
@@ -89,7 +89,7 @@ public abstract class AbstractSchedTaskM
}
}
- ((BasePage) callerPageRef.getPage()).setModalResult(true);
+ ((BasePage) pageRef.getPage()).setModalResult(true);
window.close(target);
} catch (SyncopeClientCompositeErrorException e) {
@@ -101,7 +101,6 @@ public abstract class AbstractSchedTaskM
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-
target.add(feedbackPanel);
}
};
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ApprovalModalPage.java Fri Feb 15 14:00:02 2013
@@ -70,7 +70,7 @@ public class ApprovalModalPage extends B
private final ModalWindow editUserWin;
- public ApprovalModalPage(final PageReference callerPageRef, final ModalWindow window, final WorkflowFormTO formTO) {
+ public ApprovalModalPage(final PageReference pageRef, final ModalWindow window, final WorkflowFormTO formTO) {
super();
IModel<List<WorkflowFormPropertyTO>> formProps = new LoadableDetachableModel<List<WorkflowFormPropertyTO>>() {
@@ -224,7 +224,7 @@ public class ApprovalModalPage extends B
try {
restClient.submitForm(formTO);
- ((Todo) callerPageRef.getPage()).setModalResult(true);
+ ((Todo) pageRef.getPage()).setModalResult(true);
window.close(target);
} catch (SyncopeClientCompositeErrorException e) {
error(getString("error") + ":" + e.getMessage());
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BaseModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BaseModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BaseModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BaseModalPage.java Fri Feb 15 14:00:02 2013
@@ -18,12 +18,12 @@
*/
package org.apache.syncope.console.pages;
+import org.apache.syncope.console.commons.XMLRolesReader;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.panel.FeedbackPanel;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.apache.syncope.console.commons.XMLRolesReader;
/**
* Syncope Modal Window.
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BasePage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BasePage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BasePage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/BasePage.java Fri Feb 15 14:00:02 2013
@@ -23,6 +23,7 @@ import org.apache.syncope.console.Syncop
import org.apache.syncope.console.SyncopeSession;
import org.apache.syncope.console.commons.XMLRolesReader;
import org.apache.syncope.console.rest.UserRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
import org.apache.syncope.console.wicket.markup.html.form.LinkPanel;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
@@ -30,7 +31,6 @@ import org.apache.wicket.ajax.AjaxReques
import org.apache.wicket.ajax.IAjaxIndicatorAware;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.behavior.Behavior;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.markup.html.WebMarkupContainer;
@@ -151,14 +151,16 @@ public class BasePage extends WebPage im
editProfileFrag = new Fragment("editProfile", "editProfileFrag", this);
- final AjaxLink editProfileLink = new IndicatingAjaxLink("link") {
+ final AjaxLink editProfileLink = new ClearIndicatingAjaxLink("link", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
+ protected void onClickInternal(final AjaxRequestTarget target) {
editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {
+ private static final long serialVersionUID = -7834632442532690940L;
+
@Override
public Page createPage() {
return new UserRequestModalPage(BasePage.this.getPageReference(), editProfileModalWin,
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Configuration.java Fri Feb 15 14:00:02 2013
@@ -40,6 +40,7 @@ import org.apache.syncope.console.rest.C
import org.apache.syncope.console.rest.LoggerRestClient;
import org.apache.syncope.console.rest.NotificationRestClient;
import org.apache.syncope.console.rest.WorkflowRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
import org.apache.syncope.types.PolicyType;
@@ -48,8 +49,8 @@ import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
@@ -135,9 +136,9 @@ public class Configuration extends BaseP
add(editConfigWin = new ModalWindow("editConfigurationWin"));
setupSyncopeConf();
- add(new PoliciesPanel("passwordPoliciesPanel", PolicyType.PASSWORD));
- add(new PoliciesPanel("accountPoliciesPanel", PolicyType.ACCOUNT));
- add(new PoliciesPanel("syncPoliciesPanel", PolicyType.SYNC));
+ add(new PoliciesPanel("passwordPoliciesPanel", getPageReference(), PolicyType.PASSWORD));
+ add(new PoliciesPanel("accountPoliciesPanel", getPageReference(), PolicyType.ACCOUNT));
+ add(new PoliciesPanel("syncPoliciesPanel", getPageReference(), PolicyType.SYNC));
add(createNotificationWin = new ModalWindow("createNotificationWin"));
add(editNotificationWin = new ModalWindow("editNotificationWin"));
@@ -154,28 +155,27 @@ public class Configuration extends BaseP
new PropertyModel<WorkflowDefinitionTO>(workflowDef, "xmlDefinition"));
wfForm.add(workflowDefArea);
- IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
+ AjaxButton submit =
+ new ClearIndicatingAjaxButton("apply", new Model<String>(getString("submit")), getPageReference()) {
- private static final long serialVersionUID = -958724007591692537L;
+ private static final long serialVersionUID = -958724007591692537L;
- @Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
- try {
- wfRestClient.updateDefinition(workflowDef);
- info(getString("operation_succeded"));
- } catch (SyncopeClientCompositeErrorException scee) {
- error(getString("error") + ":" + scee.getMessage());
- }
- target.add(feedbackPanel);
- }
-
- @Override
- protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ @Override
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ try {
+ wfRestClient.updateDefinition(workflowDef);
+ info(getString("operation_succeded"));
+ } catch (SyncopeClientCompositeErrorException scee) {
+ error(getString("error") + ":" + scee.getMessage());
+ }
+ target.add(feedbackPanel);
+ }
- target.add(feedbackPanel);
- }
- };
+ @Override
+ protected void onError(final AjaxRequestTarget target, final Form<?> form) {
+ target.add(feedbackPanel);
+ }
+ };
MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Configuration",
"workflowDefUpdate"));
@@ -233,7 +233,7 @@ public class Configuration extends BaseP
final ConfigurationTO configurationTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
panel.add(new ActionLink() {
@@ -402,7 +402,7 @@ public class Configuration extends BaseP
final NotificationTO notificationTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
panel.add(new ActionLink() {
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConfigurationModalPage.java Fri Feb 15 14:00:02 2013
@@ -18,21 +18,21 @@
*/
package org.apache.syncope.console.pages;
+import org.apache.syncope.client.to.ConfigurationTO;
+import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.rest.ConfigurationRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.apache.syncope.client.to.ConfigurationTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
-import org.apache.syncope.console.rest.ConfigurationRestClient;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
/**
* Modal window with Connector form.
@@ -49,12 +49,12 @@ public class ConfigurationModalPage exte
/**
* ConfigurationModalPage constructor.
*
- * @param callPageRef base
+ * @param pageRef base
* @param window
* @param configurationTO
* @param createFlag true for CREATE and false for UPDATE operation
*/
- public ConfigurationModalPage(final PageReference callPageRef, final ModalWindow window,
+ public ConfigurationModalPage(final PageReference pageRef, final ModalWindow window,
final ConfigurationTO configurationTO, final boolean createFlag) {
Form form = new Form("form", new CompoundPropertyModel(configurationTO));
@@ -69,12 +69,12 @@ public class ConfigurationModalPage exte
form.add(value);
value.addRequiredLabel();
- submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
+ submit = new ClearIndicatingAjaxButton("apply", new Model<String>(getString("submit")), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
try {
if (createFlag) {
configurationsRestClient.createConfiguration(configurationTO);
@@ -82,7 +82,7 @@ public class ConfigurationModalPage exte
configurationsRestClient.updateConfiguration(configurationTO);
}
- Configuration callerPage = (Configuration) callPageRef.getPage();
+ Configuration callerPage = (Configuration) pageRef.getPage();
callerPage.setModalResult(true);
window.close(target);
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ConnectorModalPage.java Fri Feb 15 14:00:02 2013
@@ -29,6 +29,8 @@ import org.apache.syncope.client.to.Conn
import org.apache.syncope.client.to.ConnInstanceTO;
import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
import org.apache.syncope.console.rest.ConnectorRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.console.wicket.markup.html.form.AjaxNumberFieldPanel;
@@ -45,8 +47,6 @@ import org.apache.wicket.ajax.form.AjaxF
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
@@ -95,7 +95,7 @@ public class ConnectorModalPage extends
private List<ConnConfProperty> properties;
- public ConnectorModalPage(final PageReference callerPageRef, final ModalWindow window,
+ public ConnectorModalPage(final PageReference pageRef, final ModalWindow window,
final ConnInstanceTO connectorTO) {
super();
@@ -314,12 +314,12 @@ public class ConnectorModalPage extends
connectorForm.add(propertiesContainer);
connectorPropForm.add(view);
- final AjaxLink check = new IndicatingAjaxLink("check", new ResourceModel("check")) {
+ final AjaxLink check = new ClearIndicatingAjaxLink("check", new ResourceModel("check"), pageRef) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
+ protected void onClickInternal(final AjaxRequestTarget target) {
connectorTO.setBundleName(bundleTO.getBundleName());
connectorTO.setVersion(bundleTO.getVersion());
@@ -335,12 +335,12 @@ public class ConnectorModalPage extends
connectorPropForm.add(check);
- final AjaxButton submit = new IndicatingAjaxButton("apply", new Model(getString("submit"))) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new Model(getString("submit")), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form form) {
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form form) {
final ConnInstanceTO conn = (ConnInstanceTO) form.getDefaultModelObject();
conn.setBundleName(bundleTO.getBundleName());
@@ -357,12 +357,12 @@ public class ConnectorModalPage extends
restClient.update(conn);
}
- ((Resources) callerPageRef.getPage()).setModalResult(true);
+ ((Resources) pageRef.getPage()).setModalResult(true);
window.close(target);
} catch (SyncopeClientCompositeErrorException e) {
error(getString("error") + ":" + e.getMessage());
target.add(feedbackPanel);
- ((Resources) callerPageRef.getPage()).setModalResult(false);
+ ((Resources) pageRef.getPage()).setModalResult(false);
LOG.error("While creating or updating connector {}", conn, e);
}
}
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DerivedSchemaModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DerivedSchemaModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DerivedSchemaModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DerivedSchemaModalPage.java Fri Feb 15 14:00:02 2013
@@ -21,17 +21,18 @@ package org.apache.syncope.console.pages
import org.apache.syncope.client.AbstractBaseBean;
import org.apache.syncope.client.to.DerivedSchemaTO;
import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
+import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.types.AttributableType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.ResourceModel;
-import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
/**
* Modal window with Schema form.
@@ -45,7 +46,7 @@ public class DerivedSchemaModalPage exte
}
@Override
- public void setSchemaModalPage(final PageReference callerPageRef, final ModalWindow window,
+ public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
AbstractBaseBean schema, final boolean createFlag) {
if (schema == null) {
@@ -66,13 +67,12 @@ public class DerivedSchemaModalPage exte
name.setEnabled(createFlag);
- final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("submit"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form form) {
-
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form form) {
DerivedSchemaTO schemaTO = (DerivedSchemaTO) form.getDefaultModelObject();
try {
@@ -81,8 +81,8 @@ public class DerivedSchemaModalPage exte
} else {
restClient.updateDerivedSchema(kind, schemaTO);
}
- if (callerPageRef.getPage() instanceof BasePage) {
- ((BasePage) callerPageRef.getPage()).setModalResult(true);
+ if (pageRef.getPage() instanceof BasePage) {
+ ((BasePage) pageRef.getPage()).setModalResult(true);
}
window.close(target);
@@ -94,7 +94,6 @@ public class DerivedSchemaModalPage exte
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-
target.add(feedbackPanel);
}
};
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DisplayAttributesModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DisplayAttributesModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DisplayAttributesModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/DisplayAttributesModalPage.java Fri Feb 15 14:00:02 2013
@@ -30,10 +30,11 @@ import org.apache.syncope.client.to.User
import org.apache.syncope.console.commons.Constants;
import org.apache.syncope.console.commons.PreferenceManager;
import org.apache.syncope.console.rest.SchemaRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.types.AttributableType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Check;
@@ -161,7 +162,7 @@ public class DisplayAttributesModalPage
private final List<String> selectedDerSchemas;
- public DisplayAttributesModalPage(final PageReference callerPageRef, final ModalWindow window) {
+ public DisplayAttributesModalPage(final PageReference pageRef, final ModalWindow window) {
super();
@@ -266,18 +267,16 @@ public class DisplayAttributesModalPage
selectedDerSchemas.clear();
}
- final IndicatingAjaxButton submit = new IndicatingAjaxButton("submit", new ResourceModel("submit")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("submit", new ResourceModel("submit"), pageRef) {
private static final long serialVersionUID = -4804368561204623354L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
+ if (selectedDetails.size() + selectedSchemas.size() + selectedVirSchemas.size()
+ + selectedDerSchemas.size() > MAX_SELECTIONS) {
- if (selectedDetails.size() + selectedSchemas.size() + selectedVirSchemas.size() + selectedDerSchemas.
- size()
- > MAX_SELECTIONS) {
-
- error(getString("tooMuchSelections"));
+ error(getString("tooManySelections"));
onError(target, form);
} else {
final Map<String, List<String>> prefs = new HashMap<String, List<String>>();
@@ -292,7 +291,7 @@ public class DisplayAttributesModalPage
prefMan.setList(getRequest(), getResponse(), prefs);
- ((BasePage) callerPageRef.getPage()).setModalResult(true);
+ ((BasePage) pageRef.getPage()).setModalResult(true);
window.close(target);
}
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Login.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Login.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Login.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Login.java Fri Feb 15 14:00:02 2013
@@ -28,10 +28,12 @@ import org.apache.http.impl.client.Defau
import org.apache.http.util.EntityUtils;
import org.apache.syncope.client.http.PreemptiveAuthHttpRequestFactory;
import org.apache.syncope.client.to.UserTO;
+import org.apache.syncope.console.SyncopeSession;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.console.wicket.markup.html.form.LinkPanel;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
@@ -53,8 +55,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
-import org.apache.syncope.console.SyncopeSession;
-import org.apache.syncope.console.wicket.markup.html.form.LinkPanel;
/**
* Syncope Login page.
@@ -117,7 +117,8 @@ public class Login extends WebPage {
} catch (HttpClientErrorException e) {
error(getString("login-error"));
- PreemptiveAuthHttpRequestFactory requestFactory = ((PreemptiveAuthHttpRequestFactory) SyncopeSession.
+ PreemptiveAuthHttpRequestFactory requestFactory =
+ ((PreemptiveAuthHttpRequestFactory) SyncopeSession.
get().getRestTemplate().getRequestFactory());
((DefaultHttpClient) requestFactory.getHttpClient()).getCredentialsProvider().clear();
@@ -143,12 +144,12 @@ public class Login extends WebPage {
if (isSelfRegistrationAllowed()) {
selfRegFrag = new Fragment("selfRegistration", "selfRegAllowed", this);
- final AjaxLink selfRegLink = new IndicatingAjaxLink("link") {
+ final AjaxLink selfRegLink = new ClearIndicatingAjaxLink("link", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
+ protected void onClickInternal(final AjaxRequestTarget target) {
editProfileModalWin.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/MembershipModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/MembershipModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/MembershipModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/MembershipModalPage.java Fri Feb 15 14:00:02 2013
@@ -18,18 +18,18 @@
*/
package org.apache.syncope.console.pages;
-import org.apache.wicket.PageReference;
+import org.apache.syncope.client.to.MembershipTO;
+import org.apache.syncope.client.to.UserTO;
import org.apache.syncope.console.pages.panels.AttributesPanel;
+import org.apache.syncope.console.pages.panels.DerivedAttributesPanel;
+import org.apache.syncope.console.pages.panels.VirtualAttributesPanel;
+import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.ResourceModel;
-import org.apache.syncope.client.to.MembershipTO;
-import org.apache.syncope.client.to.UserTO;
-import org.apache.syncope.console.pages.panels.DerivedAttributesPanel;
-import org.apache.syncope.console.pages.panels.VirtualAttributesPanel;
/**
* MembershipModalPage.
@@ -82,13 +82,13 @@ public class MembershipModalPage extends
//--------------------------------
// Derived attributes container
//--------------------------------
- form.add(new DerivedAttributesPanel("derivedAttributes", membershipTO));
+ form.add(new DerivedAttributesPanel("derivedAttributes", membershipTO, pageRef));
//--------------------------------
//--------------------------------
// Virtual attributes container
//--------------------------------
- form.add(new VirtualAttributesPanel("virtualAttributes", membershipTO, templateMode));
+ form.add(new VirtualAttributesPanel("virtualAttributes", membershipTO, templateMode, pageRef));
//--------------------------------
add(form);
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/NotificationModalPage.java Fri Feb 15 14:00:02 2013
@@ -29,6 +29,7 @@ import org.apache.syncope.client.validat
import org.apache.syncope.console.pages.panels.UserSearchPanel;
import org.apache.syncope.console.rest.NotificationRestClient;
import org.apache.syncope.console.rest.SchemaRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.console.wicket.markup.html.form.AjaxCheckBoxPanel;
import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.console.wicket.markup.html.form.AjaxPalettePanel;
@@ -41,7 +42,6 @@ import org.apache.wicket.ajax.AjaxReques
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.Form;
@@ -68,7 +68,7 @@ class NotificationModalPage extends Base
@SpringBean
private SchemaRestClient schemaRestClient;
- public NotificationModalPage(final PageReference callPageRef, final ModalWindow window,
+ public NotificationModalPage(final PageReference pageRef, final ModalWindow window,
final NotificationTO notificationTO, final boolean createFlag) {
Form form = new Form("form", new CompoundPropertyModel(notificationTO));
@@ -97,7 +97,7 @@ class NotificationModalPage extends Base
traceLevel.addRequiredLabel();
form.add(traceLevel);
- final UserSearchPanel about = new UserSearchPanel("about", notificationTO.getAbout());
+ final UserSearchPanel about = new UserSearchPanel("about", notificationTO.getAbout(), pageRef);
form.add(about);
final AjaxDropDownChoicePanel<IntMappingType> recipientAttrType = new AjaxDropDownChoicePanel<IntMappingType>(
@@ -159,7 +159,8 @@ class NotificationModalPage extends Base
final UserSearchPanel recipients =
new UserSearchPanel("recipients",
- notificationTO.getRecipients() == null ? null : notificationTO.getRecipients());
+ notificationTO.getRecipients() == null ? null : notificationTO.getRecipients(),
+ pageRef);
recipientsContainer.add(recipients);
recipients.setEnabled(checkRecipients.getModelObject());
@@ -195,12 +196,12 @@ class NotificationModalPage extends Base
}
});
- AjaxButton submit = new IndicatingAjaxButton("apply", new Model<String>(getString("submit"))) {
+ AjaxButton submit = new ClearIndicatingAjaxButton("apply", new Model<String>(getString("submit")), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
notificationTO.setAbout(about.buildSearchCond());
notificationTO.setRecipients(checkRecipients.getModelObject() ? recipients.buildSearchCond() : null);
@@ -212,7 +213,7 @@ class NotificationModalPage extends Base
}
info(getString("operation_succeded"));
- Configuration callerPage = (Configuration) callPageRef.getPage();
+ Configuration callerPage = (Configuration) pageRef.getPage();
callerPage.setModalResult(true);
window.close(target);
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/PolicyModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/PolicyModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/PolicyModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/PolicyModalPage.java Fri Feb 15 14:00:02 2013
@@ -19,20 +19,13 @@
package org.apache.syncope.console.pages;
import java.util.Arrays;
-import org.apache.wicket.ajax.AjaxRequestTarget;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
-import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
-import org.apache.wicket.markup.html.form.ChoiceRenderer;
-import org.apache.wicket.markup.html.form.Form;
-import org.apache.wicket.model.PropertyModel;
-import org.apache.wicket.model.ResourceModel;
-import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.syncope.client.to.AccountPolicyTO;
import org.apache.syncope.client.to.PasswordPolicyTO;
import org.apache.syncope.client.to.PolicyTO;
import org.apache.syncope.client.to.SyncPolicyTO;
import org.apache.syncope.console.pages.panels.PolicyBeanPanel;
import org.apache.syncope.console.rest.PolicyRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.types.AbstractPolicySpec;
@@ -40,6 +33,15 @@ import org.apache.syncope.types.AccountP
import org.apache.syncope.types.PasswordPolicySpec;
import org.apache.syncope.types.PolicyType;
import org.apache.syncope.types.SyncPolicySpec;
+import org.apache.wicket.PageReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.markup.html.form.ChoiceRenderer;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.spring.injection.annot.SpringBean;
/**
* Modal window with Resource form.
@@ -47,11 +49,11 @@ import org.apache.syncope.types.SyncPoli
public class PolicyModalPage<T extends PolicyTO> extends BaseModalPage {
private static final long serialVersionUID = -7325772767481076679L;
+
@SpringBean
private PolicyRestClient policyRestClient;
- public PolicyModalPage(final ModalWindow window, final T policyTO) {
-
+ public PolicyModalPage(final ModalWindow window, final T policyTO, final PageReference pageRef) {
super();
final Form form = new Form("form");
@@ -100,13 +102,12 @@ public class PolicyModalPage<T extends P
form.add(new PolicyBeanPanel("panel", policy));
- final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("apply"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
setPolicySpecification(policyTO, policy);
try {
@@ -127,7 +128,6 @@ public class PolicyModalPage<T extends P
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-
target.add(getPage().get("feedback"));
}
};
@@ -169,24 +169,27 @@ public class PolicyModalPage<T extends P
switch (policyTO.getType()) {
case GLOBAL_ACCOUNT:
case ACCOUNT:
- if (!(specification instanceof AccountPolicySpec)) {
- throw new ClassCastException("policy is type Account, but spec is not: " + specification.getClass().getName());
+ if (!(specification instanceof AccountPolicySpec)) {
+ throw new ClassCastException("policy is type Account, but spec is not: " + specification.getClass().
+ getName());
}
((AccountPolicyTO) policyTO).setSpecification((AccountPolicySpec) specification);
break;
case GLOBAL_PASSWORD:
case PASSWORD:
- if (!(specification instanceof PasswordPolicySpec)) {
- throw new ClassCastException("policy is type Password, but spec is not: " + specification.getClass().getName());
+ if (!(specification instanceof PasswordPolicySpec)) {
+ throw new ClassCastException("policy is type Password, but spec is not: "
+ + specification.getClass().getName());
}
((PasswordPolicyTO) policyTO).setSpecification((PasswordPolicySpec) specification);
break;
case GLOBAL_SYNC:
case SYNC:
- if (!(specification instanceof SyncPolicySpec)) {
- throw new ClassCastException("policy is type Sync, but spec is not: " + specification.getClass().getName());
+ if (!(specification instanceof SyncPolicySpec)) {
+ throw new ClassCastException("policy is type Sync, but spec is not: " + specification.getClass().
+ getName());
}
((SyncPolicyTO) policyTO).setSpecification((SyncPolicySpec) specification);
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportModalPage.java Fri Feb 15 14:00:02 2013
@@ -32,6 +32,7 @@ import org.apache.syncope.console.common
import org.apache.syncope.console.markup.html.CrontabContainer;
import org.apache.syncope.console.rest.ReportRestClient;
import org.apache.syncope.console.wicket.ajax.form.AbstractAjaxDownloadBehavior;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
@@ -45,8 +46,8 @@ import org.apache.wicket.ajax.IAjaxCallD
import org.apache.wicket.ajax.calldecorator.AjaxPreprocessingCallDecorator;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
@@ -105,7 +106,7 @@ public class ReportModalPage extends Bas
private String modalReportletConfOldName;
- public ReportModalPage(final ModalWindow window, final ReportTO reportTO, final PageReference callerPageRef) {
+ public ReportModalPage(final ModalWindow window, final ReportTO reportTO, final PageReference pageRef) {
this.reportTO = reportTO;
form = new Form<ReportTO>("form");
@@ -119,12 +120,12 @@ public class ReportModalPage extends Bas
"cronExpression"), reportTO.getCronExpression());
form.add(crontab);
- final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("apply")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("apply"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
ReportTO reportTO = (ReportTO) form.getModelObject();
reportTO.setCronExpression(StringUtils.hasText(reportTO.getCronExpression())
? crontab.getCronExpression()
@@ -137,7 +138,7 @@ public class ReportModalPage extends Bas
restClient.create(reportTO);
}
- ((BasePage) callerPageRef.getPage()).setModalResult(true);
+ ((BasePage) pageRef.getPage()).setModalResult(true);
window.close(target);
} catch (SyncopeClientCompositeErrorException e) {
@@ -281,7 +282,7 @@ public class ReportModalPage extends Bas
reportlets.setAddLink(new AjaxLink(ADD_BUTTON_ID) {
private static final long serialVersionUID = -7978723352517770644L;
-
+
@Override
public void onClick(final AjaxRequestTarget target) {
reportletConfWin.setPageCreator(new ModalWindow.PageCreator() {
@@ -395,7 +396,8 @@ public class ReportModalPage extends Bas
final ReportExecTO taskExecutionTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel =
+ new ActionLinksPanel(componentId, model, ReportModalPage.this.getPageReference());
panel.add(new ActionLink() {
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ReportletConfModalPage.java Fri Feb 15 14:00:02 2013
@@ -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;
@@ -83,16 +83,19 @@ public class ReportletConfModalPage exte
private ReportletConf reportletConf;
- final AjaxTextFieldPanel name;
+ private final PageReference pageRef;
+
+ private final AjaxTextFieldPanel name;
private WebMarkupContainer propertiesContainer;
private ListView<String> propView;
public ReportletConfModalPage(final ReportletConf reportletConf, final ModalWindow window,
- final PageReference callerPageRef) {
+ final PageReference pageRef) {
this.reportletConf = reportletConf;
+ this.pageRef = pageRef;
Form form = new Form("form");
add(form);
@@ -111,30 +114,30 @@ public class ReportletConfModalPage exte
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);
@@ -176,7 +179,7 @@ public class ReportletConfModalPage exte
}
}
- ((ReportModalPage) callerPageRef.getPage())
+ ((ReportModalPage) pageRef.getPage())
.setModalReportletConf(ReportletConfModalPage.this.reportletConf);
window.close(target);
}
@@ -248,8 +251,8 @@ 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;
@@ -261,7 +264,8 @@ public class ReportletConfModalPage exte
Panel panel;
if (NodeCond.class.equals(field.getType())) {
- panel = new UserSearchPanel("value", (NodeCond) wrapper.getPropertyValue(fieldName), false);
+ panel = new UserSearchPanel("value", (NodeCond) wrapper.getPropertyValue(fieldName),
+ false, pageRef);
// This is needed in order to manually update this.reportletConf with search panel selections
panel.setDefaultModel(new Model(fieldName));
} else if (List.class.equals(field.getType())) {
@@ -271,7 +275,8 @@ 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);
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Reports.java Fri Feb 15 14:00:02 2013
@@ -24,13 +24,27 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.apache.syncope.client.to.ReportTO;
+import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.commons.Constants;
+import org.apache.syncope.console.commons.PreferenceManager;
+import org.apache.syncope.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.console.pages.panels.JQueryTabbedPanel;
+import org.apache.syncope.console.rest.LoggerRestClient;
+import org.apache.syncope.console.rest.ReportRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
+import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
+import org.apache.syncope.types.AuditElements.Category;
+import org.apache.syncope.types.AuditElements.Result;
+import org.apache.syncope.types.AuditLoggerName;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
@@ -60,20 +74,6 @@ import org.apache.wicket.model.ResourceM
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.springframework.util.StringUtils;
-import org.apache.syncope.client.to.ReportTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.commons.PreferenceManager;
-import org.apache.syncope.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.console.pages.panels.JQueryTabbedPanel;
-import org.apache.syncope.console.rest.LoggerRestClient;
-import org.apache.syncope.console.rest.ReportRestClient;
-import org.apache.syncope.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
-import org.apache.syncope.types.AuditElements.Category;
-import org.apache.syncope.types.AuditElements.Result;
-import org.apache.syncope.types.AuditLoggerName;
/**
* Auditing and Reporting.
@@ -149,7 +149,7 @@ public class Reports extends BasePage {
final ReportTO reportTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
panel.add(new ActionLink() {
@@ -185,7 +185,7 @@ public class Reports extends BasePage {
error(scce.getMessage());
}
- target.add(getPage().get("feedback"));
+ target.add(feedbackPanel);
target.add(reportContainer);
}
}, ActionLink.ActionType.EXECUTE, "Reports", "execute");
@@ -203,7 +203,7 @@ public class Reports extends BasePage {
error(scce.getMessage());
}
target.add(reportContainer);
- target.add(getPage().get("feedback"));
+ target.add(feedbackPanel);
}
}, ActionLink.ActionType.DELETE, "Reports", "delete");
@@ -244,12 +244,12 @@ public class Reports extends BasePage {
paginatorForm.add(rowsChooser);
add(paginatorForm);
- AjaxLink createLink = new IndicatingAjaxLink("createLink") {
+ AjaxLink createLink = new ClearIndicatingAjaxLink("createLink", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
+ protected void onClickInternal(final AjaxRequestTarget target) {
window.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/ResourceModalPage.java Fri Feb 15 14:00:02 2013
@@ -26,11 +26,11 @@ import org.apache.syncope.console.pages.
import org.apache.syncope.console.pages.panels.ResourceMappingPanel;
import org.apache.syncope.console.pages.panels.ResourceSecurityPanel;
import org.apache.syncope.console.rest.ResourceRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
@@ -74,13 +74,13 @@ public class ResourceModalPage extends B
//--------------------------------
// Resource mapping panle
//--------------------------------
- form.add(new ResourceMappingPanel("mapping", resourceTO));
+ form.add(new ResourceMappingPanel("mapping", resourceTO, pageref));
//--------------------------------
//--------------------------------
// Resource mapping panle
//--------------------------------
- form.add(new ResourceConnConfPanel("connconf", resourceTO, createFlag));
+ form.add(new ResourceConnConfPanel("connconf", resourceTO, createFlag, pageref));
//--------------------------------
//--------------------------------
@@ -89,13 +89,13 @@ 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 ClearIndicatingAjaxButton("apply", new ResourceModel("submit", "submit"),
+ pageref) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
final ResourceTO resourceTO = (ResourceTO) form.getDefaultModelObject();
int accountIdCount = 0;
@@ -131,7 +131,6 @@ public class ResourceModalPage extends B
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-
target.add(feedbackPanel);
}
};
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Resources.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Resources.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Resources.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/Resources.java Fri Feb 15 14:00:02 2013
@@ -22,12 +22,22 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+import org.apache.syncope.client.to.ConnInstanceTO;
+import org.apache.syncope.client.to.ResourceTO;
+import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
+import org.apache.syncope.console.commons.Constants;
+import org.apache.syncope.console.commons.PreferenceManager;
+import org.apache.syncope.console.commons.SortableDataProviderComparator;
+import org.apache.syncope.console.rest.ConnectorRestClient;
+import org.apache.syncope.console.rest.ResourceRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxLink;
+import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
+import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
import org.apache.wicket.Page;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxLink;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
@@ -46,16 +56,6 @@ import org.apache.wicket.model.PropertyM
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.apache.syncope.client.to.ConnInstanceTO;
-import org.apache.syncope.client.to.ResourceTO;
-import org.apache.syncope.client.validation.SyncopeClientCompositeErrorException;
-import org.apache.syncope.console.commons.Constants;
-import org.apache.syncope.console.commons.PreferenceManager;
-import org.apache.syncope.console.commons.SortableDataProviderComparator;
-import org.apache.syncope.console.rest.ConnectorRestClient;
-import org.apache.syncope.console.rest.ResourceRestClient;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLink;
-import org.apache.syncope.console.wicket.markup.html.form.ActionLinksPanel;
/**
* Resources WebPage.
@@ -133,7 +133,7 @@ public class Resources extends BasePage
final IModel<ResourceTO> model) {
final ResourceTO resourceTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
panel.add(new ActionLink() {
@@ -206,13 +206,12 @@ public class Resources extends BasePage
editResourceWin.setInitialWidth(WIN_WIDTH);
editResourceWin.setCookieName("edit-res-modal");
- AjaxLink createResourceLink = new IndicatingAjaxLink("createResourceLink") {
+ AjaxLink createResourceLink = new ClearIndicatingAjaxLink("createResourceLink", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
-
+ protected void onClickInternal(final AjaxRequestTarget target) {
createResourceWin.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
@@ -285,7 +284,7 @@ public class Resources extends BasePage
final ConnInstanceTO connectorTO = model.getObject();
- final ActionLinksPanel panel = new ActionLinksPanel(componentId, model);
+ final ActionLinksPanel panel = new ActionLinksPanel(componentId, model, getPageReference());
panel.add(new ActionLink() {
@@ -358,13 +357,12 @@ public class Resources extends BasePage
editConnectorWin.setInitialWidth(WIN_WIDTH);
editConnectorWin.setCookieName("edit-conn-modal");
- AjaxLink createConnectorLink = new IndicatingAjaxLink("createConnectorLink") {
+ AjaxLink createConnectorLink = new ClearIndicatingAjaxLink("createConnectorLink", getPageReference()) {
private static final long serialVersionUID = -7978723352517770644L;
@Override
- public void onClick(final AjaxRequestTarget target) {
-
+ protected void onClickInternal(final AjaxRequestTarget target) {
createConnectorWin.setPageCreator(new ModalWindow.PageCreator() {
private static final long serialVersionUID = -7834632442532690940L;
Modified: syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java
URL: http://svn.apache.org/viewvc/syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java?rev=1446584&r1=1446583&r2=1446584&view=diff
==============================================================================
--- syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java (original)
+++ syncope/branches/1_0_X/console/src/main/java/org/apache/syncope/console/pages/RoleModalPage.java Fri Feb 15 14:00:02 2013
@@ -23,19 +23,19 @@ import java.util.List;
import org.apache.syncope.client.mod.RoleMod;
import org.apache.syncope.client.to.RoleTO;
import org.apache.syncope.client.util.AttributableOperations;
+import org.apache.syncope.console.pages.panels.RoleAttributesPanel;
+import org.apache.syncope.console.rest.RoleRestClient;
+import org.apache.syncope.console.wicket.ajax.markup.html.ClearIndicatingAjaxButton;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxButton;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
-import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton;
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.spring.injection.annot.SpringBean;
-import org.apache.syncope.console.pages.panels.RoleAttributesPanel;
-import org.apache.syncope.console.rest.RoleRestClient;
/**
* Modal window with Role form.
@@ -49,7 +49,7 @@ public class RoleModalPage extends BaseM
private RoleTO originalRoleTO;
- public RoleModalPage(final PageReference callerPageRef, final ModalWindow window, final RoleTO roleTO) {
+ public RoleModalPage(final PageReference pageRef, final ModalWindow window, final RoleTO roleTO) {
super();
@@ -66,21 +66,20 @@ public class RoleModalPage extends BaseM
form.setModel(new CompoundPropertyModel(roleTO));
- final RoleAttributesPanel attributesPanel = new RoleAttributesPanel("attributesPanel", form, roleTO);
+ final RoleAttributesPanel attributesPanel = new RoleAttributesPanel("attributesPanel", form, roleTO, pageRef);
form.add(attributesPanel);
- final AjaxButton submit = new IndicatingAjaxButton("submit", new ResourceModel("submit")) {
+ final AjaxButton submit = new ClearIndicatingAjaxButton("submit", new ResourceModel("submit"), pageRef) {
private static final long serialVersionUID = -958724007591692537L;
@Override
- protected void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
-
+ protected void onSubmitInternal(final AjaxRequestTarget target, final Form<?> form) {
final RoleTO roleTO = (RoleTO) form.getDefaultModelObject();
try {
- final List<String> entitlementList = new ArrayList<String>(attributesPanel.getEntitlementsPalette()
- .getModelCollection());
+ final List<String> entitlementList =
+ new ArrayList<String>(attributesPanel.getEntitlementsPalette().getModelCollection());
roleTO.setEntitlements(entitlementList);
if (createFlag) {
@@ -93,7 +92,7 @@ public class RoleModalPage extends BaseM
roleRestClient.updateRole(roleMod);
}
}
- ((Roles) callerPageRef.getPage()).setModalResult(true);
+ ((Roles) pageRef.getPage()).setModalResult(true);
window.close(target);
} catch (Exception e) {
@@ -104,15 +103,14 @@ public class RoleModalPage extends BaseM
@Override
protected void onError(final AjaxRequestTarget target, final Form<?> form) {
-
target.add(feedbackPanel);
}
};
MetaDataRoleAuthorizationStrategy.authorize(submit, ENABLE, xmlRolesReader.getAllAllowedRoles("Roles",
createFlag
- ? "create"
- : "update"));
+ ? "create"
+ : "update"));
form.add(submit);