Package org.apache.wicket.model

Examples of org.apache.wicket.model.ResourceModel


                }
                principalDataProvider.sort();               
                principalView.setCurrentPage(0);
            };
        };
        group.add(new Label("principal",new ResourceModel(principalParam)));
        orderLink.add(new Label("nameSort",new ResourceModel(principalParam)));
        group.add(orderLink);
       
        group.add(new AjaxPagingNavigator("navigator", principalView));
       
        add(group);
        Form searchForm = new Form("searchForm")
        {

            protected void onSubmit()
            {
                setPrincipal(null);
            }
        };
        TextField searchStringField = new TextField("searchString",
                new PropertyModel(this, "searchString"));
        searchForm.add(searchStringField);
        Button searchbutton = new Button("searchButton", new ResourceModel(
                "common.search"));
        searchForm.add(searchbutton);
        Button newPrincipal = new Button("newPrincipal", new ResourceModel(
                principalParam + ".new.button"))
        {

            public void onSubmit()
            {
                setPrincipal(null);
                controlPannels(false);
            }
        };
        searchForm.add(newPrincipal);
        add(searchForm);
        Label label = new Label("userLabel", new ResourceModel(principalParam
                + ".name"));
        label.setVisible(false);
        add(label);
        TextField fld = new TextField("userName", new PropertyModel(this,
                "principal.name"));
