1 package org.simantics.spreadsheet.graph.adapter;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.WriteGraph;
8 import org.simantics.db.exception.DatabaseException;
9 import org.simantics.db.layer0.adapter.impl.EntityRemover;
10 import org.simantics.spreadsheet.graph.SpreadsheetSessionManager;
12 public class SpreadsheetBookRemover extends EntityRemover {
14 public SpreadsheetBookRemover(Resource resource) {
19 public String canRemove(ReadGraph graph, Map<Object, Object> aux) throws DatabaseException {
20 return super.canRemove(graph, aux);
24 public void remove(WriteGraph graph) throws DatabaseException {
26 String bookURI = graph.getPossibleURI(resource);
27 if (bookURI != null) {
28 for (String realmId : SpreadsheetSessionManager.getInstance().getRealms()) {
29 if (realmId.startsWith(bookURI)) {
30 SpreadsheetSessionManager.getInstance().removeRealm(realmId);