Skip to content
Snippets Groups Projects
Commit c7e5404f authored by Dr Nikos Dimokas's avatar Dr Nikos Dimokas
Browse files

No commit message

No commit message
parent 4c8824b5
No related branches found
No related tags found
No related merge requests found
......@@ -15,19 +15,19 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
private static BundleContext bc;
public Activator() {
}
public void start(BundleContext context) throws Exception {
super.start(context);
this.bc = context;
Bundle[] b = context.getBundles();
for (int i=0; i<b.length; i++){
BundleContext bc = b[i].getBundleContext();
long id = b[i].getBundleId();
//System.out.println("---");
//System.out.println(id);
//long id = b[i].getBundleId();
//String sname = b[i].getSymbolicName();
}
plugin = this;
}
......@@ -41,6 +41,10 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
public static BundleContext getBc() {
return bc;
}
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
......
......@@ -42,6 +42,8 @@ import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.universaal.tools.codeassistantapplication.editor.CodeAssistantEditor;
import org.universaal.tools.codeassistantapplication.editor.CodeAssistantEditorInput;
import org.universaal.tools.codeassistantapplication.editor.model.Entity;
......@@ -55,8 +57,8 @@ public class CodeAssistantView extends ViewPart{
private Vector selectedTypes=new Vector();
public void init(final Composite parent, IProgressMonitor monitor) {
//System.out.println("DOWNLOAD ONTOLOGIES");
/*
// Authentication
AuthenticationDialog dialog = new AuthenticationDialog(parent.getShell());
int result = dialog.open();
......@@ -64,11 +66,12 @@ public class CodeAssistantView extends ViewPart{
RepositoryClient.setAPIKey(dialog.getKey());
else
RepositoryClient.setAPIKey("");
*/
monitor.worked(30);
Startup s = new Startup();
boolean b = s.earlyStartup();
monitor.worked(50);
/*
if (!b) {
Button continueButton = new Button(parent.getShell(), SWT.PUSH);
continueButton.setText("Continue");
......@@ -90,6 +93,7 @@ public class CodeAssistantView extends ViewPart{
break;
}
}
*/
}
@Override
......
......@@ -15,8 +15,9 @@ import org.w3c.dom.NodeList;
public class RepositoryClient {
//static String REPOSITORY_URL = "http://155.207.85.53:8080/bioportal/ontologies";
//static String APIKey = "990fff23-51f4-479e-863b-21554d863ef9";
static String REPOSITORY_URL = "";
static String APIKey = "990fff23-51f4-479e-863b-21554d863ef9"; // apikey
static String APIKey = "";
static String pathToSaveFiles = "./";
......@@ -28,7 +29,11 @@ public class RepositoryClient {
try {
String p_url = Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_ONTOLOGY_REPOSITORY_URL);
REPOSITORY_URL=p_url;
//System.out.println("REPOSITORY_URL="+REPOSITORY_URL);
String p_apikey = Activator.getDefault().getPreferenceStore().getString(PreferenceConstants.P_ONTOLOGY_REPOSITORY_APIKEY);
APIKey=p_apikey;
//System.out.println("repo url="+REPOSITORY_URL);
//System.out.println("APIKey="+APIKey);
} catch (Exception e) {
e.printStackTrace();
}
......
......@@ -3,4 +3,5 @@ package org.universaal.tools.codeassistantapplication.ontologyrepository.prefere
public class PreferenceConstants {
public static final String P_ONTOLOGY_REPOSITORY_URL = "ontology_repository_url_preference";
public static final String P_ONTOLOGY_REPOSITORY_APIKEY = "ontology_repository_apikey_preference";
}
......@@ -11,6 +11,9 @@ public class PreferenceInitializer extends AbstractPreferenceInitializer {
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
store.setDefault(PreferenceConstants.P_ONTOLOGY_REPOSITORY_URL,
"http://155.207.85.53:8080/bioportal/ontologies");
store.setDefault(PreferenceConstants.P_ONTOLOGY_REPOSITORY_APIKEY,
"990fff23-51f4-479e-863b-21554d863ef9");
}
......
......@@ -11,6 +11,7 @@ public class PreferencePage
implements IWorkbenchPreferencePage{
private StringFieldEditor ontRepoUrlField;
private StringFieldEditor ontRepoApikeyField;
public PreferencePage(){
super(GRID);
......@@ -29,5 +30,11 @@ public class PreferencePage
"Ontology Repository URL",
getFieldEditorParent());
addField(ontRepoUrlField);
ontRepoApikeyField = new StringFieldEditor(
PreferenceConstants.P_ONTOLOGY_REPOSITORY_APIKEY,
"Ontology Repository APIKEY",
getFieldEditorParent());
addField(ontRepoApikeyField);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment