diff options
author | jphillips | 2010-12-23 20:17:09 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2010-12-23 20:17:09 +0000 |
commit | c715e096a93c535c9308d90cec844bb23d34a19c (patch) | |
tree | ccd7652445811de1047bf1750eeb647809d87946 | |
parent | fbfdc0d72221f7e8edad8f26559ab3c9197a6949 (diff) | |
download | org.eclipse.osee-0.9.8.v201012230002_RC.tar.gz org.eclipse.osee-0.9.8.v201012230002_RC.tar.xz org.eclipse.osee-0.9.8.v201012230002_RC.zip |
refinement: Remove checks for detecting and removing prooferror tags in Wordml0.9.8.v201012230002_RC
3 files changed, 8 insertions, 32 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java index ba141d82808..78e9c0792d2 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/word/WordUtil.java @@ -23,7 +23,6 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; -import java.util.logging.Level; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; @@ -38,10 +37,8 @@ import org.eclipse.osee.framework.jdk.core.util.Lib; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.jdk.core.util.io.Streams; import org.eclipse.osee.framework.jdk.core.util.xml.Xml; -import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; -import org.eclipse.osee.framework.skynet.core.internal.Activator; /** * Provides utility methods for parsing wordML. @@ -53,8 +50,6 @@ public class WordUtil { private static final String AML_ANNOTATION = "<.??aml:annotation.*?>"; private static final String AML_CONTENT = "<.??aml:content.*?>"; private static final String DELETIONS = "<w:delText>.*?</w:delText>"; - private static final String PROOF_ERROR_CHECK = "<.??w:proofErr.*?>"; - public static final String BODY_START = "<w:body>"; public static final String BODY_END = "</w:body>"; private static final String[] NUMBER = new String[] { @@ -285,20 +280,8 @@ public class WordUtil { return newTemplate; } - public final static String stripSpellCheck(String content) { - String response = content; - if (Strings.isValid(response)) { - try { - response = response.replaceAll(PROOF_ERROR_CHECK, ""); - } catch (Exception ex) { - OseeLog.log(Activator.class, Level.SEVERE, ex); - } - } - return response; - } - public static boolean containsWordAnnotations(String wordml) { - return wordml.contains("w:proofErr") || wordml.contains("<w:delText>") || wordml.contains("w:type=\"Word.Insertion\"") || wordml.contains("w:type=\"Word.Formatting\"") || wordml.contains("w:type=\"Word.Deletion\""); + return wordml.contains("<w:delText>") || wordml.contains("w:type=\"Word.Insertion\"") || wordml.contains("w:type=\"Word.Formatting\"") || wordml.contains("w:type=\"Word.Deletion\""); } public static String removeAnnotations(String wordml) { @@ -307,7 +290,6 @@ public class WordUtil { response = response.replaceAll(AML_ANNOTATION, ""); response = response.replaceAll(AML_CONTENT, ""); response = response.replaceAll(DELETIONS, ""); - response = response.replaceAll(PROOF_ERROR_CHECK, ""); } return response; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java index a63b36c3f08..cba092c4e26 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java @@ -14,7 +14,6 @@ package org.eclipse.osee.framework.ui.skynet.render; import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.GENERALIZED_EDIT; import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.GENERAL_REQUESTED; import static org.eclipse.osee.framework.ui.skynet.render.PresentationType.SPECIALIZED_EDIT; - import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -22,9 +21,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.LinkedList; import java.util.List; - import javax.xml.namespace.QName; - import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.XMLSerializer; import org.eclipse.osee.framework.core.data.IAttributeType; @@ -152,7 +149,7 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende @Override public void renderAttribute(IAttributeType attributeType, Artifact artifact, PresentationType presentationType, Producer producer, VariableMap map, AttributeElement attributeElement) throws OseeCoreException { - String value = ""; + // String value = ""; WordMLProducer wordMl = (WordMLProducer) producer; if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) { @@ -164,23 +161,22 @@ public class WordTemplateRenderer extends WordRenderer implements ITemplateRende } if (data != null) { - value = WordUtil.stripSpellCheck(data);//TODO what is the best way to get at unknown attribute types? (because this isn't it) //Change the BinData Id so images do not get overridden by the other images - value = WordUtil.reassignBinDataID(value); + data = WordUtil.reassignBinDataID(data); LinkType linkType = (LinkType) map.getValue("linkType"); - value = WordMlLinkHandler.link(linkType, artifact, value); - value = WordUtil.reassignBookMarkID(value); + data = WordMlLinkHandler.link(linkType, artifact, data); + data = WordUtil.reassignBookMarkID(data); } if (presentationType == PresentationType.SPECIALIZED_EDIT || presentationType == PresentationType.MERGE_EDIT) { OseeLinkBuilder linkBuilder = new OseeLinkBuilder(); wordMl.addEditParagraphNoEscape(linkBuilder.getStartEditImage(artifact.getGuid())); - wordMl.addWordMl(value); + wordMl.addWordMl(data); wordMl.addEditParagraphNoEscape(linkBuilder.getEndEditImage(artifact.getGuid())); } else { - wordMl.addWordMl(value); + wordMl.addWordMl(data); } if (presentationType != PresentationType.MERGE && presentationType != PresentationType.MERGE_EDIT) { wordMl.resetListValue(); diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java index 14101f28e2e..c01872f2e7f 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java @@ -164,8 +164,6 @@ public class WordTemplateProcessor { this.outlineNumber = outlineNumber == null ? peekAtFirstArtifactToGetParagraphNumber(template, null, artifacts) : outlineNumber; template = wordMl.setHeadingNumbers(this.outlineNumber, template, outlineType); - template = WordUtil.stripSpellCheck(template); - Matcher matcher = headElementsPattern.matcher(template); int lastEndIndex = 0; @@ -425,7 +423,7 @@ public class WordTemplateProcessor { } } - private void processAttributes(VariableMap variableMap, Artifact artifact, WordMLProducer wordMl, PresentationType presentationType, boolean multipleArtifacts, boolean publishInLine) throws OseeCoreException { + private void processAttributes(VariableMap variableMap, Artifact artifact, WordMLProducer wordMl, PresentationType presentationType, boolean multipleArtifacts, boolean publishInLine) throws OseeCoreException { for (AttributeElement attributeElement : attributeElements) { String attributeName = attributeElement.getAttributeName(); |