Skip to content

Commit

Permalink
Apply subtype using page parameter when accessing new object page
Browse files Browse the repository at this point in the history
  • Loading branch information
wadahiro committed Dec 20, 2018
1 parent 0519770 commit dea33be
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -303,6 +303,11 @@ protected ObjectWrapper<O> loadObjectWrapper(PrismObject<O> objectToEdit, boolea
if (objectToEdit == null) {
LOGGER.trace("Loading object: New object (creating)");
O focusType = createNewObject();

// Apply subtype using page parameters
List<StringValue> subtypes = getPageParameters().getValues(ObjectType.F_SUBTYPE.getLocalPart());
subtypes.stream().filter(p -> !p.isEmpty()).forEach(c -> focusType.subtype(c.toString()));

getMidpointApplication().getPrismContext().adopt(focusType);
object = (PrismObject<O>) focusType.asPrismObject();
} else {
Expand Down

0 comments on commit dea33be

Please sign in to comment.