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