Source:
public void publishWithExtensionTemplates(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts) throws OseeCoreException { String masterTemplate = masterTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, ""); slaveTemplate = ""; isDiff = renderer.getBooleanOption("Publish As Diff"); renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, masterTemplateArtifact); if (slaveTemplateArtifact != null) { renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, slaveTemplateArtifact); slaveTemplate = slaveTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, ""); } Matcher matcher = headElementsPattern.matcher(masterTemplate); matcher.find(); String artifactElement = matcher.group(4); artifactElement = artifactElement.replaceAll("<(\\w+:)?Artifact/?>", ""); artifactElement = artifactElement.replaceAll("<(\\w+:)?Set_Name>.*?</(\\w+:)?Set_Name>", ""); extractSkynetAttributeReferences(artifactElement); for (AttributeElement attributeElement : attributeElements) { String attributeName = attributeElement.getAttributeName(); if (attributeName.equals("*")) { renderer.setOption("AllAttributes", true); break; } else { renderer.setOption("AllAttributes", false); renderer.setOption("AttributeName", attributeName); } } IFile file = RenderingUtil.getRenderFile(renderer, COMMON, PREVIEW, "/", masterTemplateArtifact.getSafeName(), ".xml"); AIFile.writeToFile(file, applyTemplate(artifacts, masterTemplate, file.getParent(), null, null, PREVIEW)); if (!renderer.getBooleanOption(IRenderer.NO_DISPLAY) && !isDiff) { RenderingUtil.ensureFilenameLimit(file); wordApp.execute(file.getLocation().toFile().getAbsolutePath()); } }

Target:
public void publishWithExtensionTemplates(Artifact masterTemplateArtifact, Artifact slaveTemplateArtifact, List<Artifact> artifacts) throws OseeCoreException { String masterTemplate = masterTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, ""); slaveTemplate = ""; isDiff = renderer.getBooleanOption(PUBLISH_AS_DIFF); renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, masterTemplateArtifact); if (slaveTemplateArtifact != null) { renderer.setOption(ITemplateRenderer.TEMPLATE_OPTION, slaveTemplateArtifact); slaveTemplate = slaveTemplateArtifact.getSoleAttributeValue(CoreAttributeTypes.WholeWordContent, ""); } Matcher matcher = headElementsPattern.matcher(masterTemplate); matcher.find(); String artifactElement = matcher.group(4); artifactElement = artifactElement.replaceAll("<(\\w+:)?Artifact/?>", ""); artifactElement = artifactElement.replaceAll("<(\\w+:)?Set_Name>.*?</(\\w+:)?Set_Name>", ""); extractSkynetAttributeReferences(artifactElement); for (AttributeElement attributeElement : attributeElements) { String attributeName = attributeElement.getAttributeName(); if (attributeName.equals("*")) { renderer.setOption(ALL_ATTRIBUTES, true); break; } else { renderer.setOption(ALL_ATTRIBUTES, false); renderer.setOption(ATTRIBUTE_NAME, attributeName); } } IFile file = RenderingUtil.getRenderFile(renderer, COMMON, PREVIEW, "/", masterTemplateArtifact.getSafeName(), ".xml"); AIFile.writeToFile(file, applyTemplate(artifacts, masterTemplate, file.getParent(), null, null, PREVIEW)); if (!renderer.getBooleanOption(IRenderer.NO_DISPLAY) && !isDiff) { RenderingUtil.ensureFilenameLimit(file); wordApp.execute(file.getLocation().toFile().getAbsolutePath()); } }