use of org.openntf.domino.exceptions.UnimplementedException in project org.openntf.domino by OpenNTF.
the class DElementStore method setupProxy.
@SuppressWarnings("unchecked")
protected DProxyVertex setupProxy(final Object proxy, final Serializable originalKey) {
// System.out.println("TEMP DEBUG Setting up proxy vertex");
DProxyVertex result = new DProxyVertex(getConfiguration().getGraph(), (Map<String, Object>) proxy);
Object rawpid = result.getProxiedId();
if (rawpid != null) {
if (result.getProxyDelegate() == null) {
DElement elem = (DElement) getConfiguration().getGraph().getElement(rawpid);
if (elem == null) {
rawpid = null;
}
}
}
if (rawpid == null) {
CustomProxyResolver resolver = getCustomProxyResolver();
if (resolver == null) {
System.err.println("No default resolver implemented yet");
throw new UnimplementedException("Generics resolution of proxied vertices not yet implemented");
} else {
// System.out.println("Resolving using a " + resolver.getClass().getName());
Map<String, Object> originalDelegate = resolver.getOriginalDelegate(originalKey);
if (originalDelegate instanceof Document) {
String pid = ((Document) originalDelegate).getMetaversalID();
NoteCoordinate nc = NoteCoordinate.Utils.getNoteCoordinate(pid);
// System.out.println("Setting up proxy with id " + nc.toString());
try {
result.setProxiedId(nc);
} catch (Throwable t) {
t.printStackTrace();
}
} else {
if (originalDelegate == null) {
// System.out.println("No original delegate found for key " + String.valueOf(originalKey));
} else {
// System.err.println("original delegate returned a " + originalDelegate.getClass().getName());
}
}
}
} else {
}
// System.out.println("Setup a proxy with an id of " + String.valueOf(result.getProxiedId()));
return result;
}
use of org.openntf.domino.exceptions.UnimplementedException in project org.openntf.domino by OpenNTF.
the class DEntryEdge method getVertexId.
@Override
public Object getVertexId(final Direction direction) {
if (Direction.OUT.equals(direction)) {
if (outKey_ == null) {
try {
ViewEntry entry = (org.openntf.domino.ViewEntry) getDelegate();
if (entry.isDocument()) {
String mid = entry.getDocument().getMetaversalID();
setOutId(NoteCoordinate.Utils.getNoteCoordinate(mid));
} else if (entry.isCategory()) {
String entryid = delegateKey_.toString();
String mid = "V" + entryid.substring(1);
setOutId(ViewEntryCoordinate.Utils.getViewEntryCoordinate(mid));
} else if (entry.isTotal()) {
setOutId("TOTAL");
// FIXME NTF Implement this please
} else {
Exception e = new UnimplementedException();
e.printStackTrace();
try {
throw e;
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
} catch (Throwable t) {
t.printStackTrace();
}
}
} else if (Direction.IN.equals(direction)) {
if (inKey_ == null) {
// NTF only occurs when EntryEdge is manifested by direct request from ID rather than iteration of EdgeEntryList
ViewEntryCoordinate vec = (ViewEntryCoordinate) delegateKey_;
String mid = vec.getViewDocument().getMetaversalID();
setInId(NoteCoordinate.Utils.getNoteCoordinate(mid));
}
}
return super.getVertexId(direction);
}
Aggregations