Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Aug 21, 2019
2 parents 095936e + 4b0b66c commit 2bcfe55
Show file tree
Hide file tree
Showing 139 changed files with 342 additions and 351 deletions.
Expand Up @@ -52,7 +52,7 @@ ID_INPUT, itemDefinitionAsStringModel, String.class, createAutoCompleteSettings(
protected Iterator<String> getChoices(String input) {
List<String> defsAsString = new ArrayList<>();
for (ItemDefinition<?> def : listChoices(input).values()) {
defsAsString.add(def.getName().getLocalPart());
defsAsString.add(def.getItemName().getLocalPart());
}
return defsAsString.iterator();

Expand Down
Expand Up @@ -12,7 +12,7 @@ public class AutoCompleteItemDefinitionRenderer extends AbstractAutoCompleteRend

@Override
protected String getTextValue(ItemDefinition<?> object) {
return object.getName().getLocalPart();
return object.getItemName().getLocalPart();
}

@Override
Expand Down
Expand Up @@ -51,9 +51,9 @@ public ItemDefinition<?> getItemDef() {

public void setItemDef(ItemDefinition<?> itemDef) {
if (parentPath == null) {
this.path = itemDef.getName();
this.path = itemDef.getItemName();
} else {
this.path = parentPath.toItemPath().append(itemDef.getName());
this.path = parentPath.toItemPath().append(itemDef.getItemName());
}
this.itemDef = itemDef;
}
Expand All @@ -71,12 +71,12 @@ public ItemPath toItemPath() {
if (itemDef == null) {
return path;
}
this.path = itemDef.getName();
this.path = itemDef.getItemName();
} else {
if (itemDef == null) {
return parentPath.toItemPath();
}
this.path = parentPath.toItemPath().append(itemDef.getName());
this.path = parentPath.toItemPath().append(itemDef.getItemName());
}
return path;

Expand Down
Expand Up @@ -115,10 +115,10 @@ private void collectItems(Collection<? extends ItemDefinition> definitions, Stri
}
for (ItemDefinition<?> def : definitions) {
if (StringUtils.isBlank(input)) {
toSelect.put(def.getName().getLocalPart(), def);
toSelect.put(def.getItemName().getLocalPart(), def);
} else {
if (def.getName().getLocalPart().startsWith(input)) {
toSelect.put(def.getName().getLocalPart(), def);
if (def.getItemName().getLocalPart().startsWith(input)) {
toSelect.put(def.getItemName().getLocalPart(), def);
}
}
}
Expand Down
Expand Up @@ -59,7 +59,7 @@ public void register() {
}
@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
return AssignmentType.F_FOCUS_TYPE.equals(wrapper.getName()) || DOMUtil.XSD_QNAME.equals(wrapper.getTypeName());
return AssignmentType.F_FOCUS_TYPE.equals(wrapper.getItemName()) || DOMUtil.XSD_QNAME.equals(wrapper.getTypeName());
}

@Override
Expand Down
Expand Up @@ -69,7 +69,7 @@ public class HeterogenousContainerWrapperFactory<C extends Containerable> implem
@Override
public PrismContainerWrapper<C> createWrapper(PrismContainerValueWrapper<?> parent,
ItemDefinition<?> def, WrapperContext context) throws SchemaException {
ItemName name = def.getName();
ItemName name = def.getItemName();

PrismContainer<C> childItem = parent.getNewValue().findContainer(name);
ItemStatus status = ItemStatus.NOT_CHANGED;
Expand Down Expand Up @@ -99,7 +99,7 @@ public PrismContainerValueWrapper<C> createValueWrapper(PrismContainerWrapper<C>

for (ItemDefinition<?> def : value.getDefinition().getDefinitions()) {

Item<?,?> childItem = value.findItem(def.getName());
Item<?,?> childItem = value.findItem(def.getItemName());

if (childItem == null && def instanceof PrismContainerDefinition) {
LOGGER.trace("Skipping craeting wrapper for {}, only property and refernce wrappers are created for heterogenous containers.");
Expand Down
Expand Up @@ -66,7 +66,7 @@ public boolean isPropertyReadOnly() {
}

public ItemName getDefinitionName() {
return unwrapWrapperModel().getName();
return unwrapWrapperModel().getItemName();
}

public Component getParentComponent() {
Expand Down
Expand Up @@ -59,7 +59,7 @@ public abstract class ItemWrapperFactoryImpl<IW extends ItemWrapper, PV extends

@Override
public IW createWrapper(PrismContainerValueWrapper<?> parent, ItemDefinition<?> def, WrapperContext context) throws SchemaException {
ItemName name = def.getName();
ItemName name = def.getItemName();


I childItem = null;
Expand Down Expand Up @@ -180,7 +180,7 @@ private boolean skipCreateWrapper(ItemDefinition<?> def, ItemStatus status, Wrap

protected boolean canCreateWrapper(ItemDefinition<?> def, ItemStatus status, WrapperContext context, boolean isEmptyValue) {
if (!context.isCreateOperational() && def.isOperational()) {
LOGGER.trace("Skipping creating wrapper for {}, because it is operational.", def.getName());
LOGGER.trace("Skipping creating wrapper for {}, because it is operational.", def.getItemName());
return false;
}

Expand Down
Expand Up @@ -53,7 +53,7 @@ public Integer getOrder() {

@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
return ActivationType.F_LOCKOUT_STATUS.equals(wrapper.getName());
return ActivationType.F_LOCKOUT_STATUS.equals(wrapper.getItemName());
}

@Override
Expand Down
Expand Up @@ -45,7 +45,7 @@ public class LoggingAppenderWrapperFactoryImpl<T> extends PrismPropertyWrapperFa
@Override
public boolean match(ItemDefinition<?> def) {
return def instanceof PrismPropertyDefinition
&& QNameUtil.match(def.getName(), ClassLoggerConfigurationType.F_APPENDER);
&& QNameUtil.match(def.getItemName(), ClassLoggerConfigurationType.F_APPENDER);
}

@Override
Expand Down
Expand Up @@ -49,7 +49,7 @@ public class LoggingPackageWrapperFactoryImpl<T> extends PrismPropertyWrapperFac
@Override
public boolean match(ItemDefinition<?> def) {
return def instanceof PrismPropertyDefinition
&& QNameUtil.match(def.getName(), ClassLoggerConfigurationType.F_PACKAGE);
&& QNameUtil.match(def.getItemName(), ClassLoggerConfigurationType.F_PACKAGE);
}

@Override
Expand Down
Expand Up @@ -62,7 +62,7 @@ public void register() {

@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
return wrapper.getParent() instanceof ProfilingClassLoggerContainerValueWrapperImpl && wrapper.getName().equals(ClassLoggerConfigurationType.F_LEVEL);
return wrapper.getParent() instanceof ProfilingClassLoggerContainerValueWrapperImpl && wrapper.getItemName().equals(ClassLoggerConfigurationType.F_LEVEL);
}

@Override
Expand Down
Expand Up @@ -99,7 +99,7 @@ public int getOrder() {
@Override
public PrismContainerWrapper<C> createWrapper(PrismContainerValueWrapper<?> parent, ItemDefinition<?> def,
WrapperContext context) throws SchemaException {
ItemName name = def.getName();
ItemName name = def.getItemName();

PrismContainer<C> childItem = (PrismContainer) parent.getNewValue().findItem(name);
ItemStatus status = ItemStatus.NOT_CHANGED;
Expand Down
Expand Up @@ -47,7 +47,7 @@ public void register() {

@Override
public <IW extends ItemWrapper> boolean match(IW wrapper) {
return FocusType.F_DESCRIPTION.equals(wrapper.getName()) || QueryType.COMPLEX_TYPE.equals(wrapper.getTypeName()); // || CleanupPoliciesType.COMPLEX_TYPE.equals(wrapper.getTypeName());
return FocusType.F_DESCRIPTION.equals(wrapper.getItemName()) || QueryType.COMPLEX_TYPE.equals(wrapper.getTypeName()); // || CleanupPoliciesType.COMPLEX_TYPE.equals(wrapper.getTypeName());
}

@Override
Expand Down
Expand Up @@ -40,7 +40,7 @@ public String getDisplayName() {
return def.getDisplayName();
}

return def.getName().getLocalPart();
return def.getItemName().getLocalPart();
}

public PrismContainerDefinition<?> getDef() {
Expand Down
Expand Up @@ -113,7 +113,7 @@ public <D extends ItemDelta<PV, ID>> Collection<D> getDelta() throws SchemaExcep
LOGGER.trace("Start computing delta for {}", newItem);
D delta = null;
if (parent != null && ValueStatus.ADDED == parent.getStatus()) {
delta = (D) createEmptyDelta(getName());
delta = (D) createEmptyDelta(getItemName());
} else {
delta = (D) createEmptyDelta(getPath());
}
Expand Down Expand Up @@ -455,8 +455,8 @@ ItemStatus getItemStatus() {


@Override
public ItemName getName() {
return getItemDefinition().getName();
public ItemName getItemName() {
return getItemDefinition().getItemName();
}

@Override
Expand Down
Expand Up @@ -314,7 +314,7 @@ private ItemPath getVirtualItemPath(VirtualContainerItemSpecificationType virtua
}

protected <IW extends ItemWrapper<?, ?, ?, ?>> void collectExtensionItems(ItemWrapper<?, ?, ?, ?> item, boolean containers, List<IW> itemWrappers) {
if (!ObjectType.F_EXTENSION.equals(item.getName())) {
if (!ObjectType.F_EXTENSION.equals(item.getItemName())) {
return;
}

Expand Down Expand Up @@ -392,9 +392,9 @@ private <IW extends ItemWrapper> IW findItemByQName(QName subName) throws Schema
}
IW matching = null;
for (ItemWrapper<?, ?, ?, ?> item : items) {
if (QNameUtil.match(subName, item.getName())) {
if (QNameUtil.match(subName, item.getItemName())) {
if (matching != null) {
String containerName = getParent() != null ? DebugUtil.formatElementName(getParent().getName()) : "";
String containerName = getParent() != null ? DebugUtil.formatElementName(getParent().getItemName()) : "";
throw new SchemaException("More than one items matching " + subName + " in container " + containerName);
} else {
matching = (IW) item;
Expand Down
Expand Up @@ -331,7 +331,7 @@ public <D extends ItemDelta<PrismContainerValue<C>, PrismContainerDefinition<C>>

protected ItemPath getDeltaPathForStatus(ItemStatus status) {
if (ItemStatus.ADDED == status) {
return getName();
return getItemName();
}

return getPath();
Expand Down
Expand Up @@ -38,7 +38,7 @@ public ProfilingClassLoggerContainerWrapperImpl(PrismContainerValueWrapper<?> pa
}

@Override
public ItemName getName() {
public ItemName getItemName() {
return ItemName.fromQName(ProfilingClassLoggerWrapperFactoryImpl.PROFILING_LOGGER_PATH);
}

Expand Down
Expand Up @@ -34,7 +34,7 @@ public ProfilingClassLoggerPanel(String id, IModel<PrismContainerWrapper<ClassLo

private static ItemVisibility checkVisibility(ItemWrapper itemWrapper, ItemVisibilityHandler visibilitytHandler) {

if(itemWrapper.getName().equals(ClassLoggerConfigurationType.F_PACKAGE)) {
if(itemWrapper.getItemName().equals(ClassLoggerConfigurationType.F_PACKAGE)) {
return ItemVisibility.HIDDEN;
}
return visibilitytHandler != null ? visibilitytHandler.isVisible(itemWrapper) : ItemVisibility.AUTO;
Expand Down
Expand Up @@ -80,7 +80,7 @@ public <D extends ItemDelta<PrismContainerValue<ShadowAssociationType>, PrismCon
}
ShadowAssociationType shadowAssociationType = new ShadowAssociationType();
shadowAssociationType.asPrismContainerValue().applyDefinition(getItemDefinition());
shadowAssociationType.setName(refWrapper.getName());
shadowAssociationType.setName(refWrapper.getItemName());
shadowAssociationType.setShadowRef(ObjectTypeUtil.createObjectRef((PrismReferenceValue) updatedRefValue.getNewValue()));
delta.addValueToAdd(shadowAssociationType.asPrismContainerValue());
}
Expand Down Expand Up @@ -108,7 +108,7 @@ public <D extends ItemDelta<PrismContainerValue<ShadowAssociationType>, PrismCon
}
ShadowAssociationType shadowAssociationType = new ShadowAssociationType();
shadowAssociationType.asPrismContainerValue().applyDefinition(getItemDefinition());
shadowAssociationType.setName(refWrapper.getName());
shadowAssociationType.setName(refWrapper.getItemName());
shadowAssociationType.setShadowRef(ObjectTypeUtil.createObjectRef((PrismReferenceValue) updatedRefValue.getNewValue()));

switch (updatedRefValue.getStatus()) {
Expand Down Expand Up @@ -141,7 +141,7 @@ public <D extends ItemDelta<PrismContainerValue<ShadowAssociationType>, PrismCon
}
ShadowAssociationType shadowAssociationType = new ShadowAssociationType();
shadowAssociationType.asPrismContainerValue().applyDefinition(getItemDefinition());
shadowAssociationType.setName(refWrapper.getName());
shadowAssociationType.setName(refWrapper.getItemName());
shadowAssociationType.setShadowRef(ObjectTypeUtil.createObjectRef((PrismReferenceValue) updatedRefValue.getNewValue()));
delta.addValueToDelete(shadowAssociationType.asPrismContainerValue());
}
Expand Down
Expand Up @@ -102,7 +102,7 @@ public PrismPropertyDefinition getDefinition() {

public String getName() {
String name = definition.getDisplayName();
return StringUtils.isNotEmpty(name) ? name : definition.getName().getLocalPart();
return StringUtils.isNotEmpty(name) ? name : definition.getItemName().getLocalPart();
}

public boolean isEmpty() {
Expand All @@ -129,7 +129,7 @@ public ResourceAttributeDefinitionType getConstruction(PrismContext prismContext
if (construction != null && construction.getRef() != null) {
attrConstruction.setRef(construction.getRef()); // preserves original ref (including xmlns prefix!) - in order to avoid false deltas when comparing old and new values
} else {
attrConstruction.setRef(new ItemPathType(definition.getName()));
attrConstruction.setRef(new ItemPathType(definition.getItemName()));
}
MappingType outbound;
if (construction != null && construction.getOutbound() != null) {
Expand Down
Expand Up @@ -134,7 +134,7 @@ private InputPanel createTypedInputComponent(String id, PrismPropertyDefinition
panel = new TextPanel<>(id, new PropertyModel<>(getModel(), baseExpression),
type);

if (ObjectType.F_NAME.equals(definition.getName())) {
if (ObjectType.F_NAME.equals(definition.getItemName())) {
panel.getBaseFormComponent().setRequired(true);
}
}
Expand Down
Expand Up @@ -296,7 +296,7 @@ private List<ACAttributeDto> prepareAssignmentAttributes(AssignmentType assignme
}

if (ItemPathTypeUtil.asSingleNameOrFail(attribute.getRef())
.equals(propertyDef.getName())) {
.equals(propertyDef.getItemName())) {
acAtrList.add(ACAttributeDto.createACAttributeDto(propertyDef, attribute,
prismContext));
break;
Expand Down
Expand Up @@ -909,13 +909,13 @@ private PrismObject getReference(ObjectReferenceType ref, OperationResult result
private ResourceAttributeDefinitionType findOrCreateValueConstruction(PrismPropertyDefinition attrDef,
List<ResourceAttributeDefinitionType> attrConstructions) {
for (ResourceAttributeDefinitionType construction : attrConstructions) {
if (attrDef.getName().equals(construction.getRef())) {
if (attrDef.getItemName().equals(construction.getRef())) {
return construction;
}
}

ResourceAttributeDefinitionType construction = new ResourceAttributeDefinitionType();
construction.setRef(new ItemPathType(ItemPath.create(attrDef.getName())));
construction.setRef(new ItemPathType(ItemPath.create(attrDef.getItemName())));

return construction;
}
Expand Down
Expand Up @@ -128,14 +128,4 @@ protected IModel<PrismContainerWrapper> getSpecificContainerModel(IModel<PrismCo
return Model.of();
}

@Override
protected ItemVisibility getAssignmentBasicTabVisibity(ItemWrapper<?, ?, ?, ?> itemWrapper, ItemPath parentAssignmentPath, ItemPath assignmentPath, AssignmentType prismContainerValue) {
if (itemWrapper.getPath().containsNameExactly(AssignmentType.F_CONSTRUCTION)) {
return ItemVisibility.AUTO;
} else {
return super.getAssignmentBasicTabVisibity(itemWrapper, parentAssignmentPath, assignmentPath, prismContainerValue);
}

}

}
Expand Up @@ -90,8 +90,8 @@ private static String getItemName(ItemDelta delta) {
if (delta.getDefinition().getDisplayName() != null) {
return delta.getDefinition().getDisplayName();
}
if (delta.getDefinition().getName() != null) {
return delta.getDefinition().getName().getLocalPart();
if (delta.getDefinition().getItemName() != null) {
return delta.getDefinition().getItemName().getLocalPart();
}
}
ItemPath path = delta.getPath();
Expand Down
Expand Up @@ -110,7 +110,7 @@ private String getItemDefinitionName(ItemDefinition def) {
}
String name = def.getDisplayName(); // TODO this is always null here, isn't it?
if (StringUtils.isEmpty(name)) {
name = def.getName().getLocalPart();
name = def.getItemName().getLocalPart();
}
return name;
}
Expand Down
Expand Up @@ -116,8 +116,8 @@ public List<ItemDefinition> getAllDefinitions() {
public SearchItem addItem(ItemDefinition def) {
boolean isPresent = false;
for (ItemDefinition itemDefinition : availableDefinitions){
if (itemDefinition.getName() != null &&
itemDefinition.getName().equals(def.getName())){
if (itemDefinition.getItemName() != null &&
itemDefinition.getItemName().equals(def.getItemName())){
isPresent = true;
break;
}
Expand All @@ -128,7 +128,7 @@ public SearchItem addItem(ItemDefinition def) {

SearchItemDefinition itemToRemove = null;
for (SearchItemDefinition entry : allDefinitions) {
if (entry.getDef().getName().equals(def.getName())) {
if (entry.getDef().getItemName().equals(def.getItemName())) {
itemToRemove = entry;
break;
}
Expand Down
Expand Up @@ -308,7 +308,7 @@ public static <C extends Containerable> List<SearchItemDefinition> createExtensi
}

for (ItemDefinition def : (List<ItemDefinition>) ext.getDefinitions()) {
ItemPath itemPath = ItemPath.create(extensionPath, def.getName());
ItemPath itemPath = ItemPath.create(extensionPath, def.getItemName());

if (!isIndexed(def)) {
continue;
Expand Down

0 comments on commit 2bcfe55

Please sign in to comment.