Skip to content

Commit

Permalink
adding definition of QName for objects
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Mar 5, 2019
1 parent a23ebb9 commit fb27b55
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Expand Up @@ -53,7 +53,6 @@ protected void onInitialize() {
}

private void initLayout(){

DropDownFormGroup<QName> type = new DropDownFormGroup<QName>(ID_OBJECT_TYPE, Model.of(getDefaultObjectType()), Model.ofList(getSupportedObjectTypes()),
new QNameObjectTypeChoiceRenderer(), createStringResource("chooseFocusTypeAndRelationDialogPanel.type"),
"chooseFocusTypeAndRelationDialogPanel.tooltip.type", true, "col-md-4", "col-md-8", false);
Expand Down Expand Up @@ -116,14 +115,12 @@ protected List<QName> getSupportedObjectTypes() {
return WebComponentUtil.createFocusTypeList(true);
}

private QName getDefaultObjectType() {
protected QName getDefaultObjectType() {
List<QName> supportedObjectTypes = getSupportedObjectTypes();
if (CollectionUtils.isEmpty(supportedObjectTypes)) {
return FocusType.COMPLEX_TYPE;
}

return supportedObjectTypes.iterator().next();

}

protected List<QName> getSupportedRelations() {
Expand Down
Expand Up @@ -26,17 +26,14 @@

import com.evolveum.midpoint.model.api.AssignmentCandidatesSpecification;
import com.evolveum.midpoint.model.api.AssignmentObjectRelation;
import com.evolveum.midpoint.model.api.authentication.CompiledObjectCollectionView;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.query.QueryFactory;
import com.evolveum.midpoint.prism.query.builder.S_FilterEntryOrEmpty;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.web.component.AjaxIconButton;
import com.evolveum.midpoint.web.component.MultifunctionalButton;
import com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem;
import com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction;
import com.evolveum.midpoint.web.page.admin.PageAdminObjectList;
import com.evolveum.midpoint.web.page.admin.configuration.component.HeaderMenuAction;
import com.evolveum.midpoint.web.session.MemberPanelStorage;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand Down Expand Up @@ -92,8 +89,6 @@
import com.evolveum.midpoint.web.security.GuiAuthorizationConstants;
import com.evolveum.midpoint.web.session.UserProfileStorage.TableId;

import static com.evolveum.midpoint.gui.api.util.WebComponentUtil.isAuthorized;

public abstract class AbstractRoleMemberPanel<R extends AbstractRoleType> extends BasePanel<R> {

private static final long serialVersionUID = 1L;
Expand Down Expand Up @@ -504,7 +499,12 @@ protected boolean isFocusTypeSelectorVisible() {

protected void okPerformed(QName type, Collection<QName> relations, AjaxRequestTarget target) {
unassignMembersPerformed(type, scope, relations, target);

}

@Override
protected QName getDefaultObjectType() {
return WebComponentUtil.classToQName(AbstractRoleMemberPanel.this.getPrismContext(),
AbstractRoleMemberPanel.this.getDefaultObjectType());
}
};

Expand Down Expand Up @@ -536,6 +536,12 @@ protected void okPerformed(QName type, Collection<QName> relations, AjaxRequestT
protected boolean isFocusTypeSelectorVisible() {
return !QueryScope.SELECTED.equals(scope);
}

@Override
protected QName getDefaultObjectType() {
return WebComponentUtil.classToQName(AbstractRoleMemberPanel.this.getPrismContext(),
AbstractRoleMemberPanel.this.getDefaultObjectType());
}

};

Expand Down

0 comments on commit fb27b55

Please sign in to comment.