import org.simantics.db.ReadGraph;
import org.simantics.db.RequestProcessor;
import org.simantics.db.Resource;
+import org.simantics.db.common.utils.NameUtils;
import org.simantics.db.exception.DatabaseException;
import org.simantics.db.exception.ResourceNotFoundException;
import org.simantics.db.layer0.variable.Variable;
for(Resource childContributionResource :
g.getObjects(browseContextResource, vr.BrowseContext_HasChildContribution)) {
- ChildContribution contribution = ChildContribution.create(g, childContributionResource);
- browseContext.childContributions.put(contribution.getParentNodeType(), contribution);
- browseContext.parentContributions.put(contribution.getChildNodeType(), contribution);
+ try {
+ ChildContribution contribution = ChildContribution.create(g, childContributionResource);
+ browseContext.childContributions.put(contribution.getParentNodeType(), contribution);
+ browseContext.parentContributions.put(contribution.getChildNodeType(), contribution);
+ } catch (DatabaseException e) {
+ LOGGER.error("Failed to load child contribution " + NameUtils.getSafeName(g, childContributionResource), e);
+ }
}
for(Resource visualsContributionResource :
g.getObjects(browseContextResource, vr.BrowseContext_HasVisualsContribution)) {
- VisualsContribution.load(g, visualsContributionResource,
- browseContext.labelContributions,
- browseContext.imageContributions,
- browseContext.checkedStateContributions,
- browseContext.labelDecorationContributions,
- browseContext.imageDecorationContributions,
- browseContext.modifierContributions,
- browseContext.sorterContributions,
- browseContext.flatNodeContributions,
- browseContext.tooltipContributions
+ try {
+ VisualsContribution.load(g, visualsContributionResource,
+ browseContext.labelContributions,
+ browseContext.imageContributions,
+ browseContext.checkedStateContributions,
+ browseContext.labelDecorationContributions,
+ browseContext.imageDecorationContributions,
+ browseContext.modifierContributions,
+ browseContext.sorterContributions,
+ browseContext.flatNodeContributions,
+ browseContext.tooltipContributions
);
+ } catch (DatabaseException e) {
+ LOGGER.error("Failed to load visuals contribution " + NameUtils.getSafeName(g, visualsContributionResource), e);
+ }
}
}
//browseContext.visualize();