Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Dec 13, 2017
2 parents 6eac401 + e8cecc3 commit 05236a4
Showing 1 changed file with 17 additions and 7 deletions.
Expand Up @@ -17,7 +17,6 @@

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.xml.namespace.QName;
Expand Down Expand Up @@ -53,7 +52,6 @@
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ResourceTypeUtil;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
Expand All @@ -67,7 +65,6 @@
import com.evolveum.midpoint.web.component.prism.CheckTableHeader;
import com.evolveum.midpoint.web.component.prism.ContainerStatus;
import com.evolveum.midpoint.web.component.prism.ContainerWrapper;
import com.evolveum.midpoint.web.component.prism.ItemWrapper;
import com.evolveum.midpoint.web.component.prism.ObjectWrapper;
import com.evolveum.midpoint.web.component.prism.PrismPanel;
import com.evolveum.midpoint.web.component.prism.PropertyWrapper;
Expand All @@ -89,7 +86,6 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
import com.evolveum.midpoint.xml.ns._public.resource.capabilities_3.ActivationLockoutStatusCapabilityType;

/**
* @author semancik
Expand Down Expand Up @@ -245,9 +241,23 @@ private void addSelectedAccountPerformed(AjaxRequestTarget target, List<Resource
RefinedResourceSchema refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(
resource.asPrismObject(), LayerType.PRESENTATION, getPrismContext());
if (refinedSchema == null) {
error(getString("pageAdminFocus.message.couldntCreateAccountNoSchema",
resource.getName()));
continue;
Task task = getPageBase().createSimpleTask(FocusPersonasTabPanel.class.getSimpleName() + ".loadResource");
OperationResult result = task.getResult();
PrismObject<ResourceType> loadedResource = WebModelServiceUtils.loadObject(ResourceType.class, resource.getOid(), getPageBase(), task, result);
result.recomputeStatus();

refinedSchema = RefinedResourceSchemaImpl.getRefinedSchema(
loadedResource, LayerType.PRESENTATION, getPrismContext());

if (refinedSchema == null) {
error(getString("pageAdminFocus.message.couldntCreateAccountNoSchema",
resource.getName()));
continue;
}

// resource = loadedResource.asObjectable();
shadow.setResource(loadedResource.asObjectable());

}
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Refined schema for {}\n{}", resource, refinedSchema.debugDump());
Expand Down

0 comments on commit 05236a4

Please sign in to comment.