View Javadoc

1   /*
2    WSMO Studio - a Semantic Web Service Editor
3    Copyright (c) 2004-2006, Ontotext Lab. / SIRMA Group
4    
5    This library is free software; you can redistribute it and/or modify it under
6    the terms of the GNU Lesser General Public License as published by the Free
7    Software Foundation; either version 2.1 of the License, or (at your option)
8    any later version.
9    This library is distributed in the hope that it will be useful, but WITHOUT
10   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   details.
13   You should have received a copy of the GNU Lesser General Public License along
14   with this library; if not, write to the Free Software Foundation, Inc.,
15   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16   */
17  
18  /***
19   * <p>Title: WSMO Studio</p>
20   * <p>Description: Semantic Web Service Editor</p>
21   * <p>Copyright:  Copyright (c) 2004-2006</p>
22   * <p>Company: Ontotext Lab. / SIRMA </p>
23   */
24  
25  package org.wsmostudio.repository.ordi;
26  
27  import java.util.*;
28  
29  import org.eclipse.core.resources.ResourcesPlugin;
30  import org.eclipse.jface.dialogs.MessageDialog;
31  import org.eclipse.ui.PlatformUI;
32  import org.wsmo.datastore.WsmoRepository;
33  import org.wsmo.factory.Factory;
34  import org.wsmostudio.runtime.*;
35  import org.wsmostudio.runtime.extension.Configurator;
36  
37  import com.ontotext.ordi.trree.TRREEAdapter;
38  
39  public class ORDIRepositoryConfigurator implements Configurator {
40  
41      
42      @SuppressWarnings("unchecked")    
43  	public Map getConfigurationData(WsmoRepository instance, boolean forceConfig) {
44          if (forceConfig == true) {
45              MessageDialog.openError(
46                      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
47                      "Not Configurable Repository",
48                      "The selected repository '" 
49                      + instance.getDescription() 
50                      + "' can not be configured!");
51              return null;
52          }
53          HashMap confData = new HashMap();
54          confData.put(Factory.WSMO_FACTORY, WSMORuntime.getRuntime().getWsmoFactory());
55          confData.put(Factory.LE_FACTORY, WSMORuntime.getRuntime().getLogExprFactory());
56          confData.put(Factory.DATA_FACTORY, WSMORuntime.getRuntime().getDataFactory());
57          
58          String workspacePath = ResourcesPlugin.getWorkspace().getRoot().getLocation().toString();
59          confData.put(TRREEAdapter.STORAGE_DIRECTORY, workspacePath + "/.metadata/");
60  
61          return confData;
62  	}
63  
64  }
65  
66  /*
67   * $Log$
68   * Revision 1.6  2006/07/13 11:21:29  alex_simov
69   * configurator did not report errors to the GUI when the conf file was not loaded
70   *
71   * Revision 1.5  2006/07/11 16:06:16  alex_simov
72   * depricated API usage removed
73   *
74   * Revision 1.4  2006/01/09 12:51:12  alex_simov
75   * Copyright message in header updated
76   *
77   * Revision 1.3  2005/12/07 15:37:48  alex_simov
78   * local storage directory redirected to the current workspace
79   *
80   * Revision 1.2  2005/12/01 13:59:54  alex_simov
81   * ui updates
82   *
83   * Revision 1.1  2005/11/30 14:51:12  alex_simov
84   * ORDI repository plugin
85   *
86   */