Package org.apache.wicket.markup.html.panel

Examples of org.apache.wicket.markup.html.panel.FeedbackPanel


            {
                @Override
                public void onSubmit()
                {
                    PortletPreferences prefs = ((ApplicationsListApplication)this.getApplication()).getPortletRequest().getPreferences();
                    FeedbackPanel feedback = (FeedbackPanel)this.getParent().get("feedback");
                    try
                    {
                        prefs.setValue("appRows", Integer.toString(EditModeForm.this.getAppRows()));
                        prefs.setValue("portletRows", Integer.toString(EditModeForm.this.getPortletRows()));
                        prefs.store();
                        ActionResponse ar = (ActionResponse)((ApplicationsListApplication)this.getApplication()).getPortletResponse();
                        ar.setPortletMode(PortletMode.VIEW);                       
                    }
                    catch (ReadOnlyException e)
                    {
                        feedback.error(getString("pam.details.message.errorReadonly"));
                    }
                    catch (Exception oe)
                    {
                        feedback.error(getString("pam.details.message.errorPrefs") + oe.getMessage());
                    }                   
                }
            });       
            FeedbackPanel feedback = new FeedbackPanel("feedback");
            add(feedback);
        }
View Full Code Here


                    new PropertyModel(this, "ruleName"), getFullRules());
            addRuleForm.add(ruleNameField);
            addRuleForm.add(new Button("addRule", new ResourceModel(
                    "user.rule.add")));
            add(addRuleForm);
            add(new FeedbackPanel("feedback"));
        }