View Full Code Here


                    new PropertyModel(this, "checkpass"));
            userForm.add(changePassword);
            DropDownChoice profilingtRole = new DropDownChoice("profilingRule",
                    new PropertyModel(this, "profilingRule"), getProfileList());
            userForm.add(profilingtRole);
            Button newUser = new Button("addUser",new ResourceModel(principalParam +".add.button"))
            {

                @Override
                public void onSubmit()
                {
View Full Code Here

        super();

        trackingManager = getPortletTrackingManager();
        outOfService = createList();
    
        add(new Label("header", new ResourceModel("tracker.header")));
       
        Form trackingForm = new Form("trackingForm");
        add(trackingForm);

        final CheckGroup<List> checkGroup = new CheckGroup<List>("checkGroup", new ArrayList());
        trackingForm.add(checkGroup);
       
        Button refresh = new Button("refresh", new ResourceModel("tracker.refresh")) {

            @Override
            public void onSubmit() {
                outOfService = createList();
                checkGroup.getModelObject().clear();
            }
           
        };
        trackingForm.add(refresh);
       
        Button putInService = new Button("putInService", new ResourceModel("tracker.putInService")) {

            @Override
            public void onSubmit() {
                List<String> portletNames = new ArrayList<String>();
                List selection = (List) checkGroup.getModelObject();
                for (Object object : selection) {
                    PortletDefinition pd = (PortletDefinition) object;
                    portletNames.add(pd.getUniqueName());
                }
                if (portletNames.size() > 0) {
                    trackingManager.putIntoService(portletNames);
                    outOfService = createList();
                    checkGroup.getModelObject().clear();
                }
            }
           
        };
        trackingForm.add(putInService);
       
        trackingForm.add(new Label("countLabel", new ResourceModel("tracker.count")));
        Label countValue = new Label("count", new Model(outOfService.size()));
        trackingForm.add(countValue);
       
        checkGroup.add(new Label("portletsLabel", new ResourceModel("tracker.portlets")));
       
        PageableListView portletsList = new PageableListView("portlets", new PropertyModel(this, "outOfService"), 10)
        {
            protected void populateItem(ListItem item)
            {
View Full Code Here

       
        form.add(new Image("add", new ResourceReference(EditorTemplate.class, "add.png")));

        WebMarkupContainer footer = new WebMarkupContainer("footer");
        Button saveButton = saveButton("save");
        saveButton.setDefaultModel(new ResourceModel("pam.details.action.save"));
        footer.add(saveButton);
        Button deleteBtn = deleteButton("delete");
        deleteBtn.add(new JavascriptEventConfirmation("onclick", new ResourceModel("pam.details.action.delete.confirm")));
        footer.add(deleteBtn);
        footer.add(new AttributeModifier("colspan", true, new Model<Integer>(Integer.valueOf(getColumnCount()))));
       
        form.add(footer);
        add(form);
View Full Code Here

        return this;
    }
   
    protected Button deleteButton(String componentId)
    {
        return new Button(componentId, new ResourceModel("pam.details.action.delete")) {
            @Override
            public void onSubmit() {
                List<IModel<T>> removeList = new ArrayList<IModel<T>>();
                for(SelectableModel<T> field : rows) {
                    if(field.getSelected()) {
View Full Code Here

           
           
            Form userForm = new Form("newUserForm");
            add(userForm);     
            add(new FeedbackPanel("feedback"));
            userForm.add(new Label("userNameLabel",new ResourceModel(principalParam + ".new.button")));           
            TextField userName = new RequiredTextField("userName",new PropertyModel(this, "userName"));
            userName.add(new PrincipalNameValidator());
            userForm.add(userName);
            Button newUser = new Button("addUser",new ResourceModel(principalParam +".add.button")){
        @Override
        public void onSubmit() {
          JetspeedPrincipal principal =  getManager().newPrincipal(getUserName(),false);
          try{
            getManager().addPrincipal(principal, null);
View Full Code Here

        {
            addOrReplace(new Label("status", ""));

            List<ITab> tabs = new ArrayList<ITab>();
           
            ITab detailsTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_details"))
            {

                public Panel getPanel(String panelId)
                {
                    return new DetailsPanel(panelId, paNodeBean);
                }
            };
            tabs.add(detailsTab);

            ITab metadataTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_metadata"))
            {

                public Panel getPanel(String panelId)
                {
                    return new MetadataPanel(panelId, paNodeBean);
                }
            };
            tabs.add(metadataTab);

            ITab preferencesTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_preferences"))
            {

                public Panel getPanel(String panelId)
                {
                    return new PreferencePanel(panelId, paNodeBean);
                }
            };
            tabs.add(preferencesTab);
           
            ITab languagesTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_languages"))
            {
                public Panel getPanel(String panelId)
                {
                    return new LanguagesPanel(panelId, paNodeBean);
                }
            };
            tabs.add(languagesTab);

            ITab parametersTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_parameters"))
            {

                public Panel getPanel(String panelId)
                {
                    return new ParameterPanel(panelId, paNodeBean);
                }
            };
            tabs.add(parametersTab);

            ITab securityTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_security"))
            {
                public Panel getPanel(String panelId)
                {
                    return new SecurityPanel(panelId, paNodeBean);
                }
            };
            tabs.add(securityTab);
           
            ITab supportsTab = new AbstractTab(new ResourceModel("pam.details.tabs.pd_content_type"))
            {
                public Panel getPanel(String panelId)
                {
                    return new SupportsPanel(panelId, paNodeBean);
                }
View Full Code Here

                };
            }
           
        });
       
        form.add(new Button("save", 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());
                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
                    def.setExpirationCache(getExpirationCache().intValue());
                    registry.savePortletDefinition(def);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
                    feed.info(resModel.getString());
                }
                catch (FailedToStorePortletDefinitionException e)
                {
                    logger.error("Failed to store portlet definition.", e);
                    StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }
        });
       
        form.add(new Label("resourceBundle", definition.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());
                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
                    PortletFactory factory = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletFactory();
                    factory.reloadResourceBundles(def);
                }
                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() + "::" + paNodeBean.getName(), e.getMessage() } );
                    feed.info(resModel.getString());
                }
            }
        };
       
        reloadResourceBundlesButton.add(new JavascriptEventConfirmation("onclick", new ResourceModel("pam.details.resource.bundle.reload.confirm")));
       
        reloadResourceBundlesButton.setEnabled(!StringUtils.isBlank(definition.getResourceBundle()));
       
        form.add(reloadResourceBundlesButton);
View Full Code Here

        public CloneForm(String name)
        {
            super(name);
            add(new TextField("cloneName", new PropertyModel(this, "cloneName")));       
            add(new Button("cloneButton", new ResourceModel("pam.details.action.clone"))
            {
                @Override
                public void onSubmit()
                {
                    FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
View Full Code Here

        /* Constructor */
        public ExportForm(final String id)
        {
            super(id);

            add(new Label("exportHeader", new ResourceModel("export.header")));

            add(new ExportCheckBox(USERS_GROUPS_ROLES, new PropertyModel<Boolean>(this, "doUserGroupsRoles")));
            add(new Label("usersGroupsRolesLabel", new ResourceModel("export.users_groups_roles")));

            add(new ExportCheckBox(PERMISSIONS, new PropertyModel<Boolean>(this, "doPermissions")));
            add(new Label("permissionsLabel", new ResourceModel("export.permissions")));

            add(new ExportCheckBox(PROFILING, new PropertyModel<Boolean>(this, "doProfiling")));
            add(new Label("profilingLabel", new ResourceModel("export.profiling_rules")));

            add(new ExportCheckBox(CAPABILITIES, new PropertyModel<Boolean>(this, "doCapabilities")));
            add(new Label("capabilitiesLabel", new ResourceModel("export.capabilities")));

            add(new ExportCheckBox(SSO, new PropertyModel<Boolean>(this, "doSSO")));
            add(new Label("ssoLabel", new ResourceModel("export.sso")));

            add(new ExportCheckBox(USER_PREFS, new PropertyModel<Boolean>(this, "doUserPrefs")));
            add(new Label("userPrefsLabel", new ResourceModel("export.user_preferences")));

            this.exportResourceProvider = new ExportResourceProvider(getPortletRequest().getUserPrincipal().getName());

            DynamicResourceLink downloadLink = new DynamicResourceLink("exportLink", new PropertyModel<ExportResourceProvider>(this,
                    "exportResourceProvider"))
            {

                private static final long serialVersionUID = 0L;

                @Override
                public void onClick()
                {
                    Map<String, Object> settings = new HashMap<String, Object>();
                    settings.put(JetspeedSerializer.KEY_PROCESS_USERS, new Boolean(doUserGroupsRoles));
                    settings.put(JetspeedSerializer.KEY_PROCESS_PERMISSIONS, new Boolean(doPermissions));
                    settings.put(JetspeedSerializer.KEY_PROCESS_PROFILER, new Boolean(doProfiling));
                    settings.put(JetspeedSerializer.KEY_PROCESS_CAPABILITIES, new Boolean(doCapabilities));
                    settings.put(JetspeedSerializer.KEY_PROCESS_SSO, new Boolean(doSSO));
                    settings.put(JetspeedSerializer.KEY_PROCESS_USER_PREFERENCES, new Boolean(doUserPrefs));
                    settings.put(JetspeedSerializer.KEY_EXPORT_INDENTATION, "\t");
                    settings.put(JetspeedSerializer.KEY_OVERWRITE_EXISTING, Boolean.TRUE);
                    settings.put(JetspeedSerializer.KEY_BACKUP_BEFORE_PROCESS, Boolean.FALSE);

                    exportResourceProvider.setSettings(settings);
                }
            };
            downloadLink.add(new Label("exportAction", new ResourceModel("export.action")));
            add(downloadLink);
        };
View Full Code Here

TOP

Related Classes of org.apache.wicket.model.ResourceModel

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.