use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class PageRoles method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM);
add(mainForm);
MainObjectListPanel<RoleType> roleListPanel = new MainObjectListPanel<RoleType>(ID_TABLE, RoleType.class, TableId.TABLE_ROLES, null, this) {
@Override
protected List<InlineMenuItem> createInlineMenu() {
return listInlineMenuHelper.createRowActions(false);
}
@Override
protected List<IColumn<SelectableBean<RoleType>, String>> createColumns() {
return PageRoles.this.initColumns();
}
@Override
protected IColumn<SelectableBean<RoleType>, String> createActionsColumn() {
return PageRoles.this.createActionsColumn();
}
@Override
protected void objectDetailsPerformed(AjaxRequestTarget target, RoleType object) {
PageRoles.this.roleDetailsPerformed(target, object.getOid());
;
}
@Override
protected void newObjectPerformed(AjaxRequestTarget target) {
navigateToNext(PageRole.class);
}
};
roleListPanel.setOutputMarkupId(true);
roleListPanel.setAdditionalBoxCssClasses(GuiStyleConstants.CLASS_OBJECT_ROLE_BOX_CSS_CLASSES);
mainForm.add(roleListPanel);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class PageAccounts method ownerDetailsPerformed.
private <F extends FocusType> void ownerDetailsPerformed(AjaxRequestTarget target, IModel<SelectableBean> model) {
F focus = loadShadowOwner(model);
if (focus == null) {
error(getString("PageAccounts.message.cantShowOwner"));
target.add(getFeedbackPanel());
return;
}
PageParameters parameters = new PageParameters();
parameters.add(OnePageParameterEncoder.PARAMETER, focus.getOid());
if (focus instanceof UserType) {
navigateToNext(PageUser.class, parameters);
} else if (focus instanceof RoleType) {
navigateToNext(PageRole.class, parameters);
} else if (focus instanceof OrgType) {
navigateToNext(PageOrgUnit.class, parameters);
} else {
error(getString("PageAccounts.message.unsupportedOwnerType"));
target.add(getFeedbackPanel());
return;
}
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestSchemaDelta method testDeleteInducementActivationSameNullIdApplyToObject.
@Test
public void testDeleteInducementActivationSameNullIdApplyToObject() throws Exception {
final String TEST_NAME = "testDeleteInducementActivationSameNullIdApplyToObject";
displayTestTile(TEST_NAME);
// GIVEN
PrismObject<RoleType> role = PrismTestUtil.parseObject(ROLE_CONSTRUCTION_FILE);
//Delta
ActivationType activationType = new ActivationType();
activationType.setAdministrativeStatus(ActivationStatusType.ENABLED);
// No container ID
ObjectDelta<RoleType> roleDelta = ObjectDelta.createModificationDeleteContainer(RoleType.class, ROLE_CONSTRUCTION_OID, new ItemPath(new NameItemPathSegment(RoleType.F_INDUCEMENT), new IdItemPathSegment(ROLE_CONSTRUCTION_INDUCEMENT_ID), new NameItemPathSegment(AssignmentType.F_ACTIVATION)), getPrismContext(), activationType);
// WHEN
roleDelta.applyTo(role);
// THEN
System.out.println("Role after delta application:");
System.out.println(role.debugDump());
assertEquals("Wrong OID", ROLE_CONSTRUCTION_OID, role.getOid());
PrismAsserts.assertPropertyValue(role, UserType.F_NAME, PrismTestUtil.createPolyString("Construction"));
PrismContainer<AssignmentType> inducementContainer = role.findContainer(RoleType.F_INDUCEMENT);
assertNotNull("No inducement", inducementContainer);
assertEquals("Unexpected number of inducement values", 1, inducementContainer.size());
PrismContainerValue<AssignmentType> inducementValue = inducementContainer.getValues().iterator().next();
AssignmentType inducement = inducementValue.asContainerable();
ActivationType activation = inducement.getActivation();
// activation should be gone (the error is that it is empty and not gone)
assertNull("Activation is not gone", activation);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestSchemaDelta method testDeleteInducementValidIdEmptyValueApplyToObject.
@Test
public void testDeleteInducementValidIdEmptyValueApplyToObject() throws Exception {
final String TEST_NAME = "testDeleteInducementValidIdEmptyValueApplyToObject";
displayTestTile(TEST_NAME);
// GIVEN
PrismObject<RoleType> role = PrismTestUtil.parseObject(ROLE_CONSTRUCTION_FILE);
//Delta
AssignmentType inducement = new AssignmentType();
inducement.setId(ROLE_CONSTRUCTION_INDUCEMENT_ID);
ObjectDelta<RoleType> roleDelta = ObjectDelta.createModificationDeleteContainer(RoleType.class, ROLE_CONSTRUCTION_OID, RoleType.F_INDUCEMENT, getPrismContext(), inducement);
// WHEN
roleDelta.applyTo(role);
// THEN
System.out.println("Role after delta application:");
System.out.println(role.debugDump());
assertEquals("Wrong OID", ROLE_CONSTRUCTION_OID, role.getOid());
PrismAsserts.assertPropertyValue(role, UserType.F_NAME, PrismTestUtil.createPolyString("Construction"));
PrismContainer<AssignmentType> assignment = role.findContainer(RoleType.F_INDUCEMENT);
assertNull("Unexpected inducement", assignment);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestSchemaRegistry method testRoleType.
@Test
public void testRoleType() throws Exception {
MidPointPrismContextFactory factory = getContextFactory();
PrismContext context = factory.createInitializedPrismContext();
SchemaRegistry schemaRegistry = context.getSchemaRegistry();
PrismObjectDefinition<RoleType> roleDefinition = schemaRegistry.findObjectDefinitionByCompileTimeClass(RoleType.class);
assertNotNull("No role definition", roleDefinition);
assertFalse("Role definition is marked as runtime", roleDefinition.isRuntimeSchema());
PrismPropertyDefinition nameDef = roleDefinition.findPropertyDefinition(ObjectType.F_NAME);
assertNotNull("No name definition", nameDef);
PrismContainerDefinition extensionDef = roleDefinition.findContainerDefinition(ObjectType.F_EXTENSION);
assertNotNull("No 'extension' definition", extensionDef);
assertTrue("Extension definition is NOT marked as runtime", extensionDef.isRuntimeSchema());
PrismPropertyDefinition identifierDef = roleDefinition.findPropertyDefinition(RoleType.F_IDENTIFIER);
assertNotNull("No identifier definition", identifierDef);
// Just make sure this does not end with NPE or stack overflow
PrismObjectDefinition<RoleType> shallowClone = roleDefinition.clone();
PrismObjectDefinition<RoleType> deepClone = roleDefinition.deepClone(false);
PrismObjectDefinition<RoleType> ultraDeepClone = roleDefinition.deepClone(true);
}
Aggregations