Skip to content

Commit

Permalink
Obj log improvements (#137)
Browse files Browse the repository at this point in the history
* obj log filters added

* add new tooltip lines, descriptions, etc.

* fix for type/rel attributes in ATOM link

* increase repos status column width

* add object count to type/name column, add status filter to object log, prepare logic for object icons in log

* fix warning/error status icons on TYPE level in object log

* improve object counter in object log, enable filter + search behaviour, remove filter icon undertitle, improve serializer logic

* fix for spotbugs

* fix for spotbugs

* fix for spotbugs
  • Loading branch information
OleksiiMalikov authored and absap committed May 22, 2019
1 parent ce729ad commit f1c5d7e
Show file tree
Hide file tree
Showing 9 changed files with 319 additions and 146 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ public interface IObject {

public String getMsgText();

public List<IObject> listMessages();
public List<IObject> listChildObjects();

public Object getMsgParent();
public void resetChildren();

public Object getParent();

public void setObjType(String type);

Expand All @@ -34,4 +36,6 @@ public interface IObject {

public void addChild(IObject abapLogObject);

public int countChildren();

}
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,24 @@ public void setMsgText(String msg_text) {
}

@Override
public List<IObject> listMessages() {
public List<IObject> listChildObjects() {
return this.abapLogObjectChildren;
}

@Override
public Object getMsgParent() {
// TODO Auto-generated method stub
public Object getParent() {

return null;
}

@Override
public void resetChildren() {
this.abapLogObjectChildren.clear();
}

@Override
public int countChildren() {
return this.abapLogObjectChildren.size();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ public IObject deserializeAbapObject(XMLStreamReader xmlReader, String contentTy
object.setPackage(xmlReader.getElementText());
break;
case "msg_type": //$NON-NLS-1$
// object.setMsgType(xmlReader.getElementText());
object_msg.setMsgType(xmlReader.getElementText());
message_exists = true;
break;
case "msg_text": //$NON-NLS-1$
// object.setMsgText(xmlReader.getElementText());
object_msg.setMsgText(xmlReader.getElementText());
if (message_exists) {
object.addChild(object_msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,33 @@ public IObjects deserializeAbapObjects(XMLStreamReader xmlReader, String content
IObject deserializedObj = new AbapObjectSerializer().deserializeAbapObject(xmlReader, contentType);
String objStatus = deserializedObj.getObjStatus();

//-> Object Type already exists = use existing type & add child
if (!objects.getObjects().isEmpty() && newObj_type.getObjType() != null
&& newObj_type.getObjType().equals(deserializedObj.getObjType())) {


if (objStatus != null && (objStatus.equals("W") || objStatus.equals("E") || objStatus.equals("I"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
newObj_type.setObjStatus(objStatus);
}

newObj_type.addChild(deserializedObj);
////-> Object Type already exists = use existing type & add child
if (objects.getObjects().stream().anyMatch(r -> r.getObjType().equals(deserializedObj.getObjType()))) {
IObject existingObj = objects.getObjects().stream().filter(b -> b.getObjType().equals(deserializedObj.getObjType()))
.findFirst().get();

existingObj.addChild(deserializedObj);
}
//-> New Object Type = create new type & add child
////-> New Object Type = create new type & add child
else {
newObj_type = new AbapObject();
newObj_type.setObjType(deserializedObj.getObjType());

if (objStatus != null && (objStatus.equals("W") || objStatus.equals("E") || objStatus.equals("I"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
newObj_type.setObjStatus(objStatus);
}

newObj_type.setObjType(deserializedObj.getObjType());
newObj_type.addChild(deserializedObj);

objects.add(newObj_type);
}

//-> only 1 message is present
if (deserializedObj.listChildObjects().size() <= 1) {
deserializedObj.setMsgType(objStatus);
deserializedObj.setMsgText(deserializedObj.listChildObjects().get(0).getMsgText());
deserializedObj.resetChildren();
}

//-> Set Parent name
newObj_type.setObjName(newObj_type.getObjType());

break;
default:
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,22 @@ public IRepository deserializeRepository(XMLStreamReader xmlReader, String conte
repository.setStatusText(xmlReader.getElementText());
break;
case "link": //$NON-NLS-1$
String lv_type_attr = xmlReader.getAttributeValue(null, "type"); //$NON-NLS-1$
String relType = xmlReader.getAttributeValue(null, "rel"); //$NON-NLS-1$
String lv_type_attr = relType.substring(relType.lastIndexOf("/") + 1); //$NON-NLS-1$

if (lv_type_attr == null || lv_type_attr.equals("pull_link")) { //$NON-NLS-1$
if (lv_type_attr.equals("pull")) { //$NON-NLS-1$
repository.addPullLink(xmlReader.getAttributeValue(null, "rel"), //$NON-NLS-1$
URI.create(xmlReader.getAttributeValue(null, "href"))); //$NON-NLS-1$

}

if (lv_type_attr != null && lv_type_attr.equals("status_link")) { //$NON-NLS-1$
if (lv_type_attr.equals("status")) { //$NON-NLS-1$
repository.addStatusLink(xmlReader.getAttributeValue(null, "rel"), //$NON-NLS-1$
URI.create(xmlReader.getAttributeValue(null, "href"))); //$NON-NLS-1$

}

if (lv_type_attr != null && lv_type_attr.equals("log_link")) { //$NON-NLS-1$
if (lv_type_attr.equals("log")) { //$NON-NLS-1$
repository.addLogLink(xmlReader.getAttributeValue(null, "rel"), //$NON-NLS-1$
URI.create(xmlReader.getAttributeValue(null, "href"))); //$NON-NLS-1$

Expand Down
Loading

0 comments on commit f1c5d7e

Please sign in to comment.