Author: DartPeng
Date: 2009-12-02 04:03:25 -0500 (Wed, 02 Dec 2009)
New Revision: 18969
Added:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
Removed:
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/freemarker/FreemarkerPackage.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
Log:
JBIDE-5326
DONE
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/freemarker/FreemarkerPackage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/freemarker/FreemarkerPackage.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks/model/freemarker/FreemarkerPackage.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -58,7 +58,7 @@
* <!-- end-user-doc -->
* @generated
*/
- String eNS_PREFIX = "flt";
+ String eNS_PREFIX = "ftl";
/**
* The singleton instance of the package.
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/RuntimeMetadata.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -21,7 +21,9 @@
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.IOException;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -43,13 +45,13 @@
/**
* Smooks configuration runtime metadata.
* <p/>
- * Verifies the specified config is a Smooks configuration and extracts metadata from the
- * config e.g. input file, dependencies.
+ * Verifies the specified config is a Smooks configuration and extracts metadata
+ * from the config e.g. input file, dependencies.
*
* @author <a
href="mailto:tom.fennelly@jboss.com">tom.fennelly@jboss.com</a>
*/
public class RuntimeMetadata {
-
+
private Smooks metadataExtractor;
private boolean isSmooksConfig;
private boolean isValidSmooksConfig;
@@ -61,13 +63,15 @@
public RuntimeMetadata() {
metadataExtractor = new Smooks();
- metadataExtractor.addVisitor(new SmooksConfigAsserter(),
"/smooks-resource-list", "http://www.milyn.org/xsd/smooks-1.1.xsd");
- metadataExtractor.addVisitor(new InputParamExtractor(),
"/smooks-resource-list/params/param",
"http://www.milyn.org/xsd/smooks-1.1.xsd");
-
+ metadataExtractor.addVisitor(new SmooksConfigAsserter(),
"/smooks-resource-list",
+ "http://www.milyn.org/xsd/smooks-1.1.xsd");
+ metadataExtractor.addVisitor(new InputParamExtractor(),
"/smooks-resource-list/params/param",
+ "http://www.milyn.org/xsd/smooks-1.1.xsd");
+
// Build dependency map...
RuntimeDependency.addDependencyChecklist(metadataExtractor);
}
-
+
public boolean isSmooksConfig() {
return isSmooksConfig;
}
@@ -77,29 +81,30 @@
}
public String getErrorMessage() {
- if(isValidSmooksConfig) {
- throw new IllegalStateException("Invalid call to 'getErrorMessage()'.
Smooks configuration is NOT invalid.");
+ if (isValidSmooksConfig) {
+ throw new IllegalStateException(
+ "Invalid call to 'getErrorMessage()'. Smooks configuration is NOT
invalid.");
}
-
- if(configFile == null) {
+
+ if (configFile == null) {
return "Smooks configuration file not configured, or does not exist.";
- } else if(!configFile.exists()) {
+ } else if (!configFile.exists()) {
return "Specified Smooks configuration file not found.";
- } else if(!configFile.isFile()) {
- return "Specified Smooks configuration file is not a readable file.";
- } else if(!isSmooksConfig) {
- return "Specified Smooks configuration file is not a valid Smooks
Configuration.";
- } else if(inputFile == null) {
- return "Specified Smooks configuration 'Input' task is not configured
with a sample input file. Please configure the 'Input' task in the Process
flow.";
- } else if(!inputFile.exists()) {
- return "Specified Smooks configuration 'Input' task is configured with a
sample input file, but the file cannot be found. Please reconfigure the 'Input'
task in the Process flow.";
- } else if(!inputFile.isFile()) {
- return "Specified Smooks configuration 'Input' task is configured with a
sample input file, but the file cannot be read. Please reconfigure the 'Input'
task in the Process flow.";
+ } else if (!configFile.isFile()) {
+ return "Specified Smooks configuration file is not a readable file.";
+ } else if (!isSmooksConfig) {
+ return "Specified Smooks configuration file is not a valid Smooks
Configuration.";
+ } else if (inputFile == null) {
+ return "Specified Smooks configuration 'Input' task is not configured
with a sample input file. Please configure the 'Input' task in the Process
flow.";
+ } else if (!inputFile.exists()) {
+ return "Specified Smooks configuration 'Input' task is configured with a
sample input file, but the file cannot be found. Please reconfigure the 'Input'
task in the Process flow.";
+ } else if (!inputFile.isFile()) {
+ return "Specified Smooks configuration 'Input' task is configured with a
sample input file, but the file cannot be read. Please reconfigure the 'Input'
task in the Process flow.";
}
- return "";
+ return "";
}
-
+
public File getConfigFile() {
return configFile;
}
@@ -111,7 +116,7 @@
public File getInputFile() {
return inputFile;
}
-
+
public List<RuntimeDependency> getDependencies() {
return dependencies;
}
@@ -119,57 +124,57 @@
public Set<ProcessNodeType> getNodeTypes() {
return processNodeTypes;
}
-
+
public String getNodeTypesString() {
StringBuilder builder = new StringBuilder();
- for(ProcessNodeType nodeType : processNodeTypes) {
- if(builder.length() > 0) {
+ for (ProcessNodeType nodeType : processNodeTypes) {
+ if (builder.length() > 0) {
builder.append(',');
}
builder.append(nodeType.toString());
}
return builder.toString();
}
-
+
public void setSmooksConfig(IResource smooksConfig) {
reset();
-
- if(smooksConfig != null) {
+
+ if (smooksConfig != null) {
setSmooksConfig(new File(smooksConfig.getRawLocation().toOSString().trim()));
}
}
-
+
public void setSmooksConfig(File file) {
reset();
- if(file != null) {
+ if (file != null) {
configFile = file;
- if(configFile.exists() && configFile.isFile()) {
+ if (configFile.exists() && configFile.isFile()) {
ExecutionContext execContext = metadataExtractor.createExecutionContext();
Properties inputParams = new Properties();
-
+
try {
// Filter the config and capture the input params...
execContext.setAttribute(InputParamExtractor.class, inputParams);
execContext.setAttribute(RuntimeMetadata.class, this);
-
+
metadataExtractor.filterSource(execContext, new StreamSource(new
FileInputStream(configFile)));
-
+
inputType = inputParams.getProperty(SmooksModelUtils.INPUT_TYPE);
- if(inputType != null) {
+ if (inputType != null) {
String inputPath = inputParams.getProperty(inputType);
- if(inputPath != null) {
+ if (inputPath != null) {
String resolvedFilePath;
try {
resolvedFilePath = SmooksUIUtils.parseFilePath(inputPath.trim());
- } catch(Exception e) {
+ } catch (Exception e) {
// It's not a valid config...
inputFile = new File(inputPath.trim());
return;
}
-
- inputFile = new File(resolvedFilePath);
- if(inputFile.exists() && inputFile.isFile()) {
+
+ inputFile = new File(resolvedFilePath);
+ if (inputFile.exists() && inputFile.isFile()) {
isValidSmooksConfig = true;
}
}
@@ -181,6 +186,54 @@
}
}
+ public void setSmooksConfig(File file, InputStream inputStream) {
+ reset();
+ if (file != null) {
+ configFile = file;
+ if (configFile.exists() && configFile.isFile()) {
+ if (inputStream == null) {
+ try {
+ inputStream = new FileInputStream(file);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+ ExecutionContext execContext = metadataExtractor.createExecutionContext();
+ Properties inputParams = new Properties();
+
+ try {
+ // Filter the config and capture the input params...
+ execContext.setAttribute(InputParamExtractor.class, inputParams);
+ execContext.setAttribute(RuntimeMetadata.class, this);
+
+ metadataExtractor.filterSource(execContext, new StreamSource(inputStream));
+
+ inputType = inputParams.getProperty(SmooksModelUtils.INPUT_TYPE);
+ if (inputType != null) {
+ String inputPath = inputParams.getProperty(inputType);
+ if (inputPath != null) {
+ String resolvedFilePath;
+ try {
+ resolvedFilePath = SmooksUIUtils.parseFilePath(inputPath.trim());
+ } catch (Exception e) {
+ // It's not a valid config...
+ inputFile = new File(inputPath.trim());
+ return;
+ }
+
+ inputFile = new File(resolvedFilePath);
+ if (inputFile.exists() && inputFile.isFile()) {
+ isValidSmooksConfig = true;
+ }
+ }
+ }
+ } catch (Exception e) {
+ // Not a valid Smooks config file
+ }
+ }
+ }
+ }
+
private void reset() {
isSmooksConfig = false;
isValidSmooksConfig = false;
@@ -190,8 +243,9 @@
processNodeTypes.clear();
}
- private static class SmooksConfigAsserter implements SAXVisitBefore {
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException, IOException {
+ private static class SmooksConfigAsserter implements SAXVisitBefore {
+ public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException,
+ IOException {
RuntimeMetadata metadata = (RuntimeMetadata)
execContext.getAttribute(RuntimeMetadata.class);
metadata.isSmooksConfig = true;
}
@@ -199,22 +253,24 @@
private static class InputParamExtractor implements SAXVisitBefore, SAXVisitAfter {
- public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException, IOException {
+ public void visitBefore(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException,
+ IOException {
paramElement.accumulateText();
}
- public void visitAfter(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException, IOException {
+ public void visitAfter(SAXElement paramElement, ExecutionContext execContext) throws
SmooksException,
+ IOException {
Properties inputParams = (Properties)
execContext.getAttribute(InputParamExtractor.class);
-
- if(inputParams != null) {
+
+ if (inputParams != null) {
String paramName = paramElement.getAttribute("name");
-
- if(paramName != null) {
- if(paramName.equals(SmooksModelUtils.INPUT_TYPE)) {
+
+ if (paramName != null) {
+ if (paramName.equals(SmooksModelUtils.INPUT_TYPE)) {
inputParams.setProperty(SmooksModelUtils.INPUT_TYPE,
paramElement.getTextContent());
} else {
String paramType = paramElement.getAttribute("type");
- if(paramType != null &&
paramType.equals(SmooksModelUtils.INPUT_ACTIVE_TYPE)) {
+ if (paramType != null &&
paramType.equals(SmooksModelUtils.INPUT_ACTIVE_TYPE)) {
inputParams.setProperty(paramName, paramElement.getTextContent());
}
}
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.common.command.Command;
@@ -22,6 +23,7 @@
import org.eclipse.emf.edit.command.RemoveCommand;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -36,6 +38,7 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.IFormColors;
import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -47,6 +50,8 @@
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
+import org.jboss.tools.smooks.graphical.editors.ISmooksEditorInitListener;
+import org.jboss.tools.smooks.graphical.editors.SmooksMessage;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
import org.jboss.tools.smooks.model.smooks.ParamType;
import org.jboss.tools.smooks.model.smooks.ParamsType;
@@ -59,8 +64,10 @@
*
*/
public class SmooksConfigurationOverviewPage extends FormPage implements
ISmooksModelValidateListener,
- ISourceSynchronizeListener {
+ ISourceSynchronizeListener, ISmooksEditorInitListener {
+ private int currentMessageType = IMessageProvider.NONE;
+ private String currentMessage = null;
private ISmooksModelProvider smooksModelProvider;
private ModelPanelCreator defaultSettingPanelCreator;
private Section globalParamSection;
@@ -225,7 +232,8 @@
// pgl.numColumns = 2;
//
// createProfilesSection(profilesComposite, toolkit);
-
+
+ updateFormHeader();
}
private void createSettingSection(Composite settingComposite, FormToolkit toolkit) {
@@ -323,15 +331,15 @@
private void createGlobalParamterSection(Composite globalParamComposite, FormToolkit
toolkit) {
if (smooksModelProvider != null) {
- toolkit.createLabel(globalParamComposite,
Messages.SmooksConfigurationOverviewPage_FilterTypeLabel).setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(globalParamComposite,
Messages.SmooksConfigurationOverviewPage_FilterTypeLabel)
+ .setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false);
streamFilterTypeCombo = new Combo(globalParamComposite, SWT.DROP_DOWN |
SWT.READ_ONLY);
streamFilterTypeCombo.setItems(new String[] { "SAX", "DOM" });
//$NON-NLS-1$ //$NON-NLS-2$
streamFilterTypeCombo.setLayoutData(gd);
- toolkit.createLabel(globalParamComposite,
Messages.SmooksConfigurationOverviewPage_SerializationLabel).setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(globalParamComposite,
Messages.SmooksConfigurationOverviewPage_SerializationLabel)
+ .setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
gd = new GridData(SWT.FILL, SWT.NONE, true, false);
defaultSerializationOnCheckbox = toolkit.createButton(globalParamComposite,
"", SWT.CHECK); //$NON-NLS-1$
defaultSerializationOnCheckbox.setLayoutData(gd);
@@ -599,6 +607,48 @@
return null;
}
+ public void initFailed(int messageType, String message) {
+ this.currentMessage = message;
+ this.currentMessageType = messageType;
+ updateFormHeader();
+ }
+
+ protected void updateFormHeader() {
+ if (currentMessageType == IMessageProvider.NONE) {
+ if (this.getManagedForm() != null) {
+ getManagedForm().getMessageManager().removeAllMessages();
+ getManagedForm().getMessageManager().update();
+
+ streamFilterTypeCombo.setEnabled(true);
+ defaultSerializationOnCheckbox.setEnabled(true);
+ }
+ } else {
+ if (this.getManagedForm() != null) {
+ streamFilterTypeCombo.setEnabled(false);
+ defaultSerializationOnCheckbox.setEnabled(false);
+ String[] messages = currentMessage.split("\n");
+ List<IMessage> messageList = new ArrayList<IMessage>();
+ for (int i = 0; i < messages.length; i++) {
+ String message = messages[i];
+ if (message != null)
+ message.trim();
+ if (message.length() == 0) {
+ continue;
+ }
+ messageList.add(new SmooksMessage(currentMessageType, message));
+ }
+ String mainMessage = null;
+ if (messageList.isEmpty()) {
+ mainMessage = currentMessage;
+ } else {
+ mainMessage = messageList.get(0).getMessage();
+ }
+ this.getManagedForm().getForm().getForm().setMessage(mainMessage,
currentMessageType,
+ messageList.toArray(new IMessage[] {}));
+ }
+ }
+ }
+
/*
* The following code has been commented out for now. We may add more
* properties as they become necessary, but for now, this is just extraneous
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -75,6 +75,7 @@
optionsPage = createSmooksConfigurationOverviewPage();
addValidateListener(optionsPage);
addSourceSynchronizeListener(optionsPage);
+ addSmooksEditorInitListener(optionsPage);
try {
int index = this.addPage(optionsPage);
setPageText(index, Messages.SmooksMultiFormEditor_opetiontab_label);
@@ -101,6 +102,7 @@
processPage = new SmooksProcessGraphicalEditor(this, "process",
Messages.SmooksMultiFormEditor_processpage_name, this); //$NON-NLS-1$
addSourceSynchronizeListener(processPage);
addValidateListener(processPage);
+ addSmooksEditorInitListener(processPage);
try {
int index = this.addPage(processPage);
setPageText(index, Messages.SmooksMultiFormEditor_processtabel_label);
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/uitls/SmooksUIUtils.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -3005,7 +3005,6 @@
}
public static String judgeSmooksPlatformVersion(EObject smooksModel) {
-
if (smooksModel instanceof org.jboss.tools.smooks.model.smooks.DocumentRoot) {
EMap<String, String> nsMap = ((org.jboss.tools.smooks.model.smooks.DocumentRoot)
smooksModel)
.getXMLNSPrefixMap();
@@ -3034,26 +3033,113 @@
params.getParam().add(param);
}
+ protected static String getSelectorValue(EObject model) {
+ if (getSelectorFeature(model) != null) {
+ EStructuralFeature feature = getSelectorFeature(model);
+ Object selectorValue = model.eGet(feature);
+ if (selectorValue != null)
+ return selectorValue.toString();
+ }
+ return null;
+ }
+
+ protected static boolean isJavaPatternSelector(String selector) {
+ if (selector.indexOf('.') != -1) {
+ String[] ss = selector.split("\\.");
+ for (int i = 0; i < ss.length; i++) {
+ String s = ss[i];
+ if (s != null) {
+ char[] chars = s.toCharArray();
+ for (int j = 0; j < chars.length; j++) {
+ char c = chars[j];
+ if (Character.isJavaIdentifierPart(c)) {
+
+ } else {
+ return false;
+ }
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ protected static void collectSelectorStrings(EObject model, List<String>
selectors) {
+ EStructuralFeature feature = getSelectorFeature(model);
+ if (feature != null) {
+ String fullSelector = getSelectorValue(model);
+ if (fullSelector != null) {
+ selectors.add(fullSelector);
+ }
+ }
+ List<EObject> children = model.eContents();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ EObject eObject = (EObject) iterator.next();
+ collectSelectorStrings(eObject, selectors);
+ }
+ }
+
+ protected static boolean isJavaPatternSelectorValue(EObject model) {
+ List<String> selectorList = new ArrayList<String>();
+ collectSelectorStrings(model, selectorList);
+ for (Iterator<?> iterator = selectorList.iterator(); iterator.hasNext();) {
+ String fullSelector = (String) iterator.next();
+ String[] selectors = null;
+
+ // '/' is selector seperator
+ if (fullSelector.indexOf("/") != -1) {
+ selectors = fullSelector.split("/");
+ } else {
+ // ' ' is selector seperator too
+ if (fullSelector.indexOf(" ") != -1) {
+ selectors = fullSelector.split(" ");
+ }
+ }
+ if (selectors != null) {
+ for (int k = 0; k < selectors.length; k++) {
+ String selector = selectors[k];
+ if (selector != null)
+ selector = selector.trim();
+ if (selector.length() == 0)
+ continue;
+ if (isJavaPatternSelector(selector)) {
+ return true;
+ }
+ }
+ } else {
+ if (isJavaPatternSelector(fullSelector)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
public static String judgeInputType(EObject smooksModel) {
- String inputType = null;
+ String inputType = SmooksModelUtils.INPUT_TYPE_XML;
if (smooksModel instanceof org.jboss.tools.smooks.model.smooks.DocumentRoot) {
SmooksResourceListType rlist = ((org.jboss.tools.smooks.model.smooks.DocumentRoot)
smooksModel)
.getSmooksResourceList();
- if (rlist.getAbstractReader().isEmpty())
- return null;
- AbstractReader reader = rlist.getAbstractReader().get(0);
- if (CsvReader.class.isInstance(reader) || CSV12Reader.class.isInstance(reader)) {
- inputType = SmooksModelUtils.INPUT_TYPE_CSV;
+ if (rlist.getAbstractReader().isEmpty()) {
+ if (isJavaPatternSelectorValue(rlist)) {
+ inputType = SmooksModelUtils.INPUT_TYPE_JAVA;
+ }
+ } else {
+ AbstractReader reader = rlist.getAbstractReader().get(0);
+ if (CsvReader.class.isInstance(reader) || CSV12Reader.class.isInstance(reader)) {
+ inputType = SmooksModelUtils.INPUT_TYPE_CSV;
+ }
+ if (EDIReader.class.isInstance(reader) || EDI12Reader.class.isInstance(reader)) {
+ inputType = SmooksModelUtils.INPUT_TYPE_EDI_1_1;
+ }
+ if (JsonReader.class.isInstance(reader) || Json12Reader.class.isInstance(reader)) {
+ inputType = SmooksModelUtils.INPUT_TYPE_JSON_1_1;
+ }
+ if (ReaderType.class.isInstance(reader)) {
+ inputType = SmooksModelUtils.INPUT_TYPE_CUSTOME;
+ }
}
- if (EDIReader.class.isInstance(reader) || EDI12Reader.class.isInstance(reader)) {
- inputType = SmooksModelUtils.INPUT_TYPE_EDI_1_1;
- }
- if (JsonReader.class.isInstance(reader) || Json12Reader.class.isInstance(reader)) {
- inputType = SmooksModelUtils.INPUT_TYPE_JSON_1_1;
- }
- if (ReaderType.class.isInstance(reader)) {
- inputType = SmooksModelUtils.INPUT_TYPE_CUSTOME;
- }
}
return inputType;
}
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -47,6 +47,7 @@
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IDocumentListener;
@@ -69,6 +70,7 @@
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
import org.jboss.tools.smooks.configuration.validate.SmooksMarkerHelper;
import org.jboss.tools.smooks.configuration.validate.SmooksModelValidator;
+import org.jboss.tools.smooks.graphical.editors.ISmooksEditorInitListener;
import org.jboss.tools.smooks.model.calc.provider.CalcItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.common.AbstractAnyType;
import org.jboss.tools.smooks.model.common.provider.CommonItemProviderAdapterFactory;
@@ -106,6 +108,8 @@
protected String platformVersion = SmooksConstants.VERSION_1_2;
+ protected List<ISmooksEditorInitListener> smooksInitListener = new
ArrayList<ISmooksEditorInitListener>();
+
protected String inputType = null;
protected List<ISourceSynchronizeListener> sourceSynchronizeListener = new
ArrayList<ISourceSynchronizeListener>();
@@ -173,6 +177,14 @@
this.platformVersion = platformVersion;
}
+ public void addSmooksEditorInitListener(ISmooksEditorInitListener listener) {
+ this.smooksInitListener.add(listener);
+ }
+
+ public void removeSmooksEditorInitListener(ISmooksEditorInitListener listener) {
+ this.smooksInitListener.remove(listener);
+ }
+
@Override
public Object getAdapter(Class adapter) {
if (adapter == ISmooksModelProvider.class)
@@ -426,15 +438,6 @@
*/
@Override
protected void addPages() {
- // configurationPage = createSmooksConfigurationFormPage();
- // addValidateListener(configurationPage);
- // try {
- // int index = this.addPage(configurationPage);
- // setPageText(index, "Design");
- // } catch (PartInitException e) {
- // e.printStackTrace();
- // }
-
textEditor = createTextEditor();
try {
int index = this.addPage(textEditor, getEditorInput());
@@ -442,6 +445,14 @@
} catch (PartInitException e) {
e.printStackTrace();
}
+
+ Exception exception = checkSmooksConfigContents(null);
+ if (exception != null) {
+ for (Iterator<?> iterator = this.smooksInitListener.iterator();
iterator.hasNext();) {
+ ISmooksEditorInitListener initListener = (ISmooksEditorInitListener)
iterator.next();
+ initListener.initFailed(IMessageProvider.WARNING, exception.getMessage());
+ }
+ }
}
protected StructuredTextEditor createTextEditor() {
@@ -500,16 +511,35 @@
IDocumentProvider dp = textEditor.getDocumentProvider();
if (dp == null)
return;
+ Exception exception = null;
+ int messageType = IMessageProvider.NONE;
IDocument document = dp.getDocument(textEditor.getEditorInput());
String conents = document.get();
Resource resource = editingDomain.getResourceSet().getResources().get(0);
resource.unload();
+ InputStream stream = null;
try {
- resource.load(new ByteArrayInputStream(conents.getBytes()), Collections.emptyMap());
+ stream = new ByteArrayInputStream(conents.getBytes());
+ resource.load(stream, Collections.emptyMap());
this.smooksModel = resource.getContents().get(0);
} catch (IOException e) {
smooksModel = null;
+ exception = e;
+ messageType = IMessageProvider.ERROR;
+ } finally {
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException e) {
+ }
+ }
}
+ if (exception == null) {
+ stream = new ByteArrayInputStream(conents.getBytes());
+ exception = checkSmooksConfigContents(stream);
+ if (exception != null)
+ messageType = IMessageProvider.WARNING;
+ }
setPlatformVersion(SmooksUIUtils.judgeSmooksPlatformVersion(smooksModel));
judgeInputReader();
for (Iterator<?> iterator = this.sourceSynchronizeListener.iterator();
iterator.hasNext();) {
@@ -520,6 +550,14 @@
e.printStackTrace();
}
}
+ String message = null;
+ if (exception != null) {
+ message = exception.getMessage();
+ }
+ for (Iterator<?> iterator = this.smooksInitListener.iterator();
iterator.hasNext();) {
+ ISmooksEditorInitListener initListener = (ISmooksEditorInitListener) iterator.next();
+ initListener.initFailed(messageType, message);
+ }
}
protected void handleDocumentChange() {
@@ -614,7 +652,7 @@
String partName = "smooks editor";
IFile file = null;
RuntimeMetadata runtimeMetadata = new RuntimeMetadata();
-
+
if (input instanceof FileStoreEditorInput) {
try {
filePath = ((FileStoreEditorInput) input).getURI().toURL().getFile();
@@ -632,8 +670,6 @@
if (filePath == null)
throw new PartInitException("Can't get the input file");
-
- assertConfigSupported(runtimeMetadata);
Resource smooksResource = null;
@@ -669,14 +705,17 @@
private void assertConfigSupported(RuntimeMetadata runtimeMetadata) throws
PartInitException {
List<RuntimeDependency> dependencies = runtimeMetadata.getDependencies();
-
- for(RuntimeDependency dependency : dependencies) {
- if(!dependency.isSupportedByEditor()) {
+
+ for (RuntimeDependency dependency : dependencies) {
+ if (!dependency.isSupportedByEditor()) {
java.net.URI changeToNS = dependency.getChangeToNS();
- String errorMsg = "\n\nSorry, this configuration is not yet supported by the
Smooks Editor because it contains configurations from the '" +
dependency.getNamespaceURI() + "' configuration namespace.\n\nPlease open this
configuration using the XML Editor.";
-
- if(changeToNS != null) {
- errorMsg += "\n\nFix: Update the configuration to use the '" +
changeToNS + "' configuration namespace.";
+ String errorMsg = "\n\nSorry, this configuration is not yet supported by the
Smooks Editor because it contains configurations from the '"
+ + dependency.getNamespaceURI()
+ + "' configuration namespace.\n\nPlease open this configuration using the
XML Editor.";
+
+ if (changeToNS != null) {
+ errorMsg += "\n\nFix: Update the configuration to use the '" +
changeToNS
+ + "' configuration namespace.";
}
throw new PartInitException(errorMsg);
@@ -684,6 +723,41 @@
}
}
+ protected Exception checkSmooksConfigContents(InputStream stream) {
+ // Check
+ Exception exception = null;
+ IFile file = null;
+ String filePath = null;
+ RuntimeMetadata runtimeMetadata = new RuntimeMetadata();
+ IEditorInput input = getEditorInput();
+ if (input instanceof FileStoreEditorInput) {
+ try {
+ filePath = ((FileStoreEditorInput) input).getURI().toURL().getFile();
+ runtimeMetadata.setSmooksConfig(new File(filePath), stream);
+ } catch (MalformedURLException e) {
+ exception = e;
+ // throw new PartInitException("Transform URL to URL error.",
+ // e);
+ }
+ }
+ if (exception == null) {
+ if (input instanceof IFileEditorInput) {
+ file = ((IFileEditorInput) input).getFile();
+ File f = new File(file.getRawLocation().toOSString().trim());
+ runtimeMetadata.setSmooksConfig(f, stream);
+ }
+
+ try {
+
+ assertConfigSupported(runtimeMetadata);
+
+ } catch (PartInitException e) {
+ exception = e;
+ }
+ }
+ return exception;
+ }
+
protected void judgeInputReader() {
SmooksResourceListType resourceList =
SmooksUIUtils.getSmooks11ResourceListType(smooksModel);
if (resourceList == null)
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -108,6 +108,7 @@
if (beanid.equals(idRefData)) {
AbstractSmooksGraphicalModel sourceGraphModel =
SmooksGraphUtil.findSmooksGraphModel(root,
eObject);
+ if(sourceGraphModel == null) continue;
List<TreeNodeConnection> scs = sourceGraphModel.getSourceConnections();
boolean createNewConnection = true;
for (Iterator<?> iterator2 = scs.iterator(); iterator2.hasNext();) {
Added:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
(rev 0)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -0,0 +1,19 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors;
+
+/**
+ * @author Dart
+ *
+ */
+public interface ISmooksEditorInitListener {
+ void initFailed(int messageType , String message);
+}
Property changes on:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ISmooksEditorInitListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
(rev 0)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.graphical.editors;
+
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.forms.IMessage;
+
+/**
+ * @author Dart
+ *
+ */
+public class SmooksMessage implements IMessage {
+
+ private int messageType;
+
+ private Control control;
+
+ private Object data;
+
+ private Object key;
+
+ private String prefix = "-";
+
+ private String message;
+
+ public SmooksMessage(int messageType , String message){
+ this.setMessage(message);
+ this.setMessageType(messageType);
+ }
+
+ /**
+ * @return the messageType
+ */
+ public int getMessageType() {
+ return messageType;
+ }
+
+ /**
+ * @param messageType the messageType to set
+ */
+ public void setMessageType(int messageType) {
+ this.messageType = messageType;
+ }
+
+ /**
+ * @return the control
+ */
+ public Control getControl() {
+ return control;
+ }
+
+ /**
+ * @param control the control to set
+ */
+ public void setControl(Control control) {
+ this.control = control;
+ }
+
+ /**
+ * @return the data
+ */
+ public Object getData() {
+ return data;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ /**
+ * @return the key
+ */
+ public Object getKey() {
+ return key;
+ }
+
+ /**
+ * @param key the key to set
+ */
+ public void setKey(Object key) {
+ this.key = key;
+ }
+
+ /**
+ * @return the prefix
+ */
+ public String getPrefix() {
+ return prefix;
+ }
+
+ /**
+ * @param prefix the prefix to set
+ */
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ /**
+ * @return the message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * @param message the message to set
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
Property changes on:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksProcessGraphicalEditor.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -37,6 +37,7 @@
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -55,6 +56,7 @@
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.IMessage;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
@@ -68,6 +70,7 @@
import org.eclipse.zest.core.widgets.ZestStyles;
import org.eclipse.zest.layouts.LayoutStyles;
import org.eclipse.zest.layouts.algorithms.HorizontalTreeLayoutAlgorithm;
+import org.jboss.tools.smooks.configuration.editors.GraphicsConstants;
import org.jboss.tools.smooks.configuration.editors.SmooksReaderFormPage;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
@@ -95,10 +98,14 @@
*/
public class SmooksProcessGraphicalEditor extends FormPage implements
ISelectionChangedListener,
ISourceSynchronizeListener, IPropertyListener, ISmooksModelValidateListener,
IProcessProvider,
- PropertyChangeListener {
-
+ PropertyChangeListener, ISmooksEditorInitListener {
+
+ private int currentMessageType = IMessageProvider.NONE;
+
+ private String currentMessage = null;
+
private boolean processChanged = false;
-
+
private boolean lockProcessChangeEvent = false;
private List<IAction> processPanelActions = new ArrayList<IAction>();
@@ -135,6 +142,7 @@
public SmooksProcessGraphicalEditor(String id, String title, ISmooksModelProvider
provider) {
super(id, title);
this.smooksModelProvider = provider;
+ this.getManagedForm();
}
/**
@@ -518,6 +526,7 @@
public void createPartControl(Composite parent) {
// TODO Auto-generated method stub
super.createPartControl(parent);
+ updateHeaderFormMessage();
}
public GraphViewer getProcessGraphViewer() {
@@ -826,7 +835,7 @@
dirty = (((IEditorPart) object).isDirty() || dirty);
}
}
- return( dirty || processChanged);
+ return (dirty || processChanged);
}
/*
@@ -910,7 +919,8 @@
}
protected void showTaskControl(Object model) {
- if(pageBook == null) return;
+ if (pageBook == null)
+ return;
if (model == null)
pageBook.showEmptyPage();
FormToolkit toolkit = ((AbstractSmooksFormEditor)
this.smooksModelProvider).getToolkit();
@@ -1126,7 +1136,8 @@
}
public void propertyChange(PropertyChangeEvent evt) {
- if(lockProcessChangeEvent) return;
+ if (lockProcessChangeEvent)
+ return;
String name = evt.getPropertyName();
Object newtask = evt.getNewValue();
if (ProcessType.PRO_ADD_CHILD.equals(name) ||
ProcessType.PRO_REMOVE_CHILD.equals(name)) {
@@ -1137,7 +1148,7 @@
processChanged = true;
getManagedForm().dirtyStateChanged();
}
-
+
if (ProcessType.PRO_ADD_CHILD.equals(name)) {
this.showTaskControl(newtask);
}
@@ -1145,4 +1156,52 @@
this.showTaskControl(null);
}
}
+
+ public void initFailed(int messageType, String message) {
+ this.currentMessage = message;
+ this.currentMessageType = messageType;
+ updateHeaderFormMessage();
+ }
+
+ protected void updateHeaderFormMessage() {
+ if (this.getManagedForm() != null) {
+ getManagedForm().getMessageManager().removeAllMessages();
+ getManagedForm().getMessageManager().update();
+ getProcessGraphViewer().getControl().setEnabled(true);
+ getProcessGraphViewer().getControl().setBackground(
+ getManagedForm().getToolkit().getColors().getBackground());
+ }
+ if (currentMessageType != IMessageProvider.NONE && currentMessage != null) {
+ if (this.getProcessGraphViewer() != null) {
+ getProcessGraphViewer().getControl().setBackground(GraphicsConstants.BORDER_CORLOR);
+ getProcessGraphViewer().getControl().setEnabled(false);
+ getProcessGraphViewer().setInput(new Object());
+ showTaskControl(null);
+ }
+ if (this.getManagedForm() != null) {
+
+ String[] messages = currentMessage.split("\n");
+ List<IMessage> messageList = new ArrayList<IMessage>();
+ for (int i = 0; i < messages.length; i++) {
+ String message = messages[i];
+ if (message != null)
+ message.trim();
+ if (message.length() == 0) {
+ continue;
+ }
+ messageList.add(new SmooksMessage(currentMessageType, message));
+ }
+ String mainMessage = null;
+ if (messageList.isEmpty()) {
+ mainMessage = currentMessage;
+ } else {
+ mainMessage = messageList.get(0).getMessage();
+ }
+
+ this.getManagedForm().getForm().getForm().setMessage(mainMessage,
currentMessageType,
+ messageList.toArray(new IMessage[] {}));
+
+ }
+ }
+ }
}
Deleted:
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/db-extract-transform-load_edi-to-sax-order-mapping.xml 2009-12-02
09:03:25 UTC (rev 18969)
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<medi:edimap
xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.0.xsd&...
-
- <medi:description name="DVD Order" version="1.0"/>
-
- <medi:delimiters segment=" " field="*"
component="^" sub-component="~"/>
-
- <medi:segments xmltag="orders">
-
- <medi:segment segcode="MLS" xmltag="message-header">
- <medi:field xmltag="date"/>
- </medi:segment>
-
- <medi:segment segcode="HDR" xmltag="order"
minOccurs="1" maxOccurs="-1">
- <medi:field xmltag="order-id"/>
- <medi:field xmltag="status-code"/>
- <medi:field xmltag="net-amount"/>
- <medi:field xmltag="total-amount"/>
- <medi:field xmltag="tax"/>
-
- <medi:segment segcode="CUS" xmltag="customer-details"
minOccurs="1" maxOccurs="1">
- <medi:field xmltag="username"/>
- <medi:field xmltag="name">
- <medi:component xmltag="firstname"/>
- <medi:component xmltag="lastname"/>
- </medi:field>
- <medi:field xmltag="state"/>
- </medi:segment>
-
- <medi:segment segcode="ORD" xmltag="order-item"
minOccurs="1" maxOccurs="-1">
- <medi:field xmltag="position"/>
- <medi:field xmltag="quantity"/>
- <medi:field xmltag="productId"/>
- <medi:field xmltag="title"/>
- <medi:field xmltag="price"/>
- </medi:segment>
-
- </medi:segment>
-
- </medi:segments>
-
-</medi:edimap>
\ No newline at end of file
Deleted:
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/projects/smooks-all-config-files/smooks-config-files/sj-testimonial_edi-mapping.xml 2009-12-02
09:03:25 UTC (rev 18969)
@@ -1,63 +0,0 @@
-<medi:edimap
xmlns:medi="http://www.milyn.org/schema/edi-message-mapping-1.0.xsd&...
-
- <medi:description name="rollingstock_edi" version="1.0" />
-
- <medi:delimiters segment=" " field=","
component="*" sub-component="-"/>
-
- <medi:segments xmltag="rollingstocks">
-
- <medi:segment segcode="Ta" xmltag="rollingstock"
minOccurs="0" maxOccurs="-1">
- <medi:field xmltag="departureDate"/>
- <medi:field xmltag="departureTime"/>
- <medi:field xmltag="rollingstockId"/>
- <medi:field xmltag="departureSignature"/>
- <medi:field xmltag="destinationSignature"/>
- <medi:field xmltag="dayLimit"/>
-
- <medi:segment segcode="Tr" xmltag="route"
minOccurs="0" maxOccurs="1">
- <medi:field xmltag="route"/>
- </medi:segment>
-
- <medi:segment segcode="Fo" xmltag="vehicle"
minOccurs="0" maxOccurs="-1">
- <medi:field xmltag="litt"/>
- <medi:field xmltag="vehicleId"/>
- <medi:field xmltag="originalLitt"/>
- <medi:field xmltag="ticketId"/>
- <medi:field xmltag="vehicleType"/>
- <medi:field xmltag="weight"/>
- <medi:field xmltag="dynamicWeight"/>
- <medi:field xmltag="brakeWeight"/>
- <medi:field xmltag="length"/>
- <medi:field xmltag="nrOfAxles"/>
- <medi:field xmltag="speed"/>
- <medi:field xmltag="serviceType"/>
- <medi:field xmltag="canDoorsBeLocked"/>
- <medi:field xmltag="class1"/>
- <medi:field xmltag="class2"/>
- <medi:field xmltag="couchette"/>
- <medi:field xmltag="nrOfCompartments"/>
- <medi:field xmltag="nrOfPlacesPerCompartment"/>
- <medi:field xmltag="departureStation"/>
- <medi:field xmltag="departureDate"/>
- <medi:field xmltag="departureTime"/>
- <medi:field xmltag="destination"/>
-
-
- <medi:segment segcode="Fx" xmltag="comments"
minOccurs="0" maxOccurs="1">
- <medi:field xmltag="comment"/>
- </medi:segment>
-
- <medi:segment segcode="Ft" xmltag="phoneNumber"
minOccurs="0" maxOccurs="-1">
- <medi:field xmltag="litt"/>
- <medi:field xmltag="vehicleId"/>
- <medi:field xmltag="phoneNumber"/>
- <medi:field xmltag="function"/>
- <medi:field xmltag="location"/>
- </medi:segment>
- </medi:segment>
-
- </medi:segment>
-
- </medi:segments>
-
-</medi:edimap>
\ No newline at end of file
Modified:
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java 2009-12-02
07:57:07 UTC (rev 18968)
+++
branches/jbosstools-3.1.0.RC1/smooks/tests/org.jboss.tools.smooks.core.test/src/org/jboss/tools/smooks/test/openeditor/OpenAllSmooksConfigFileTestCase.java 2009-12-02
09:03:25 UTC (rev 18969)
@@ -25,7 +25,6 @@
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
-import org.jboss.tools.smooks.model.freemarker.Template;
/**
* @author Dart