use of com.evolveum.midpoint.prism.polystring.PolyString in project midpoint by Evolveum.
the class ImportObjects method getDisplayName.
private String getDisplayName(PrismObject object) {
StringBuilder builder = new StringBuilder();
//name
PolyString name = getName(object);
if (name != null) {
builder.append(name.getOrig());
}
//oid
if (builder.length() != 0) {
builder.append(' ');
}
builder.append('\'').append(object.getOid()).append('\'');
return builder.toString();
}
use of com.evolveum.midpoint.prism.polystring.PolyString in project midpoint by Evolveum.
the class ExportObjects method getDisplayName.
private String getDisplayName(PrismObject object) {
StringBuilder builder = new StringBuilder();
//name
PolyString name = getName(object);
if (name != null) {
builder.append(name.getOrig());
}
//oid
if (builder.length() != 0) {
builder.append(' ');
}
builder.append('\'').append(object.getOid()).append('\'');
return builder.toString();
}
use of com.evolveum.midpoint.prism.polystring.PolyString in project midpoint by Evolveum.
the class TestMultiResource method test228ModifyUserJackDefaultDummyNoError.
/**
* Reset break mode, make sure that everything is back to normal.
* MID-2134
*/
@Test
public void test228ModifyUserJackDefaultDummyNoError() throws Exception {
final String TEST_NAME = "test228ModifyUserJackDefaultDummyNoError";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestMultiResource.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
dummyAuditService.clear();
getDummyResource().resetBreakMode();
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyUserReplace(USER_JACK_OID, UserType.F_FULL_NAME, task, result, new PolyString(USER_JACK_FULL_NAME, null));
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
display("Result", result);
TestUtil.assertSuccess(result);
PrismObject<UserType> userJack = getUser(USER_JACK_OID);
assertLinks(userJack, 2);
display("dummy resource after", getDummyResource());
display("beige dummy resource after", dummyResourceBeige);
assertDummyAccount(null, ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, true);
assertDummyAccount(RESOURCE_DUMMY_BEIGE_NAME, ACCOUNT_JACK_DUMMY_USERNAME, ACCOUNT_JACK_DUMMY_FULLNAME, true);
// No value for ship ... no place to get it from
assertDummyAccountAttribute(RESOURCE_DUMMY_BEIGE_NAME, ACCOUNT_JACK_DUMMY_USERNAME, DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_SHIP_NAME);
assertNoDummyAccount(RESOURCE_DUMMY_LAVENDER_NAME, ACCOUNT_JACK_DUMMY_USERNAME);
assertNoDummyAccount(RESOURCE_DUMMY_IVORY_NAME, ACCOUNT_JACK_DUMMY_USERNAME);
}
use of com.evolveum.midpoint.prism.polystring.PolyString in project midpoint by Evolveum.
the class WebComponentUtil method getEffectiveName.
public static <O extends ObjectType> String getEffectiveName(PrismObject<O> object, QName propertyName) {
if (object == null) {
return null;
}
PrismProperty prop = object.findProperty(propertyName);
if (prop != null) {
Object realValue = prop.getRealValue();
if (prop.getDefinition().getTypeName().equals(DOMUtil.XSD_STRING)) {
return (String) realValue;
} else if (realValue instanceof PolyString) {
return WebComponentUtil.getOrigStringFromPoly((PolyString) realValue);
}
}
PolyString name = getValue(object, ObjectType.F_NAME, PolyString.class);
return name != null ? name.getOrig() : null;
}
use of com.evolveum.midpoint.prism.polystring.PolyString in project midpoint by Evolveum.
the class PropertyWrapper method createAddedValue.
@Override
public ValueWrapper createAddedValue() {
ItemDefinition definition = item.getDefinition();
ValueWrapper wrapper;
if (SchemaConstants.T_POLY_STRING_TYPE.equals(definition.getTypeName())) {
wrapper = new ValueWrapper(this, new PrismPropertyValue(new PolyString("")), new PrismPropertyValue(new PolyString("")), ValueStatus.ADDED);
} else if (isUser() && isThisPropertyActivationEnabled()) {
wrapper = new ValueWrapper(this, new PrismPropertyValue(null), new PrismPropertyValue(null), ValueStatus.ADDED);
} else {
wrapper = new ValueWrapper(this, new PrismPropertyValue(null), ValueStatus.ADDED);
}
return wrapper;
}
Aggregations