View Full Code Here

        public RuleEditPanel(String id) {
            super(id);
           
            Form ruleEditForm = new Form("ruleEditForm");
           
            FeedbackPanel feedbackPanel = new FeedbackPanel("feedbackPanel");
            ruleEditForm.add(feedbackPanel);
           
            ruleEditForm.add(new Label("ruleIdLabel", new ResourceModel("profiler.rule.id")));
            ruleEditForm.add(new Label("ruleTitleLabel", new ResourceModel("profiler.rule.title")));
            ruleEditForm.add(new Label("ruleClassLabel", new ResourceModel("profiler.rule.class")));
View Full Code Here

                    ApplicationServerManager asm = locator.getApplicationServerManager();
                    AuditActivity auditActivity = locator.getAuditActivity();

                    ApplicationBean pab = (ApplicationBean) model.getObject();
                    PortletApplication pa = registry.getPortletApplication(pab.getApplicationName());
                    FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                   
                    if (isServerReady(asm, feed, "start", pa, pab))
                    {
                        try
                        {
                            ApplicationServerManagerResult result = asm.start(pa.getContextPath());
                           
                            if (!result.isOk())
                            {
                                throw new Exception(getString("pam.details.action.status.appServerNotConfigured"));
                            }
                            else
                            {
                                StringResourceModel resModel = new StringResourceModel("pam.details.action.status.startOK", this, null, new Object [] { pab.getPath() } );
                                feed.info(resModel.getString());
                                auditActivity.logAdminRegistryActivity(
                                                                       ((AbstractAdminWebApplication) getApplication()).getUserPrincipalName(),
                                                                       ((AbstractAdminWebApplication) getApplication()).getIPAddress(),
                                                                       AuditActivity.REGISTRY_START,
                                                                       PORTLET_REGISTRY_MANAGER
                                                                       );
                            }
                        }
                        catch (Exception e)
                        {
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.startFailure", this, null, new Object [] { pab.getPath(), e.getMessage() } );
                            feed.error(resModel.getString());
                        }
                    }
                }
            };

            Link<String> stop = new Link<String>("stop")
            {
                private static final long serialVersionUID = 1L;

                public void onClick()
                {
                    JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                    PortletRegistry registry = locator.getPortletRegistry();
                    ApplicationServerManager asm = locator.getApplicationServerManager();
                    AuditActivity auditActivity = locator.getAuditActivity();

                    ApplicationBean pab = (ApplicationBean) model.getObject();
                    PortletApplication pa = registry.getPortletApplication(pab.getApplicationName());
                    FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                   
                    if (isServerReady(asm, feed, "stop", pa, pab))
                    {
                        try
                        {
                            ApplicationServerManagerResult result = asm.stop(pa.getContextPath());
                           
                            if (!result.isOk())
                            {
                                throw new Exception(getString("pam.details.action.status.appServerNotConfigured"));
                            }
                            else
                            {
                                StringResourceModel resModel = new StringResourceModel("pam.details.action.status.stopOK", this, null, new Object [] { pab.getPath() } );
                                feed.info(resModel.getString());
                               
                                auditActivity.logAdminRegistryActivity(
                                                                       ((AbstractAdminWebApplication) getApplication()).getUserPrincipalName(),
                                                                       ((AbstractAdminWebApplication) getApplication()).getIPAddress(),
                                                                       AuditActivity.REGISTRY_STOP,
                                                                       PORTLET_REGISTRY_MANAGER
                                                                       );
                            }
                        }
                        catch (Exception e)
                        {
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.stopFailure", this, null, new Object [] { pab.getPath(), e.getMessage() } );
                            feed.error(resModel.getString());
                        }
                    }
                }
            };
           
            Link<String> undeploy = new Link<String>("undeploy")
            {
                private static final long serialVersionUID = 1L;

                public void onClick()
                {
                    JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                    PortletRegistry registry = locator.getPortletRegistry();
                    ApplicationServerManager asm = locator.getApplicationServerManager();
                    AuditActivity auditActivity = locator.getAuditActivity();

                    ApplicationBean pab = (ApplicationBean) model.getObject();
                    PortletApplication pa = registry.getPortletApplication(pab.getApplicationName());
                    FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                   
                    if (isServerReady(asm, feed, "undeploy", pa, pab))
                    {
                        try
                        {
                            ApplicationServerManagerResult result = asm.undeploy(pa.getContextPath());
                           
                            if (!result.isOk())
                            {
                                throw new Exception(getString("pam.details.action.status.appServerNotConfigured"));
                            }
                            else
                            {
                                StringResourceModel resModel = new StringResourceModel("pam.details.action.status.undeployOK", this, null, new Object [] { pab.getPath() } );
                                feed.info(resModel.getString());
                                auditActivity.logAdminRegistryActivity(
                                                                       ((AbstractAdminWebApplication) getApplication()).getUserPrincipalName(),
                                                                       ((AbstractAdminWebApplication) getApplication()).getIPAddress(),
                                                                       AuditActivity.REGISTRY_UNDEPLOY,
                                                                       PORTLET_REGISTRY_MANAGER
                                                                       );
                            }
                        }
                        catch (Exception e)
                        {
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.undeployFailure", this, null, new Object [] { pab.getPath(), e.getMessage() } );
                            feed.error(resModel.getString());
                        }
                    }
                }
            };

            Link<String> del = new Link<String>("delete")
            {
                private static final long serialVersionUID = 1L;

                public void onClick()
                {
                    JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
                    PortletRegistry registry = locator.getPortletRegistry();
                    ApplicationServerManager asm = locator.getApplicationServerManager();
                    AuditActivity auditActivity = locator.getAuditActivity();
                    PortletApplicationManagement pam = locator.getPortletApplicationManager();

                    ApplicationBean pab = (ApplicationBean) model.getObject();
                    PortletApplication pa = registry.getPortletApplication(pab.getApplicationName());
                    FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
                   
                    if (isServerReady(asm, feed, "remove from registry", pa, pab))
                    {
                        try
                        {
                            pam.unregisterPortletApplication(pa.getName());
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.deleteOK", this, null, new Object [] { pab.getPath() } );
                            feed.info(resModel.getString());
                            auditActivity.logAdminRegistryActivity(
                                                                   ((AbstractAdminWebApplication) getApplication()).getUserPrincipalName(),
                                                                   ((AbstractAdminWebApplication) getApplication()).getIPAddress(),
                                                                   AuditActivity.REGISTRY_DELETE,
                                                                   PORTLET_REGISTRY_MANAGER
                                                                   );
                        }
                        catch (Exception e)
                        {
                            StringResourceModel resModel = new StringResourceModel("pam.details.action.status.deleteFailure", this, null, new Object [] { pab.getPath(), e.getMessage() } );
                            feed.error(resModel.getString());
                        }
                    }
                }
            };
