Skip to content

Commit

Permalink
Merge pull request #91 from openstandia/subtype-page-parameter
Browse files Browse the repository at this point in the history
Apply subtype using page parameter when accessing new object page
  • Loading branch information
semancik committed Dec 21, 2018
2 parents ab39fd0 + dea33be commit 1a891f1
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -307,6 +307,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 1a891f1

Please sign in to comment.