felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r995403 - in /felix/trunk/upnp/basedriver: pom.xml src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java
Date Thu, 09 Sep 2010 12:33:52 GMT
Author: lenzi
Date: Thu Sep  9 12:33:51 2010
New Revision: 995403

URL: http://svn.apache.org/viewvc?rev=995403&view=rev
Log:
Fixed FELIX-2579 by adding a new method extractDeviceType and calling it for root device and
its children
Fixed FELIX-2588 by merging org.osgi.service.upnp classes into the bundle during the packaging
phase


Modified:
    felix/trunk/upnp/basedriver/pom.xml
    felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java

Modified: felix/trunk/upnp/basedriver/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/pom.xml?rev=995403&r1=995402&r2=995403&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/pom.xml (original)
+++ felix/trunk/upnp/basedriver/pom.xml Thu Sep  9 12:33:51 2010
@@ -12,13 +12,42 @@
   <artifactId>org.apache.felix.upnp.basedriver</artifactId>
   <version>0.9.0-SNAPSHOT</version>
 
+  <properties>
+    <cyberdomo.jdk14.version>1.8.0</cyberdomo.jdk14.version>
+    <cyberdomo.jdk13.version>1.8.0</cyberdomo.jdk13.version>
+    <cyberlink.jdk14.version>1.7.0</cyberlink.jdk14.version>
+  </properties>
+
   <profiles>
     <profile>
+      <id>LATEST</id>
+      <repositories>
+        <repository>
+          <id>release.domoware.isti.cnr.it</id>
+          <name>Domoware Java Repository</name>
+          <url>http://domoware.isti.cnr.it/maven2/</url>
+          <snapshots><enabled>false</enabled></snapshots>
+        </repository>
+        <repository>
+          <id>snapshot.domoware.isti.cnr.it</id>
+          <name>Domoware Java Snapshot Repository</name>
+          <url>http://domoware.isti.cnr.it/maven2-snap/</url>
+          <releases><enabled>false</enabled></releases>
+        </repository>
+      </repositories>
+      <properties>
+        <cyberdomo.jdk14.version>1.9.0-SNAPSHOT</cyberdomo.jdk14.version>
+        <cyberdomo.jdk13.version>1.8.1-SNAPSHOT</cyberdomo.jdk13.version>
+        <cyberlink.jdk14.version>1.8.0-SNAPSHOT</cyberlink.jdk14.version>
+      </properties>
+    </profile>
+
+    <profile>
       <id>cyberlink</id>
       <activation>
       	<property>
-	  <name>cyberlink</name><value>true</value>
-	</property>	
+          <name>cyberlink</name><value>true</value>
+        </property>	
       </activation>
 
       <repositories>
@@ -53,7 +82,8 @@
                     <Export-Package>
                       org.apache.felix.upnp.basedriver.controller;version=0.1.0,
                       org.apache.felix.upnp.basedriver.util;version=0.3.0,
-                      org.apache.felix.upnp.basedriver.resources;version=0.3.0
+                      org.apache.felix.upnp.basedriver.resources;version=0.3.0,
+                      org.osgi.service.upnp;version=1.1.0
                     </Export-Package>
                     <Import-Package>
                       org.osgi.*, javax.xml.parsers, org.w3c.dom, org.xml.sax,
@@ -117,7 +147,8 @@
             <Export-Package>
               org.apache.felix.upnp.basedriver.controller;version=0.1.0,
               org.apache.felix.upnp.basedriver.util;version=0.3.0,
-              org.apache.felix.upnp.basedriver.resources;version=0.3.0
+              org.apache.felix.upnp.basedriver.resources;version=0.3.0,
+              org.osgi.service.upnp;version=1.1.0
             </Export-Package>
             <Import-Package>
               org.osgi.*, javax.xml.parsers, org.w3c.dom, org.xml.sax
@@ -141,7 +172,8 @@
                 <Export-Package>
                   org.apache.felix.upnp.basedriver.controller;version=0.1.0,
                   org.apache.felix.upnp.basedriver.util;version=0.3.0,
