SCOUT-129, setting bags to null if they are empty, and switching to assuming a Concept rather then a SpecificationLink in the specifications Collection.

git-svn-id: https://svn.apache.org/repos/asf/juddi/scout/trunk@1295125 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiV3Helper.java b/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiV3Helper.java
index ac42ac9..490ca0d 100644
--- a/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiV3Helper.java
+++ b/src/main/java/org/apache/ws/scout/util/ScoutJaxrUddiV3Helper.java
@@ -833,7 +833,8 @@
     				}
                 }
 			}
-			return cbag;
+			if (cbag.getKeyedReference().isEmpty()) return null;
+			else return cbag;
     	} catch (Exception ud) {
 			throw new JAXRException("Apache JAXR Impl:", ud);
 		}
@@ -849,20 +850,25 @@
 			Iterator speciter = specifications.iterator();
 			while (speciter.hasNext()) {
 				RegistryObject registryobject = (RegistryObject) speciter.next();
-				if (registryobject instanceof SpecificationLink) {
-					SpecificationLink specificationlink = (SpecificationLink) registryobject;
-					if (specificationlink.getSpecificationObject() != null) {
-						RegistryObject ro = specificationlink.getSpecificationObject();
-						if (ro.getKey() != null) {
-							Key key = ro.getKey();
-							tbag.getTModelKey().add(key.toString());
-						}
-					}
+				if (registryobject instanceof Concept) {
+				    Concept concept = (Concept) registryobject;
+				    if (concept.getKey() != null) {
+				        tbag.getTModelKey().add(concept.getKey().toString());
+				    }
+//					SpecificationLink specificationlink = (SpecificationLink) registryobject;
+//					if (specificationlink.getSpecificationObject() != null) {
+//						RegistryObject ro = specificationlink.getSpecificationObject();
+//						if (ro.getKey() != null) {
+//							Key key = ro.getKey();
+//							tbag.getTModelKey().add(key.toString());
+//						}
+//					}
 				} else {
 					log.info("ebXML case - the RegistryObject is an ExtrinsicObject, Not implemented");
 				}
 			}
-			return tbag;
+			if (tbag.getTModelKey().isEmpty()) return null;
+			else return tbag;
     	} catch (Exception ud) {
 			throw new JAXRException("Apache JAXR Impl:", ud);
 		}