Search in sources :

Example 11 with OperationResultStatusType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType in project midpoint by Evolveum.

the class PageAccounts method createAccountsColumns.

private List<IColumn> createAccountsColumns() {
    List<IColumn> columns = new ArrayList<>();
    columns.add(new PropertyColumn(createStringResource("PageAccounts.accounts.oid"), SelectableBean.F_VALUE + ".oid"));
    columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.name"), ShadowType.F_NAME.getLocalPart(), SelectableBean.F_VALUE + ".name"));
    columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.kind"), ShadowType.F_KIND.getLocalPart(), SelectableBean.F_VALUE + ".kind"));
    columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.intent"), ShadowType.F_INTENT.getLocalPart(), SelectableBean.F_VALUE + ".intent"));
    columns.add(new PropertyColumn<QName, String>(createStringResource("PageAccounts.accounts.objectClass"), ShadowType.F_OBJECT_CLASS.getLocalPart(), SelectableBean.F_VALUE + ".objectClass.localPart"));
    columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationSituation"), ShadowType.F_SYNCHRONIZATION_SITUATION.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationSituation"));
    columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.synchronizationTimestamp"), ShadowType.F_SYNCHRONIZATION_TIMESTAMP.getLocalPart(), SelectableBean.F_VALUE + ".synchronizationTimestamp"));
    //        columns.add(new PropertyColumn<>(createStringResource("PageAccounts.accounts.result"),
    //                ShadowType.F_RESULT.getLocalPart(), SelectableBean.F_VALUE + ".result.status"));
    columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.result")) {

        @Override
        protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
            return new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    OperationResultType result = getResult(rowModel);
                    if (result == null) {
                        return "";
                    }
                    return createStringResource("OperationResultStatusType." + result.getStatus()).getObject();
                }
            };
        }

        @Override
        public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
            showShadowResult(target, rowModel);
        }
    });
    columns.add(new LinkColumn<SelectableBean>(createStringResource("PageAccounts.accounts.owner")) {

        @Override
        protected IModel<String> createLinkModel(final IModel<SelectableBean> rowModel) {
            return new AbstractReadOnlyModel<String>() {

                @Override
                public String getObject() {
                    FocusType focus = loadShadowOwner(rowModel);
                    return WebComponentUtil.getName(focus);
                }
            };
        }

        @Override
        public void onClick(AjaxRequestTarget target, IModel<SelectableBean> rowModel) {
            ownerDetailsPerformed(target, rowModel);
        }
    });
    return columns;
}
Also used : IModel(org.apache.wicket.model.IModel) PropertyColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType) FocusType(com.evolveum.midpoint.xml.ns._public.common.common_3.FocusType) SelectableBean(com.evolveum.midpoint.web.component.util.SelectableBean)

Aggregations

OperationResultStatusType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultStatusType)6 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)5 ObjectDeltaType (com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType)4 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)3 ObjectFactory (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectFactory)2 PendingOperationType (com.evolveum.midpoint.xml.ns._public.common.common_3.PendingOperationType)2 ItemDeltaType (com.evolveum.prism.xml.ns._public.types_3.ItemDeltaType)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 QName (javax.xml.namespace.QName)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 IModel (org.apache.wicket.model.IModel)2 ItemPathDto (com.evolveum.midpoint.gui.api.component.path.ItemPathDto)1 ItemPathPanel (com.evolveum.midpoint.gui.api.component.path.ItemPathPanel)1 CanonicalItemPath (com.evolveum.midpoint.prism.path.CanonicalItemPath)1 ResourceShadowDiscriminator (com.evolveum.midpoint.schema.ResourceShadowDiscriminator)1 AjaxSubmitButton (com.evolveum.midpoint.web.component.AjaxSubmitButton)1 MultiValueChoosePanel (com.evolveum.midpoint.web.component.form.multivalue.MultiValueChoosePanel)1 DatePanel (com.evolveum.midpoint.web.component.input.DatePanel)1