ws-scout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r190882 - /webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
Date Thu, 16 Jun 2005 07:11:28 GMT
Author: anil
Date: Thu Jun 16 00:11:26 2005
New Revision: 190882

URL: http://svn.apache.org/viewcvs?rev=190882&view=rev
Log:
Fix the AccessURI update in Service Binding. 

Modified:
    webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java

Modified: webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
URL: http://svn.apache.org/viewcvs/webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java?rev=190882&r1=190881&r2=190882&view=diff
==============================================================================
--- webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
(original)
+++ webservices/scout/trunk/modules/scout/src/java/org/apache/ws/scout/util/ScoutJaxrUddiHelper.java
Thu Jun 16 00:11:26 2005
@@ -107,6 +107,7 @@
             throws JAXRException
     {
         BindingTemplate bt = new BindingTemplate();
+        if( serve.getKey() != null) bt.setBindingKey(serve.getKey().getId());
         try
         {
             //Set Access URI
@@ -114,6 +115,7 @@
             if (accessuri != null)
             {
                 AccessPoint ap = new AccessPoint();
+                ap.setURLType(getURLType(accessuri));
                 ap.setURL(accessuri);
                 bt.setAccessPoint(ap);
             }
@@ -172,7 +174,13 @@
             String v = c.getValue();
             KeyedReference kr = new KeyedReference();
             Key key = c.getKey();
-            if(key != null ) kr.setTModelKey(c.getKey().getId());
+            if(key == null )
+            {
+                //TODO:Need to check this.  If the concept is a predefined
+                //enumeration, the key can be the parent classification scheme
+                key = c.getClassificationScheme().getKey();
+            }
+            kr.setTModelKey(key.getId());
             kr.setKeyName("Concept");
             kr.setKeyValue(v);
             pa.setKeyedReference(kr);
@@ -195,7 +203,10 @@
                pa.setFromKey(getToken(token.nextToken()));
                pa.setToKey(getToken(token.nextToken()));
                KeyedReference kr = new KeyedReference();
-               kr.setTModelKey(getToken(token.nextToken()));
+               //Sometimes the Key is UUID:something
+               String str = getToken(token.nextToken());
+               if("UUID".equals(str)) str += ":" + getToken(token.nextToken());
+               kr.setTModelKey(str);
                kr.setKeyName(getToken(token.nextToken()));
                kr.setKeyValue(getToken(token.nextToken()));
                pa.setKeyedReference(kr);
@@ -494,6 +505,18 @@
       //Token can have the value NULL which need to be converted into null
       if(tokenstr.equals("NULL")) tokenstr="";
       return tokenstr;
+   }
+
+   private static String getURLType( String accessuri)
+   {
+       String acc = accessuri.toLowerCase();
+       String uri = "other";
+       if( acc.startsWith("http:")) uri = "http";
+       else if(acc.startsWith("https:")) uri = "https";
+       else if(acc.startsWith("ftp:")) uri = "ftp";
+       else if(acc.startsWith("phone:")) uri = "phone";//TODO:Handle this better
+
+       return uri;
    }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: scout-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: scout-dev-help@ws.apache.org


Mime
View raw message