Skip to content

Commit

Permalink
MID-2776 fixed storing debug list page search
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Mar 26, 2016
1 parent 089397e commit 41081cd
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 11 deletions.
Expand Up @@ -160,18 +160,18 @@ public class PageDebugList extends PageAdminConfiguration {
private IModel<List<ObjectViewDto>> resourcesModel;

public PageDebugList() {
this(true);
}

public PageDebugList(boolean clearPagingInSession) {
searchModel = new LoadableModel<DebugSearchDto>(false) {

@Override
protected DebugSearchDto load() {
ConfigurationStorage storage = getSessionStorage().getConfiguration();

DebugSearchDto dto = storage.getDebugSearchDto();
setupSearchDto(dto);
if (dto == null) {
dto = new DebugSearchDto();
dto.setType(ObjectTypes.SYSTEM_CONFIGURATION);
setupSearchDto(dto);
}

return dto;
}
Expand All @@ -185,7 +185,7 @@ protected DebugConfDialogDto load() {
}
};

resourcesModel = new LoadableModel<List<ObjectViewDto>>() {
resourcesModel = new LoadableModel<List<ObjectViewDto>>(false) {

@Override
protected List<ObjectViewDto> load() {
Expand Down
Expand Up @@ -344,7 +344,7 @@ public void savePerformed(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
} else {
showResult(result);
setResponsePage(new PageDebugList(false));
setResponsePage(new PageDebugList());
}
}
}
Expand Up @@ -21,6 +21,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;

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

/**
* @author lazyman
Expand Down Expand Up @@ -104,4 +105,23 @@ public Class<T> getType() {
public void setType(Class<T> type) {
this.type = type;
}

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

ObjectViewDto<?> that = (ObjectViewDto<?>) o;

if (oid != null ? !oid.equals(that.oid) : that.oid != null) return false;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (xml != null ? !xml.equals(that.xml) : that.xml != null) return false;
if (object != null ? !object.equals(that.object) : that.object != null) return false;
return type != null ? type.equals(that.type) : that.type == null;
}

@Override
public int hashCode() {
return Arrays.hashCode(new Object[]{oid, name, xml, object, type});
}
}
Expand Up @@ -36,10 +36,6 @@ public class ConfigurationStorage extends PageStorage {
private ObjectPaging accountDetailsPaging;

public DebugSearchDto getDebugSearchDto() {
if (debugSearchDto == null) {
debugSearchDto = new DebugSearchDto();
debugSearchDto.setType(ObjectTypes.SYSTEM_CONFIGURATION);
}
return debugSearchDto;
}

Expand Down

0 comments on commit 41081cd

Please sign in to comment.