Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into audit-changing-to-sql
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Jul 10, 2019
2 parents 8ce3093 + e48d7b1 commit 972bed2
Show file tree
Hide file tree
Showing 17 changed files with 234 additions and 80 deletions.
Expand Up @@ -1851,13 +1851,12 @@ public String getBubbleLabel() {
};

addMenuItem(item, "PageAdmin.menu.top.cases.listAll", GuiStyleConstants.EVO_CASE_OBJECT_ICON, PageCases.class);
addCollectionsMenuItems(item.getItems(), CaseType.COMPLEX_TYPE, PageCases.class);

addMenuItem(item, "PageAdmin.menu.top.caseWorkItems.listAll", GuiStyleConstants.CLASS_OBJECT_WORK_ITEM_ICON, PageCaseWorkItemsAll.class);
addMenuItem(item, "PageAdmin.menu.top.caseWorkItems.list", PageCaseWorkItemsAllocatedToMe.class);
addMenuItem(item, "PageAdmin.menu.top.workItems.listAttorney", PageAttorneySelection.class);

addCollectionsMenuItems(item.getItems(), CaseType.COMPLEX_TYPE, PageCases.class);


createFocusPageViewMenu(item.getItems(), "PageAdmin.menu.top.caseWorkItems.view", PageCaseWorkItem.class);

