Commit 073d975c authored by Remi Melisson's avatar Remi Melisson
Browse files

Adding UPnP module : model extension + frascati binding

parent 83b998dc
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: SCA Binding UPnP
*
* Copyright (c) 2010 INRIA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Rémi Mélisson
*
* Contributor(s):
*
-->
<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>
<!-- ===================== -->
<!-- General Information -->
<!-- ===================== -->
<parent>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-modules</artifactId>
<version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.upnp</groupId>
<artifactId>frascati-binding-upnp</artifactId>
<packaging>jar</packaging>
<name>OW2 FraSCAti: SCA Binding UPnP Module</name>
<url>http://frascati.ow2.org/</url>
<inceptionYear>2010</inceptionYear>
<!-- ========== -->
<!-- Properties -->
<!-- ========== -->
<properties>
</properties>
<!-- ======= -->
<!-- Build -->
<!-- ======= -->
<build>
<defaultGoal>install</defaultGoal>
<plugins>
</plugins>
</build>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<!-- OW2 FraSCAti Runtime Factory Module. -->
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>${frascati.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-binding-factory</artifactId>
<version>${frascati.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati.upnp</groupId>
<artifactId>frascati-metamodel-upnp</artifactId>
<version>${frascati.version}</version>
</dependency>
<dependency>
<groupId>org.objectweb.fractal.bf.connectors</groupId>
<artifactId>fractal-bf-connectors-upnp</artifactId>
<version>${fractal-bf.version}</version>
</dependency>
</dependencies>
<!-- ============= -->
<!-- Repositories -->
<!-- ============= -->
<repositories>
</repositories>
</project>
/**
* OW2 FraSCAti SCA Binding UPnP
* Copyright (C) 2008-2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Rémi Mélisson
*
* Contributor(s):
*
*/
package org.ow2.frascati.upnp.binding;
import java.util.Map;
import org.ow2.frascati.binding.factory.AbstractBindingFactoryProcessor;
import org.ow2.frascati.upnp.UPnPBinding;
import org.ow2.frascati.upnp.UpnpPackage;
/**
* Bind components using a UPnP Binding.
*
* @author Rémi Mélisson
* @version 1.1
*/
public class FrascatiBindingUPnPProcessor
extends AbstractBindingFactoryProcessor<UPnPBinding> {
// --------------------------------------------------------------------------
// Internal methods.
// --------------------------------------------------------------------------
/**
* @see org.ow2.frascati.factory.processor.AbstractProcessor#toStringBuffer(EObjectType, StringBuffer)
*/
@Override
protected void toStringBuffer(UPnPBinding upnpBinding, StringBuffer sb) {
sb.append("<upnp:binding.upnp");
super.toStringBuffer(upnpBinding, sb);
}
@Override
protected String getBindingFactoryPluginId() {
return "upnp";
}
@Override
@SuppressWarnings("static-access")
protected void initializeBindingHints(UPnPBinding upnpBinding, Map<String, Object> hints) {
// set protocol specific parameter
//hints.put(RestConnectorConstants.URI, restBinding.getUri());
}
// --------------------------------------------------------------------------
// Public methods.
// --------------------------------------------------------------------------
/**
* @see org.ow2.frascati.factory.api.Processor#getProcessorID()
*/
public String getProcessorID() {
return getID(UpnpPackage.Literals.UPN_PBINDING);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!-- OW2 FraSCAti: SCA Binding UPnP -->
<!-- Copyright (C) 2010 INRIA -->
<!-- -->
<!-- This library is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU Lesser General Public -->
<!-- License as published by the Free Software Foundation; either -->
<!-- version 2 of the License, or (at your option) any later version. -->
<!-- -->
<!-- This library is distributed in the hope that it will be useful, -->
<!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
<!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -->
<!-- Lesser General Public License for more details. -->
<!-- -->
<!-- You should have received a copy of the GNU Lesser General Public -->
<!-- License along with this library; if not, write to the Free Software -->
<!-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -->
<!-- -->
<!-- Contact: frascati@ow2.org -->
<!-- -->
<!-- Author: Rémi Mélisson -->
<!-- -->
<!-- Contributor(s): -->
<!-- -->
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
xmlns:bf="org/ow2/frascati/binding/factory"
name="org.ow2.frascati.factory.AssemblyFactory">
<component name="sca-binding-upnp" constrainingType="bf:BindingFactoryProcessorType">
<implementation.java class="org.ow2.frascati.upnp.binding.FrascatiBindingUPnPProcessor"/>
</component>
<wire source="sca-binding/bindings" target="sca-binding-upnp/binding-processor"/>
</composite>
/**
* OW2 FraSCAti: SCA Binding RESTful
* Copyright (C) 2010 INRIA, USTL
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Philippe Merle
*
* Contributor(s):
*
*/
package org.ow2.frascati.binding.rest;
import org.junit.Test;
public class FactoryTest {
@Test
public void newFactory() throws Exception {
return;
}
}
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: frascati-metamodel-upnp;singleton:=true
Bundle-Version: 1.0.0
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.ow2.frascati.upnp,
org.ow2.frascati.upnp.impl,
org.ow2.frascati.upnp.util
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore;visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.eclipse.stp.sca;visibility:=reexport
Bundle-ActivationPolicy: lazy
# <copyright>
# </copyright>
#
# $Id$
bin.includes = .,\
model/,\
META-INF/,\
plugin.xml,\
plugin.properties
jars.compile.order = .
source.. = src/main/java/
output.. = bin/
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="upnp"
nsURI="http://frascati.ow2.org/xmlns/upnp/1.0" nsPrefix="upnp">
<eClassifiers xsi:type="ecore:EClass" name="DocumentRoot" eSuperTypes="platform:/plugin/org.eclipse.stp.sca/model/sca.ecore#//DocumentRoot">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value=""/>
<details key="kind" value="mixed"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EReference" name="bindingUPnP" upperBound="-2"
eType="#//UPnPBinding" volatile="true" transient="true" derived="true" containment="true"
resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="binding.upnp"/>
<details key="namespace" value="##targetNamespace"/>
<details key="affiliation" value="http://www.osoa.org/xmlns/sca/1.0#binding"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="UPnPBinding" eSuperTypes="platform:/plugin/org.eclipse.stp.sca/model/sca.ecore#//Binding">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="UPnPBinding"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="anyAttribute" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attributeWildcard"/>
<details key="wildcards" value="##any"/>
<details key="name" value=":3"/>
<details key="processing" value="lax"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="group" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="group"/>
<details key="name" value="group:sca:upnpbinding"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/frascati-metamodel-upnp/src/main/java"
modelPluginID="frascati-metamodel-upnp" modelName="Upnp" importerID="org.eclipse.emf.importer.ecore"
complianceLevel="5.0" copyrightFields="false" usedGenPackages="platform:/plugin/org.eclipse.stp.sca/model/sca.genmodel#//sca platform:/plugin/org.eclipse.stp.sca/model/sca.genmodel#//policy platform:/plugin/org.eclipse.stp.sca/model/sca.genmodel#//instance"
classNamePattern="">
<foreignModel>upnp.ecore</foreignModel>
<genPackages prefix="Upnp" basePackage="org.ow2.frascati" resource="XML" disposableProviderFactory="true"
ecorePackage="upnp.ecore#/">
<genClasses ecoreClass="upnp.ecore#//DocumentRoot">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference upnp.ecore#//DocumentRoot/bindingUPnP"/>
</genClasses>
<genClasses ecoreClass="upnp.ecore#//UPnPBinding">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute upnp.ecore#//UPnPBinding/anyAttribute"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute upnp.ecore#//UPnPBinding/group"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute upnp.ecore#//UPnPBinding/library"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
# <copyright>
# </copyright>
#
# $Id$
pluginName = Upnp Model
providerName = www.example.org
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<!--
<copyright>
</copyright>
$Id$
-->
<plugin>
<extension point="org.eclipse.emf.ecore.generated_package">
<package
uri="http://frascati.ow2.org/xmlns/upnp/1.0"
class="org.ow2.frascati.upnp.UpnpPackage"
genModel="model/upnp.genmodel"/>
</extension>
<extension point="org.eclipse.emf.ecore.extension_parser">
<parser
type="upnp"
class="org.ow2.frascati.upnp.util.UpnpResourceFactoryImpl"/>
</extension>
</plugin>
<?xml version="1.0"?>
<!--
* OW2 FraSCAti: UPnP Metamodel Extension
*
* Copyright (c) 2010 INRIA, University of Lille 1
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Contact: frascati@ow2.org
*
* Author: Rémi Mélisson
*
* Contributor(s):
*
-->
<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>
<!-- ===================== -->
<!-- General Information -->
<!-- ===================== -->
<parent>
<groupId>org.ow2.frascati</groupId>
<artifactId>module-upnp</artifactId>
<version>1.3-SNAPSHOT</version>
</parent>
<groupId>org.ow2.frascati.upnp</groupId>
<artifactId>frascati-metamodel-upnp</artifactId>
<name>OW2 FraSCAti: Metamodel for UPnP binding</name>
<description>SCA metamodel extension for describing UPnP binding.</description>
<!-- ===== -->
<!-- Build -->
<!-- ===== -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<configuration>
<sources>
<source>${basedir}/src</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<!-- ============ -->
<!-- Dependencies -->
<!-- ============ -->
<dependencies>
<!-- Eclipse STP SCA metamodel. -->
<dependency>
<groupId>org.eclipse.stp.sca</groupId>
<artifactId>sca-model</artifactId>
<version>${org.eclipse.stp.sca.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.stp.sca.domainmodel</groupId>
<artifactId>frascati-model</artifactId>
<version>${org.eclipse.stp.sca.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.frascati</groupId>
<artifactId>frascati-runtime-factory</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
/**
* <copyright>
* </copyright>
*
* $Id$
*/
package org.ow2.frascati.upnp;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>Document Root</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.ow2.frascati.upnp.DocumentRoot#getBindingUPnP <em>Binding UPn P</em>}</li>
* </ul>
* </p>
*
* @see org.ow2.frascati.upnp.UpnpPackage#getDocumentRoot()
* @model extendedMetaData="name='' kind='mixed'"
* @generated
*/
public interface DocumentRoot extends org.eclipse.stp.sca.DocumentRoot {
/**
* Returns the value of the '<em><b>Binding UPn P</b></em>' containment reference.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Binding UPn P</em>' containment reference isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Binding UPn P</em>' containment reference.
* @see #setBindingUPnP(UPnPBinding)
* @see org.ow2.frascati.upnp.UpnpPackage#getDocumentRoot_BindingUPnP()
* @model containment="true" upper="-2" transient="true" volatile="true" derived="true"
* extendedMetaData="kind='element' name='binding.upnp' namespace='##targetNamespace' affiliation='http://www.osoa.org/xmlns/sca/1.0#binding'"
* @generated
*/
UPnPBinding getBindingUPnP();
/**
* Sets the value of the '{@link org.ow2.frascati.upnp.DocumentRoot#getBindingUPnP <em>Binding UPn P</em>}' containment reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Binding UPn P</em>' containment reference.
* @see #getBindingUPnP()
* @generated
*/
void setBindingUPnP(UPnPBinding value);
} // DocumentRoot