]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.project/src/org/simantics/project/management/DatabaseSpec.java
Fix CopyAdvisorUtil.copy2 to copy IsRelatedTo-statements left out before
[simantics/platform.git] / bundles / org.simantics.project / src / org / simantics / project / management / DatabaseSpec.java
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
7  *
8  * Contributors:
9  *     VTT Technical Research Centre of Finland - initial API and implementation
10  *******************************************************************************/
11 package org.simantics.project.management;
12
13 import java.util.ArrayList;
14 import java.util.List;
15
16 import org.simantics.db.ReadGraph;
17 import org.simantics.db.exception.DatabaseException;
18 import org.simantics.db.request.Read;
19
20 /**
21  * A description of database 
22  *
23  * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
24  */
25 public class DatabaseSpec {
26
27         // Installed Ontologies
28         public List<OntologySpec> ontologies = new ArrayList<OntologySpec>();
29         
30         // Installed Projects   
31         public List<ProjectSpec> projects = new ArrayList<ProjectSpec>();       
32         
33         
34         /** A query that reads database spec, projects ordered by URI, ontologies ordered by versionedId */
35         static Read<DatabaseSpec> QUERY = new Read<DatabaseSpec>() {
36                 @Override
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 );
41                         return spec;
42                 }
43         };
44         
45         
46 }
47