View Full Code Here

        subite = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_SUBSITE, "");
        profile = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_PROFILE, "");
        role = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.DEFAULT_ROLE, "");
        templateDir = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.NEW_USER_TEMPLATE_DIR, "");
        subSiteRoot = request.getPreferences().getValue(JetspeedPrincipalManagementPortlet.SUB_SITE_ROOT, "");
        add(new FeedbackPanel("feedback"));
        Form userPrefernces = new Form("userPrefernces");
        userPrefernces.add(new Label("subsiterootLabel", new ResourceModel("subsiteroot")));
        userPrefernces.add(new TextField("subsiteroot", new PropertyModel(this, "subSiteRoot")));       
        userPrefernces.add(new Label("subsiteLabel", new ResourceModel("default.subsite")));
        userPrefernces.add(new DropDownChoice("defaultSubSite", new PropertyModel(this, "subite"),getSubSites));
View Full Code Here

        form.add(new Button("jsecSave", new ResourceModel("pam.details.action.save"))
        {
            @Override
            public void onSubmit()
            {
                FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
               
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    app.setJetspeedSecurityConstraint("".equals(jetspeedSecurityConstraint) ? null : jetspeedSecurityConstraint);
                    registry.updatePortletApplication(app);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.application.saveOK", this, null, new Object [] { paNodeBean.getApplicationName() } );
                    feed.info(resModel.getString());
                }
                catch (RegistryException e)
                {
                    logger.error("Failed to update jetspeed security constraint defs of application.", e);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.application.saveFailure", this, null, new Object [] { paNodeBean.getApplicationName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }
        });
       
        form.add(new Label("resourceBundle", app.getResourceBundle()));
       
        Button reloadResourceBundlesButton = new Button("reloadResourceBundle", new ResourceModel("pam.details.resource.bundle.reload"))
        {
            @Override
            public void onSubmit()
            {
                FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
               
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletFactory factory = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletFactory();
                    factory.reloadResourceBundles(app);
                }
                catch (Exception e)
                {
                    logger.error("Failed to reload the resource bundle of application.", e);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.resource.bundle.reloadFailure", this, null, new Object [] { paNodeBean.getApplicationName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }
        };
       
        reloadResourceBundlesButton.add(new JavascriptEventConfirmation("onclick", new ResourceModel("pam.details.resource.bundle.reload.confirm")));
View Full Code Here

            }

            addOrReplace(tabbedPanel);
        }

        FeedbackPanel feedback = new FeedbackPanel("feedback");
        feedback.setEscapeModelStrings(false);
        addOrReplace(feedback);

    }
View Full Code Here

                    Component parent = (reporter instanceof BeanForm ? reporter : reporter.findParent(BeanForm.class));
                    return reporter == BeanForm.this || parent == null || parent == BeanForm.this;
                }
        };
       
        feedback = new FeedbackPanel("feedback", feedbackFilter);
        feedback.setOutputMarkupId(true);
        form.add(feedback);       

        createGlobalActions();
    }
View Full Code Here

   *
   * @return A new feedback panel
   */
  protected Component newFeedbackPanel(final String id)
  {
    return new FeedbackPanel(id, new ContainerFeedbackMessageFilter(this));
  }
View Full Code Here

      }
    };
    add(form);
    form.add(dateTextField);
    dateTextField.add(new DatePicker());
    add(new FeedbackPanel("feedback"));
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.panel.FeedbackPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.