import org.simantics.modeling.adapters.ChangeInformation;
import org.simantics.modeling.subscription.SubscriptionItemLabel;
import org.simantics.utils.format.ValueFormat;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class Bean {
+ private static final Logger LOGGER = LoggerFactory.getLogger(Bean.class);
+
public String createdBy = "";
public String modifiedBy = "";
public long modifiedAt = 0;
Resource parent = graph.getPossibleObject(r, L0.PartOf);
if(parent != null) {
String uri = graph.getPossibleURI(parent);
- if(uri.endsWith("/__CONTAINER__/__DIAGRAM__")) uri = uri.substring(0, uri.length()-"/__CONTAINER__/__DIAGRAM__".length());
- if(uri.endsWith("/__CONTAINER__")) uri = uri.substring(0, uri.length()-"/__CONTAINER__".length());
- if(uri.equals(baseURI)) uri = "<selected resource>";
- if(uri.startsWith(baseURI)) uri = uri.substring(baseURI.length());
- if(uri.startsWith("/Configuration/")) uri = uri.substring("/Configuration/".length());
-
- uri = uri.replace("http://Projects/Development%20Project/", "");
- uri = URIStringUtils.unescape(uri);
-
- if(graph.isInstanceOf(parent, MOD.Subscription)) {
+ if (uri != null) {
+ if(uri.endsWith("/__CONTAINER__/__DIAGRAM__")) uri = uri.substring(0, uri.length()-"/__CONTAINER__/__DIAGRAM__".length());
+ if(uri.endsWith("/__CONTAINER__")) uri = uri.substring(0, uri.length()-"/__CONTAINER__".length());
+ if(uri.equals(baseURI)) uri = "<selected resource>";
+ if(uri.startsWith(baseURI)) uri = uri.substring(baseURI.length());
+ if(uri.startsWith("/Configuration/")) uri = uri.substring("/Configuration/".length());
+
+ uri = uri.replace("http://Projects/Development%20Project/", "");
+ uri = URIStringUtils.unescape(uri);
+
+ if(graph.isInstanceOf(parent, MOD.Subscription)) {
- String name = graph.getPossibleRelatedValue(parent, L0.HasName, Bindings.STRING);
- String label = graph.getPossibleRelatedValue(parent, L0.HasLabel, Bindings.STRING);
- uri = uri.replace(name, label);
-
+ String name = graph.getPossibleRelatedValue(parent, L0.HasName, Bindings.STRING);
+ String label = graph.getPossibleRelatedValue(parent, L0.HasLabel, Bindings.STRING);
+ uri = uri.replace(name, label);
+
+ }
+
+ setPath(uri);
+ } else {
+ LOGGER.warn("Could not resolve path (URI) for parent resource {} of child {}", parent, r);
+ setPath("");
}
-
- setPath(uri);
} else {
setPath("");
}