cli/src/main/java/net/timbusproject/populator/modules/linuxhardwareconverter/Cli.java Diff Switch to unified view
bundle/src/main/java/net/timbusproject/populator/modules/linuxhardwareconverter/Bundle.java Diff Switch to unified view
src/main/resources/META-INF
File was removed.
src/main/resources/META-INF/spring
File was removed.
eHealth-hardware.json
File was removed.
eHealth-hardware_bak.json
File was removed.
hardwareClusterNodes.owl
File was removed.
output-example.owl
File was removed.
output.json
File was removed.
output_2.json
File was removed.
testbed-extraction-hw.json
File was removed.
testlshw_medusa.tar.gz
File was removed.
testlshwall.json
File was removed.
timbus-cms@testbed.timbusproject.net
File was removed.
timbus.json
File was removed.
vm.json
File was removed.
src/main/java/net/timbusproject/populator/modules/linuxhardwareconverter/LinuxHardwareConverter.java Diff Switch to unified view
src/main/java/net/timbusproject/populator/modules/linuxhardwareconverter/TestConverter.java to bundle/pom.xml
--- a/src/main/java/net/timbusproject/populator/modules/linuxhardwareconverter/TestConverter.java +++ b/bundle/pom.xml @@ -1,31 +1,80 @@ -package net.timbusproject.populator.modules.linuxhardwareconverter; +<?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/xsd/maven-4.0.0.xsd"> -/** - * Copyright (c) 2013, Caixa Magica Software Lda (CMS). - * The work has been developed in the TIMBUS Project and the above-mentioned are Members of the TIMBUS Consortium. - * TIMBUS is supported by the European Union under the 7th Framework Programme for research and technological - * development and demonstration activities (FP7/2007-2013) under grant agreement no. 269940. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on - * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including without - * limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTIBITLY, or FITNESS FOR A PARTICULAR - * PURPOSE. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, - * unless required by applicable law or agreed to in writing, shall any Contributor be liable for damages, including - * any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this - * License or out of the use or inability to use the Work. - * See the License for the specific language governing permissions and limitation under the License. - */ -public class TestConverter { - public static void main(String[] args) throws Exception { - LinuxHardwareConverter converter = new LinuxHardwareConverter(); - ReadJSON readJSON = new ReadJSON("eHealth-hardware.json"); -// JSONObject jsonObject = readJSON.getJsonObject().getJSONArray("children").getJSONObject(0); -// JSONObject jsonObject = readJSON.getJsonObject().getJSONArray("return").getJSONObject(0); -// System.out.println(readJSON.getJsonObject().getJSONArray("return").get(0)); -// String result = converter.convert(readJSON.getJsonObject().getJSONArray("return").get(0).toString()); - String result = converter.convert(readJSON.getJsonObject().getJSONObject("result").toString(2)); -// System.out.println(result); - } -} + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.timbusproject.populator</groupId> + <artifactId>linux-hardware-converter</artifactId> + <version>1.1-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <artifactId>linux-hardware-converter-bundle</artifactId> + <packaging>bundle</packaging> + <name>Linux Hardware Converter - OSGi bundle</name> + + <properties> + <springframework.version>3.2.3.RELEASE</springframework.version> + </properties> + + <dependencies> + <dependency> + <groupId>${project.parent.groupId}</groupId> + <artifactId>${project.parent.artifactId}</artifactId> + <version>${project.parent.version}</version> + <scope>system</scope> + <systemPath>${project.basedir}/../pom.xml</systemPath> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>3.2.3.RELEASE</version> + </dependency> + </dependencies> + + <build> + <resources> + <resource> + <directory>../src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9</version> + <executions> + <execution> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>../src/main/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.felix</groupId> + <artifactId>maven-bundle-plugin</artifactId> + <configuration> + <excludeDependencies>${project.parent.artifactId}</excludeDependencies> + </configuration> + </plugin> + </plugins> + </build> + +</project>
src/main/resources/META-INF/spring/bundle-context-osgi.xml to bundle/src/main/resources/META-INF/spring/bundle-context-osgi.xml
File was renamed.
src/main/resources/META-INF/spring/bundle-context.xml to bundle/src/main/resources/META-INF/spring/bundle-context.xml
--- a/src/main/resources/META-INF/spring/bundle-context.xml +++ b/bundle/src/main/resources/META-INF/spring/bundle-context.xml @@ -10,7 +10,7 @@ configuration file so that this file can easily be used for integration testing outside of an OSGi environment --> - <bean name="converter" class="net.timbusproject.populator.modules.linuxhardwareconverter.LinuxHardwareConverter" /> + <bean name="converter" class="net.timbusproject.populator.modules.linuxhardwareconverter.Bundle" /> <context:annotation-config/>
linuxHardware.owl to cli/pom.xml
--- a/linuxHardware.owl +++ b/cli/pom.xml @@ -1,122 +1,87 @@ -<?xml version="1.0"?> -<rdf:RDF xmlns="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#" - xml:base="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl" - xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" - xmlns:owl="http://www.w3.org/2002/07/owl#" - xmlns:xsd="http://www.w3.org/2001/XMLSchema#" - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" - xmlns:HardwareIndividuals="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#"> - <owl:Ontology rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl"> - <owl:imports rdf:resource="http://timbus.teco.edu/ontologies/DSOs/hardwareMapping.owl"/> - </owl:Ontology> - +<?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/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>net.timbusproject.populator</groupId> + <artifactId>linux-hardware-converter</artifactId> + <version>1.1-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Data properties - // - /////////////////////////////////////////////////////////////////////////////////////// - --> + <artifactId>linux-hardware-converter-cli</artifactId> + <packaging>jar</packaging> + <name>Linux Hardware Converter - command-line interface</name> - + <properties> + <project.mainClass>net.timbusproject.populator.modules.linuxhardwareconverter.Cli</project.mainClass> + </properties> + <dependencies> + <dependency> + <groupId>${project.parent.groupId}</groupId> + <artifactId>${project.parent.artifactId}</artifactId> + <version>${project.parent.version}</version> + <scope>system</scope> + <systemPath>${project.basedir}/../pom.xml</systemPath> + </dependency> + <dependency> + <groupId>commons-cli</groupId> + <artifactId>commons-cli</artifactId> + <version>1.2</version> + </dependency> + <dependency> + <groupId>org.codehaus.janino</groupId> + <artifactId>janino</artifactId> + <version>2.6.1</version> + </dependency> + </dependencies> - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#hasCapacity --> + <build> + <resources> + <resource> + <directory>../src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> + <directory>src/main/resources</directory> + <includes> + <include>**/*</include> + </includes> + </resource> + </resources> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.9</version> + <executions> + <execution> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>../src/main/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <configuration> + <appendAssemblyId>false</appendAssemblyId> + <descriptorRefs> + <descriptor>jar-with-dependencies</descriptor> + </descriptorRefs> + </configuration> + </plugin> + </plugins> + </build> - <owl:DatatypeProperty rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#hasCapacity"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Classes - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#CentralProcessingUnit --> - - <owl:Class rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#CentralProcessingUnit"/> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#Motherboard --> - - <owl:Class rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#Motherboard"/> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#NetworkResource --> - - <owl:Class rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#NetworkResource"/> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#StorageResource --> - - <owl:Class rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#StorageResource"/> - - - - <!-- - /////////////////////////////////////////////////////////////////////////////////////// - // - // Individuals - // - /////////////////////////////////////////////////////////////////////////////////////// - --> - - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl# --> - - <owl:NamedIndividual rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#"> - <rdf:type rdf:resource="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#NetworkResource"/> - </owl:NamedIndividual> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#BIOS --> - - <owl:NamedIndividual rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#BIOS"> - <rdf:type rdf:resource="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#StorageResource"/> - <hasCapacity rdf:datatype="http://www.w3.org/2001/XMLSchema#string">131072</hasCapacity> - </owl:NamedIndividual> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHzIntel Corp. --> - - <owl:NamedIndividual rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHzIntel Corp."> - <rdf:type rdf:resource="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#CentralProcessingUnit"/> - </owl:NamedIndividual> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#MotherboardVirtualBox --> - - <owl:NamedIndividual rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#MotherboardVirtualBox"> - <rdf:type rdf:resource="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#Motherboard"/> - </owl:NamedIndividual> - - - - <!-- http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#System memory --> - - <owl:NamedIndividual rdf:about="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#System memory"> - <rdf:type rdf:resource="http://timbus.teco.edu/ontologies/DSOs/HardwareIndividuals.owl#StorageResource"/> - <hasCapacity rdf:datatype="http://www.w3.org/2001/XMLSchema#string">1044664320</hasCapacity> - </owl:NamedIndividual> -</rdf:RDF> - - - -<!-- Generated by the OWL API (version 3.4.3-SNAPSHOT) http://owlapi.sourceforge.net --> - +</project>