diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/META-INF/MANIFEST.MF b/edexOsgi/com.raytheon.uf.common.registry.ebxml/META-INF/MANIFEST.MF index 4027d8337b..bf12ea2f36 100644 --- a/edexOsgi/com.raytheon.uf.common.registry.ebxml/META-INF/MANIFEST.MF +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/META-INF/MANIFEST.MF @@ -22,3 +22,4 @@ Require-Bundle: org.apache.commons.codec;bundle-version="1.4.0", com.raytheon.uf.common.comm;bundle-version="1.12.1174", com.raytheon.uf.common.time;bundle-version="1.12.1174", org.apache.http;bundle-version="4.1.2" +Import-Package: com.vividsolutions.jts.geom diff --git a/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/GeometrySlotConverter.java b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/GeometrySlotConverter.java new file mode 100644 index 0000000000..4fe00c9e3f --- /dev/null +++ b/edexOsgi/com.raytheon.uf.common.registry.ebxml/src/com/raytheon/uf/common/registry/ebxml/slots/GeometrySlotConverter.java @@ -0,0 +1,79 @@ +/** + * This software was developed and / or modified by Raytheon Company, + * pursuant to Contract DG133W-05-CQ-1067 with the US Government. + * + * U.S. EXPORT CONTROLLED TECHNICAL DATA + * This software product contains export-restricted data whose + * export/transfer/disclosure is restricted by U.S. law. Dissemination + * to non-U.S. persons whether in the United States or abroad requires + * an export license or other authorization. + * + * Contractor Name: Raytheon Company + * Contractor Address: 6825 Pine Street, Suite 340 + * Mail Stop B8 + * Omaha, NE 68106 + * 402.291.0100 + * + * See the AWIPS II Master Rights File ("Master Rights File.pdf") for + * further licensing information. + **/ +package com.raytheon.uf.common.registry.ebxml.slots; + +import java.util.ArrayList; +import java.util.List; + +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.SlotType; +import oasis.names.tc.ebxml.regrep.xsd.rim.v4.StringValueType; + +import com.vividsolutions.jts.geom.Geometry; + +/** + * Turns {@link Geometry} into Strings for storage in the registry + * + *
+ * 
+ * SOFTWARE HISTORY
+ * 
+ * Date         Ticket#    Engineer    Description
+ * ------------ ---------- ----------- --------------------------
+ * Nov 14, 2012            mnash     Initial creation
+ * 
+ * 
+ * + * @author mnash + * @version 1.0 + */ + +public class GeometrySlotConverter implements SlotConverter { + + public static final GeometrySlotConverter INSTANCE = new GeometrySlotConverter(); + + /* + * (non-Javadoc) + * + * @see + * com.raytheon.uf.common.registry.ebxml.slots.SlotConverter#getSlots(java + * .lang.String, java.lang.Object) + */ + @Override + public List getSlots(String slotName, Object slotValue) + throws IllegalArgumentException { + List slots = new ArrayList(); + if (slotValue instanceof Geometry) { + Geometry geom = (Geometry) slotValue; + SlotType slot = new SlotType(); + StringValueType type = new StringValueType(); + slot.setName(slotName); + type.setStringValue(geom.toText()); + slot.setSlotValue(type); + slots.add(slot); + } else { + throw new IllegalArgumentException("Object of type " + + slotValue.getClass().getName() + + " cannot be converted by " + + GeometrySlotConverter.class.getName()); + } + return slots; + } + +} diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-common.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-common.xml index 508a99c78f..6a8e3edc3c 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-common.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-common.xml @@ -26,17 +26,4 @@ class="org.springframework.orm.hibernate3.HibernateTransactionManager"> - - - - - - - - - - - - - diff --git a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml index a0455c9276..8fc4387562 100644 --- a/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml +++ b/edexOsgi/com.raytheon.uf.edex.registry.ebxml/res/spring/ebxml-impl.xml @@ -43,5 +43,17 @@ class="com.raytheon.uf.edex.registry.ebxml.services.cataloger.CatalogerImpl" > + + + + + + + + + + + +