Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabria committed Apr 9, 2015
2 parents af163fc + 07e2905 commit c8e61bd
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 15 deletions.
Expand Up @@ -46,8 +46,10 @@
public class WizardStep extends org.apache.wicket.extensions.wizard.WizardStep {

private OperationResult result;
private PageBase pageBase;

public WizardStep() {
public WizardStep(PageBase pageBase) {
this.pageBase = pageBase;
setTitleModel(new StringResourceModel("WizardStep.title", this, null, "WizardStep.title"));
}

Expand All @@ -63,7 +65,7 @@ public String getObject() {
}

public PageBase getPageBase() {
return (PageBase) getPage();
return pageBase;
}

public String getString(String resourceKey, Object... objects) {
Expand Down
Expand Up @@ -34,6 +34,7 @@
import com.evolveum.midpoint.web.component.wizard.WizardStep;
import com.evolveum.midpoint.web.component.wizard.resource.component.capability.*;
import com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
import com.evolveum.midpoint.web.util.WebModelUtils;
Expand Down Expand Up @@ -103,7 +104,8 @@ public class CapabilityStep extends WizardStep {
private IModel<CapabilityStepDto> model;
private IModel<PrismObject<ResourceType>> resourceModel;

public CapabilityStep(IModel<PrismObject<ResourceType>> prismModel){
public CapabilityStep(IModel<PrismObject<ResourceType>> prismModel, PageBase pageBase){
super(pageBase);
this.resourceModel = prismModel;

model = new LoadableModel<CapabilityStepDto>() {
Expand Down
Expand Up @@ -68,7 +68,8 @@ public class ConfigurationStep extends WizardStep {
private boolean isNewResource;
private IModel<ObjectWrapper> configurationProperties;

public ConfigurationStep(IModel<PrismObject<ResourceType>> resourceModel, boolean isNewResource) {
public ConfigurationStep(IModel<PrismObject<ResourceType>> resourceModel, boolean isNewResource, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;
this.isNewResource = isNewResource;

Expand Down
Expand Up @@ -79,7 +79,8 @@ public class NameStep extends WizardStep {
//filtered, based on selection
private LoadableModel<List<PrismObject<ConnectorType>>> connectorTypes;

public NameStep(IModel<PrismObject<ResourceType>> model) {
public NameStep(IModel<PrismObject<ResourceType>> model, PageBase pageBase) {
super(pageBase);
this.resourceModel = model;

connectorsModel = new LoadableModel<List<PrismObject<ConnectorType>>>(false) {
Expand Down
Expand Up @@ -35,6 +35,7 @@
import com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.*;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ResourceObjectTypeDefinitionTypeDto;
import com.evolveum.midpoint.web.component.wizard.resource.dto.SchemaHandlingDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
Expand Down Expand Up @@ -120,7 +121,8 @@ public class SchemaHandlingStep extends WizardStep {
private IModel<PrismObject<ResourceType>> resourceModel;
private IModel<SchemaHandlingDto> model;

public SchemaHandlingStep(final IModel<PrismObject<ResourceType>> resourceModel) {
public SchemaHandlingStep(final IModel<PrismObject<ResourceType>> resourceModel, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;

model = new LoadableModel<SchemaHandlingDto>(false) {
Expand Down
Expand Up @@ -58,7 +58,8 @@ public class SchemaStep extends WizardStep {
private static final String ID_RELOAD = "reload";
private IModel<PrismObject<ResourceType>> model;

public SchemaStep(IModel<PrismObject<ResourceType>> model) {
public SchemaStep(IModel<PrismObject<ResourceType>> model, PageBase pageBase) {
super(pageBase);
this.model = model;
setOutputMarkupId(true);

Expand Down
Expand Up @@ -37,6 +37,7 @@
import com.evolveum.midpoint.web.component.wizard.resource.component.synchronization.SynchronizationReactionEditor;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectSynchronizationTypeDto;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ResourceSynchronizationDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
Expand Down Expand Up @@ -118,7 +119,8 @@ public class SynchronizationStep extends WizardStep {
private IModel<PrismObject<ResourceType>> resourceModel;
private IModel<ResourceSynchronizationDto> model;

public SynchronizationStep(IModel<PrismObject<ResourceType>> resourceModel) {
public SynchronizationStep(IModel<PrismObject<ResourceType>> resourceModel, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;

model = new LoadableModel<ResourceSynchronizationDto>(false) {
Expand Down
Expand Up @@ -145,12 +145,12 @@ protected String load() {

private void initLayout() {
WizardModel wizardModel = new WizardModel();
wizardModel.add(new NameStep(model));
wizardModel.add(new ConfigurationStep(model, isNewResource));
wizardModel.add(new SchemaStep(model));
wizardModel.add(new SchemaHandlingStep(model));
wizardModel.add(new CapabilityStep(model));
wizardModel.add(new SynchronizationStep(model));
wizardModel.add(new NameStep(model, this));
wizardModel.add(new ConfigurationStep(model, isNewResource, this));
wizardModel.add(new SchemaStep(model, this));
wizardModel.add(new SchemaHandlingStep(model, this));
wizardModel.add(new CapabilityStep(model, this));
wizardModel.add(new SynchronizationStep(model, this));

Wizard wizard = new Wizard(ID_WIZARD, new Model(wizardModel));
wizard.setOutputMarkupId(true);
Expand Down
35 changes: 35 additions & 0 deletions model/model-intest/src/test/resources/gensync/role-prisoner.xml
@@ -0,0 +1,35 @@
<!--
~ Copyright (c) 2015 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<role oid="90c332ec-ddc8-11e4-bb3b-001e8c717e5b"
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3">
<name>Prisoner</name>
<authorization>
<action>http://midpoint.evolveum.com/xml/ns/public/security/authorization-model-3#read</action>
<item>c:name</item>
<item>fullName</item>
<item>activation/administrativeStatus</item>
<item>assignment</item>
<item>description</item>
</authorization>
<authorization>
<action>http://midpoint.evolveum.com/xml/ns/public/security/authorization-model-3#modify</action>
<item>fullName</item>
<item>additionalName</item>
<item>description</item>
</authorization>
</role>
41 changes: 41 additions & 0 deletions model/model-intest/src/test/resources/gensync/user-otis.xml
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2015 Evolveum
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<user oid="fd5039c8-ddc8-11e4-8ec7-001e8c717e5b"
xmlns='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:c='http://midpoint.evolveum.com/xml/ns/public/common/common-3'
xmlns:t='http://prism.evolveum.com/xml/ns/public/types-3'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:piracy='http://midpoint.evolveum.com/xml/ns/samples/piracy'>
<name>otis</name>
<assignment>
<targetRef oid="90c332ec-ddc8-11e4-bb3b-001e8c717e5b" type="RoleType"/> <!-- Prisoner -->
</assignment>
<activation>
<c:administrativeStatus>enabled</c:administrativeStatus>
</activation>
<!-- No full name -->
<givenName>Otis</givenName>
<employeeType>PIRATE</employeeType>
<credentials>
<password>
<value>
<clearValue>JailT1m3</clearValue>
</value>
</password>
</credentials>
</user>
Expand Up @@ -102,7 +102,7 @@ public WorkItemEvent createWorkItemCreateEvent(String workItemName, String assig

@Override
public WorkItemEvent createWorkItemCompleteEvent(String workItemName, String assigneeOid, PrismObject<? extends ProcessInstanceState> instanceState, String decision) {
return createWorkItemEvent(workItemName, assigneeOid, instanceState, ChangeType.ADD, decision);
return createWorkItemEvent(workItemName, assigneeOid, instanceState, ChangeType.DELETE, decision);
}

private WorkItemEvent createWorkItemEvent(String workItemName, String assigneeOid, PrismObject<? extends ProcessInstanceState> instanceState, ChangeType changeType, String decision) {
Expand Down

0 comments on commit c8e61bd

Please sign in to comment.