use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class DynamicFieldGroupPanel method findItemWrapper.
@NotNull
private ItemWrapper<?, ?> findItemWrapper(AbstractFormItemType formField, PrismObjectWrapper<O> objectWrapper) {
ItemPath path = GuiImplUtil.getItemPath(formField);
if (path == null) {
getSession().error("Bad form item definition. It has to contain reference to the real attribute");
LOGGER.error("Bad form item definition. It has to contain reference to the real attribute");
throw new RestartResponseException(getPageBase());
}
ItemWrapper<?, ?> itemWrapper;
try {
itemWrapper = objectWrapper.findItem(path, ItemWrapper.class);
} catch (SchemaException e) {
getSession().error("Bad form item definition. No attribute with path: " + path + " was found");
LOGGER.error("Bad form item definition. No attribute with path: " + path + " was found");
throw new RestartResponseException(getPageBase());
}
if (itemWrapper == null) {
getSession().error("Bad form item definition. No attribute with path: " + path + " was found");
LOGGER.error("Bad form item definition. No attribute with path: " + path + " was found");
throw new RestartResponseException(getPageBase());
}
return itemWrapper;
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class WrapperTestUtil method assertPropertyWrapper.
public static <C extends Containerable, T> void assertPropertyWrapper(PrismContainerValueWrapper<C> containerWrapper, ItemPath itemPath, T... expectedValues) throws SchemaException {
ItemWrapper itemWrapper = containerWrapper.findItem(itemPath, ItemWrapper.class);
assertNotNull("No item wrapper for path " + itemPath + " in " + containerWrapper, itemWrapper);
assertPropertyWrapper(containerWrapper, itemWrapper, itemPath.lastName(), expectedValues);
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class WrapperTestUtil method assertPropertyWrapperByName.
// todo better name
public static <C extends Containerable, T> void assertPropertyWrapperByName(PrismContainerValueWrapper<C> containerWrapper, ItemName itemName, T... expectedValues) throws SchemaException {
ItemWrapper itemWrapper = containerWrapper.findItem(itemName, ItemWrapper.class);
assertNotNull("No item wrapper " + itemName + " in " + containerWrapper, itemWrapper);
assertPropertyWrapper(containerWrapper, itemWrapper, itemName, expectedValues);
}
Aggregations