diff --git a/src/main/java/com/lmco/spectrum/systemnavigation3d/service/SmgService.java b/src/main/java/com/lmco/spectrum/systemnavigation3d/service/SmgService.java index 0547e28..e1faf57 100644 --- a/src/main/java/com/lmco/spectrum/systemnavigation3d/service/SmgService.java +++ b/src/main/java/com/lmco/spectrum/systemnavigation3d/service/SmgService.java @@ -4,6 +4,7 @@ import com.lmco.spectrum.systemnavigation3d.util.io.SfxZipInputStream; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Nullable; @@ -22,6 +23,9 @@ public class SmgService { private static final Logger log = LoggerFactory.getLogger(SmgService.class); private static final String PRODUCT_XML = "product.smgXml"; + @Autowired + TransformationService transformationService; + // Max capacity is 2^31-1 bytes or ~2GB. @Nullable public byte[] processSmg(byte[] data){ @@ -29,10 +33,8 @@ public byte[] processSmg(byte[] data){ byte[] smgXmlData = entryMap.get(PRODUCT_XML); if(smgXmlData != null) { String smgXml = new String(smgXmlData); - // TODO transform - - // Update XML entry. - entryMap.put(PRODUCT_XML, smgXml.getBytes()); + smgXml = transformationService.transform(smgXml); + entryMap.put(PRODUCT_XML, smgXml.getBytes()); // Update XML entry. return repackageSmg(entryMap); } else { return null; diff --git a/src/main/java/com/lmco/spectrum/systemnavigation3d/service/TransformationService.java b/src/main/java/com/lmco/spectrum/systemnavigation3d/service/TransformationService.java new file mode 100644 index 0000000..e2d7b19 --- /dev/null +++ b/src/main/java/com/lmco/spectrum/systemnavigation3d/service/TransformationService.java @@ -0,0 +1,17 @@ +package com.lmco.spectrum.systemnavigation3d.service; + +import org.springframework.stereotype.Service; + +@Service +public class TransformationService { + + // TODO make functional + // TODO consider types of transformations we need to make + // accept list of transformation options? + // accept GEIA dtos and infer transformations? + // pending + public String transform(String smgXml){ + return smgXml; + } + +}