@Override public boolean saveItem(WorkspaceItem<?> item) { if (!item.getStatus().canBeSaved()) { return true; } List<IWorkspaceItemRepository> repos = getRepositories(item); if (repos == null) { return true; } for (IWorkspaceItemRepository repo : repos) { if (repo.save(item)) { return true; } } return false; }
@Override public boolean deleteItem(WorkspaceItem<?> item) { if (!item.getStatus().hasStorage()) { return true; } List<IWorkspaceItemRepository> repos = getRepositories(item); if (repos == null) { return true; } for (IWorkspaceItemRepository repo : repos) { if (repo.delete(item)) { return true; } } return false; }
@Override public boolean loadItem(WorkspaceItem<?> item) { IWorkspaceItemManager<?> manager = WorkspaceFactory.getInstance().getManager(item.getFamily()); if (manager == null) { return false; } List<IWorkspaceItemRepository> repos = getRepositories(manager.getItemClass()); if (repos == null) { return false; } for (IWorkspaceItemRepository repo : repos) { if (repo.load(item)) { return true; } } return false; }