use of org.openntf.domino.graph2.impl.DEdge in project org.openntf.domino by OpenNTF.
the class JsonSearchAdapter method getJsonProperties.
@Override
public Iterator<String> getJsonProperties() {
List<String> result = new ArrayList<String>();
result.add("@id");
result.add("@type");
result.add("@editable");
if (getIncludeDebug()) {
result.add("@debug");
}
Collection<CharSequence> props = getProperties();
if (props == null) {
// NoteCoordinate nc = (NoteCoordinate)
// ((VertexFrame)frame_).asVertex().getId();
props = new ArrayList<CharSequence>();
props.addAll(getGetters().keySet());
if (props == null || props.size() < 5) {
if (frame_ instanceof DVertexFrame) {
try {
Set<String> raw = ((DVertexFrame) frame_).asVertex().getPropertyKeys();
props.addAll(CaseInsensitiveString.toCaseInsensitive(raw));
} catch (Throwable t) {
Throwable cause = t.getCause();
if (cause != null) {
System.err.println("Exception trying to process a frame of type " + DGraphUtils.findInterface(frame_) + " resulting in a " + cause.getClass().getSimpleName());
cause.printStackTrace();
try {
throw cause;
} catch (Throwable e) {
e.printStackTrace();
}
}
}
} else if (frame_ instanceof DEdgeFrame) {
// Set<CharSequence> raw = ((DEdgeFrame)
// frame_).asMap().keySet();
// props.addAll(CaseInsensitiveString.toCaseInsensitive(raw));
}
}
}
for (CharSequence cis : props) {
result.add(cis.toString());
}
Object frame = getFrame();
if (frame instanceof VertexFrame && getIncludeEdges()) {
result.add("@edges");
}
if (getIncludeActions()) {
result.add("@actions");
}
if (frame instanceof VertexFrame && getIncludeCounts()) {
for (CaseInsensitiveString key : getCounters().keySet()) {
result.add("@counts" + key.toString());
}
}
if (frame instanceof VertexFrame) {
Vertex v = ((VertexFrame) frame).asVertex();
if (v instanceof DProxyVertex) {
result.add("@proxyid");
}
}
if (frame instanceof VertexFrame && getLabels() != null) {
for (CharSequence cis : getLabels()) {
result.add("#" + cis.toString());
}
}
if (frame instanceof EdgeFrame) {
result.add("@in");
result.add("@out");
}
if (frame instanceof ViewVertex) {
result.add("@columninfo");
}
if (frame instanceof ViewVertex.Contains) {
Edge edge = ((ViewVertex.Contains) frame).asEdge();
if (edge instanceof DEdge) {
result.addAll(((DEdge) edge).getDelegate().keySet());
}
}
Collection<CharSequence> hideProps = getHideProperties();
if (hideProps != null && !hideProps.isEmpty()) {
for (CharSequence cis : hideProps) {
result.remove(cis.toString());
}
}
return result.iterator();
}
use of org.openntf.domino.graph2.impl.DEdge in project org.openntf.domino by OpenNTF.
the class FramedEdgeList method toVertexList.
// TODO optimize by building a NoteCoordinateList of the target vertices
public FramedVertexList<?> toVertexList() {
// System.out.println("TEMP DEBUG converting a FramedEdgeList to a FramedVertexList");
List<Vertex> vertList = new ArrayList<Vertex>();
for (Edge edge : list_) {
if (edge instanceof DEdge) {
try {
Vertex other = ((DEdge) edge).getOtherVertex(sourceVertex_);
vertList.add(other);
} catch (IllegalStateException ise) {
System.out.println("WARNING: " + ise.getMessage());
} catch (Throwable t) {
t.printStackTrace();
}
} else {
// System.out.println("TEMP DEBUG edge is actually a " + edge.getClass().getName());
}
}
FramedVertexList<?> result = new FramedVertexList<VertexFrame>(this.framedGraph, sourceVertex_, vertList, null);
return result;
}
Aggregations