Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-03-12 13:27:25 -0500
committerrescobar2010-03-12 13:27:25 -0500
commit205aa057fa925d37a3a5375aa8418b9567e99c6d (patch)
treed33f80b9f727c479b8031aeb352494c38ad9878d /plugins/org.eclipse.osee.demo.db.connection
parent0e6d2b595cfb4d54eccdf3479e7c5d74d9c736a5 (diff)
downloadorg.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.tar.gz
org.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.tar.xz
org.eclipse.osee-205aa057fa925d37a3a5375aa8418b9567e99c6d.zip
Diffstat (limited to 'plugins/org.eclipse.osee.demo.db.connection')
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/.classpath7
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/.project28
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/META-INF/MANIFEST.MF13
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/OSGI-INF/demo.connection.contributor.xml7
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/build.properties6
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/DemoDbConnectionInfo.java29
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/internal/Activator.java36
-rw-r--r--plugins/org.eclipse.osee.demo.db.connection/support/osee.demo.db.connection.xml50
8 files changed, 176 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.demo.db.connection/.classpath b/plugins/org.eclipse.osee.demo.db.connection/.classpath
new file mode 100644
index 0000000000..8a8f1668cd
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.osee.demo.db.connection/.project b/plugins/org.eclipse.osee.demo.db.connection/.project
new file mode 100644
index 0000000000..4b75fbfa5d
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.osee.demo.db.connection</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.osee.demo.db.connection/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.demo.db.connection/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..65e6dcc7b2
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Connection Plug-in
+Bundle-SymbolicName: org.eclipse.osee.demo.db.connection;singleton:=true
+Bundle-Version: 0.9.2.qualifier
+Bundle-Activator: org.eclipse.osee.demo.db.connection.internal.Activator
+Bundle-Vendor: Boeing
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.osee.framework.core.data,
+ org.eclipse.osee.framework.database.core,
+ org.osgi.framework
+Service-Component: OSGI-INF/demo.connection.contributor.xml
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/org.eclipse.osee.demo.db.connection/OSGI-INF/demo.connection.contributor.xml b/plugins/org.eclipse.osee.demo.db.connection/OSGI-INF/demo.connection.contributor.xml
new file mode 100644
index 0000000000..43d4af0203
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/OSGI-INF/demo.connection.contributor.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0"?>
+<component name="demo.connection.contributor">
+ <implementation class="org.eclipse.osee.demo.db.connection.DemoDbConnectionInfo"/>
+ <service>
+ <provide interface="org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor"/>
+ </service>
+</component> \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.demo.db.connection/build.properties b/plugins/org.eclipse.osee.demo.db.connection/build.properties
new file mode 100644
index 0000000000..4a07e3b597
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ support/,\
+ OSGI-INF/
diff --git a/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/DemoDbConnectionInfo.java b/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/DemoDbConnectionInfo.java
new file mode 100644
index 0000000000..514baeba1d
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/DemoDbConnectionInfo.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.demo.db.connection;
+
+import java.net.URL;
+import org.eclipse.osee.demo.db.connection.internal.Activator;
+import org.eclipse.osee.framework.core.data.IDatabaseInfo;
+import org.eclipse.osee.framework.database.core.DatabaseInfoManager;
+import org.eclipse.osee.framework.database.core.IDbConnectionInformationContributor;
+
+/**
+ * @author Andrew M Finkbeiner
+ */
+public class DemoDbConnectionInfo implements IDbConnectionInformationContributor {
+
+ @Override
+ public IDatabaseInfo[] getDbInformation() throws Exception {
+ URL url = Activator.getEntry("/support/osee.demo.db.connection.xml");
+ return DatabaseInfoManager.readFromXml(url.openStream());
+ }
+}
diff --git a/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/internal/Activator.java b/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/internal/Activator.java
new file mode 100644
index 0000000000..1eb9db91db
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/src/org/eclipse/osee/demo/db/connection/internal/Activator.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.demo.db.connection.internal;
+
+import java.net.URL;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Roberto E. Escobar
+ */
+public class Activator implements BundleActivator {
+
+ private static Activator instance;
+ private BundleContext context;
+
+ public void start(BundleContext context) throws Exception {
+ instance = this;
+ this.context = context;
+ }
+
+ public void stop(BundleContext context) throws Exception {
+ }
+
+ public static URL getEntry(String path) {
+ return instance.context.getBundle().getEntry(path);
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.demo.db.connection/support/osee.demo.db.connection.xml b/plugins/org.eclipse.osee.demo.db.connection/support/osee.demo.db.connection.xml
new file mode 100644
index 0000000000..3d678398ff
--- /dev/null
+++ b/plugins/org.eclipse.osee.demo.db.connection/support/osee.demo.db.connection.xml
@@ -0,0 +1,50 @@
+<DbConnection>
+
+ <DatabaseInfo id="DerbyServer">
+ <DatabaseHome key="#DBHOME#" />
+ <DatabaseName key="#DBNAME#" value="DerbyDatabase" />
+ <DatabaseType key="#TYPE#" value="derby" />
+ <Prefix key="#PREFIX#" value="jdbc:derby" />
+ <UserName key="#USERNAME#" value="osee" />
+ <Password key="#PASSWORD#" value="oseeadmin" />
+ <Host key="#HOST#" value="@AvailableDbServices.hostAddress" />
+ <Port key="#PORT#" value="@AvailableDbServices.port" />
+ </DatabaseInfo>
+
+ <DatabaseInfo id="postgresqlInfo">
+ <DatabaseHome key="#DBHOME#" />
+ <DatabaseName key="#DBNAME#" value="OSEE" />
+ <DatabaseType key="#TYPE#" value="postgresql" />
+ <Prefix key="#PREFIX#" value="jdbc:postgresql" />
+ <UserName key="#USERNAME#" value="osee" />
+ <Password key="#PASSWORD#" value="osee" />
+ <Host key="#HOST#" value="@AvailableDbServices.hostAddress" />
+ <Port key="#PORT#" value="@AvailableDbServices.port" />
+ </DatabaseInfo>
+
+ <ConnectionDescription id="postgresql">
+ <Driver>org.postgresql.Driver</Driver>
+ <Url>#PREFIX#://#HOST#:#PORT#/#DBHOME##DBNAME#</Url>
+ </ConnectionDescription>
+
+ <ConnectionDescription id="NetDerbyClient">
+ <Driver>org.apache.derby.jdbc.ClientDriver</Driver>
+ <Url>#PREFIX#://#HOST#:#PORT#/#DBHOME##DBNAME#;</Url>
+ <UrlAttributes>
+ <Entry>create=true</Entry>
+ </UrlAttributes>
+ </ConnectionDescription>
+
+ <AvailableDbServices>
+
+ <Server id="derby" dbInfo="DerbyServer" hostAddress="127.0.0.1" port="1621" connectsWith="NetDerbyClient" />
+
+ <Server id="osee.microdoc" dbInfo="postgresqlInfo" hostAddress="78.46.71.230"
+ port="5432" connectsWith="postgresql" applicationServer="http://osee.microdoc.com:8089/" />
+
+ <Server id="postgresqlLocalhost" dbInfo="postgresqlInfo"
+ hostAddress="localhost" port="5432" connectsWith="postgresql"
+ applicationServer="http://localhost:8089/" />
+
+ </AvailableDbServices>
+</DbConnection> \ No newline at end of file

Back to the top