Skip to content

Commit

Permalink
Merge branch 'master' into access-certification
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Jan 12, 2016
2 parents 0edad99 + cd22146 commit 6362376
Show file tree
Hide file tree
Showing 45 changed files with 2,266 additions and 327 deletions.
2 changes: 1 addition & 1 deletion config/initial-objects/090-report-audit.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion config/initial-objects/110-report-user-list.xml

Large diffs are not rendered by default.

Expand Up @@ -417,8 +417,12 @@ public boolean isVisible(int index) {
if (visibilities.length > 0) {
Boolean visible = visibilities[index];
if (visible == null) {
visible = tabs.getObject().get(index).isVisible();
visibilities[index] = visible;
List<T> tabsList = tabs.getObject();
T tab = tabsList == null || tabsList.size() == 0 ? null : tabs.getObject().get(index);
visible = tab != null && tab.isVisible();
if (tab != null) {
visibilities[index] = visible;
}
}
return visible;
} else {
Expand Down
Expand Up @@ -433,7 +433,7 @@ private List<ContainerWrapper> createResourceContainers(PageBase pageBase) throw

private PrismObject<ConnectorType> loadConnector() {
PrismReference connectorRef = object.findReference(ResourceType.F_CONNECTOR_REF);
return connectorRef.getValue().getObject();
return connectorRef != null ? (connectorRef.getValue() != null ? connectorRef.getValue().getObject() : null) : null;
// todo reimplement
}

Expand Down Expand Up @@ -628,7 +628,9 @@ public ObjectDelta getObjectDelta() throws SchemaException {
Collections.sort(containers, new ItemWrapperComparator());

// Make sure we have all the definitions
object.getPrismContext().adopt(delta);
if (object.getPrismContext() != null) {
object.getPrismContext().adopt(delta);
}
return delta;
}

Expand Down
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2010-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.
*/

package com.evolveum.midpoint.web.component.search;

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

/**
* @author Viliam Repan (lazyman)
*/
public class MoreDialogDto implements Serializable {

public static final String F_NAME_FILTER = "nameFilter";
public static final String F_PROPERTIES = "properties";

private String nameFilter;

private List<Property> properties;

public String getNameFilter() {
return nameFilter;
}

public void setNameFilter(String nameFilter) {
this.nameFilter = nameFilter;
}

public List<Property> getProperties() {
if (properties == null) {
properties = new ArrayList<>();
}
return properties;
}

public void setProperties(List<Property> properties) {
this.properties = properties;
}
}
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
~ Copyright (c) 2010-2013 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.
-->
<wicket:panel xmlns:wicket="http://wicket.apache.org">
<div class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
<p>One fine body&hellip;</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
</wicket:panel>
@@ -0,0 +1,32 @@
/*
* Copyright (c) 2010-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.
*/

package com.evolveum.midpoint.web.component.search;

import com.evolveum.midpoint.web.component.util.SimplePanel;
import org.apache.wicket.model.IModel;

/**
* @author Viliam Repan (lazyman)
*/
public class ObjectBrowserDialog extends SimplePanel {

public ObjectBrowserDialog(String id, IModel model) {
super(id, model);
}

//todo implement
}
@@ -0,0 +1,110 @@
/*
* Copyright (c) 2010-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.
*/

package com.evolveum.midpoint.web.component.search;

import com.evolveum.midpoint.prism.ItemDefinition;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.wicket.model.IModel;

import java.io.Serializable;

/**
* @author Viliam Repan (lazyman)
*/
public class Property implements Serializable, Comparable<Property> {

public static final String F_SELECTED = "selected";
public static final String F_NAME = "name";

private boolean selected;
private ItemDefinition definition;

public Property(ItemDefinition definition) {
Validate.notNull(definition, "Property name must no be null");

this.definition=definition;
}

public ItemDefinition getDefinition() {
return definition;
}

public String getName() {
return getItemDefinitionName(definition);
}

public boolean isSelected() {
return selected;
}

public void setSelected(boolean selected) {
this.selected = selected;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Property property = (Property) o;

if (selected != property.selected) return false;
return !(definition != null ? !definition.equals(property.definition) : property.definition != null);

}

@Override
public int hashCode() {
int result = (selected ? 1 : 0);
result = 31 * result + (definition != null ? definition.hashCode() : 0);
return result;
}

@Override
public String toString() {
return new ToStringBuilder(this)
.append("definition", definition)
.append("selected", selected)
.toString();
}

@Override
public int compareTo(Property o) {
String n1 = getItemDefinitionName(definition);
String n2 = getItemDefinitionName(o.definition);

if (n1 == null || n2 == null) {
return 0;
}

return String.CASE_INSENSITIVE_ORDER.compare(n1, n2);
}

private String getItemDefinitionName(ItemDefinition def) {
if (def == null) {
return null;
}

String name = def.getDisplayName();
if (StringUtils.isEmpty(name)) {
name = def.getName().getLocalPart();
}
return name;
}
}

0 comments on commit 6362376

Please sign in to comment.