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

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 @@
</parent>
<artifactId>common-homeautomation-interface</artifactId>
<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>
\ 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"?>
<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>
<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: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:element minOccurs="0" name="arg0" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg1" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg2" type="xsd:string"/>
<xsd:element minOccurs="0" name="arg3" 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:element minOccurs="0" name="return" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="invokeModuleResponse">
<wsdl:part element="tns:invokeModuleResponse" name="parameters">
<wsdl:part name="parameters" element="tns:invokeModuleResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="invokeModule">
<wsdl:part element="tns:invokeModule" name="parameters">
<wsdl:part name="parameters" element="tns:invokeModule">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="ZibasePortType">
<wsdl:operation name="invokeModule">
<wsdl:input message="tns:invokeModule" name="invokeModule">
<wsdl:input name="invokeModule" message="tns:invokeModule">
</wsdl:input>
<wsdl:output message="tns:invokeModuleResponse" name="invokeModuleResponse">
<wsdl:output name="invokeModuleResponse" message="tns:invokeModuleResponse">
</wsdl:output>
</wsdl:operation>
</wsdl:portType>
......@@ -48,8 +48,8 @@
</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 name="ZibasePort" binding="tns:ZibaseSoapBinding">
<soap:address location="http://localhost:9090/ZibasePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
\ No newline at end of file
</wsdl:definitions>
......@@ -10,6 +10,7 @@
<name>Common Mock Ligth component</name>
<properties>
<composite.file>light-mock</composite.file>
<composite.file.local>light-mock</composite.file.local>
<composite.file.deploy>light-mock</composite.file.deploy>
</properties>
......
......@@ -25,20 +25,19 @@
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>
<artifactId>common-homeautomation</artifactId>
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
-->
<groupId>org.ow2.frascati.demo</groupId>
<version>0.0.1-SNAPSHOT</version>
<artifactId>common-homeautomation-light</artifactId>
<name>Common Ligth component</name>
<properties>
<composite.file>light</composite.file>
<composite.file.local>light</composite.file.local>
<composite.file.deploy>light</composite.file.deploy>
</properties>
......@@ -48,19 +47,22 @@
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<artifactId>common-onoffdevice</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-ws</artifactId>
<version>1.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.demo</groupId>
<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>
<!--Dependencies for module common-homeautomation-zibase deployed during the test phase-->
......@@ -68,40 +70,17 @@
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.1.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1</version>
<scope>test</scope>
</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>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
......
......@@ -27,19 +27,21 @@
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.Reference;
import org.osoa.sca.annotations.Scope;
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.zibase.ZibasePortType;
/**
* 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 = -2220769980129769032L;
private static final long serialVersionUID = 3127503827067316210L;
/**
* @Property
......@@ -64,28 +66,28 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement
*/
public Light()
{
//super("Remote Ligth");
super("Remote Ligth");
}
// /**
// * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
// */
// @Override
// public Boolean onAction()
// {
// acturatorOn();
// return null;
// }
//
// /**
// * @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
// */
// @Override
// public Boolean offAction()
// {
// acturatorOff();
// return null;
// }
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#onAction()
*/
@Override
public Boolean onAction()
{
acturatorOn();
return null;
}
/**
* @see org.ow2.frascati.demo.common.onoffdevice.SwOnOffDevice#offAction()
*/
@Override
public Boolean offAction()
{
acturatorOff();
return null;
}
/**
* @see org.ow2.frascati.demo.common.homeautomation.actuator.OnOffActuator#acturatorOn()
......@@ -109,9 +111,6 @@ public class Light implements OnOffDimActuator //extends SwOnOffDevice implement
public void actuatorDim(int 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()
......
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() {
return arg2;
}
/**
* Sets the value of the arg2 property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setArg2(JAXBElement<String> value) {
this.arg2 = ((JAXBElement<String> ) value);
}
/**
* Gets the value of the arg3 property.
*
* @return
* possible object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public JAXBElement<String> getArg3() {
return arg3;
}
/**
* Sets the value of the arg3 property.
*
* @param value
* allowed object is
* {@link JAXBElement }{@code <}{@link String }{@code >}
*
*/
public void setArg3(JAXBElement<String> value) {
this.arg3 = ((JAXBElement<String> ) value);
}
public void toString(ToStringBuilder toStringBuilder) {
{
JAXBElement<String> theArg0;
theArg0 = this.getArg0();
toStringBuilder.append("arg0", theArg0);
}
{
JAXBElement<String> theArg1;
theArg1 = this.getArg1();
toStringBuilder.append("arg1", theArg1);
}
{
JAXBElement<String> theArg2;
theArg2 = this.getArg2();
toStringBuilder.append("arg2", theArg2);
}
{
JAXBElement<String> theArg3;
theArg3 = this.getArg3();
toStringBuilder.append("arg3", theArg3);
}
}
public String toString() {
final ToStringBuilder toStringBuilder = new JAXBToStringBuilder(this);
toString(toStringBuilder);
return toStringBuilder.toString();
}
}
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 invokeModuleResponse complex type.