Search in sources :

Example 16 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class ResourceTasksPanel method initLayout.

private void initLayout(final ListModel<TaskType> tasks) {
    final MainObjectListPanel<TaskType> tasksPanel = new MainObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, TableId.PAGE_RESOURCE_TASKS_PANEL, null, pageBase) {

        private static final long serialVersionUID = 1L;

        @Override
        protected BaseSortableDataProvider<SelectableBean<TaskType>> initProvider() {
            return new ListDataProvider2(pageBase, tasks);
        }

        @Override
        protected List<InlineMenuItem> createInlineMenu() {
            // TODO Auto-generated method stub
            return null;
        }

        @Override
        public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
            // TODO Auto-generated method stub
            //				super.objectDetailsPerformed(target, task);
            PageParameters parameters = new PageParameters();
            parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
            getPageBase().navigateToNext(PageTaskEdit.class, parameters);
        }

        @Override
        protected void newObjectPerformed(AjaxRequestTarget target) {
            getPageBase().navigateToNext(PageTaskAdd.class);
        }

        @Override
        protected List<IColumn<SelectableBean<TaskType>, String>> createColumns() {
            return ColumnUtils.getDefaultTaskColumns();
        }
    };
    //		final ObjectListPanel<TaskType> tasksPanel = new ObjectListPanel<TaskType>(ID_TASKS_TABLE, TaskType.class, pageBase){
    //			
    //			@Override
    //			protected BaseSortableDataProvider<SelectableBean<TaskType>> getProvider() {
    //				return new ListDataProvider2(pageBase, tasks);
    //			}
    //			
    //			@Override
    //			public boolean isEditable() {
    //				return ResourceTasksPanel.this.editable;
    //			}
    //			
    //			@Override
    //			public void objectDetailsPerformed(AjaxRequestTarget target, TaskType task) {
    //				// TODO Auto-generated method stub
    //				super.objectDetailsPerformed(target, task);
    //				PageParameters parameters = new PageParameters();
    //		        parameters.add(OnePageParameterEncoder.PARAMETER, task.getOid());
    //		        setResponsePage(new PageTaskEdit(parameters));
    //			}
    //		};
    //		tasksPanel.setEditable(false);
    tasksPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_TASK_BOX_CSS_CLASSES);
    add(tasksPanel);
    AjaxButton runNow = new AjaxButton(ID_RUN_NOW, pageBase.createStringResource("pageTaskEdit.button.runNow")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.runNowPerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(runNow);
    AjaxButton resume = new AjaxButton(ID_RESUME, pageBase.createStringResource("pageTaskEdit.button.resume")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.resumePerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(resume);
    AjaxButton suspend = new AjaxButton(ID_SUSPEND, pageBase.createStringResource("pageTaskEdit.button.suspend")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            List<String> oids = createOidList(getTaskListPanel().getSelectedObjects());
            if (!oids.isEmpty()) {
                OperationResult result = TaskOperationUtils.suspendPerformed(pageBase.getTaskService(), oids);
                pageBase.showResult(result);
            } else {
                noTasksSelected();
            }
            target.add(pageBase.getFeedbackPanel());
        }
    };
    add(suspend);
}
Also used : MainObjectListPanel(com.evolveum.midpoint.gui.api.component.MainObjectListPanel) ListDataProvider2(com.evolveum.midpoint.web.component.util.ListDataProvider2) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) TaskType(com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem)

Example 17 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageConnectorHosts method editResourcePerformed.

private void editResourcePerformed(ResourceType resourceType) {
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, resourceType.getOid());
    navigateToNext(new PageResourceWizard(parameters));
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 18 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageResources method resourceDetailsPerformed.

private void resourceDetailsPerformed(AjaxRequestTarget target, String oid) {
    clearSessionStorageForResourcePage();
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, oid);
    navigateToNext(PageResource.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 19 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageResources method editAsXmlPerformed.

private void editAsXmlPerformed(ResourceType resourceType) {
    PageParameters parameters = new PageParameters();
    parameters.add(PageDebugView.PARAM_OBJECT_ID, resourceType.getOid());
    parameters.add(PageDebugView.PARAM_OBJECT_TYPE, ResourceType.class.getSimpleName());
    navigateToNext(PageDebugView.class, parameters);
}
Also used : ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Example 20 with PageParameters

use of org.apache.wicket.request.mapper.parameter.PageParameters in project midpoint by Evolveum.

the class PageRoles method roleDetailsPerformed.

private void roleDetailsPerformed(AjaxRequestTarget target, String oid) {
    PageParameters parameters = new PageParameters();
    parameters.add(OnePageParameterEncoder.PARAMETER, oid);
    navigateToNext(PageRole.class, parameters);
}
Also used : PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters)

Aggregations

PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)52 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)7 ArrayList (java.util.ArrayList)5 StringValue (org.apache.wicket.util.string.StringValue)5 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)4 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)4 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)4 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)3 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)3 Label (org.apache.wicket.markup.html.basic.Label)3 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)3 PropertyModel (org.apache.wicket.model.PropertyModel)3 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 WorkItemsPanel (com.evolveum.midpoint.web.component.wf.WorkItemsPanel)2