[MOBY-guts] biomoby commit

Dmitry Repchevski drepchevski at dev.open-bio.org
Wed Feb 2 13:23:41 UTC 2011


drepchevski
Wed Feb  2 08:23:41 EST 2011
Update of /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/factory/jaxb
In directory dev.open-bio.org:/tmp/cvs-serv16893

Modified Files:
	JAXBMobyCentralImpl.java 
Log Message:
registerService() was broken in MobyCentral library
moby-live/Java/src/main/org/inb/biomoby/central/factory/jaxb JAXBMobyCentralImpl.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/factory/jaxb/JAXBMobyCentralImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/factory/jaxb/JAXBMobyCentralImpl.java	2009/09/09 19:47:48	1.1
+++ /home/repository/moby/moby-live/Java/src/main/org/inb/biomoby/central/factory/jaxb/JAXBMobyCentralImpl.java	2011/02/02 13:23:40	1.2
@@ -71,7 +71,168 @@
         request.setAuthURI(service.getAuthURI());
         request.setContactEmail(service.getContactEmail());
         request.setDescription(service.getDescription());
-        
+
+        request.setURL(service.getUrl());
+        request.setCategory(service.getCategory().name());
+
+        request.setAuthoritativeService(service.isAuthoritative() ? 1 : 0);
+
+        ServiceType serviceType = service.getServiceType();
+        request.setServiceType(serviceType == null ? "" : serviceType.getName());
+
+        Input input = service.getInput();
+
+        if (input != null)
+        {
+            RegisterServiceOperation.Input in = new RegisterServiceOperation.Input();
+
+            for (Simple simple : input.getSimples())
+            {
+                RegisterServiceOperation.Simple sm = new RegisterServiceOperation.Simple();
+                sm.setArticleName(simple.getArticleName());
+
+                ObjectType objectType = simple.getObjectType();
+
+                if (objectType != null)
+                {
+                    sm.setObjectType(objectType.getName());
+                }
+
+                for (Namespace namespace : simple.getNamespaces())
+                {
+                    sm.getNamespaces().add(namespace.getName());
+                }
+
+                in.getSimples().add(sm);
+            }
+
+            for (Collection collection : input.getCollections())
+            {
+                RegisterServiceOperation.Collection cl = new RegisterServiceOperation.Collection();
+
+                cl.setArticleName(collection.getArticleName());
+
+                Simple simple = collection.getSimple();
+
+                if (simple != null)
+                {
+                    RegisterServiceOperation.Simple sm = new RegisterServiceOperation.Simple();
+                    sm.setArticleName(simple.getArticleName());
+
+                    ObjectType objectType = simple.getObjectType();
+
+                    if (objectType != null)
+                    {
+                        sm.setObjectType(objectType.getName());
+                    }
+
+                    for (Namespace namespace : simple.getNamespaces())
+                    {
+                        sm.getNamespaces().add(namespace.getName());
+                    }
+
+                    cl.setSimple(sm);
+                }
+
+                in.getCollections().add(cl);
+            }
+
+            request.setInput(in);
+        }
+
+        Output output = service.getOutput();
+
+        if (output != null)
+        {
+            RegisterServiceOperation.Output out = new RegisterServiceOperation.Output();
+
+            for (Simple simple : output.getSimples())
+            {
+                RegisterServiceOperation.Simple sm = new RegisterServiceOperation.Simple();
+                sm.setArticleName(simple.getArticleName());
+
+                ObjectType objectType = simple.getObjectType();
+
+                if (objectType != null)
+                {
+                    sm.setObjectType(objectType.getName());
+                }
+
+                for (Namespace namespace : simple.getNamespaces())
+                {
+                    sm.getNamespaces().add(namespace.getName());
+                }
+
+                out.getSimples().add(sm);
+            }
+
+            for (Collection collection : output.getCollections())
+            {
+                RegisterServiceOperation.Collection cl = new RegisterServiceOperation.Collection();
+
+                cl.setArticleName(collection.getArticleName());
+
+                Simple simple = collection.getSimple();
+
+                if (simple != null)
+                {
+                    RegisterServiceOperation.Simple sm = new RegisterServiceOperation.Simple();
+                    sm.setArticleName(simple.getArticleName());
+
+                    ObjectType objectType = simple.getObjectType();
+
+                    if (objectType != null)
+                    {
+                        sm.setObjectType(objectType.getName());
+                    }
+
+                    for (Namespace namespace : simple.getNamespaces())
+                    {
+                        sm.getNamespaces().add(namespace.getName());
+                    }
+
+                    cl.setSimple(sm);
+                }
+
+                out.getCollections().add(cl);
+            }
+
+            request.setOutput(out);
+        }
+
+        List<Parameter> parameters = service.getSecondaryArticles();
+
+        if (!parameters.isEmpty())
+        {
+            RegisterServiceOperation.SecondaryArticles sa = new RegisterServiceOperation.SecondaryArticles();
+
+            for (Parameter parameter :service.getSecondaryArticles())
+            {
+                RegisterServiceOperation.Parameter p = new RegisterServiceOperation.Parameter();
+
+                p.setDatatype(parameter.getDatatype().name());
+                p.setArticleName(parameter.getArticleName());
+                p.setDefault(parameter.getDefault());
+                p.setDescription(parameter.getDescription());
+                p.setMin(parameter.getMin());
+                p.setMax(parameter.getMax());
+
+                List<String> enums = parameter.getEnum();
+
+                if (!enums.isEmpty())
+                {
+                    for (String _enum : enums)
+                    {
+                        p.getEnum().add(_enum);
+                    }
+                }
+
+                sa.getParameter().add(p);
+            }
+
+            request.setSecondaryArticles(sa);
+        }
+
         MobyRegistration response = endpoint.call(request);
         
         Registration registration = new Registration();




More information about the MOBY-guts mailing list