1 /*******************************************************************************
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * VTT Technical Research Centre of Finland - initial API and implementation
10 *******************************************************************************/
11 package org.simantics.project.management;
13 import java.util.ArrayList;
14 import java.util.List;
16 import org.simantics.db.ReadGraph;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.request.Read;
21 * A description of database
23 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
25 public class DatabaseSpec {
27 // Installed Ontologies
28 public List<OntologySpec> ontologies = new ArrayList<OntologySpec>();
31 public List<ProjectSpec> projects = new ArrayList<ProjectSpec>();
34 /** A query that reads database spec, projects ordered by URI, ontologies ordered by versionedId */
35 static Read<DatabaseSpec> QUERY = new Read<DatabaseSpec>() {
37 public DatabaseSpec perform(ReadGraph g) throws DatabaseException {
38 DatabaseSpec spec = new DatabaseSpec();
39 spec.projects = g.syncRequest( ProjectSpec.QUERY );
40 spec.ontologies = g.syncRequest( OntologySpec.QUERY );