return item;
Expand Down
Expand Up @@ -24,21 +24,25 @@
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.xml.ns._public.common.common_3.CaseEventType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemCompletionEventType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemDelegationEventType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemEventType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
* Created by honchar
*/
@Component
public class CaseEventWrapperFactoryImpl extends PrismContainerWrapperFactoryImpl<CaseEventType> {
public class CaseEventWrapperFactoryImpl<CET extends CaseEventType> extends PrismContainerWrapperFactoryImpl<CET> {

@Autowired
private GuiComponentRegistry registry;

@Override
public boolean match(ItemDefinition<?> def) {
return CaseEventType.COMPLEX_TYPE.equals(def.getTypeName());
return CaseEventType.COMPLEX_TYPE.equals(def.getTypeName()) || WorkItemEventType.COMPLEX_TYPE.equals(def.getTypeName()) ||
WorkItemCompletionEventType.COMPLEX_TYPE.equals(def.getTypeName()) || WorkItemDelegationEventType.COMPLEX_TYPE.equals(def.getTypeName());
}

@Override
Expand All @@ -52,19 +56,19 @@ public int getOrder() {
}

@Override
protected PrismContainerValue<CaseEventType> createNewValue(PrismContainer<CaseEventType> item) {
protected PrismContainerValue<CET> createNewValue(PrismContainer<CET> item) {
throw new UnsupportedOperationException("New case event value should not be created while creating wrappers.");
}


@Override
protected boolean shouldCreateEmptyValue(PrismContainer<CaseEventType> item, WrapperContext context) {
protected boolean shouldCreateEmptyValue(PrismContainer<CET> item, WrapperContext context) {
return false;
}

@Override
public PrismContainerValueWrapper<CaseEventType> createValueWrapper(PrismContainerWrapper<CaseEventType> parent,
PrismContainerValue<CaseEventType> value, ValueStatus status, WrapperContext context) throws SchemaException {
public PrismContainerValueWrapper<CET> createValueWrapper(PrismContainerWrapper<CET> parent,
PrismContainerValue<CET> value, ValueStatus status, WrapperContext context) throws SchemaException {
context.setCreateIfEmpty(false);
return super.createValueWrapper(parent, value, status, context);
}
Expand Down
Expand Up @@ -19,6 +19,7 @@
import java.util.Collection;
import java.util.List;

import com.evolveum.midpoint.prism.*;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;

Expand All @@ -29,10 +30,6 @@
import com.evolveum.midpoint.gui.impl.prism.PrismValueWrapper;
import com.evolveum.midpoint.gui.impl.registry.GuiComponentRegistryImpl;
import com.evolveum.midpoint.model.api.ModelInteractionService;
import com.evolveum.midpoint.prism.Item;
import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.PrismValue;
import com.evolveum.midpoint.prism.path.ItemName;
import com.evolveum.midpoint.schema.processor.ResourceAttribute;
import com.evolveum.midpoint.util.exception.SchemaException;
Expand Down Expand Up @@ -136,7 +133,12 @@ private boolean skipCreateWrapper(ItemDefinition<?> def, ItemStatus status, Wrap
LOGGER.trace("Skipping creating wrapper for search filter: {}", def.getName());
return false;
}


if (ItemProcessing.IGNORE == def.getProcessing()) {
LOGGER.trace("Skip creating wrapper for {}, because item processig is set to IGNORE.", def);
return false;
}

if (def.isExperimental() && !WebModelServiceUtils.isEnableExperimentalFeature(modelInteractionService, context.getTask(), context.getResult())) {
LOGGER.trace("Skipping creating wrapper for {}, because experimental GUI features are turned off.", def);
return false;
Expand Down
@@ -0,0 +1,73 @@
/*
* Copyright (c) 2010-2019 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.
*/
package com.evolveum.midpoint.gui.impl.factory;

import com.evolveum.midpoint.gui.api.prism.PrismContainerWrapper;
import com.evolveum.midpoint.gui.api.registry.GuiComponentRegistry;
import com.evolveum.midpoint.gui.impl.prism.PrismContainerValueWrapper;
import com.evolveum.midpoint.prism.ItemDefinition;
import com.evolveum.midpoint.prism.PrismContainer;
import com.evolveum.midpoint.prism.PrismContainerValue;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.ValueStatus;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
* Created by honchar
*/
@Component
public class WorkItemOutputWrapperFactoryImpl extends PrismContainerWrapperFactoryImpl<AbstractWorkItemOutputType> {

@Autowired
private GuiComponentRegistry registry;

@Override
public boolean match(ItemDefinition<?> def) {
return AbstractWorkItemOutputType.COMPLEX_TYPE.equals(def.getTypeName());
}

@Override
public void register() {
registry.addToRegistry(this);
}

@Override
public int getOrder() {
return 1000;
}

@Override
protected PrismContainerValue<AbstractWorkItemOutputType> createNewValue(PrismContainer<AbstractWorkItemOutputType> item) {
throw new UnsupportedOperationException("New work item output value should not be created while creating wrappers.");
}


@Override
protected boolean shouldCreateEmptyValue(PrismContainer<AbstractWorkItemOutputType> item, WrapperContext context) {
return false;
}

@Override
public PrismContainerValueWrapper<AbstractWorkItemOutputType> createValueWrapper(PrismContainerWrapper<AbstractWorkItemOutputType> parent,
PrismContainerValue<AbstractWorkItemOutputType> value, ValueStatus status, WrapperContext context) throws SchemaException {
context.setCreateIfEmpty(false);
return super.createValueWrapper(parent, value, status, context);
}


}
Expand Up @@ -253,6 +253,7 @@ public String debugDump(int indent) {
sb.append("Old item: \n").append(oldItem).append("\n");
sb.append("Values: \n");
for (VW value : values) {
DebugUtil.indentDebugDump(sb, indent + 1);
sb.append(value.debugDump());
}
return sb.toString();
Expand Down
Expand Up @@ -382,7 +382,7 @@ public String debugDump(int indent) {
StringBuilder sb = new StringBuilder(super.debugDump(indent));
sb.append("Items:\n");
for (ItemWrapper<?, ?, ?, ?> item: items) {
sb.append(item).append("\n");
sb.append(item.debugDump(indent + 1)).append("\n");
}

return sb.toString();
Expand Down
Expand Up @@ -56,5 +56,9 @@ public <T extends Containerable> List<PrismContainerWrapper<T>> getContainers()
public String getDisplayName() {
return new StringResourceModel("prismContainer.mainPanelDisplayName").getString();
}


@Override
public boolean isExpanded() {
return true;
}
}
Expand Up @@ -20,6 +20,7 @@
import com.evolveum.midpoint.prism.PrismValue;
import com.evolveum.midpoint.prism.delta.ItemDelta;
import com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy;
import com.evolveum.midpoint.util.DebugUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.web.component.prism.ValueStatus;

Expand Down Expand Up @@ -129,7 +130,7 @@ public void setStatus(ValueStatus status) {

@Override
public String debugDump(int indent) {
StringBuilder sb = new StringBuilder();
StringBuilder sb = DebugUtil.createIndentedStringBuilder(indent);
sb.append("Status: ").append(status).append("\n");
sb.append("New value: ").append(newValue.debugDump()).append("\n");
sb.append("Old value: ").append(oldValue.debugDump()).append("\n");
Expand Down
Expand Up @@ -159,8 +159,25 @@
<authorization>http://midpoint.evolveum.com/xml/ns/public/security/authorization-ui-3#resources</authorization>
</userDashboardLink>
<objectCollectionViews>
<objectCollectionView>
<identifier>my-cases</identifier>
<displayOrder>1000</displayOrder>
<type>CaseType</type>
<display>
<label>Case</label>
<pluralLabel>My Cases</pluralLabel>
<icon>
<cssClass>fe fe-case-object</cssClass>
</icon>
</display>
<collection>
<collectionRef oid="00000000-0000-0000-0000-000000000344" relation="org:default" type="c:ObjectCollectionType">
</collectionRef>
</collection>
</objectCollectionView>
<objectCollectionView>
<identifier>manual-case-view</identifier>
<displayOrder>1001</displayOrder>
<type>CaseType</type>
<collection>
<collectionRef oid="00000000-0000-0000-0000-000000000340" relation="org:default" type="c:ArchetypeType">
Expand All @@ -169,6 +186,7 @@
</objectCollectionView>
<objectCollectionView>
<identifier>operation-request-case-view</identifier>
<displayOrder>1002</displayOrder>
<type>CaseType</type>
<collection>
<collectionRef oid="00000000-0000-0000-0000-000000000341" relation="org:default" type="c:ArchetypeType">
Expand All @@ -177,6 +195,7 @@
</objectCollectionView>
<objectCollectionView>
<identifier>approval-case-view</identifier>
<displayOrder>1003</displayOrder>
<type>CaseType</type>
<collection>
<collectionRef oid="00000000-0000-0000-0000-000000000342" relation="org:default" type="c:ArchetypeType">
Expand Down
@@ -0,0 +1,29 @@
<objectCollection xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3" xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3" xmlns:org="http://midpoint.evolveum.com/xml/ns/public/common/org-3" xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3" xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3" xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3" oid="00000000-0000-0000-0000-000000000344" version="5">
<name>My cases</name>
<type>CaseType</type>
<filter>
<q:and>
<q:ref>
<q:path>requestorRef</q:path>
<expression>
<script>
<code>
import com.evolveum.midpoint.xml.ns._public.common.common_3.*
new ObjectReferenceType().oid(midpoint.principalOid)
</code>
</script>
</expression>
</q:ref>
<q:not>
<q:equal>
<q:path>state</q:path>
<q:value>closed</q:value>
</q:equal>
</q:not>
</q:and>
</filter>
<baseCollection>
<collectionRef oid="00000000-0000-0000-0000-000000000341" relation="org:default" type="c:ArchetypeType">
</collectionRef>
</baseCollection>
</objectCollection>

0 comments on commit 972bed2

Please sign in to comment.