diff --git a/ucc/ucc.api/.classpath b/ucc/ucc.api/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..055ab88b47c463d04379e9012c9988e1ee094256 --- /dev/null +++ b/ucc/ucc.api/.classpath @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/ucc/ucc.api/.project b/ucc/ucc.api/.project new file mode 100644 index 0000000000000000000000000000000000000000..7926ee25e70ce83717dd300d0919a22a028c9b75 --- /dev/null +++ b/ucc/ucc.api/.project @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ucc.api</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + </natures> +</projectDescription> diff --git a/ucc/ucc.api/.settings/org.eclipse.jdt.core.prefs b/ucc/ucc.api/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..74d46f7a8b39ce807bfa6fba6ff8628a44c77862 --- /dev/null +++ b/ucc/ucc.api/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Mon Jul 25 12:22:18 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/ucc/ucc.api/.settings/org.maven.ide.eclipse.prefs b/ucc/ucc.api/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000000000000000000000000000000000000..e465529f355e4e437928261ed5371ed8b58cc31b --- /dev/null +++ b/ucc/ucc.api/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Jul 15 11:05:10 CEST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/ucc/ucc.api/pom.xml b/ucc/ucc.api/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..fac677ee00b9079b5b542a906aec9046aac54eb2 --- /dev/null +++ b/ucc/ucc.api/pom.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.pom</artifactId> + <version>1.0.0</version> + <relativePath>../ucc.pom/pom.xml</relativePath> + </parent> + <artifactId>ucc.api</artifactId> + <version>0.0.1</version> + <name>API for the uCC</name> + <description>This API contains of interfaces for a model, a view and the core itself.</description> + <packaging>bundle</packaging> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.data.representation</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-Name>${project.name}</Bundle-Name> + <Bundle-Activator>org.universAAL.ucc.api.Activator</Bundle-Activator> + <Bundle-Description>${project.description}</Bundle-Description> + <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> + <Private-Package>org.universAAL.ucc.api.*</Private-Package> + <Export-Package>org.universAAL.ucc.api.core.*,org.universAAL.ucc.api.model.*,org.universAAL.ucc.api.view.*</Export-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + <repositories> + <repository> + <id>central</id> + <name>Central Maven Repository</name> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Snapshots</name> + <url>http://people.apache.org/repo/m2-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <updatePolicy>daily</updatePolicy> + </snapshots> + </repository> + <repository> + <id>uaal</id> + <name>universAAL Repositories</name> + <url>http://depot.universaal.org/maven-repo/releases/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>uaal-snapshots</id> + <name>universAAL Snapshot Repositories</name> + <url>http://depot.universaal.org/maven-repo/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> +</project> diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/Activator.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/Activator.java new file mode 100644 index 0000000000000000000000000000000000000000..ec5d176da4f6372fde5d2e2a8236a0c45447fa60 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/Activator.java @@ -0,0 +1,16 @@ +package org.universAAL.ucc.api; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; + +public class Activator implements BundleActivator{ + public static BundleContext context=null; + + public void start(BundleContext context) throws Exception { + Activator.context=context; + } + + public void stop(BundleContext arg0) throws Exception { + } + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IConfigurator.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IConfigurator.java new file mode 100644 index 0000000000000000000000000000000000000000..43b1db3151b2ac7487d5035efdf1bf4a7bb817e2 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IConfigurator.java @@ -0,0 +1,15 @@ +package org.universAAL.ucc.api.core; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.osgi.framework.Bundle; +import org.universAAL.middleware.owl.ManagedIndividual; + +public interface IConfigurator { + + public ManagedIndividual[] getOntologyContent(String uri); + public void performConfiguration(String Path); + public String finishConfiguration(String appName, ArrayList<Bundle> bundles, HashMap<String,String> conf); + public void testAMethod(); +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IDeinstaller.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IDeinstaller.java new file mode 100644 index 0000000000000000000000000000000000000000..3619fc0d23d4ac6cafaf3aab4ee442c1b4908f90 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IDeinstaller.java @@ -0,0 +1,7 @@ +package org.universAAL.ucc.api.core; + +public interface IDeinstaller { + + public boolean deinstallAppication(String appName); + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInformation.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInformation.java new file mode 100644 index 0000000000000000000000000000000000000000..101a2c94c349bdefa79616c1cfc727ffa6a338dd --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInformation.java @@ -0,0 +1,10 @@ +package org.universAAL.ucc.api.core; + +import org.osgi.framework.Bundle; + +public interface IInformation { + + public String[] activeBundles(); + public Bundle[] bundles(); + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInstaller.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInstaller.java new file mode 100644 index 0000000000000000000000000000000000000000..2737e90d07f6e0a0b69f1cd0b0e9dc9b6df47941 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/core/IInstaller.java @@ -0,0 +1,15 @@ +package org.universAAL.ucc.api.core; + +import java.io.File; +import java.util.ArrayList; + +import org.osgi.framework.Bundle; + +public interface IInstaller { + + public String installApplication(String path) throws Exception; + public ArrayList<Bundle> getInstalledBundles(); + public void resetBundles(); + public void revertInstallation(File folder); + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationManagment.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationManagment.java new file mode 100644 index 0000000000000000000000000000000000000000..c9a5df51366cd28e3166a12a2ee4e09531972908 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationManagment.java @@ -0,0 +1,18 @@ +package org.universAAL.ucc.api.model; + +import java.util.List; +import java.util.Map; + +public interface IApplicationManagment { + + public List<String> getInstalledApplications(); + public List<String> getAllInstalledBundles(); + public List<String> getInstalledBundles(String appName); + public boolean containsApplication(String appName); + public List<String> getBundles(String appName); + public boolean isEmpty(); + public Map<String, String> getConfiguration(String bundleName); + + + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationRegistration.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationRegistration.java new file mode 100644 index 0000000000000000000000000000000000000000..7d5aa5686b61da0c3504deae7ea84ccde00350dc --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IApplicationRegistration.java @@ -0,0 +1,14 @@ +package org.universAAL.ucc.api.model; + +import java.util.Map; + +public interface IApplicationRegistration { + + public boolean unregisterApplication(String appName); + public boolean unregisterBundle(String bundleName); + public boolean registerBundle(String appName, String bundleName); + public boolean registerApplication(String appName, Map<String, String> configuration); + + + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IModel.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IModel.java new file mode 100644 index 0000000000000000000000000000000000000000..8f32585816dce47a5ef26127f4d10b3001d2c4fa --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/model/IModel.java @@ -0,0 +1,8 @@ +package org.universAAL.ucc.api.model; + +public interface IModel { + + public IApplicationRegistration getApplicationRegistration(); + public IApplicationManagment getApplicationManagment(); + +} diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/IMainWindow.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/IMainWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..cf8c2d852b4ba844335671c218647027054feed0 --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/IMainWindow.java @@ -0,0 +1,24 @@ +package org.universAAL.ucc.api.view; + +/** + * @author Alex + * @version 1.0 + * @created 11-Jul-2011 16:45:44 + */ +public interface IMainWindow { + + /** + * + * @param subWindow + */ + public void addSubWindow(ISubWindow subWindow); + + /** + * + * @param subWindow + */ + public void closeSubWindow(ISubWindow subWindow); + + public boolean initialize(); + +} \ No newline at end of file diff --git a/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/ISubWindow.java b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/ISubWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..9ba0450daf19efd74f994f9da58205f915171a2c --- /dev/null +++ b/ucc/ucc.api/src/main/java/org/universAAL/ucc/api/view/ISubWindow.java @@ -0,0 +1,14 @@ +package org.universAAL.ucc.api.view; + +/** + * @author Alex + * @version 1.0 + * @created 11-Jul-2011 16:45:44 + */ +public interface ISubWindow { + + public boolean close(); + + public void initialize(); + +} \ No newline at end of file diff --git a/ucc/ucc.api/target/ucc.api-0.0.1.jar b/ucc/ucc.api/target/ucc.api-0.0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..01d439352beed5717af574ea2f2895b859b5b45d Binary files /dev/null and b/ucc/ucc.api/target/ucc.api-0.0.1.jar differ diff --git a/ucc/ucc.core/.classpath b/ucc/ucc.core/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..505c7192a516c57aff1e56ee8f44ccc0f9f7b4fd --- /dev/null +++ b/ucc/ucc.core/.classpath @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/ucc/ucc.core/.project b/ucc/ucc.core/.project new file mode 100644 index 0000000000000000000000000000000000000000..18ce0de92e0e8e0f7f9d50e3407c1784fc04f9dc --- /dev/null +++ b/ucc/ucc.core/.project @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ucc.core</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + </natures> +</projectDescription> diff --git a/ucc/ucc.core/.settings/org.eclipse.jdt.core.prefs b/ucc/ucc.core/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..2883c40863fa80083551c37d6eecfa0bb7535722 --- /dev/null +++ b/ucc/ucc.core/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Fri Jul 15 17:23:12 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/ucc/ucc.core/.settings/org.maven.ide.eclipse.prefs b/ucc/ucc.core/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f46ba52d64bafe8f841053f8eed388c59ead79c6 --- /dev/null +++ b/ucc/ucc.core/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Jul 15 11:49:55 CEST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/ucc/ucc.core/pom.xml b/ucc/ucc.core/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..66ad584d4894d8f5b5393f644388a1ec121de748 --- /dev/null +++ b/ucc/ucc.core/pom.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.pom</artifactId> + <version>1.0.0</version> + <relativePath>../ucc.pom/pom.xml</relativePath> + </parent> + <artifactId>ucc.core</artifactId> + <version>0.0.1</version> + <name>Core of the uCC</name> + <description>Provides the main functionalities of the uCC.</description> + <packaging>bundle</packaging> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.data.representation</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.bus.model</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.bus.io</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.api</artifactId> + <version>0.0.1</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-Name>${project.name}</Bundle-Name> + <Bundle-Activator>org.universAAL.ucc.core.Activator</Bundle-Activator> + <Bundle-Description>${project.description}</Bundle-Description> + <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> + <Private-Package>org.universAAL.ucc.core.*</Private-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + <repositories> + <repository> + <id>central</id> + <name>Central Maven Repository</name> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Snapshots</name> + <url>http://people.apache.org/repo/m2-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <updatePolicy>daily</updatePolicy> + </snapshots> + </repository> + <repository> + <id>uaal</id> + <name>universAAL Repositories</name> + <url>http://depot.universaal.org/maven-repo/releases/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>uaal-snapshots</id> + <name>universAAL Snapshot Repositories</name> + <url>http://depot.universaal.org/maven-repo/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> +</project> diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/Activator.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/Activator.java new file mode 100644 index 0000000000000000000000000000000000000000..7b4efab7f7378a875e28d091220095e256cb4e80 --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/Activator.java @@ -0,0 +1,121 @@ +package org.universAAL.ucc.core; + +import java.io.File; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; +import org.universAAL.middleware.io.rdf.Form; +import org.universAAL.middleware.io.rdf.Group; +import org.universAAL.middleware.io.rdf.InputField; +import org.universAAL.middleware.io.rdf.Label; +import org.universAAL.middleware.io.rdf.Select1; +import org.universAAL.middleware.io.rdf.Submit; +import org.universAAL.middleware.io.rdf.TextArea; +import org.universAAL.middleware.rdf.PropertyPath; +import org.universAAL.middleware.sodapop.msg.MessageContentSerializer; + +import org.universAAL.ucc.api.core.IConfigurator; +import org.universAAL.ucc.api.core.IDeinstaller; +import org.universAAL.ucc.api.core.IInformation; +import org.universAAL.ucc.api.core.IInstaller; +import org.universAAL.ucc.api.model.IModel; +import org.universAAL.ucc.core.configuration.Configurator; +import org.universAAL.ucc.core.information.Information; +import org.universAAL.ucc.core.installation.Deinstaller; +import org.universAAL.ucc.core.installation.Installer; + +/** + * The uCCCore is the connection to the OSGi Framework and therefore need to have + * an Activator. Other part of the uCC (View and Plug-Ins) not necessary need to + * be valid bundles and maybe can get there information from the core (if needed). + * @author amarinc + * @version 1.0 + * @updated 11-Jul-2011 16:37:33 + */ +public class Activator implements BundleActivator { + private static BundleContext context = null; + private static String rundir = "c:"+File.separator; + + private static MessageContentSerializer contentSerializer = null; + + private static IModel model = null; + + private IInstaller installer = null; + private IDeinstaller deinstaller = null; + private IInformation information = null; + private IConfigurator configurator = null; + + public static IModel getModel() { + return model; + } + + public static synchronized void testForm() { + //if (Constants.debugMode()) { + if (contentSerializer == null) { + ServiceReference sr = context.getServiceReference(MessageContentSerializer.class.getName()); + if (sr == null) + return; + + contentSerializer = (MessageContentSerializer) context.getService(sr); + } + + Form f = Form.newDialog("TestForm", (String)null); + Group controls = f.getIOControls(); + Group submits = f.getSubmits(); + + new InputField(controls,new Label("Your Adress:",(String)null),new PropertyPath(null,false,new String[]{"http://myinput#InputField1"}),null,""); + new InputField(controls,new Label("Your Phone-Number:",(String)null),new PropertyPath(null,false,new String[]{"http://myinput#InputField2"}),null,""); + Select1 ms1=new Select1(controls,new Label("Enable SMS Messages:",(String)null),new PropertyPath(null, false, new String[]{"http://myinput#MySelect"}),null,""); + ms1.generateChoices(new String[]{"Yes", "No"}); + new TextArea(controls,new Label("SMS message text (optional)",(String)null),new PropertyPath(null,false,new String[]{"http://myinput#MyTextArea"}),null,""); + + Label labelBoton = new Label("OK",null); + new Submit(submits,labelBoton,"OK_TEST"); + + String str = contentSerializer.serialize(f); + System.out.println(); + System.out.println(str); + System.out.println(); + //} + } + + public static String getRundir() { + return rundir; + } + + public void start(BundleContext context) throws Exception { + Activator.context = context; + ServiceReference sr = context.getServiceReference(IModel.class.getName()); + if (sr == null) + return; + Object o = context.getService(sr); + Activator.model = (IModel)o; + + String bundlePath = Activator.context.getBundle().getLocation(); + Activator.rundir = bundlePath.substring(bundlePath.indexOf("/")+1,bundlePath.lastIndexOf("/")); + Activator.rundir= Activator.rundir.replace("/", "\\"); + + this.installer = new Installer(context); + this.deinstaller = new Deinstaller(context); + this.information = new Information(context); + this.configurator = new Configurator(context); + + context.registerService(new String[] { IInstaller.class.getName() }, installer, null); + context.registerService(new String[] { IDeinstaller.class.getName() }, deinstaller, null); + context.registerService(new String[] { IInformation.class.getName() }, information, null); + context.registerService(new String[] { IConfigurator.class.getName() }, configurator, null); + + + + + + //Activator.model.getApplicationRegistration().registerApplicaton("testApp"); + + } + + public void stop(BundleContext arg0) throws Exception { + + } + +} \ No newline at end of file diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/configuration/Configurator.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/configuration/Configurator.java new file mode 100644 index 0000000000000000000000000000000000000000..0f59b2a58a097c663c11f93683ae3dcf8e111b57 --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/configuration/Configurator.java @@ -0,0 +1,88 @@ +package org.universAAL.ucc.core.configuration; + +import java.util.ArrayList; +import java.util.Dictionary; +import java.util.HashMap; +import java.util.Iterator; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.universAAL.middleware.owl.ManagedIndividual; +import org.universAAL.ucc.api.core.IConfigurator; +import org.universAAL.ucc.core.Activator; + + +/** + * @author Alex + * @version 1.0 + * @created 11-Jul-2011 15:57:26 + */ +public class Configurator implements IConfigurator { + private BundleContext context; + + public Configurator(BundleContext con){ + context=con; + } + + public void finalize() throws Throwable { + + } + + /** + * Path = Path to configuration file + * + * @param Path Path to Configuration-File is needed + */ + private void checkIfConfigurationNeeded(String Path){ + + } + + /** + * Solve meta-information for concepts (like "this field should contains all + * instances of oven") + * + * @param uri + */ + public ManagedIndividual[] getOntologyContent(String uri){ + return null; + } + + public String finishConfiguration(String appName, ArrayList<Bundle> bundles, HashMap<String,String> conf){ + if(!Activator.getModel().getApplicationRegistration().registerApplication(appName, conf)) + return "App Registration failed!"; + Iterator<Bundle> itr=bundles.iterator(); + while(itr.hasNext()){ + Bundle b=itr.next(); + if(!Activator.getModel().getApplicationRegistration().registerBundle(appName, generateBundleName(b))) + return "Bundle Registration failed!"; + if(b.getState()==Bundle.INSTALLED){ + try { + b.start(); + } catch (BundleException e) { + + return "Error starting Bundle "+b.getSymbolicName()+": "+e.getMessage(); + } + } + } + + return null; + } + private String generateBundleName(Bundle bundle){ + Dictionary dict = bundle.getHeaders(); + return(bundle.getSymbolicName()+"_"+dict.get("Bundle-Version")); + } + + /** + * + * @param Path + */ + public void performConfiguration(String Path){ + + } + + public void testAMethod(){ + System.out.println("This is a Test!"); + } + +} \ No newline at end of file diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/information/Information.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/information/Information.java new file mode 100644 index 0000000000000000000000000000000000000000..d600a1139aafb00eb606c262898c7cfaede55741 --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/information/Information.java @@ -0,0 +1,36 @@ +package org.universAAL.ucc.core.information; + +import java.util.ArrayList; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.universAAL.ucc.api.core.IInformation; + +public class Information implements IInformation { + + private BundleContext context = null; + + public Information(BundleContext context) { + this.context = context; + } + + @Override + public String[] activeBundles() { + Bundle[] bundles = context.getBundles(); + ArrayList<String> activeBundles = new ArrayList<String>(); + + for (int i = 0; i<bundles.length; i++) + if (bundles[i].getState() == Bundle.ACTIVE) + activeBundles.add(bundles[i].getSymbolicName()); + + String[] result = new String[activeBundles.size()]; + + return activeBundles.toArray(result); + } + + @Override + public Bundle[] bundles() { + return context.getBundles(); + } + +} diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/ApplicationManager.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/ApplicationManager.java new file mode 100644 index 0000000000000000000000000000000000000000..8f2d1cbd46e18e9f654c522e3c473de70000c8c1 --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/ApplicationManager.java @@ -0,0 +1,19 @@ +package org.universAAL.ucc.core.installation; + +import java.io.File; + +public class ApplicationManager { + + public String[] getInstalledApps() { + return new String[0]; + } + + protected String[] getRelatedFiles(String appName) { + return new String[0]; + } + + protected String generateAppName(String path) { + return path; + } + +} diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Deinstaller.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Deinstaller.java new file mode 100644 index 0000000000000000000000000000000000000000..f1bc17018b2fc7438cf13405304ecf42c00cca9d --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Deinstaller.java @@ -0,0 +1,76 @@ +package org.universAAL.ucc.core.installation; + +import java.io.File; +import java.util.Dictionary; +import java.util.Iterator; +import java.util.List; + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.universAAL.ucc.api.core.IDeinstaller; +import org.universAAL.ucc.api.model.IApplicationManagment; +import org.universAAL.ucc.api.model.IApplicationRegistration; +import org.universAAL.ucc.core.Activator; + + +public class Deinstaller extends ApplicationManager implements IDeinstaller { + private IApplicationManagment manager=Activator.getModel().getApplicationManagment(); + private IApplicationRegistration register= Activator.getModel().getApplicationRegistration(); + private BundleContext context; + + public Deinstaller(BundleContext con){ + context=con; + } + + public boolean deinstallAppication(String appName) { + if(!manager.containsApplication(appName)) + return false; + List<String> bundles=manager.getBundles(appName); + Iterator<String> itr=bundles.iterator(); + while(itr.hasNext()){ + if(!deinstallBundle(itr.next())) + return false; + } + return true; + + } + + private boolean deinstallBundle(String bundleName) { + return register.unregisterBundle(bundleName); + } + + private boolean removeData(String appDir, List<String> bundles){ + Bundle[] installedBundles=context.getBundles(); + Iterator<String> itr= bundles.iterator(); + String version,name; + String versionInstalled,nameInstalled; + while(itr.hasNext()){ + String[] temp=itr.next().split("_"); + name=temp[0]; + version=temp[1]; + for(int i=0;i<installedBundles.length;i++){ + Dictionary dict = installedBundles[i].getHeaders(); + nameInstalled=installedBundles[i].getSymbolicName(); + versionInstalled=(String) dict.get("Bundle-Version"); + if(name.equals(nameInstalled)& version.equals(versionInstalled)) + try { + installedBundles[i].uninstall(); + } catch (BundleException e) { + return false; + } + } + } + deleteFolder(new File(appDir)); + return true; + } + public static void deleteFolder(File folder){ + File[] df=folder.listFiles(); + if(df==null) return; + for(int i=0;i<df.length;i++){ + df[i].delete(); + } + folder.delete(); + } + +} diff --git a/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Installer.java b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Installer.java new file mode 100644 index 0000000000000000000000000000000000000000..54f1adc561c2848f27737e47a80908c61ed55547 --- /dev/null +++ b/ucc/ucc.core/src/main/java/org/universAAL/ucc/core/installation/Installer.java @@ -0,0 +1,186 @@ +package org.universAAL.ucc.core.installation; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.Iterator; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + + +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.osgi.framework.BundleException; +import org.universAAL.ucc.api.core.IInstaller; +import org.universAAL.ucc.core.Activator; + + +/** + * @author Alex + * @version 1.0 + * @created 11-Jul-2011 15:57:26 + */ +public class Installer extends ApplicationManager implements IInstaller { + + private BundleContext context; + private ArrayList<Bundle> installedBundles=new ArrayList<Bundle>(); + public Installer(BundleContext con) { + context=con; + } + + public Installer(String path) throws Exception { + installApplication(path); + } + + public void finalize() throws Throwable { + System.out.println(); + } + + /** + * + * @param Path + * @throws Exception + */ + public String installApplication(String path) throws Exception { + + String exdir=extractBundles(path); + if(exdir==null)throw new Exception("Error extracting uaal Package"); + File appDir=new File(exdir); + checkApplicationForInstall(appDir); + String[] bundlelist=appDir.list(); + for(int i=0;i<bundlelist.length;i++){ + if(bundlelist[i].endsWith(".jar")){ + Bundle temp=installBundle(exdir+File.separator+bundlelist[i]); + if(temp==null){ + revertInstallation(appDir); + throw new Exception("Error installing Bundle "+ bundlelist[i]); + } + installedBundles.add(temp); + } + } + return exdir; + } + + /** + * Is bundle valid? All need files available? Dependencies to check and all + * right? Check if concrete instances available (but how)? + * + * @param Path + * @throws Exception + */ + private void checkApplicationForInstall(File folder) throws Exception { + String[] content = folder.list(); + boolean jarok=false; + boolean configok=false; + boolean eulaok=false; + for(int i=0;i<content.length;i++){ + if(content[i].endsWith(".jar")) jarok=true; + if(content[i].equals("config.xml")) configok=true; + if(content[i].equals("EULA.txt")) eulaok=true; + } + if(!jarok) throw new Exception("There is no installable jar File in uaal Package!"); + if(!configok) throw new Exception("config.xml file not found!"); + if(!eulaok) throw new Exception("No License agreement found!"); + } + + + + /** + * + * @param Path + */ + private Bundle installBundle(String path) { + try { + + Bundle neu=context.installBundle("file:"+path); + System.out.println("===================================="); + System.out.println("BundleID: "+neu.getBundleId()); + System.out.println("Location: "+neu.getLocation()); + System.out.println("state: "+neu.getState()); + System.out.println("symbolic Name: "+neu.getSymbolicName()); + System.out.println("===================================="); + return neu; + } catch (BundleException e) { + System.out.println("Error installing bundle"); + return null; + } + } + public ArrayList<Bundle> getInstalledBundles(){ + return installedBundles; + } + public void resetBundles(){ + installedBundles.clear(); + } + + public boolean copy(File inputFile, File outputFile) { + try { + FileReader in = new FileReader(inputFile); + FileWriter out = new FileWriter(outputFile); + int c; + + while ((c = in.read()) != -1) + out.write(c); + + in.close(); + out.close(); + } catch (Exception e) { + return false; + } + return true; + } + + +private String extractBundles(String path) { + + String destDir = path.substring(path.lastIndexOf(File.separator) + 1,path.lastIndexOf(".")); + destDir =Activator.getRundir() + File.separator + destDir; + File appDir=new File(destDir); + int suffix=1; + while(appDir.exists()){ + destDir=destDir.substring(0, destDir.length())+suffix; + appDir=new File(destDir); + suffix++; + } + appDir.mkdir(); + try { + JarFile jar; + jar = new JarFile(path); + Enumeration<JarEntry> e = jar.entries(); + while (e.hasMoreElements()) { + JarEntry file = (JarEntry) e.nextElement(); + File f = new File(destDir + File.separator + file.getName()); + InputStream is = jar.getInputStream(file); // get the input stream + FileOutputStream fos = new java.io.FileOutputStream(f); + while (is.available() > 0) { // write contents of 'is' to 'fos' + fos.write(is.read()); + } + fos.close(); + is.close(); + } + return destDir; + } catch (IOException e1) { + Deinstaller.deleteFolder(appDir); + return null; + } + } + +public void revertInstallation(File folder){ + Iterator<Bundle> itr=installedBundles.iterator(); + while(itr.hasNext()){ + try { + Bundle b=itr.next(); + if(!(b.getState()==Bundle.UNINSTALLED)) + b.uninstall(); + } catch (BundleException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + Deinstaller.deleteFolder(folder); +} +} \ No newline at end of file diff --git a/ucc/ucc.core/target/ucc.core-0.0.1.jar b/ucc/ucc.core/target/ucc.core-0.0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..41d42b1b81bea991e3751759ced1b2a26cebe3ba Binary files /dev/null and b/ucc/ucc.core/target/ucc.core-0.0.1.jar differ diff --git a/ucc/ucc.model/.classpath b/ucc/ucc.model/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..505c7192a516c57aff1e56ee8f44ccc0f9f7b4fd --- /dev/null +++ b/ucc/ucc.model/.classpath @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/ucc/ucc.model/.project b/ucc/ucc.model/.project new file mode 100644 index 0000000000000000000000000000000000000000..9f094e60890c4fd272bf679264cb682e93b47670 --- /dev/null +++ b/ucc/ucc.model/.project @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ucc.model</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + </natures> +</projectDescription> diff --git a/ucc/ucc.model/.settings/org.eclipse.jdt.core.prefs b/ucc/ucc.model/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..922656a558897b507ad0f52dfaf05f45603ad1a2 --- /dev/null +++ b/ucc/ucc.model/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Fri Jul 15 17:22:59 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/ucc/ucc.model/.settings/org.maven.ide.eclipse.prefs b/ucc/ucc.model/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f46ba52d64bafe8f841053f8eed388c59ead79c6 --- /dev/null +++ b/ucc/ucc.model/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Jul 15 11:49:55 CEST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/ucc/ucc.model/pom.xml b/ucc/ucc.model/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..eeec937a3d904652dbfb4b5bad877a31ccd8fe4d --- /dev/null +++ b/ucc/ucc.model/pom.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.pom</artifactId> + <version>1.0.0</version> + <relativePath>../ucc.pom/pom.xml</relativePath> + </parent> + <artifactId>ucc.model</artifactId> + <version>0.0.1</version> + <name>Model of the uCC</name> + <description>This bundle is responsible to manage all needed data for the uCC like listing of installed applications.</description> + <packaging>bundle</packaging> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.data.representation</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.api</artifactId> + <version>0.0.1</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-Name>${project.name}</Bundle-Name> + <Bundle-Activator>org.universAAL.ucc.model.Activator</Bundle-Activator> + <Bundle-Description>${project.description}</Bundle-Description> + <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> + <Private-Package>org.universAAL.ucc.model.*</Private-Package> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + <repositories> + <repository> + <id>central</id> + <name>Central Maven Repository</name> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Snapshots</name> + <url>http://people.apache.org/repo/m2-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <updatePolicy>daily</updatePolicy> + </snapshots> + </repository> + <repository> + <id>uaal</id> + <name>universAAL Repositories</name> + <url>http://depot.universaal.org/maven-repo/releases/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>uaal-snapshots</id> + <name>universAAL Snapshot Repositories</name> + <url>http://depot.universaal.org/maven-repo/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> +</project> diff --git a/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Activator.java b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Activator.java new file mode 100644 index 0000000000000000000000000000000000000000..14d07e7577a9e13fbc502f6f587ffcafc497463d --- /dev/null +++ b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Activator.java @@ -0,0 +1,28 @@ +package org.universAAL.ucc.model; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.universAAL.ucc.api.model.IModel; + +public class Activator implements BundleActivator { + public static BundleContext context=null; + + private static IModel model; + + public void start(BundleContext context) throws Exception { + Activator.context=context; + + model = new Model(); + + context.registerService(new String[] { IModel.class.getName() }, model, null); + } + + public void stop(BundleContext arg0) throws Exception { + + } + + public static IModel getModel() { + return model; + } + +} diff --git a/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationManagment.java b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationManagment.java new file mode 100644 index 0000000000000000000000000000000000000000..22f3ee6e05bacaf874f46d51b133d4c6d81de47a --- /dev/null +++ b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationManagment.java @@ -0,0 +1,154 @@ +package org.universAAL.ucc.model; + +import java.util.List; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import org.universAAL.ucc.api.model.IApplicationManagment; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +public class ApplicationManagment implements IApplicationManagment{ + + public List<String> getInstalledApplications(){ + if(new File(Model.FILENAME).exists()){ + List<String> list = new ArrayList<String>(); + Document doc = Model.getDocument(); + NodeList nodeList = doc.getElementsByTagName("application"); + for(int i = 0; i < nodeList.getLength(); i++){ + Element element = (Element) nodeList.item(i); + list.add(element.getAttribute("name")); + } + + return list; + + }else{ + return new ArrayList<String>(); + } + } + + public List<String> getAllInstalledBundles(){ + if(new File(Model.FILENAME).exists()){ + List<String> list = new ArrayList<String>(); + Document doc = Model.getDocument(); + NodeList nodeList = doc.getElementsByTagName("application"); + for(int i = 0; i < nodeList.getLength(); i++){ + NodeList nl = nodeList.item(i).getChildNodes(); + for(int j = 0; j < nl.getLength(); j++){ + Element element = (Element) nl.item(j); + list.add(element.getAttribute("name")); + } + } + + return list; + }else{ + return new ArrayList<String>(); + } + } + + public List<String> getInstalledBundles(String appName){ + List<String> list = new ArrayList<String>(); + if(new File(Model.FILENAME).exists()){ + Document doc = Model.getDocument(); + NodeList nodeList = doc.getElementsByTagName("application"); + for(int i = 0; i < nodeList.getLength(); i++){ + Element el = (Element) nodeList.item(i); + if(el.getAttribute("name").equals(appName)){ + NodeList nl = el.getChildNodes(); + for(int j = 0; j < nl.getLength(); j++){ + Element element = (Element) nl.item(j); + list.add(element.getAttribute("name")); + } + } + } + } + return list; + } + + public boolean containsApplication(String appName){ + + Document doc = Model.getDocument(); + NodeList nodeList = null; + + try{ + nodeList = doc.getChildNodes(); + }catch(Exception e){ + return false; + } + + for(int i = 0; i< nodeList.getLength(); i++){ + Element el = (Element) nodeList.item(i); + try{ + if(el.getAttribute("name").equals(appName)){ + return true; + } + }catch(Exception e){ + } + } + return false; + } + + public boolean isEmpty(){ + try{ + Document doc = Model.getDocument(); + doc.getChildNodes(); + }catch(Exception e){ + return false; + } + return true; + } + + public static Element getApplication(String appName, Document doc){ + NodeList nodeList = doc.getChildNodes(); + for(int i = 0; i < nodeList.getLength() ; i++){ + Element el = (Element) nodeList.item(i); + if(el.getAttribute("name").equals(appName)){ + return el; + } + } + return null; + } + + public static Element getBundle(String bundleName, Document doc){ + NodeList nodeList = doc.getChildNodes(); + + for(int i = 0 ; i < nodeList.getLength() ; i++){ + NodeList nl = nodeList.item(i).getChildNodes(); + for(int j = 0 ; i < nl.getLength() ; j++){ + Element el = (Element) nl.item(j); + if(el.getAttribute("name").equals(bundleName)){ + return el; + } + } + } + return null; + + } + + public Map<String, String> getConfiguration(String appName){ + Document doc = Model.getDocument(); + NamedNodeMap nodeMap = getApplication(appName, doc).getAttributes(); + Map<String, String> returnMap = new HashMap<String, String>(); + for(int i = 0; i < nodeMap.getLength(); i++){ + Node node = nodeMap.item(i); + returnMap.put(node.getNodeName(), node.getNodeValue()); + } + return returnMap; + } + + public List<String> getBundles(String appName){ + Document doc = Model.getDocument(); + NodeList nodeList = getApplication(appName, doc).getChildNodes(); + List<String> returnList = new ArrayList<String>(); + for(int i = 0; i < nodeList.getLength(); i++){ + Element el = (Element) nodeList.item(i); + returnList.add(el.getAttribute("name")); + } + return returnList; + } +} diff --git a/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationRegistration.java b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationRegistration.java new file mode 100644 index 0000000000000000000000000000000000000000..e9cb4d55605c92f6fbe6ea2ef2c039d83e4c40dd --- /dev/null +++ b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/ApplicationRegistration.java @@ -0,0 +1,120 @@ +package org.universAAL.ucc.model; + +import java.util.Map; +import java.util.Map.Entry; + +import javax.xml.transform.TransformerConfigurationException; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import org.universAAL.ucc.api.model.IApplicationRegistration; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class ApplicationRegistration implements IApplicationRegistration { + + public boolean unregisterApplication(String appName) { + Document doc = Model.getDocument(); + doc.removeChild(ApplicationManagment.getApplication(appName, doc)); + + try { + TransformerFactory.newInstance().newTransformer().transform( + new DOMSource(doc), new StreamResult(Model.FILENAME)); + } catch (TransformerConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerFactoryConfigurationError e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return true; + } + + public boolean unregisterBundle(String bundleName) { + Document doc = Model.getDocument(); + doc.removeChild(ApplicationManagment.getBundle(bundleName, doc)); + + try { + TransformerFactory.newInstance().newTransformer().transform( + new DOMSource(doc), new StreamResult(Model.FILENAME)); + } catch (TransformerConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerFactoryConfigurationError e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return true; +} + + + public boolean registerBundle(String appName, String bundleName) { + if(Activator.getModel().getApplicationManagment().containsApplication(appName) + && !Activator.getModel().getApplicationManagment().getInstalledBundles(appName).contains(bundleName)){ + + return addBundleToXML(appName, bundleName); + }else{ + return false; + } + } + + public boolean registerApplication(String appName, Map<String, String> configuration) { + return addApplicationToXML(appName, configuration); + } + + private boolean addBundleToXML(String appName, String bundleName){ + boolean success = true; + try { + + Document doc = Model.getDocument(); + + Element element = ApplicationManagment.getApplication(appName, doc); + Element bundleRoot = doc.createElement("bundle"); + element.appendChild(bundleRoot); + + bundleRoot.setAttribute("name", bundleName); + + TransformerFactory.newInstance().newTransformer().transform( + new DOMSource(doc), new StreamResult(Model.FILENAME)); + + } catch (Exception e){ + e.printStackTrace(); + success = false; + } + return success; + } + + private boolean addApplicationToXML(String appName, Map<String, String> configuration){ + boolean success = true; + try { + Document doc = Model.getDocument(); + Element appRoot = doc.createElement("application"); + doc.appendChild(appRoot); + appRoot.setAttribute("name", appName); + + for(Entry<String, String> entry : configuration.entrySet()){ + appRoot.setAttribute(entry.getKey(), entry.getValue()); + } + + TransformerFactory.newInstance().newTransformer().transform( + new DOMSource(doc), new StreamResult(Model.FILENAME)); + + } catch (Exception e){ + e.printStackTrace(); + success = false; + } + return success; + } + + + +} diff --git a/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Model.java b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Model.java new file mode 100644 index 0000000000000000000000000000000000000000..d69d6264bf25c3f51def3ba24200198d510a74c9 --- /dev/null +++ b/ucc/ucc.model/src/main/java/org/universAAL/ucc/model/Model.java @@ -0,0 +1,49 @@ +package org.universAAL.ucc.model; + +import java.io.File; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +import org.universAAL.ucc.api.model.IApplicationManagment; +import org.universAAL.ucc.api.model.IApplicationRegistration; +import org.universAAL.ucc.api.model.IModel; +import org.w3c.dom.Document; + +public class Model implements IModel { + + private IApplicationRegistration appReg; + private IApplicationManagment appMan; + public final static String FILENAME = "applications.xml"; + + public Model() { + appReg = (IApplicationRegistration)(new ApplicationRegistration()); + appMan = (IApplicationManagment) (new ApplicationManagment()); + } + + public IApplicationRegistration getApplicationRegistration() { + return appReg; + } + + public IApplicationManagment getApplicationManagment() { + return appMan; + } + + static protected Document getDocument(){ + File file = new File(FILENAME); + try { + if(file.exists()){ + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + DocumentBuilder db; + db = dbf.newDocumentBuilder(); + return db.parse(file); + }else{ + return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument(); + } + + } catch (Exception e) { + return null; + } + } + +} diff --git a/ucc/ucc.model/target/ucc.model-0.0.1.jar b/ucc/ucc.model/target/ucc.model-0.0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..158723ce78a1bf136cea7286c721fe43cb82e1a8 Binary files /dev/null and b/ucc/ucc.model/target/ucc.model-0.0.1.jar differ diff --git a/ucc/ucc.pom/.launches/uCC.launch b/ucc/ucc.pom/.launches/uCC.launch new file mode 100644 index 0000000000000000000000000000000000000000..54f237bb9b8f63cddaf3c4f401c4ca7158a7430e --- /dev/null +++ b/ucc/ucc.pom/.launches/uCC.launch @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.EquinoxLauncher"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="false"/> +<stringAttribute key="configLocation" value="${workspace_loc}/rundir/smp.lighting"/> +<booleanAttribute key="default_auto_start" value="true"/> +<intAttribute key="default_start_level" value="8"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.pde.ui.launcher.PDESourceLookupDirector"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;ucc.viewjambi&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/mw.bus.context/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/mw.bus.model/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/mw.bus.service/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/mw.data.representation/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/mw.data.serialization/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/ont.lighting/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/ont.phWorld/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/smp.lighting.client/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;folder nest=&quot;false&quot; path=&quot;/smp.lighting.server/src/main/java&quot;/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.folder"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> +<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-console --obrRepositories=http://a1gforge.igd.fraunhofer.de/nexus/content/repositories/snapshots/repository.xml,http://a1gforge.igd.fraunhofer.de/nexus/content/repositories/releases/repository.xml,http://bundles.osgi.org/obr/browse?_xml=1&amp;cmd=repository --org.ops4j.pax.url.mvn.repositories=+http://a1gforge.igd.fraunhofer.de/nexus/content/groups/public,http://a1gforge.igd.fraunhofer.de/nexus/content/repositories/snapshots@snapshots@noreleases --log=DEBUG"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.noShutdown=true -Dfelix.log.level=4 -Dorg.universAAL.middleware.peer.is_coordinator=true -Dorg.universAAL.middleware.peer.member_of=urn:org.universAAL.aal_space:test_env -Dbundles.configuration.location=${workspace_loc}/rundir/confadmin"/> +<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc}/rundir/smp.lighting"/> +<stringAttribute key="org.ops4j.pax.cursor.logLevel" value="DEBUG"/> +<booleanAttribute key="org.ops4j.pax.cursor.overwrite" value="false"/> +<booleanAttribute key="org.ops4j.pax.cursor.overwriteSystemBundles" value="false"/> +<booleanAttribute key="org.ops4j.pax.cursor.overwriteUserBundles" value="false"/> +<listAttribute key="org.ops4j.pax.cursor.profiles"> +<listEntry value="obr"/> +</listAttribute> +<mapAttribute key="org.ops4j.pax.cursor.provisionItems"> +<mapEntry key="mvn:org.universAAL.middleware/mw.data.serialization" value="true@true@4@false"/> +<mapEntry key="mvn:org.universAAL.ucc/ucc.viewjambi" value="true@true@7@true"/> +<mapEntry key="mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4" value="true@true@2@false"/> +<mapEntry key="mvn:org.universAAL.ontology/ont.phWorld" value="true@true@5@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.acl.interfaces" value="true@true@2@false"/> +<mapEntry key="mvn:org.universAAL.ucc/ucc.api" value="true@true@6@true"/> +<mapEntry key="wrap:mvn:jp.go.ipa/jgcl/1.0" value="true@true@2@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.bus.model" value="true@true@3@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.bus.context" value="true@true@4@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.data.representation" value="true@true@4@false"/> +<mapEntry key="wrap:mvn:org.osgi/osgi_R4_compendium/1.0" value="true@true@2@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.bus.service" value="true@true@4@false"/> +<mapEntry key="wrap:mvn:java3d/vecmath/1.3.1" value="true@true@2@false"/> +<mapEntry key="wrap:mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2" value="true@true@3@false"/> +<mapEntry key="mvn:org.universAAL.middleware/mw.bus.io" value="true@true@4@false"/> +<mapEntry key="wrap:mvn:org.bouncycastle/jce.jdk13/144" value="true@true@2@false"/> +<mapEntry key="wrap:mvn:org.ops4j.pax.logging/pax-logging-api/1.4" value="true@true@2@false"/> +<mapEntry key="mvn:org.universAAL.ucc/ucc.core" value="true@true@6@true"/> +<mapEntry key="wrap:mvn:org.ops4j.pax.logging/pax-logging-service/1.4" value="true@true@3@false"/> +<mapEntry key="mvn:org.universAAL.ucc/ucc.model" value="true@true@6@true"/> +<mapEntry key="wrap:mvn:java3d/j3d-core/1.3.1" value="true@true@2@false"/> +</mapAttribute> +<listAttribute key="org.ops4j.pax.cursor.runArguments"> +<listEntry value="--overwrite=false"/> +<listEntry value="--overwriteUserBundles=false"/> +<listEntry value="--overwriteSystemBundles=false"/> +<listEntry value="--log=DEBUG"/> +<listEntry value="--profiles=obr"/> +<listEntry value="mvn:org.universAAL.ucc/ucc.viewjambi@7@update"/> +<listEntry value="mvn:org.universAAL.ontology/ont.phWorld@5"/> +<listEntry value="mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4@2"/> +<listEntry value="mvn:org.universAAL.middleware/mw.acl.interfaces@2"/> +<listEntry value="wrap:mvn:jp.go.ipa/jgcl/1.0@2"/> +<listEntry value="mvn:org.universAAL.middleware/mw.bus.context@4"/> +<listEntry value="mvn:org.universAAL.middleware/mw.bus.service@4"/> +<listEntry value="wrap:mvn:java3d/vecmath/1.3.1@2"/> +<listEntry value="wrap:mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2@3"/> +<listEntry value="mvn:org.universAAL.middleware/mw.bus.io@4"/> +<listEntry value="wrap:mvn:org.bouncycastle/jce.jdk13/144@2"/> +<listEntry value="wrap:mvn:org.ops4j.pax.logging/pax-logging-service/1.4@3"/> +<listEntry value="mvn:org.universAAL.ucc/ucc.model@6@update"/> +<listEntry value="wrap:mvn:java3d/j3d-core/1.3.1@2"/> +<listEntry value="mvn:org.universAAL.middleware/mw.data.serialization@4"/> +<listEntry value="mvn:org.universAAL.ucc/ucc.api@6@update"/> +<listEntry value="mvn:org.universAAL.middleware/mw.bus.model@3"/> +<listEntry value="mvn:org.universAAL.middleware/mw.data.representation@4"/> +<listEntry value="wrap:mvn:org.osgi/osgi_R4_compendium/1.0@2"/> +<listEntry value="mvn:org.universAAL.ucc/ucc.core@6@update"/> +<listEntry value="wrap:mvn:org.ops4j.pax.logging/pax-logging-api/1.4@2"/> +</listAttribute> +<stringAttribute key="osgi_framework_id" value="--platform=felix --version=1.4.0"/> +<stringAttribute key="pde.version" value="3.3"/> +<booleanAttribute key="show_selected_only" value="false"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useDefaultConfigArea" value="false"/> +</launchConfiguration> diff --git a/ucc/ucc.pom/.project b/ucc/ucc.pom/.project new file mode 100644 index 0000000000000000000000000000000000000000..a586e9d7fa7a3a296ec7c5139e7bd0306a948fb9 --- /dev/null +++ b/ucc/ucc.pom/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ucc.pom</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + </natures> +</projectDescription> diff --git a/ucc/ucc.pom/.settings/org.maven.ide.eclipse.prefs b/ucc/ucc.pom/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000000000000000000000000000000000000..16d2994b74b54593e4dc9f347a35f3b725301f7d --- /dev/null +++ b/ucc/ucc.pom/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Jul 15 12:10:18 CEST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/ucc/ucc.pom/pom.xml b/ucc/ucc.pom/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..fad8d61c6cc8dfe430383535bf56c8ca0b2af98e --- /dev/null +++ b/ucc/ucc.pom/pom.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.pom</artifactId> + <version>1.0.0</version> + + <packaging>pom</packaging> + <name>universAAL Control Center</name> + <description>A tool to install, manage and configure applications for universAAL an a local maschine.</description> + <url> + <![CDATA[http://forge.universaal.org/gf/project/svn/uaaltools/trunk/ucc/]]> + </url> + + <issueManagement> + <system>GForge - Tracker</system> + <url> + <![CDATA[http://forge.universaal.org/gf/project/middleware/tracker/]]> + </url> + </issueManagement> + + <mailingLists /> + + <scm> + <connection>scm:svn:http://forge.universaal.org/svn/uaaltools/trunk/ucc</connection> + <developerConnection>scm:svn:http://forge.universaal.org/svn/uaaltools/trunk/ucc</developerConnection> + <url>http://forge.universaal.org/gf/project/uaaltools/scmsvn/?path=%2Ftrunk%2Fucc%2F</url> + </scm> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.1</version> + <scope>provided</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <organization> + <name>universAAL Consortium</name> + <url>http://www.universAAL.org/</url> + </organization> + + <developers> + <developer> + <id>alex</id> + <email>alexander.marinc@igd.fraunhofer.de</email> + <name>Alexander Marinc</name> + <roles> + <role>architect</role> + <role>developer</role> + </roles> + <timezone>CEST/CET</timezone> + </developer> + <developer> + <id>tom</id> + <email>zentek@fzi.de</email> + <name>Tom Zentek</name> + <roles> + <role>builder</role> + <role>developer</role> + </roles> + <timezone>CEST/CET</timezone> + </developer> + </developers> + + <contributors /> + + <properties> + <remoteOBR /> + <!-- Default configuration for compiler source and target JVM --> + <maven.compile.source>1.5</maven.compile.source> + <maven.compile.target>1.5</maven.compile.target> + </properties> + + <distributionManagement> + <repository> + <id>releases</id> + <name>universAAL Releases</name> + <url>http://depot.universaal.org/nexus/content/repositories/releases/</url> + </repository> + <snapshotRepository> + <id>snapshots</id> + <name>universAAL Snapshots</name> + <url>http://depot.universaal.org/nexus/content/repositories/snapshots/</url> + </snapshotRepository> + </distributionManagement> + + <modules> + <module>../ucc.api</module> + <module>../ucc.model</module> + <module>../ucc.viewjambi</module> + <module>../ucc.core</module> + </modules> + +</project> diff --git a/ucc/ucc.viewjambi/.classpath b/ucc/ucc.viewjambi/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..89cd6f803a34bf815648e686757ff2fbddffbf5c --- /dev/null +++ b/ucc/ucc.viewjambi/.classpath @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" output="target/classes" path="src/main/java"/> + <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/> + <classpathentry kind="src" output="target/test-classes" path="src/test/java"/> + <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/> + <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="src" path="Generated JUIC files"/> + <classpathentry kind="lib" path="C:/workspaces/uAAL_dev/jambi/qtjambi-4.7.1/qtjambi-4.7.1.jar"/> + <classpathentry kind="lib" path="C:/workspaces/uAAL_dev/jambi/qtjambi-4.7.1/qtjambi-win32-msvc2008-4.7.1.jar"/> + <classpathentry kind="output" path="target/classes"/> +</classpath> diff --git a/ucc/ucc.viewjambi/.project b/ucc/ucc.viewjambi/.project new file mode 100644 index 0000000000000000000000000000000000000000..256d4767494211ec31eb5352c903ccac496995ff --- /dev/null +++ b/ucc/ucc.viewjambi/.project @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>ucc.viewjambi</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.wst.common.project.facet.core.builder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.trolltech.qtjambi.juicBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.maven.ide.eclipse.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>org.maven.ide.eclipse.maven2Nature</nature> + <nature>org.eclipse.wst.common.project.facet.core.nature</nature> + </natures> +</projectDescription> diff --git a/ucc/ucc.viewjambi/.settings/org.eclipse.jdt.core.prefs b/ucc/ucc.viewjambi/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..4107385ea25751c7013e11849a25291e5cb2bcfe --- /dev/null +++ b/ucc/ucc.viewjambi/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +#Fri Jul 15 17:22:39 CEST 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/ucc/ucc.viewjambi/.settings/org.maven.ide.eclipse.prefs b/ucc/ucc.viewjambi/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000000000000000000000000000000000000..61b39c92e6d731846bf0dc0266529377ea0301bb --- /dev/null +++ b/ucc/ucc.viewjambi/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Fri Jul 15 11:49:56 CEST 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/ucc/ucc.viewjambi/pom.xml b/ucc/ucc.viewjambi/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..91510b7ccb882a0439fbfb5cd38f3f8fb839f204 --- /dev/null +++ b/ucc/ucc.viewjambi/pom.xml @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.pom</artifactId> + <version>1.0.0</version> + <relativePath>../ucc.pom/pom.xml</relativePath> + </parent> + <artifactId>ucc.viewjambi</artifactId> + <version>0.0.1</version> + <name>Jambi View for uCC</name> + <description>This is an example view for the uCC, based on the Jambi libraries.</description> + <packaging>bundle</packaging> + <dependencies> + <dependency> + <groupId>org.apache.felix</groupId> + <artifactId>org.osgi.core</artifactId> + <version>1.0.1</version> + </dependency> + <dependency> + <groupId>org.universAAL.middleware</groupId> + <artifactId>mw.data.representation</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.universAAL.ucc</groupId> + <artifactId>ucc.api</artifactId> + <version>0.0.1</version> + </dependency> + </dependencies> + <build> + <plugins> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <extensions>true</extensions> + <configuration> + <instructions> + <Bundle-Name>${project.name}</Bundle-Name> + <Bundle-Activator>org.universAAL.ucc.viewjambi.Activator</Bundle-Activator> + <Bundle-Description>${project.description}</Bundle-Description> + <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> + <Private-Package>org.universAAL.ucc.viewjambi.*</Private-Package> + <Include-Resource> + {maven-resources} + </Include-Resource> + <Bundle-ClassPath>.,lib/qtjambi-4.5.2_01.jar,lib/qtjambi-win32-msvc2005-4.5.2_01.jar,bin,lib{maven-dependencies}</Bundle-ClassPath> + </instructions> + </configuration> + </plugin> + </plugins> + </build> + <repositories> + <repository> + <id>central</id> + <name>Central Maven Repository</name> + <url>http://repo1.maven.org/maven2</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>apache-snapshots</id> + <name>Apache Snapshots</name> + <url>http://people.apache.org/repo/m2-snapshot-repository</url> + <releases> + <enabled>false</enabled> + </releases> + <snapshots> + <updatePolicy>daily</updatePolicy> + </snapshots> + </repository> + <repository> + <id>uaal</id> + <name>universAAL Repositories</name> + <url>http://depot.universaal.org/maven-repo/releases/</url> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>uaal-snapshots</id> + <name>universAAL Snapshot Repositories</name> + <url>http://depot.universaal.org/maven-repo/snapshots/</url> + <releases> + <enabled>false</enabled> + </releases> + </repository> + </repositories> +</project> diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/Activator.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/Activator.java new file mode 100644 index 0000000000000000000000000000000000000000..6880c867af35ec78c6714783214053ceca8a0a45 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/Activator.java @@ -0,0 +1,154 @@ +package org.universAAL.ucc.viewjambi; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.Properties; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceReference; + +import org.universAAL.ucc.api.core.IConfigurator; +import org.universAAL.ucc.api.core.IDeinstaller; +import org.universAAL.ucc.api.core.IInformation; +import org.universAAL.ucc.api.core.IInstaller; +import org.universAAL.ucc.api.model.IModel; +import org.universAAL.ucc.api.view.IMainWindow; + +import com.trolltech.qt.gui.QApplication; + +public class Activator implements BundleActivator { + private static Thread thread = null; + private static BundleContext context = null; + private static String rundir = "c:"+File.separator; + + private static IInstaller installer = null; + private static IDeinstaller deinstaller = null; + private static IInformation information = null; + private static IModel model = null; + private static IConfigurator configurator = null; + private IMainWindow mainWindow = null; + + static final String libraryNames[] = { "qtjambi.dll", + "com_trolltech_qt_core.dll", "com_trolltech_qt_gui.dll", + "QtCore4.dll", "QtGui4.dll" }; + + static { + for (int i = 0; i < libraryNames.length; i++) + extractDll(libraryNames[i]); + } + + private static void extractDll(String name) { + InputStream inputStream = Activator.class.getClassLoader() + .getResourceAsStream(name); + File libraryFile = new File(name); + libraryFile.deleteOnExit(); + try { + FileOutputStream fileOutputStream = new FileOutputStream( + libraryFile); + byte[] buffer = new byte[8192]; + int bytesRead; + while ((bytesRead = inputStream.read(buffer)) > 0) { + fileOutputStream.write(buffer, 0, bytesRead); + } + fileOutputStream.close(); + inputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + static BundleContext getContext() { + return context; + } + + public static String getRundir() { + return rundir; + } + + public static IInstaller getInstaller() { + Activator.getServices(); + return Activator.installer; + } + + public static IDeinstaller getDeinstaller() { + Activator.getServices(); + return Activator.deinstaller; + } + + public static IInformation getInformation() { + Activator.getServices(); + return Activator.information; + } + + public static IModel getModel() { + Activator.getServices(); + return Activator.model; + } + public static IConfigurator getConfigurator() { + Activator.getServices(); + return Activator.configurator; + } + + public void start(final BundleContext context) throws Exception { + Activator.context = context; + + String bundlePath = Activator.context.getBundle().getLocation(); + Activator.rundir = bundlePath.substring(bundlePath.indexOf("/")+1,bundlePath.lastIndexOf("/")); + + Properties props = System.getProperties(); + String path = ".;" + props.getProperty("java.library.path"); + props.setProperty("java.library.path", path); + System.setProperties(props); + + thread = new Thread(new Runnable() { + public void run() { + QApplication.initialize(new String[0]); + + MainWindow newWindow = new MainWindow(context); + newWindow.show(); + + mainWindow = newWindow; + + QApplication.exec(); + } + }); + thread.start(); + + while (mainWindow == null) + ; + + context.registerService(new String[] { IMainWindow.class.getName() }, + mainWindow, null); + } + + @SuppressWarnings("deprecation") + public void stop(BundleContext context) throws Exception { + thread.stop(); + } + + private static void getServices() { + if (installer == null || deinstaller == null || configurator == null || information==null) { + ServiceReference sr = context.getServiceReference(IInstaller.class + .getName()); + if (sr != null) + Activator.installer = (IInstaller) context.getService(sr); + + sr = context.getServiceReference(IDeinstaller.class.getName()); + if (sr != null) + Activator.deinstaller = (IDeinstaller) context.getService(sr); + + sr = context.getServiceReference(IModel.class.getName()); + if (sr != null) + Activator.model = (IModel) context.getService(sr); + + sr = context.getServiceReference(IInformation.class.getName()); + if (sr != null) + Activator.information = (IInformation) context.getService(sr); + sr = context.getServiceReference(IConfigurator.class.getName()); + if (sr != null) + Activator.configurator = (IConfigurator) context.getService(sr); + } + } +} \ No newline at end of file diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/MainWindow.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/MainWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..51bc8e3718e50cd44e84907c90eb63bc459375ac --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/MainWindow.java @@ -0,0 +1,92 @@ +package org.universAAL.ucc.viewjambi; + +import java.io.IOException; +import java.util.HashMap; + +import org.osgi.framework.BundleContext; + +import org.universAAL.ucc.api.view.IMainWindow; +import org.universAAL.ucc.api.view.ISubWindow; +import org.universAAL.ucc.viewjambi.information.InformationView; +import org.universAAL.ucc.viewjambi.install.ConfigView; +import org.universAAL.ucc.viewjambi.install.InstallView; +import org.universAAL.ucc.viewjambi.install.LicenseView; +import org.universAAL.ucc.viewjambi.juic.Ui_MainWindow; +import org.universAAL.ucc.viewjambi.overview.OverviewView; + +import com.trolltech.qt.gui.*; + +public class MainWindow extends QMainWindow implements IMainWindow { + + private Ui_MainWindow ui_base = new Ui_MainWindow(); + private HashMap<ISubWindow,QMdiSubWindow> subWindows = new HashMap<ISubWindow,QMdiSubWindow>(); + + public MainWindow(BundleContext context) { + super(); + + ui_base.setupUi(this); +// +// System.out.println("Installing Bundle.."); +// try{ +// context.installBundle("file:C:\\plugins\\de.bla.testBundle_1.0.0.201107232348.jar"); +// }catch(Exception e){ +// e.printStackTrace(); +// System.out.println("Installing failed.."); +// } + + ui_base.actionExit.triggered.connect(this, "close()"); + ui_base.actionInstall.triggered.connect(this, "installApp()"); +// ui_base.actionUninstall.triggered.connect(this, "uninstallApp()"); + ui_base.actionOverview.triggered.connect(this, "overviewApp()"); + ui_base.actionSystem_Information.triggered.connect(this, "showInformation()"); + } + + @Override + protected void resizeEvent(QResizeEvent event) { + super.resizeEvent(event); + } + + @Override + public void addSubWindow(ISubWindow subWindow) { + if (subWindow instanceof SubWindow) { + QMdiSubWindow mdiWindow = ui_base.mdiArea.addSubWindow((QWidget)subWindow); + subWindows.put(subWindow, mdiWindow); + mdiWindow.show(); + } + } + + @Override + public void closeSubWindow(ISubWindow subWindow) { + QMdiSubWindow mdiChild = subWindows.remove(subWindow); + if (mdiChild != null) + mdiChild.close(); + } + + @Override + public boolean initialize() { + // TODO Auto-generated method stub + return false; + } + + protected void installApp() { + new InstallView(this); + } + public void configureApp(String path){ + new ConfigView(this, path); + } + public void showLicense(String path) throws IOException{ + new LicenseView(this, path); + } + + protected void uninstallApp() { + new InstallView(this); + } + + protected void overviewApp() { + new OverviewView(this); + } + + protected void showInformation() { + new InformationView(this); + } +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/SubWindow.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/SubWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..5caa1463d088a4f244d70935118d6fb98b0f7c72 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/SubWindow.java @@ -0,0 +1,41 @@ +package org.universAAL.ucc.viewjambi; + +import org.universAAL.ucc.api.view.ISubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_SubWindow; + +import com.trolltech.qt.QUiForm; +import com.trolltech.qt.gui.QPixmap; +import com.trolltech.qt.gui.QWidget; + +public class SubWindow extends QWidget implements ISubWindow { + + private Ui_SubWindow ui_base = new Ui_SubWindow(); + protected MainWindow parent = null; + + protected SubWindow(MainWindow parent, QUiForm<QWidget> ui_content) { + super(parent); + this.parent = parent; + + ui_base.setupUi(this); + + String jarPath = "classpath:" + + Activator.getContext().getBundle().getLocation().substring(6) + + "#images/uaal.bmp"; + QPixmap pixmap = new QPixmap(jarPath); + ui_base.headerLogo.setPixmap(pixmap); + + ui_content.setupUi(ui_base.content); + + this.parent.addSubWindow(this); + } + + public void initialize() { + this.show(); + } + + protected QWidget getContentWidget() { + return ui_base.content; + } + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/information/InformationView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/information/InformationView.java new file mode 100644 index 0000000000000000000000000000000000000000..f6c95f2a188bca43d2c885bffdf92aad3ed7f34b --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/information/InformationView.java @@ -0,0 +1,58 @@ +package org.universAAL.ucc.viewjambi.information; + +import java.util.Date; + +import org.osgi.framework.Bundle; +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_SystemInformation; + +import com.trolltech.qt.gui.QTableWidgetItem; + +public class InformationView extends SubWindow { + + private static Ui_SystemInformation information_base = new Ui_SystemInformation(); + + public InformationView(MainWindow parent) { + super(parent, InformationView.information_base); + + Bundle[] bundles = Activator.getInformation().bundles(); + + for (int i = 0; i < bundles.length; i++) { + information_base.bundleList.insertRow(i); + information_base.bundleList.setItem(i, 0, new QTableWidgetItem( + bundles[i].getSymbolicName())); + information_base.bundleList.setItem(i, 1, new QTableWidgetItem( + (new Date(bundles[i].getLastModified())).toString())); + information_base.bundleList.setItem(i, 2, new QTableWidgetItem( + statusToString(bundles[i].getState()))); + information_base.bundleList.setItem(i, 3, new QTableWidgetItem( + bundles[i].getLocation())); + } + + information_base.closeButton.clicked.connect(this, "closeMe()"); + } + + protected void closeMe() { + this.parent.closeSubWindow(this); + } + + protected String statusToString(int status) { + switch (status) { + case Bundle.ACTIVE: + return "Active"; + case Bundle.INSTALLED: + return "Installed"; + case Bundle.RESOLVED: + return "Resolved"; + case Bundle.STARTING: + return "Starting"; + case Bundle.STOPPING: + return "Stopping"; + case Bundle.UNINSTALLED: + return "Uninstalled"; + } + return "Unknown"; + } +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/ConfigView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/ConfigView.java new file mode 100644 index 0000000000000000000000000000000000000000..456570f02a580ae2b56ebeeba4902ff65682250d --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/ConfigView.java @@ -0,0 +1,211 @@ +package org.universAAL.ucc.viewjambi.install; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Stack; + +import javax.xml.stream.XMLEventReader; +import javax.xml.stream.XMLInputFactory; +import javax.xml.stream.XMLStreamException; +import javax.xml.stream.events.Attribute; +import javax.xml.stream.events.XMLEvent; +import javax.xml.transform.stream.StreamSource; + +import org.universAAL.ucc.api.model.IModel; +import org.osgi.framework.Bundle; +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_Configure; + +import com.trolltech.qt.core.QObject; +import com.trolltech.qt.gui.QBoxLayout; +import com.trolltech.qt.gui.QCheckBox; +import com.trolltech.qt.gui.QComboBox; +import com.trolltech.qt.gui.QGroupBox; +import com.trolltech.qt.gui.QHBoxLayout; +import com.trolltech.qt.gui.QLabel; +import com.trolltech.qt.gui.QLineEdit; +import com.trolltech.qt.gui.QMessageBox; +import com.trolltech.qt.gui.QVBoxLayout; +import com.trolltech.qt.gui.QWidget; + +public class ConfigView extends SubWindow { + + private static Ui_Configure install_base=new Ui_Configure(); + private static String appDir; + private HashMap<String,QObject> configdata= new HashMap<String, QObject>(); + private static IModel model; + private HashMap<String,String> appInfo=new HashMap<String,String>(); + + + public ConfigView(MainWindow parent, String configpath) { + super(parent, install_base); + + + appDir = configpath; + try { + if(!performConfiguration(configpath+ File.separator +"config.xml", install_base)){ + QLabel info = new QLabel(); + info.setText("No Configuration necessary!"); + install_base.verticalLayout_4.insertWidget(0,info); + } + } catch (XMLStreamException e) { + QMessageBox.critical(this, "Error", "Error parsing config file!"); + } + if(appInfo.get("id")==null||appInfo.get("name")==null){ + QMessageBox.critical(this, "Error", "Application Info is not properly set!"); + + } + install_base.okButton.clicked.connect(this, "saveConfiguration()"); + install_base.cancelButton.clicked.connect(this, "cancel()"); + this.adjustSize(); + } + + protected void saveConfiguration() { + model = Activator.getModel(); + //Map<String, String> returnMap = new HashMap<String, String>(); + Collection<QObject> c = configdata.values(); + Iterator<QObject> itr = c.iterator(); + HashMap<String,String> conf=new HashMap<String,String>(); + while(itr.hasNext()){ + String key; + String value = ""; + QObject a = itr.next(); + key = a.objectName(); + if(a.getClass().getName().equals("com.trolltech.qt.gui.QComboBox")){ + value=((QComboBox) a).currentText(); + } + if(a.getClass().getName().equals("com.trolltech.qt.gui.QLineEdit")){ + if(((QLineEdit) a).text().equals("")){ + QMessageBox.critical(this, "Error", "Please fill out all fields!"); + return; + } + value=((QLineEdit) a).text(); + } + if(a.getClass().getName().equals("com.trolltech.qt.gui.QCheckBox")){ + System.out.print(": "+((QCheckBox) a).isChecked()); + if(((QCheckBox) a).isChecked()){ + value = "true"; + }else{ + value = "false"; + } + } + System.out.println(); + //returnMap.put(key, value); + //value=new Boolean(((QCheckBox) a).isChecked()).toString(); + conf.put(key, value); + } + ArrayList<Bundle> ib = Activator.getInstaller().getInstalledBundles(); + String install_base = ib.get(0).getLocation(); + install_base=install_base.substring(5, install_base.lastIndexOf(File.separator)); + conf.put("install_base",install_base); + conf.put("appName", appInfo.get("name")); + String completed=Activator.getConfigurator().finishConfiguration(appInfo.get("id"), ib , conf); + if(completed==null){ + Activator.getInstaller().resetBundles(); + QMessageBox.information(this, "Installation", "Installation successfully completed!"); + }else + QMessageBox.critical(this, "Error", completed); + this.parent.closeSubWindow(this); + + } + + protected void cancel() { + Activator.getInstaller().revertInstallation(new File(appDir)); + this.parent.closeSubWindow(this); + } + + /** For convenience and test purposes the xml parsing is done here. + * In the future this method should be moved to the Configurator class. + * + * @param Path + * @throws XMLStreamException + */ + @SuppressWarnings("unchecked") + public boolean performConfiguration(String Path, Ui_Configure conf) throws XMLStreamException{ + + + QBoxLayout parent = conf.verticalLayout_4; + QWidget current = new QWidget(); + QLabel curLabel = new QLabel(); + String curid=null; + int row =0; + int panelrow=0; + boolean added=false; + + + XMLInputFactory inputFactory = XMLInputFactory.newInstance(); + XMLEventReader evRd = inputFactory.createXMLEventReader( new StreamSource( Path ) ); + Stack<String> stck = new Stack<String>(); + while( evRd.hasNext() ) { + XMLEvent ev = evRd.nextEvent(); + if( ev.isStartElement() ) { + stck.push( ev.asStartElement().getName().getLocalPart() ); + + Iterator<Attribute> iter = ev.asStartElement().getAttributes(); + while( iter.hasNext() ) { + Attribute a = iter.next(); + if(ev.asStartElement().getName().getLocalPart().equals("root")) + appInfo.put(a.getName().getLocalPart(), a.getValue()); + curid=a.getValue(); + } + if(ev.asStartElement().getName().getLocalPart().equals("panel")){ + QGroupBox panel= new QGroupBox(); + QVBoxLayout lay= new QVBoxLayout(); + panel.setLayout(lay); + panel.setTitle(curid); + parent.insertWidget(panelrow, panel); + parent=lay; + panelrow++; + } + } + if( ev.isCharacters() ) { + String s = ev.asCharacters().getData(); + if( s.trim().length() > 0 ){ + if(stck.peek().equals("type")){ + if(s.equals("TEXTBOX"))current=new QLineEdit(); + if(s.equals("DROPDOWNLIST"))current=new QComboBox(); + if(s.equals("CHECKBOX"))current=new QCheckBox(); + + current.setObjectName(curid); + } + if(stck.peek().equals("title")){ + curLabel=new QLabel(); + curLabel.setText(s); + } + if(stck.peek().equals("domain")){ + String[] entries=s.split(";"); + for(int i=0;i<entries.length;i++){ + ((QComboBox) current).addItem(entries[i]); + } + + } + } + } + if( ev.isEndElement()){ + String stckitem=stck.pop(); + if(stckitem.equals("element")){ + QHBoxLayout temp = new QHBoxLayout(); + current.setParent(conf.verticalLayout_4); + temp.insertWidget(0,curLabel); + temp.insertWidget(1,current); + parent.insertLayout(row, temp); + configdata.put(current.objectName(), current); + row++; + added=true; + } + if(stckitem.equals("panel")){ + parent=conf.verticalLayout_4; + row=0; + } + } + } + conf.verticalLayout_4.activate(); + return added; + } +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/InstallView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/InstallView.java new file mode 100644 index 0000000000000000000000000000000000000000..d1f1729eb40ffcae0fdab599820cb3639affdcda --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/InstallView.java @@ -0,0 +1,61 @@ +package org.universAAL.ucc.viewjambi.install; + +import java.io.File; +import java.io.IOException; + +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_Install; + +import com.trolltech.qt.gui.QDialog; +import com.trolltech.qt.gui.QFileDialog; +import com.trolltech.qt.gui.QMessageBox; + + +public class InstallView extends SubWindow { + + private static Ui_Install install_base = new Ui_Install(); + + + public InstallView(MainWindow parent) { + super(parent, InstallView.install_base); + + install_base.fileChoise.clicked.connect(this,"openFileChoise()"); + install_base.okButton.clicked.connect(this, "installFile()"); + install_base.cancelButton.clicked.connect(this, "cancel()"); + } + + protected void openFileChoise() { + QFileDialog dialog = new QFileDialog(this, "Please choose a file to install!", ".", "universAAL (*.uaal)"); + int result = dialog.exec(); + + if (result == QDialog.DialogCode.Accepted.value()) { + String file = dialog.selectedFiles().get(0); + if (file != null) + install_base.fileName.setText(file); + System.out.println(install_base.fileName.text()); + } + } + + protected void installFile() { + System.out.println("InstallFile started"); + String p=install_base.fileName.text(); + p=p.replace("/", "\\"); + try { + String appDir = Activator.getInstaller().installApplication(p); + this.parent.closeSubWindow(this); + this.parent.showLicense(appDir); + } catch (NullPointerException e){ + QMessageBox.critical(this, "Error", "Installation failed! The Application probably already is installed!"); + } catch (Exception e) { + QMessageBox.critical(this, "Error", e.getMessage()); + this.parent.closeSubWindow(this); + } + } + + protected void cancel() { + this.parent.closeSubWindow(this); + } + +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/LicenseView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/LicenseView.java new file mode 100644 index 0000000000000000000000000000000000000000..c4a92858b1700f1596317fede651ee97326a06ec --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/install/LicenseView.java @@ -0,0 +1,73 @@ +package org.universAAL.ucc.viewjambi.install; + +import java.io.BufferedReader; +import java.io.File; + +import java.io.FileReader; +import java.io.IOException; + + +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; + +import org.universAAL.ucc.viewjambi.juic.Ui_License; + + + + +public class LicenseView extends SubWindow { + + private static Ui_License install_base = new Ui_License(); + private static String appDir; + + public LicenseView(MainWindow parent,String path) throws IOException { + super(parent, LicenseView.install_base); + appDir=path; + StringBuffer l=readLicense(path+ File.separator +"EULA.txt"); + + install_base.license.setText(l.toString()); + + install_base.okButton.clicked.connect(this, "accept()"); + install_base.cancelButton.clicked.connect(this, "cancel()"); + } + + + protected void accept() { + this.parent.closeSubWindow(this); + this.parent.configureApp(appDir); + } + + + + private StringBuffer readLicense(String path) throws IOException { + File file = new File(path); + StringBuffer contents = new StringBuffer(); + BufferedReader reader = null; + + + reader = new BufferedReader(new FileReader(file)); + String text = null; + + // repeat until all lines is read + while ((text = reader.readLine()) != null) { + contents.append(text) + .append(System.getProperty( + "line.separator")); + } + + reader.close(); + + + + return contents; + } + + + + protected void cancel() { + Activator.getInstaller().revertInstallation(new File(appDir)); + this.parent.closeSubWindow(this); + } + +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Configure.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Configure.java new file mode 100644 index 0000000000000000000000000000000000000000..7d181317013ecc44eab87ca981eae19c845bfd12 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Configure.java @@ -0,0 +1,103 @@ +/******************************************************************************** +** Form generated from reading ui file 'configure.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_Configure implements com.trolltech.qt.QUiForm<QWidget> +{ + public QGridLayout gridLayout_2; + public QGridLayout gridLayout; + public QWidget widget; + public QHBoxLayout horizontalLayout_2; + public QHBoxLayout horizontalLayout; + public QSpacerItem horizontalSpacer; + public QPushButton okButton; + public QPushButton cancelButton; + public QVBoxLayout verticalLayout_4; + public QSpacerItem verticalSpacer; + + public Ui_Configure() { super(); } + + public void setupUi(QWidget Configure) + { + Configure.setObjectName("Configure"); + Configure.resize(new QSize(800, 600).expandedTo(Configure.minimumSizeHint())); + gridLayout_2 = new QGridLayout(Configure); + gridLayout_2.setObjectName("gridLayout_2"); + gridLayout = new QGridLayout(); + gridLayout.setObjectName("gridLayout"); + widget = new QWidget(Configure); + widget.setObjectName("widget"); + widget.setMinimumSize(new QSize(0, 20)); + horizontalLayout_2 = new QHBoxLayout(widget); + horizontalLayout_2.setMargin(0); + horizontalLayout_2.setObjectName("horizontalLayout_2"); + horizontalLayout = new QHBoxLayout(); + horizontalLayout.setObjectName("horizontalLayout"); + horizontalLayout.setSizeConstraint(com.trolltech.qt.gui.QLayout.SizeConstraint.SetFixedSize); + horizontalSpacer = new QSpacerItem(40, 20, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum); + + horizontalLayout.addItem(horizontalSpacer); + + okButton = new QPushButton(widget); + okButton.setObjectName("okButton"); + QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Fixed, com.trolltech.qt.gui.QSizePolicy.Policy.Fixed); + sizePolicy.setHorizontalStretch((byte)0); + sizePolicy.setVerticalStretch((byte)0); + sizePolicy.setHeightForWidth(okButton.sizePolicy().hasHeightForWidth()); + okButton.setSizePolicy(sizePolicy); + okButton.setMinimumSize(new QSize(75, 0)); + okButton.setMaximumSize(new QSize(75, 16777215)); + okButton.setBaseSize(new QSize(100, 0)); + + horizontalLayout.addWidget(okButton); + + cancelButton = new QPushButton(widget); + cancelButton.setObjectName("cancelButton"); + cancelButton.setMinimumSize(new QSize(75, 0)); + cancelButton.setMaximumSize(new QSize(75, 16777215)); + + horizontalLayout.addWidget(cancelButton); + + + horizontalLayout_2.addLayout(horizontalLayout); + + + gridLayout.addWidget(widget, 0, 0, 1, 2); + + + gridLayout_2.addLayout(gridLayout, 1, 0, 1, 1); + + verticalLayout_4 = new QVBoxLayout(); + verticalLayout_4.setObjectName("verticalLayout_4"); + verticalLayout_4.setSizeConstraint(com.trolltech.qt.gui.QLayout.SizeConstraint.SetMinAndMaxSize); + verticalSpacer = new QSpacerItem(20, 40, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding); + + verticalLayout_4.addItem(verticalSpacer); + + + gridLayout_2.addLayout(verticalLayout_4, 0, 0, 1, 1); + + retranslateUi(Configure); + + Configure.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget Configure) + { + Configure.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("Configure", "Install a new application", null)); + okButton.setText(com.trolltech.qt.core.QCoreApplication.translate("Configure", "OK", null)); + cancelButton.setText(com.trolltech.qt.core.QCoreApplication.translate("Configure", "Cancel", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Install.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Install.java new file mode 100644 index 0000000000000000000000000000000000000000..d6056361d0e3cf5360752e1f107233c2bdde0b84 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Install.java @@ -0,0 +1,128 @@ +/******************************************************************************** +** Form generated from reading ui file 'install.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_Install implements com.trolltech.qt.QUiForm<QWidget> +{ + public QGridLayout gridLayout_2; + public QGridLayout gridLayout; + public QLabel label; + public QLineEdit fileName; + public QSpacerItem verticalSpacer; + public QSpacerItem verticalSpacer_2; + public QPushButton fileChoise; + public QWidget widget; + public QHBoxLayout horizontalLayout_2; + public QHBoxLayout horizontalLayout; + public QSpacerItem horizontalSpacer; + public QPushButton okButton; + public QPushButton cancelButton; + public QLabel label_2; + + public Ui_Install() { super(); } + + public void setupUi(QWidget Install) + { + Install.setObjectName("Install"); + Install.resize(new QSize(400, 300).expandedTo(Install.minimumSizeHint())); + gridLayout_2 = new QGridLayout(Install); + gridLayout_2.setObjectName("gridLayout_2"); + gridLayout = new QGridLayout(); + gridLayout.setObjectName("gridLayout"); + label = new QLabel(Install); + label.setObjectName("label"); + + gridLayout.addWidget(label, 1, 0, 1, 1); + + fileName = new QLineEdit(Install); + fileName.setObjectName("fileName"); + + gridLayout.addWidget(fileName, 2, 0, 1, 1); + + verticalSpacer = new QSpacerItem(20, 40, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding); + + gridLayout.addItem(verticalSpacer, 0, 0, 1, 1); + + verticalSpacer_2 = new QSpacerItem(20, 40, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding); + + gridLayout.addItem(verticalSpacer_2, 4, 0, 1, 1); + + fileChoise = new QPushButton(Install); + fileChoise.setObjectName("fileChoise"); + fileChoise.setMaximumSize(new QSize(40, 16777215)); + + gridLayout.addWidget(fileChoise, 2, 1, 1, 1); + + widget = new QWidget(Install); + widget.setObjectName("widget"); + widget.setMinimumSize(new QSize(0, 20)); + horizontalLayout_2 = new QHBoxLayout(widget); + horizontalLayout_2.setMargin(0); + horizontalLayout_2.setObjectName("horizontalLayout_2"); + horizontalLayout = new QHBoxLayout(); + horizontalLayout.setObjectName("horizontalLayout"); + horizontalSpacer = new QSpacerItem(40, 20, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum); + + horizontalLayout.addItem(horizontalSpacer); + + okButton = new QPushButton(widget); + okButton.setObjectName("okButton"); + QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Fixed, com.trolltech.qt.gui.QSizePolicy.Policy.Fixed); + sizePolicy.setHorizontalStretch((byte)0); + sizePolicy.setVerticalStretch((byte)0); + sizePolicy.setHeightForWidth(okButton.sizePolicy().hasHeightForWidth()); + okButton.setSizePolicy(sizePolicy); + okButton.setMinimumSize(new QSize(75, 0)); + okButton.setMaximumSize(new QSize(75, 16777215)); + okButton.setBaseSize(new QSize(100, 0)); + + horizontalLayout.addWidget(okButton); + + cancelButton = new QPushButton(widget); + cancelButton.setObjectName("cancelButton"); + cancelButton.setMinimumSize(new QSize(75, 0)); + cancelButton.setMaximumSize(new QSize(75, 16777215)); + + horizontalLayout.addWidget(cancelButton); + + + horizontalLayout_2.addLayout(horizontalLayout); + + + gridLayout.addWidget(widget, 5, 0, 1, 2); + + label_2 = new QLabel(Install); + label_2.setObjectName("label_2"); + + gridLayout.addWidget(label_2, 3, 0, 1, 1); + + + gridLayout_2.addLayout(gridLayout, 0, 0, 1, 1); + + retranslateUi(Install); + + Install.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget Install) + { + Install.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("Install", "Install a new application", null)); + label.setText(com.trolltech.qt.core.QCoreApplication.translate("Install", "Please select a application to install:", null)); + fileChoise.setText(com.trolltech.qt.core.QCoreApplication.translate("Install", "...", null)); + okButton.setText(com.trolltech.qt.core.QCoreApplication.translate("Install", "OK", null)); + cancelButton.setText(com.trolltech.qt.core.QCoreApplication.translate("Install", "Cancel", null)); + label_2.setText(com.trolltech.qt.core.QCoreApplication.translate("Install", "I want to try this out to!", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_License.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_License.java new file mode 100644 index 0000000000000000000000000000000000000000..721780a80eeaf3d3e22d958de8b2c782f279c606 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_License.java @@ -0,0 +1,104 @@ +/******************************************************************************** +** Form generated from reading ui file 'license.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_License implements com.trolltech.qt.QUiForm<QWidget> +{ + public QGridLayout gridLayout_2; + public QGridLayout gridLayout; + public QWidget widget; + public QHBoxLayout horizontalLayout_2; + public QHBoxLayout horizontalLayout; + public QSpacerItem horizontalSpacer; + public QPushButton okButton; + public QPushButton cancelButton; + public QVBoxLayout verticalLayout_4; + public QTextBrowser license; + + public Ui_License() { super(); } + + public void setupUi(QWidget License) + { + License.setObjectName("License"); + License.resize(new QSize(800, 600).expandedTo(License.minimumSizeHint())); + gridLayout_2 = new QGridLayout(License); + gridLayout_2.setObjectName("gridLayout_2"); + gridLayout = new QGridLayout(); + gridLayout.setObjectName("gridLayout"); + widget = new QWidget(License); + widget.setObjectName("widget"); + widget.setMinimumSize(new QSize(0, 20)); + horizontalLayout_2 = new QHBoxLayout(widget); + horizontalLayout_2.setMargin(0); + horizontalLayout_2.setObjectName("horizontalLayout_2"); + horizontalLayout = new QHBoxLayout(); + horizontalLayout.setObjectName("horizontalLayout"); + horizontalLayout.setSizeConstraint(com.trolltech.qt.gui.QLayout.SizeConstraint.SetFixedSize); + horizontalSpacer = new QSpacerItem(40, 20, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum); + + horizontalLayout.addItem(horizontalSpacer); + + okButton = new QPushButton(widget); + okButton.setObjectName("okButton"); + QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Fixed, com.trolltech.qt.gui.QSizePolicy.Policy.Fixed); + sizePolicy.setHorizontalStretch((byte)0); + sizePolicy.setVerticalStretch((byte)0); + sizePolicy.setHeightForWidth(okButton.sizePolicy().hasHeightForWidth()); + okButton.setSizePolicy(sizePolicy); + okButton.setMinimumSize(new QSize(75, 0)); + okButton.setMaximumSize(new QSize(75, 16777215)); + okButton.setBaseSize(new QSize(100, 0)); + + horizontalLayout.addWidget(okButton); + + cancelButton = new QPushButton(widget); + cancelButton.setObjectName("cancelButton"); + cancelButton.setMinimumSize(new QSize(75, 0)); + cancelButton.setMaximumSize(new QSize(75, 16777215)); + + horizontalLayout.addWidget(cancelButton); + + + horizontalLayout_2.addLayout(horizontalLayout); + + + gridLayout.addWidget(widget, 0, 0, 1, 2); + + + gridLayout_2.addLayout(gridLayout, 1, 0, 1, 1); + + verticalLayout_4 = new QVBoxLayout(); + verticalLayout_4.setObjectName("verticalLayout_4"); + verticalLayout_4.setSizeConstraint(com.trolltech.qt.gui.QLayout.SizeConstraint.SetMinAndMaxSize); + license = new QTextBrowser(License); + license.setObjectName("license"); + + verticalLayout_4.addWidget(license); + + + gridLayout_2.addLayout(verticalLayout_4, 0, 0, 1, 1); + + retranslateUi(License); + + License.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget License) + { + License.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("License", "Install a new application", null)); + okButton.setText(com.trolltech.qt.core.QCoreApplication.translate("License", "Accept", null)); + cancelButton.setText(com.trolltech.qt.core.QCoreApplication.translate("License", "Cancel", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_MainWindow.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_MainWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..26d720f6a0942b7d5a2e8cdab6a581b2eb5f8bf8 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_MainWindow.java @@ -0,0 +1,100 @@ +/******************************************************************************** +** Form generated from reading ui file 'MainWindow.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_MainWindow implements com.trolltech.qt.QUiForm<QMainWindow> +{ + public QAction actionExit; + public QAction actionInstall; + public QAction actionSystem_Information; + public QAction actionDeinstall; + public QAction actionOverview; + public QWidget centralwidget; + public QVBoxLayout verticalLayout; + public QMdiArea mdiArea; + public QMenuBar menubar; + public QMenu menuFile; + public QMenu menuApplications; + public QMenu menuSystem; + public QStatusBar statusbar; + + public Ui_MainWindow() { super(); } + + public void setupUi(QMainWindow MainWindow) + { + MainWindow.setObjectName("MainWindow"); + MainWindow.resize(new QSize(640, 480).expandedTo(MainWindow.minimumSizeHint())); + actionExit = new QAction(MainWindow); + actionExit.setObjectName("actionExit"); + actionInstall = new QAction(MainWindow); + actionInstall.setObjectName("actionInstall"); + actionSystem_Information = new QAction(MainWindow); + actionSystem_Information.setObjectName("actionSystem_Information"); + actionDeinstall = new QAction(MainWindow); + actionDeinstall.setObjectName("actionDeinstall"); + actionOverview = new QAction(MainWindow); + actionOverview.setObjectName("actionOverview"); + centralwidget = new QWidget(MainWindow); + centralwidget.setObjectName("centralwidget"); + verticalLayout = new QVBoxLayout(centralwidget); + verticalLayout.setMargin(0); + verticalLayout.setObjectName("verticalLayout"); + mdiArea = new QMdiArea(centralwidget); + mdiArea.setObjectName("mdiArea"); + + verticalLayout.addWidget(mdiArea); + + MainWindow.setCentralWidget(centralwidget); + menubar = new QMenuBar(MainWindow); + menubar.setObjectName("menubar"); + menubar.setGeometry(new QRect(0, 0, 640, 21)); + menuFile = new QMenu(menubar); + menuFile.setObjectName("menuFile"); + menuApplications = new QMenu(menubar); + menuApplications.setObjectName("menuApplications"); + menuSystem = new QMenu(menubar); + menuSystem.setObjectName("menuSystem"); + MainWindow.setMenuBar(menubar); + statusbar = new QStatusBar(MainWindow); + statusbar.setObjectName("statusbar"); + MainWindow.setStatusBar(statusbar); + + menubar.addAction(menuFile.menuAction()); + menubar.addAction(menuApplications.menuAction()); + menubar.addAction(menuSystem.menuAction()); + menuFile.addAction(actionExit); + menuApplications.addAction(actionOverview); + menuApplications.addSeparator(); + menuApplications.addAction(actionInstall); + menuApplications.addAction(actionDeinstall); + menuSystem.addAction(actionSystem_Information); + retranslateUi(MainWindow); + + MainWindow.connectSlotsByName(); + } // setupUi + + void retranslateUi(QMainWindow MainWindow) + { + MainWindow.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "universAAL Control Center (UCC)", null)); + actionExit.setText(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "Exit", null)); + actionInstall.setText(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "Install", null)); + actionSystem_Information.setText(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "System Information", null)); + actionDeinstall.setText(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "Deinstall", null)); + actionOverview.setText(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "Overview", null)); + menuFile.setTitle(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "File", null)); + menuApplications.setTitle(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "Applications", null)); + menuSystem.setTitle(com.trolltech.qt.core.QCoreApplication.translate("MainWindow", "System", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Overview.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Overview.java new file mode 100644 index 0000000000000000000000000000000000000000..2e63649fc029b702b9f86ad7ed51a2a5668020d9 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_Overview.java @@ -0,0 +1,68 @@ +/******************************************************************************** +** Form generated from reading ui file 'Overview.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_Overview implements com.trolltech.qt.QUiForm<QWidget> +{ + public QGridLayout gridLayout_2; + public QGridLayout gridLayout; + public QTreeView treeView; + public QLabel label; + + public Ui_Overview() { super(); } + + public void setupUi(QWidget Overview) + { + Overview.setObjectName("Overview"); + Overview.resize(new QSize(261, 592).expandedTo(Overview.minimumSizeHint())); + gridLayout_2 = new QGridLayout(Overview); + gridLayout_2.setObjectName("gridLayout_2"); + gridLayout = new QGridLayout(); + gridLayout.setObjectName("gridLayout"); + treeView = new QTreeView(Overview); + treeView.setObjectName("treeView"); + treeView.setMinimumSize(new QSize(200, 400)); + treeView.setRootIsDecorated(true); + treeView.setItemsExpandable(true); + treeView.setExpandsOnDoubleClick(false); + + gridLayout.addWidget(treeView, 0, 0, 1, 1); + + + gridLayout_2.addLayout(gridLayout, 1, 0, 1, 1); + + label = new QLabel(Overview); + label.setObjectName("label"); + QFont font = new QFont(); + font.setPointSize(14); + font.setBold(true); + font.setWeight(75); + label.setFont(font); + label.setScaledContents(true); + label.setAlignment(com.trolltech.qt.core.Qt.AlignmentFlag.createQFlags(com.trolltech.qt.core.Qt.AlignmentFlag.AlignCenter)); + + gridLayout_2.addWidget(label, 0, 0, 1, 1); + + retranslateUi(Overview); + + Overview.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget Overview) + { + Overview.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("Overview", "Application Overview", null)); + label.setText(com.trolltech.qt.core.QCoreApplication.translate("Overview", "Applications", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SubWindow.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SubWindow.java new file mode 100644 index 0000000000000000000000000000000000000000..2827282aa1500304c22fba85ece4fc6921b2d319 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SubWindow.java @@ -0,0 +1,97 @@ +/******************************************************************************** +** Form generated from reading ui file 'subwindow.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_SubWindow implements com.trolltech.qt.QUiForm<QWidget> +{ + public QVBoxLayout verticalLayout_2; + public QVBoxLayout mainLayou; + public QWidget header; + public QHBoxLayout headerLayou; + public QHBoxLayout horizontalLayout; + public QLabel headerLogo; + public QWidget content; + + public Ui_SubWindow() { super(); } + + public void setupUi(QWidget SubWindow) + { + SubWindow.setObjectName("SubWindow"); + SubWindow.resize(new QSize(402, 326).expandedTo(SubWindow.minimumSizeHint())); + verticalLayout_2 = new QVBoxLayout(SubWindow); + verticalLayout_2.setSpacing(6); + verticalLayout_2.setMargin(0); + verticalLayout_2.setObjectName("verticalLayout_2"); + mainLayou = new QVBoxLayout(); + mainLayou.setSpacing(0); + mainLayou.setObjectName("mainLayou"); + header = new QWidget(SubWindow); + header.setObjectName("header"); + QPalette palette= new QPalette(); + palette.setColor(QPalette.ColorGroup.Active, QPalette.ColorRole.Button, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Active, QPalette.ColorRole.Midlight, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Active, QPalette.ColorRole.Base, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Active, QPalette.ColorRole.Window, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Button, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Midlight, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Base, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Inactive, QPalette.ColorRole.Window, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Button, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Midlight, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Base, new QColor(204, 204, 204)); + palette.setColor(QPalette.ColorGroup.Disabled, QPalette.ColorRole.Window, new QColor(204, 204, 204)); + header.setPalette(palette); + header.setAutoFillBackground(true); + headerLayou = new QHBoxLayout(header); + headerLayou.setMargin(4); + headerLayou.setObjectName("headerLayou"); + horizontalLayout = new QHBoxLayout(); + horizontalLayout.setObjectName("horizontalLayout"); + headerLogo = new QLabel(header); + headerLogo.setObjectName("headerLogo"); + + horizontalLayout.addWidget(headerLogo); + + + headerLayou.addLayout(horizontalLayout); + + + mainLayou.addWidget(header); + + content = new QWidget(SubWindow); + content.setObjectName("content"); + QSizePolicy sizePolicy = new QSizePolicy(com.trolltech.qt.gui.QSizePolicy.Policy.Preferred, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding); + sizePolicy.setHorizontalStretch((byte)0); + sizePolicy.setVerticalStretch((byte)0); + sizePolicy.setHeightForWidth(content.sizePolicy().hasHeightForWidth()); + content.setSizePolicy(sizePolicy); + content.setMinimumSize(new QSize(150, 50)); + + mainLayou.addWidget(content); + + + verticalLayout_2.addLayout(mainLayou); + + retranslateUi(SubWindow); + + SubWindow.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget SubWindow) + { + SubWindow.setWindowTitle(""); + headerLogo.setText(com.trolltech.qt.core.QCoreApplication.translate("SubWindow", "TextLabel", null)); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SystemInformation.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SystemInformation.java new file mode 100644 index 0000000000000000000000000000000000000000..91388a3b0c5053daa72572f4fe9ebef7a4f82d9b --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/juic/Ui_SystemInformation.java @@ -0,0 +1,128 @@ +/******************************************************************************** +** Form generated from reading ui file 'SystemInformation.jui' +** +** Created: Mi 27. Jul 18:39:05 2011 +** by: Qt User Interface Compiler version 4.5.2 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +package org.universAAL.ucc.viewjambi.juic; + +import com.trolltech.qt.core.*; +import com.trolltech.qt.gui.*; + +public class Ui_SystemInformation implements com.trolltech.qt.QUiForm<QWidget> +{ + public QGridLayout gridLayout_2; + public QGridLayout gridLayout; + public QLabel label; + public QWidget widget; + public QHBoxLayout horizontalLayout; + public QSpacerItem horizontalSpacer; + public QPushButton closeButton; + public QWidget widget_2; + public QVBoxLayout verticalLayout; + public QLabel label_2; + public QSpacerItem verticalSpacer; + public QTableWidget bundleList; + + public Ui_SystemInformation() { super(); } + + public void setupUi(QWidget SystemInformation) + { + SystemInformation.setObjectName("SystemInformation"); + SystemInformation.resize(new QSize(640, 480).expandedTo(SystemInformation.minimumSizeHint())); + gridLayout_2 = new QGridLayout(SystemInformation); + gridLayout_2.setObjectName("gridLayout_2"); + gridLayout = new QGridLayout(); + gridLayout.setObjectName("gridLayout"); + label = new QLabel(SystemInformation); + label.setObjectName("label"); + + gridLayout.addWidget(label, 0, 0, 1, 1); + + widget = new QWidget(SystemInformation); + widget.setObjectName("widget"); + horizontalLayout = new QHBoxLayout(widget); + horizontalLayout.setObjectName("horizontalLayout"); + horizontalSpacer = new QSpacerItem(40, 20, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum); + + horizontalLayout.addItem(horizontalSpacer); + + closeButton = new QPushButton(widget); + closeButton.setObjectName("closeButton"); + + horizontalLayout.addWidget(closeButton); + + + gridLayout.addWidget(widget, 2, 0, 1, 2); + + widget_2 = new QWidget(SystemInformation); + widget_2.setObjectName("widget_2"); + verticalLayout = new QVBoxLayout(widget_2); + verticalLayout.setObjectName("verticalLayout"); + label_2 = new QLabel(widget_2); + label_2.setObjectName("label_2"); + + verticalLayout.addWidget(label_2); + + verticalSpacer = new QSpacerItem(20, 40, com.trolltech.qt.gui.QSizePolicy.Policy.Minimum, com.trolltech.qt.gui.QSizePolicy.Policy.Expanding); + + verticalLayout.addItem(verticalSpacer); + + + gridLayout.addWidget(widget_2, 1, 1, 1, 1); + + bundleList = new QTableWidget(SystemInformation); + bundleList.setObjectName("bundleList"); + + gridLayout.addWidget(bundleList, 1, 0, 1, 1); + + + gridLayout_2.addLayout(gridLayout, 0, 0, 1, 1); + + retranslateUi(SystemInformation); + + SystemInformation.connectSlotsByName(); + } // setupUi + + void retranslateUi(QWidget SystemInformation) + { + SystemInformation.setWindowTitle(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "System Information", null)); + label.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "List of active OSGi bundles:", null)); + closeButton.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "Close", null)); + label_2.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"+ +"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"+ +"p, li { white-space: pre-wrap; }\n"+ +"</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"+ +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">universAAL Version:</span></p>\n"+ +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">1.0.0</span></p>\n"+ +"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"></p>\n"+ +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">uCC Version:</span></p>\n"+ +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><span style=\" font-size:8pt;\">1.0.0</span></p>\n"+ +"<p style=\"-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;\"></p>\n"+ +"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\"><a href=\"www.universAAL.org\"><span style=\" text-decoration: underline; color:#0000ff;\">www.universAAL.org</span></a></p></body></html>", null)); + bundleList.clear(); + bundleList.setColumnCount(4); + + QTableWidgetItem __colItem = new QTableWidgetItem(); + __colItem.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "Symbolic Name", null)); + bundleList.setHorizontalHeaderItem(0, __colItem); + + QTableWidgetItem __colItem1 = new QTableWidgetItem(); + __colItem1.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "Last Update", null)); + bundleList.setHorizontalHeaderItem(1, __colItem1); + + QTableWidgetItem __colItem2 = new QTableWidgetItem(); + __colItem2.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "Status", null)); + bundleList.setHorizontalHeaderItem(2, __colItem2); + + QTableWidgetItem __colItem3 = new QTableWidgetItem(); + __colItem3.setText(com.trolltech.qt.core.QCoreApplication.translate("SystemInformation", "Comments", null)); + bundleList.setHorizontalHeaderItem(3, __colItem3); + bundleList.setRowCount(0); + } // retranslateUi + +} + diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/OverviewView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/OverviewView.java new file mode 100644 index 0000000000000000000000000000000000000000..797edc41f4e7cbb989bd7a0829a1e6260c29fe76 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/OverviewView.java @@ -0,0 +1,72 @@ +package org.universAAL.ucc.viewjambi.overview; + +import org.universAAL.ucc.api.model.IModel; +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_Overview; + +import com.trolltech.qt.core.QModelIndex; +import com.trolltech.qt.gui.QTreeModel; + +public class OverviewView extends SubWindow { + + private static Ui_Overview install_base = new Ui_Overview(); + private static IModel model; + + public OverviewView(MainWindow parent) { + super(parent, OverviewView.install_base); + model = Activator.getModel(); + init(); + } + + public void init(){ + + + QTreeModel treeModel = new QTreeModel() { + + @Override + public String text(Object arg0) { + return (String) arg0; + } + + @Override + public int childCount(Object arg0) { + if(!(arg0 == null)){ + if(model.getApplicationManagment().containsApplication((String) arg0)){ + return model.getApplicationManagment().getInstalledBundles((String) arg0).size(); + }else{ + return 0; + } + }else{ + return model.getApplicationManagment().getInstalledApplications().size(); + } + } + + @Override + public Object child(Object arg0, int arg1) { + if(arg0 == null){ + return model.getApplicationManagment().getInstalledApplications().get(arg1); + }else{ + return model.getApplicationManagment().getInstalledBundles((String) arg0).get(arg1); + } + } + }; + + + install_base.treeView.setHeaderHidden(true); + install_base.treeView.setModel(treeModel); + install_base.treeView.doubleClicked.connect(this, "onDoubleClick(QModelIndex)"); + + } + private void onDoubleClick(QModelIndex index){ + if(Activator.getModel().getApplicationManagment().containsApplication((String) index.data())) + new Overview_ConfigView(this.parent, (String) index.data()); + } + + protected void cancel() { + this.parent.closeSubWindow(this); + } + + +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/Overview_ConfigView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/Overview_ConfigView.java new file mode 100644 index 0000000000000000000000000000000000000000..111a152f799534ac5ec05f1b7c2b86c431ee5193 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/overview/Overview_ConfigView.java @@ -0,0 +1,64 @@ +package org.universAAL.ucc.viewjambi.overview; + +import java.util.Map; +import java.util.Map.Entry; + +import org.universAAL.ucc.api.model.IModel; +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_Configure; + +import com.trolltech.qt.QUiForm; +import com.trolltech.qt.gui.QBoxLayout; +import com.trolltech.qt.gui.QHBoxLayout; +import com.trolltech.qt.gui.QLabel; +import com.trolltech.qt.gui.QWidget; + +public class Overview_ConfigView extends SubWindow { + + private static Ui_Configure install_base = new Ui_Configure(); + private static IModel model; + private String bundleName; + + protected Overview_ConfigView(MainWindow parent, String bundleName) { + super(parent, install_base); + this.bundleName = bundleName; + model = Activator.getModel(); + install_base.cancelButton.clicked.connect(this, "cancel()"); + install_base.okButton.clicked.connect(this, "save()"); + init(); + } + + public void init(){ + Map<String, String> configMap = model.getApplicationManagment().getConfiguration(bundleName); + int row = 0; + + for(Entry<String, String> entry : configMap.entrySet()){ + QHBoxLayout hBoxLayout = new QHBoxLayout(); + + QLabel attribute = new QLabel(entry.getKey()); + QLabel value = new QLabel(entry.getValue()); + + attribute.setParent(hBoxLayout); + hBoxLayout.insertWidget(0, attribute); + value.setParent(hBoxLayout); + hBoxLayout.insertWidget(1, value); + + install_base.verticalLayout_4.insertLayout(row, hBoxLayout); + row++; + } + install_base.verticalLayout_4.activate(); + } + + + protected void cancel() { + this.parent.closeSubWindow(this); + } + + protected void save(){ + + } + + +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/UninstallView.java b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/UninstallView.java new file mode 100644 index 0000000000000000000000000000000000000000..d2289b9c7b6305a89a4ea17232245f4c44050ab5 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/UninstallView.java @@ -0,0 +1,49 @@ +package org.universAAL.ucc.viewjambi.uninstall; + +import org.universAAL.ucc.viewjambi.Activator; +import org.universAAL.ucc.viewjambi.MainWindow; +import org.universAAL.ucc.viewjambi.SubWindow; +import org.universAAL.ucc.viewjambi.juic.Ui_Install; + +import com.trolltech.qt.gui.QDialog; +import com.trolltech.qt.gui.QFileDialog; +import com.trolltech.qt.gui.QMessageBox; + +public class UninstallView extends SubWindow { + + private static Ui_Install install_base = new Ui_Install(); + + + public UninstallView(MainWindow parent) { + super(parent, UninstallView.install_base); + + install_base.fileChoise.clicked.connect(this,"openFileChoise()"); + install_base.okButton.clicked.connect(this, "installFile()"); + install_base.cancelButton.clicked.connect(this, "cancel()"); + } + + protected void openFileChoise() { + QFileDialog dialog = new QFileDialog(this, "Please choose a file to install!", ".", "universAAL (*.uaal)"); + int result = dialog.exec(); + + if (result == QDialog.DialogCode.Accepted.value()) { + String file = dialog.selectedFiles().get(0); + if (file != null) + install_base.fileName.setText(file); + } + } + + protected void installFile() { + try { + Activator.getInstaller().installApplication(install_base.fileName.text()); + QMessageBox.information(this, "Sucess", "Application has been succesfull installed!"); + } catch (Exception e) { + QMessageBox.critical(this, "Error", "Application has not been installed!"); + } + this.parent.closeSubWindow(this); + } + + protected void cancel() { + this.parent.closeSubWindow(this); + } +} diff --git a/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/com_trolltech_qt_core.dll b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/com_trolltech_qt_core.dll new file mode 100644 index 0000000000000000000000000000000000000000..e0b46ed04d135c0a9250867f9223e99ec89746d9 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/java/org/universAAL/ucc/viewjambi/uninstall/com_trolltech_qt_core.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/bin/QtCore4.dll b/ucc/ucc.viewjambi/src/main/resources/bin/QtCore4.dll new file mode 100644 index 0000000000000000000000000000000000000000..3096618dd9f32e9e97b183e8c85eb92db74e36f1 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/bin/QtCore4.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/bin/QtGui4.dll b/ucc/ucc.viewjambi/src/main/resources/bin/QtGui4.dll new file mode 100644 index 0000000000000000000000000000000000000000..142f79d855e926fb6c34dc8c6f3f838d15a65ff8 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/bin/QtGui4.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_core.dll b/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_core.dll new file mode 100644 index 0000000000000000000000000000000000000000..befa2f71f0e93ef923d75c0cc323a6e9002fa709 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_core.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_gui.dll b/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_gui.dll new file mode 100644 index 0000000000000000000000000000000000000000..fbf12c94c4df738e5468b36dd4a054c577ea9e28 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/bin/com_trolltech_qt_gui.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/bin/qtjambi.dll b/ucc/ucc.viewjambi/src/main/resources/bin/qtjambi.dll new file mode 100644 index 0000000000000000000000000000000000000000..0ba40bc8e7c5b94b7cb9f8ee4b1c1da178b80c78 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/bin/qtjambi.dll differ diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/compile.bat b/ucc/ucc.viewjambi/src/main/resources/forms/compile.bat new file mode 100644 index 0000000000000000000000000000000000000000..e1be3f54ab519ba989c1f2bd4d5ad12b4729f043 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/compile.bat @@ -0,0 +1 @@ +call juic -cp -d %cd%\..\..\java\ -a \ No newline at end of file diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/MainWindow.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/MainWindow.jui new file mode 100644 index 0000000000000000000000000000000000000000..8ae5433eca4bdb27b998ce450c928515ba64b1e4 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/MainWindow.jui @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>MainWindow</class> + <widget class="QMainWindow" name="MainWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>640</width> + <height>480</height> + </rect> + </property> + <property name="windowTitle"> + <string>universAAL Control Center (UCC)</string> + </property> + <widget class="QWidget" name="centralwidget"> + <layout class="QVBoxLayout" name="verticalLayout"> + <property name="margin"> + <number>0</number> + </property> + <item> + <widget class="QMdiArea" name="mdiArea"/> + </item> + </layout> + </widget> + <widget class="QMenuBar" name="menubar"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>640</width> + <height>21</height> + </rect> + </property> + <widget class="QMenu" name="menuFile"> + <property name="title"> + <string>File</string> + </property> + <addaction name="actionExit"/> + </widget> + <widget class="QMenu" name="menuApplications"> + <property name="title"> + <string>Applications</string> + </property> + <addaction name="actionOverview"/> + <addaction name="separator"/> + <addaction name="actionInstall"/> + <addaction name="actionDeinstall"/> + </widget> + <widget class="QMenu" name="menuSystem"> + <property name="title"> + <string>System</string> + </property> + <addaction name="actionSystem_Information"/> + </widget> + <addaction name="menuFile"/> + <addaction name="menuApplications"/> + <addaction name="menuSystem"/> + </widget> + <widget class="QStatusBar" name="statusbar"/> + <action name="actionExit"> + <property name="text"> + <string>Exit</string> + </property> + </action> + <action name="actionInstall"> + <property name="text"> + <string>Install</string> + </property> + </action> + <action name="actionSystem_Information"> + <property name="text"> + <string>System Information</string> + </property> + </action> + <action name="actionDeinstall"> + <property name="text"> + <string>Deinstall</string> + </property> + </action> + <action name="actionOverview"> + <property name="text"> + <string>Overview</string> + </property> + </action> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/Overview.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/Overview.jui new file mode 100644 index 0000000000000000000000000000000000000000..d2d6ad2d45c7d1d6501b0676b1bf2d3275dddeb4 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/Overview.jui @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>Overview</class> + <widget class="QWidget" name="Overview"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>261</width> + <height>592</height> + </rect> + </property> + <property name="windowTitle"> + <string>Application Overview</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QTreeView" name="treeView"> + <property name="minimumSize"> + <size> + <width>200</width> + <height>400</height> + </size> + </property> + <property name="rootIsDecorated"> + <bool>true</bool> + </property> + <property name="itemsExpandable"> + <bool>true</bool> + </property> + <property name="expandsOnDoubleClick"> + <bool>false</bool> + </property> + <attribute name="headerVisible"> + <bool>false</bool> + </attribute> + </widget> + </item> + </layout> + </item> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="font"> + <font> + <pointsize>14</pointsize> + <weight>75</weight> + <bold>true</bold> + </font> + </property> + <property name="text"> + <string>Applications</string> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="alignment"> + <set>com.trolltech.qt.core.Qt.AlignmentFlag.AlignCenter</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/SystemInformation.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/SystemInformation.jui new file mode 100644 index 0000000000000000000000000000000000000000..143bfcc0d30dc924bc30b78aca6f148071465243 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/SystemInformation.jui @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>SystemInformation</class> + <widget class="QWidget" name="SystemInformation"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>640</width> + <height>480</height> + </rect> + </property> + <property name="windowTitle"> + <string>System Information</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>List of active OSGi bundles:</string> + </property> + </widget> + </item> + <item row="2" column="0" colspan="2"> + <widget class="QWidget" name="widget" native="true"> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="closeButton"> + <property name="text"> + <string>Close</string> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="1" column="1"> + <widget class="QWidget" name="widget_2" native="true"> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">universAAL Version:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">1.0.0</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">uCC Version:</span></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">1.0.0</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8pt;"></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="www.universAAL.org"><span style=" text-decoration: underline; color:#0000ff;">www.universAAL.org</span></a></p></body></html></string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </widget> + </item> + <item row="1" column="0"> + <widget class="QTableWidget" name="bundleList"> + <column> + <property name="text"> + <string>Symbolic Name</string> + </property> + </column> + <column> + <property name="text"> + <string>Last Update</string> + </property> + </column> + <column> + <property name="text"> + <string>Status</string> + </property> + </column> + <column> + <property name="text"> + <string>Comments</string> + </property> + </column> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/configure.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/configure.jui new file mode 100644 index 0000000000000000000000000000000000000000..c817af35323dce1b6db3b9c6e3b94e99fce2ab12 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/configure.jui @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>Configure</class> + <widget class="QWidget" name="Configure"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>Install a new application</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0" colspan="2"> + <widget class="QWidget" name="widget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="margin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="sizeConstraint"> + <enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetFixedSize</enum> + </property> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="okButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>OK</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelButton"> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </item> + <item row="0" column="0"> + <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0"> + <property name="sizeConstraint"> + <enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetMinAndMaxSize</enum> + </property> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/install.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/install.jui new file mode 100644 index 0000000000000000000000000000000000000000..4d1037e25f9a3304ac6dc20eac58f8305e61fed2 --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/install.jui @@ -0,0 +1,163 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>Install</class> + <widget class="QWidget" name="Install"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>Install a new application</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="0" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="1" column="0"> + <widget class="QLabel" name="label"> + <property name="text"> + <string>Please select a application to install:</string> + </property> + </widget> + </item> + <item row="2" column="0"> + <widget class="QLineEdit" name="fileName"/> + </item> + <item row="0" column="0"> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="4" column="0"> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item row="2" column="1"> + <widget class="QPushButton" name="fileChoise"> + <property name="maximumSize"> + <size> + <width>40</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + <item row="5" column="0" colspan="2"> + <widget class="QWidget" name="widget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="margin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="okButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>OK</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelButton"> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item row="3" column="0"> + <widget class="QLabel" name="label_2"> + <property name="text"> + <string>I want to try this out to!</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/license.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/license.jui new file mode 100644 index 0000000000000000000000000000000000000000..95b8488d8d148011d46ed7cf188cb9f9f84ec20a --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/license.jui @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>License</class> + <widget class="QWidget" name="License"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>800</width> + <height>600</height> + </rect> + </property> + <property name="windowTitle"> + <string>Install a new application</string> + </property> + <layout class="QGridLayout" name="gridLayout_2"> + <item row="1" column="0"> + <layout class="QGridLayout" name="gridLayout"> + <item row="0" column="0" colspan="2"> + <widget class="QWidget" name="widget" native="true"> + <property name="minimumSize"> + <size> + <width>0</width> + <height>20</height> + </size> + </property> + <layout class="QHBoxLayout" name="horizontalLayout_2"> + <property name="margin"> + <number>0</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <property name="sizeConstraint"> + <enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetFixedSize</enum> + </property> + <item> + <spacer name="horizontalSpacer"> + <property name="orientation"> + <enum>com.trolltech.qt.core.Qt.Orientation.Horizontal</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QPushButton" name="okButton"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="baseSize"> + <size> + <width>100</width> + <height>0</height> + </size> + </property> + <property name="text"> + <string>Accept</string> + </property> + </widget> + </item> + <item> + <widget class="QPushButton" name="cancelButton"> + <property name="minimumSize"> + <size> + <width>75</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>75</width> + <height>16777215</height> + </size> + </property> + <property name="text"> + <string>Cancel</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + </layout> + </item> + <item row="0" column="0"> + <layout class="QVBoxLayout" name="verticalLayout_4" stretch="0"> + <property name="sizeConstraint"> + <enum>com.trolltech.qt.gui.QLayout.SizeConstraint.SetMinAndMaxSize</enum> + </property> + <item> + <widget class="QTextBrowser" name="license"/> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/subwindow.jui b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/subwindow.jui new file mode 100644 index 0000000000000000000000000000000000000000..deaf7aaaace45d84ef9bf89451464010cd17661f --- /dev/null +++ b/ucc/ucc.viewjambi/src/main/resources/forms/org/universAAL/ucc/viewjambi/juic/subwindow.jui @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0" language="jambi"> + <class>SubWindow</class> + <widget class="QWidget" name="SubWindow"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>402</width> + <height>326</height> + </rect> + </property> + <property name="windowTitle"> + <string/> + </property> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <property name="spacing"> + <number>6</number> + </property> + <property name="margin"> + <number>0</number> + </property> + <item> + <layout class="QVBoxLayout" name="mainLayou"> + <property name="spacing"> + <number>0</number> + </property> + <item> + <widget class="QWidget" name="header" native="true"> + <property name="palette"> + <palette> + <active> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + </active> + <inactive> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + </inactive> + <disabled> + <colorrole role="Button"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Midlight"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Base"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + <colorrole role="Window"> + <brush brushstyle="SolidPattern"> + <color alpha="255"> + <red>204</red> + <green>204</green> + <blue>204</blue> + </color> + </brush> + </colorrole> + </disabled> + </palette> + </property> + <property name="autoFillBackground"> + <bool>true</bool> + </property> + <layout class="QHBoxLayout" name="headerLayou"> + <property name="margin"> + <number>4</number> + </property> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLabel" name="headerLogo"> + <property name="text"> + <string>TextLabel</string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" name="content" native="true"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>150</width> + <height>50</height> + </size> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </widget> + <resources/> + <connections/> +</ui> diff --git a/ucc/ucc.viewjambi/src/main/resources/images/uaal.bmp b/ucc/ucc.viewjambi/src/main/resources/images/uaal.bmp new file mode 100644 index 0000000000000000000000000000000000000000..6ac99423ac4f7f8394c111ef44e9786accf49593 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/images/uaal.bmp differ diff --git a/ucc/ucc.viewjambi/src/main/resources/images/uaal.gif b/ucc/ucc.viewjambi/src/main/resources/images/uaal.gif new file mode 100644 index 0000000000000000000000000000000000000000..f7222dcbd9c6844dfe643aef4002dc3feec5a9f1 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/images/uaal.gif differ diff --git a/ucc/ucc.viewjambi/src/main/resources/images/uaal.jpg b/ucc/ucc.viewjambi/src/main/resources/images/uaal.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1034ca163d806584949f7bf89ef2d4b129f1e7a2 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/images/uaal.jpg differ diff --git a/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-4.5.2_01.jar b/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-4.5.2_01.jar new file mode 100644 index 0000000000000000000000000000000000000000..745e43c5a9d7cfb10238e668387d811d5420a06e Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-4.5.2_01.jar differ diff --git a/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-win32-msvc2005-4.5.2_01.jar b/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-win32-msvc2005-4.5.2_01.jar new file mode 100644 index 0000000000000000000000000000000000000000..ce2458b29d32ed0758d2e7d52a8800bfc4701345 Binary files /dev/null and b/ucc/ucc.viewjambi/src/main/resources/lib/qtjambi-win32-msvc2005-4.5.2_01.jar differ diff --git a/ucc/ucc.viewjambi/target/ucc.viewjambi-0.0.1.jar b/ucc/ucc.viewjambi/target/ucc.viewjambi-0.0.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..5dcbf2cbcde3844627bfc927380bfa677e45ac40 Binary files /dev/null and b/ucc/ucc.viewjambi/target/ucc.viewjambi-0.0.1.jar differ