-                  org.apache.felix.upnp.basedriver.resources;version=0.3.0
+                  org.apache.felix.upnp.basedriver.resources;version=0.3.0,
+                  org.osgi.service.upnp;version=1.1.0
                 </Export-Package>
                 <Import-Package>
                   org.osgi.*
@@ -202,13 +234,13 @@
     <dependency>
       <groupId>it.cnr.isti.domoware.cyberdomo</groupId>
       <artifactId>upnp-stack</artifactId>
-      <version>1.8.0</version>
+      <version>${cyberdomo.jdk14.version}</version>
       <optional>true</optional>
     </dependency>
     <dependency>
       <groupId>it.cnr.isti.domoware.cyberdomo</groupId>
       <artifactId>upnp-stack-jdk13</artifactId>
-      <version>1.8.0</version>
+      <version>${cyberdomo.jdk13.version}</version>
       <optional>true</optional>
     </dependency>
   </dependencies>

Modified: felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java
URL: http://svn.apache.org/viewvc/felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java?rev=995403&r1=995402&r2=995403&view=diff
==============================================================================
--- felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java
(original)
+++ felix/trunk/upnp/basedriver/src/main/java/org/apache/felix/upnp/basedriver/export/BuildDevice.java
Thu Sep  9 12:33:51 2010
@@ -59,21 +59,11 @@ public class BuildDevice {
 		root.addNode(spec);
 		return root;
 	}
-	
-	private static Device buildRootDeviceNode(Node root,ServiceReference sr){		
-		Node dev = new Node(Device.ELEM_NAME);
-		root.addNode(dev);
-		DeviceData dd = new DeviceData();
-		dd.setDescriptionURI("/gen-desc.xml");
-		dev.setUserData(dd);
-		Device devUPnP = new Device(root,dev);
-
 
+	private static String extractDeviceType(ServiceReference sr) {
 		Object aux = sr.getProperty(UPnPDevice.TYPE);
-		if(aux==null){
-			devUPnP.setDeviceType(null);		
-		}else if(aux instanceof String){
-			devUPnP.setDeviceType((String) aux);
+		if(aux instanceof String){
+			return (String) aux;
 		}else if(aux instanceof String[]){
 			//The property key UPnP.device.type should be a String
 			String[] v = (String[]) aux;
@@ -87,9 +77,21 @@ public class BuildDevice {
 					maxindex=i;
 				}				
 			}
-			devUPnP.setDeviceType(v[maxindex]);
+			return v[maxindex];
+		}else{
+			return "";
 		}				
-		
+	}
+	
+	private static Device buildRootDeviceNode(Node root, ServiceReference sr){		
+		Node dev = new Node(Device.ELEM_NAME);
+		root.addNode(dev);
+		DeviceData dd = new DeviceData();
+		dd.setDescriptionURI("/gen-desc.xml");
+		dev.setUserData(dd);
+		Device devUPnP = new Device(root,dev);
+
+		devUPnP.setDeviceType(extractDeviceType(sr));
 		devUPnP.setFriendlyName((String) sr.getProperty(UPnPDevice.FRIENDLY_NAME));
 		devUPnP.setManufacture((String) sr.getProperty(UPnPDevice.MANUFACTURER));
 		devUPnP.setManufactureURL((String) sr.getProperty(UPnPDevice.MANUFACTURER_URL));
@@ -139,6 +141,7 @@ public class BuildDevice {
 		
 		Device devUPnP = new Device(dev);
 		
+		devUPnP.setDeviceType(extractDeviceType(sr));
 		devUPnP.setFriendlyName((String) sr.getProperty(UPnPDevice.FRIENDLY_NAME));
 		devUPnP.setManufacture((String) sr.getProperty(UPnPDevice.MANUFACTURER));
 		devUPnP.setManufactureURL((String) sr.getProperty(UPnPDevice.MANUFACTURER_URL));



Mime
View raw message