Commit 9834219e authored by Gwenael Cattez's avatar Gwenael Cattez

Remove demo module from FraSCAti main pom (avoid waste of time when building FraSCAti)

Add new functionality to common-homeautomation-interface to generate zibase wsdl from java interface and exclude this interface from the generated jar
Modify the modules depending on zibase with this new functionality
parent 20e772fa
...@@ -32,4 +32,47 @@ ...@@ -32,4 +32,47 @@
</parent> </parent>
<artifactId>common-homeautomation-interface</artifactId> <artifactId>common-homeautomation-interface</artifactId>
<name>Common interfaces for home automation</name> <name>Common interfaces for home automation</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>2.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>2.4.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-wsdl</id>
<phase>process-classes</phase>
<configuration>
<className>org.ow2.frascati.demo.common.homeautomation.zibase.Zibase</className>
<outputFile>src/main/resources/zibase.wsdl</outputFile>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<excludes>
<exclude>org/ow2/frascati/demo/common/homeautomation/zibase/*</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>
\ No newline at end of file
<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions name="Zibase" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="invokeModule" type="tns:invokeModule"/>
<xsd:complexType name="invokeModule">
<xsd:sequence>
<xsd:element minOccurs="0" name="arg0" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg1" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg2" nillable="true" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg3" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="invokeModuleResponse" type="tns:invokeModuleResponse"/>
<xsd:complexType name="invokeModuleResponse">
<xsd:sequence>
<xsd:element minOccurs="0" name="return" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="invokeModuleResponse">
<wsdl:part element="tns:invokeModuleResponse" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:message name="invokeModule">
<wsdl:part element="tns:invokeModule" name="parameters">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ZibasePortType">
<wsdl:operation name="invokeModule">
<wsdl:input message="tns:invokeModule" name="invokeModule">
</wsdl:input>
<wsdl:output message="tns:invokeModuleResponse" name="invokeModuleResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ZibaseSoapBinding" type="tns:ZibasePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="invokeModule">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="invokeModule">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="invokeModuleResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Zibase">
<wsdl:port binding="tns:ZibaseSoapBinding" name="ZibasePort">
<soap:address location="http://localhost:9100/zibase/invoke"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="Zibase" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <wsdl:definitions name="Zibase" targetNamespace="http://zibase.homeautomation.common.demo.frascati.ow2.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://zibase.homeautomation.common.demo.frascati.ow2.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types> <wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://zibase.demo.frascati.ow2.org/" xmlns:tns="http://zibase.demo.frascati.ow2.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://zibase.homeautomation.common.demo.frascati.ow2.org/" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://zibase.homeautomation.common.demo.frascati.ow2.org/">
<xsd:element name="invokeModule" type="tns:invokeModule"/> <xsd:element name="invokeModule" type="tns:invokeModule"/>
<xsd:complexType name="invokeModule"> <xsd:complexType name="invokeModule">
<xsd:sequence> <xsd:sequence>
<xsd:element minOccurs="0" name="arg0" nillable="true" type="xsd:string"/> <xsd:element minOccurs="0" name="arg0" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg1" nillable="true" type="xsd:string"/> <xsd:element minOccurs="0" name="arg1" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg2" nillable="true" type="xsd:string"/> <xsd:element minOccurs="0" name="arg2" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg3" nillable="true" type="xsd:string"/> <xsd:element minOccurs="0" name="arg3" type="xsd:string"/>
</xsd:sequence> </xsd:sequence>
</xsd:complexType> </xsd:complexType>
<xsd:element name="invokeModuleResponse" type="tns:invokeModuleResponse"/> <xsd:element name="invokeModuleResponse" type="tns:invokeModuleResponse"/>
<xsd:complexType name="invokeModuleResponse"> <xsd:complexType name="invokeModuleResponse">
<xsd:sequence> <xsd:sequence>
<xsd:element minOccurs="0" name="return" nillable="true" type="xsd:string"/> <xsd:element minOccurs="0" name="return" type="xsd:string"/>
</xsd:sequence> </xsd:sequence>
</xsd:complexType> </xsd:complexType>
</xsd:schema> </xsd:schema>
</wsdl:types> </wsdl:types>
<wsdl:message name="invokeModuleResponse"> <wsdl:message name="invokeModuleResponse">
<wsdl:part element="tns:invokeModuleResponse" name="parameters"> <wsdl:part name="parameters" element="tns:invokeModuleResponse">
</wsdl:part> </wsdl:part>
</wsdl:message> </wsdl:message>
<wsdl:message name="invokeModule"> <wsdl:message name="invokeModule">
<wsdl:part element="tns:invokeModule" name="parameters"> <wsdl:part name="parameters" element="tns:invokeModule">
</wsdl:part> </wsdl:part>
</wsdl:message> </wsdl:message>
<wsdl:portType name="ZibasePortType"> <wsdl:portType name="ZibasePortType">
<wsdl:operation name="invokeModule"> <wsdl:operation name="invokeModule">
<wsdl:input message="tns:invokeModule" name="invokeModule"> <wsdl:input name="invokeModule" message="tns:invokeModule">
</wsdl:input> </wsdl:input>
<wsdl:output message="tns:invokeModuleResponse" name="invokeModuleResponse"> <wsdl:output name="invokeModuleResponse" message="tns:invokeModuleResponse">
</wsdl:output> </wsdl:output>
</wsdl:operation> </wsdl:operation>
</wsdl:portType> </wsdl:portType>
...@@ -48,8 +48,8 @@ ...@@ -48,8 +48,8 @@
</wsdl:operation> </wsdl:operation>
</wsdl:binding> </wsdl:binding>
<wsdl:service name="Zibase"> <wsdl:service name="Zibase">
<wsdl:port binding="tns:ZibaseSoapBinding" name="ZibasePort"> <wsdl:port name="ZibasePort" binding="tns:ZibaseSoapBinding">
<soap:address location="http://localhost:9100/zibase/invoke"/> <soap:address location="http://localhost:9090/ZibasePort"/>
</wsdl:port> </wsdl:port>
</wsdl:service> </wsdl:service>
</wsdl:definitions> </wsdl:definitions>
\ No newline at end of file
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<name>Common Mock Ligth component</name> <name>Common Mock Ligth component</name>
<properties> <properties>
<composite.file>light-mock</composite.file>
<composite.file.local>light-mock</composite.file.local> <composite.file.local>light-mock</composite.file.local>
<composite.file.deploy>light-mock</composite.file.deploy> <composite.file.deploy>light-mock</composite.file.deploy>
</properties> </properties>
......
...@@ -25,20 +25,19 @@ ...@@ -25,20 +25,19 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 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> <modelVersion>4.0.0</modelVersion>
<!--
<parent> <parent>
<artifactId>common-homeautomation</artifactId> <artifactId>common-homeautomation</artifactId>
<groupId>org.ow2.frascati.demo</groupId> <groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath> <relativePath>..</relativePath>
</parent> </parent>
-->
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>common-homeautomation-light</artifactId> <artifactId>common-homeautomation-light</artifactId>
<name>Common Ligth component</name> <name>Common Ligth component</name>
<properties> <properties>
<composite.file>light</composite.file>
<composite.file.local>light</composite.file.local> <composite.file.local>light</composite.file.local>
<composite.file.deploy>light</composite.file.deploy> <composite.file.deploy>light</composite.file.deploy>
</properties> </properties>
...@@ -48,19 +47,22 @@ ...@@ -48,19 +47,22 @@
<dependency> <dependency>
<groupId>org.ow2.frascati.demo</groupId> <groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-onoffdevice</artifactId> <artifactId>common-onoffdevice</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ow2.frascati</groupId> <groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-ws</artifactId> <artifactId>frascati-binding-ws</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.ow2.frascati.demo</groupId> <groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-homeautomation-interface</artifactId> <artifactId>common-homeautomation-interface</artifactId>
<version>0.0.1-SNAPSHOT</version> </dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<scope>test</scope>
</dependency> </dependency>
<!--Dependencies for module common-homeautomation-zibase deployed during the test phase--> <!--Dependencies for module common-homeautomation-zibase deployed during the test phase-->
...@@ -68,40 +70,17 @@ ...@@ -68,40 +70,17 @@
<dependency> <dependency>
<groupId>com.sun.jersey</groupId> <groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId> <artifactId>jersey-client</artifactId>
<version>1.1.5</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.jdom</groupId> <groupId>org.jdom</groupId>
<artifactId>jdom</artifactId> <artifactId>jdom</artifactId>
<version>1.1</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency>
<groupId>org.ow2.frascati.examples.test</groupId>
<artifactId>frascati-test</artifactId>
<version>1.5-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>1.5-SNAPSHOT</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
......
...@@ -27,19 +27,21 @@ ...@@ -27,19 +27,21 @@
package org.ow2.frascati.demo.common.homeautomation.light; package org.ow2.frascati.demo.common.homeautomation.light;
import org.osoa.sca.annotations.EagerInit;
import org.osoa.sca.annotations.Property; import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference; import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Scope;
import org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator; import org.ow2.frascati.demo.common.homeautomation.actuator.OnOffDimActuator;
import org.ow2.frascati.demo.common.homeautomation.zibase.ZibasePortType;
import org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice; import org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice;
import org.ow2.frascati.demo.zibase.ZibasePortType;
/** /**
* Implementation of an on,off,dim light communicated with a zibase * Implementation of an on,off,dim light communicated with a zibase
*/ */
public class Light implements OnOffDimActuator //extends SwOnOffDevice implements OnOffDimActuator @EagerInit
@Scope("COMPOSITE")
public class Light extends SwOnOffDevice implements OnOffDimActuator
{ {
private static final long serialVersionUID = 3127503827067316210L;
private static final long serialVersionUID = -2220769980129769032L;
/** /**
* @Property * @Property
...@@ -64,28 +66,28 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement ...@@ -64,28 +66,28 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement
*/ */
public Light() public Light()
{ {
//super("Remote Ligth"); super("Remote Ligth");
} }
// /** /**
// * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction() * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
// */ */
// @Override @Override
// public Boolean onAction() public Boolean onAction()
// { {
// acturatorOn(); acturatorOn();
// return null; return null;
// } }
//
// /** /**
// * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction() * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
// */ */
// @Override @Override
// public Boolean offAction() public Boolean offAction()
// { {
// acturatorOff(); acturatorOff();
// return null; return null;
// } }
/** /**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn() * @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn()
...@@ -109,9 +111,6 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement ...@@ -109,9 +111,6 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement
public void actuatorDim(int dimValue) public void actuatorDim(int dimValue)
{ {
zibase.invokeModule(moduleID, String.valueOf(OnOffDimActuator.ZIBASE_FUNCTION_DIM),protocolID,String.valueOf(dimValue)); zibase.invokeModule(moduleID, String.valueOf(OnOffDimActuator.ZIBASE_FUNCTION_DIM),protocolID,String.valueOf(dimValue));
// int convertedDim=dimValue*OnOffDimActuator.ZIBASE_ACTIONMODULE_DIM_CONSTANT;
// convertedDim+=OnOffDimActuator.ZIBASE_ACTIONMODULE_DIM;
// zibase.invokeModule(moduleID, convertedDim);
} }
public String getModuleID() public String getModuleID()
......
package org.ow2.frascati.demo.zibase;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.jvnet.jaxb2_commons.lang.ToString;
import org.jvnet.jaxb2_commons.lang.builder.JAXBToStringBuilder;
/**
* <p>Java class for invokeModule complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="invokeModule">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="arg1" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="arg2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;element name="arg3" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "invokeModule", propOrder = {
"arg0",
"arg1",
"arg2",
"arg3"
})
public class InvokeModule
implements ToString
{
@XmlElementRef(name = "arg0", namespace = "http://zibase.demo.frascati.ow2.org/", type = JAXBElement.class)
protected JAXBElement<String> arg0;
@XmlElementRef(name = "arg1", namespace = "http://zibase.demo.frascati.ow2.org/", type = JAXBElement.class)
protected JAXBElement<String> arg1;
@XmlElementRef(name = "arg2", namespace = "http://zibase.demo.frascati.ow2.org/", type = JAXBElement.class)
protected JAXBElement<String> arg2;
@XmlElementRef(name = "arg3", namespace = "http://zibase.demo.frascati.ow2.org/", type = JAXBElement.class)
protected JAXBElement<String> arg3;
/**
* Gets the value of the arg0 property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getArg0() {
return arg0;
}
/**
* Sets the value of the arg0 property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setArg0(JAXBElement<String> value) {
this.arg0 = ((JAXBElement<String> ) value);
}
/**
* Gets the value of the arg1 property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getArg1() {
return arg1;
}
/**
* Sets the value of the arg1 property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setArg1(JAXBElement<String> value) {
this.arg1 = ((JAXBElement<String> ) value);
}
/**
* Gets the value of the arg2 property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getArg2() {