[
https://jira.jboss.org/browse/JBIDE-7232?page=com.atlassian.jira.plugin.s...
]
Brian Fitzpatrick commented on JBIDE-7232:
------------------------------------------
Ok, I found part of the problem but fixing the issue with the Java Mapping connections
being correctly reloaded from the file causes the Direct Source to Target mapping bits not
to work for me. Go figure.
So in the org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart class,
it's the createConnection(List<AbstractSmooksGraphicalModel> children,
List<TreeNodeConnection> connections) method that was causing trouble.
As discussed on IRC, it looked like you were checking the parent task (i.e. for Input Task
-> Apply Template Task, "Input Task" is the parent to "Apply
Template", or for Input -> Java Mapping -> Apply Template, "Java
Mapping" is the parent to "Apply Template") regardless of what the current
task actually was. So if the task was "Java Mapping" the connections weren't
being correctly set because the parent was "Input"...
So I added back in (in comments) the original code in Dart's class from back in April
2010 at the top of the method and added a check to see if the task type is "Apply
Template" or "Java Mapping". That solves the problem with the connections
not being drawn in when loading the file.
Unfortunately, fixing it broke the Direct Source to Target mapping for me and I wasn't
able to map from an XML to an XML.
Here's the code for the modified method... I'll also attach a patch and the
modified class to the JIRA.
public void createConnection(List<AbstractSmooksGraphicalModel> children,
List<TreeNodeConnection> connections) {
/*
* This was the original code that Dart had here
*/
// for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
// AbstractSmooksGraphicalModel abstractSmooksGraphicalModel =
(AbstractSmooksGraphicalModel) iterator.next();
// if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
// if (canCreateConnection(abstractSmooksGraphicalModel)) {
// Collection<TreeNodeConnection> c =
createConnection(abstractSmooksGraphicalModel);
// if (c != null) {
// connections.addAll(c);
// }
// }
// List<AbstractSmooksGraphicalModel> cchildren =
abstractSmooksGraphicalModel.getChildren();
// createConnection(cchildren, connections);
// }
// }
if (taskType != null) {
String id = taskType.getId();
if (id.equals(TaskTypeManager.TASK_ID_FREEMARKER_CSV_TEMPLATE) ||
id.equals(TaskTypeManager.TASK_ID_FREEMARKER_XML_TEMPLATE)) {
Object parentTask = taskType.getParent();
if(parentTask instanceof TaskType) {
if(((TaskType) parentTask).getId().equals(TaskTypeManager.TASK_ID_INPUT)) {
for (AbstractSmooksGraphicalModel abstractSmooksGraphicalModel : children) {
if (abstractSmooksGraphicalModel instanceof InputDataContianerModel) {
createConnection(abstractSmooksGraphicalModel);
break;
}
}
} else if(((TaskType)
parentTask).getId().equals(TaskTypeManager.TASK_ID_JAVA_MAPPING)) {
for (AbstractSmooksGraphicalModel abstractSmooksGraphicalModel : children) {
if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
if (canCreateConnection(abstractSmooksGraphicalModel)) {
Collection<TreeNodeConnection> c =
createConnection(abstractSmooksGraphicalModel);
if (c != null) {
connections.addAll(c);
}
}
List<AbstractSmooksGraphicalModel> cchildren =
abstractSmooksGraphicalModel.getChildren();
createConnection(cchildren, connections);
}
}
}
}
} else if (id.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING)) {
for (AbstractSmooksGraphicalModel abstractSmooksGraphicalModel : children) {
if (!(abstractSmooksGraphicalModel instanceof InputDataContianerModel)) {
if (canCreateConnection(abstractSmooksGraphicalModel)) {
Collection<TreeNodeConnection> c =
createConnection(abstractSmooksGraphicalModel);
if (c != null) {
connections.addAll(c);
}
}
List<AbstractSmooksGraphicalModel> cchildren =
abstractSmooksGraphicalModel.getChildren();
createConnection(cchildren, connections);
}
}
}
}
}
Smooks editor doesn't show connectors after file is reopened
------------------------------------------------------------
Key: JBIDE-7232
URL:
https://jira.jboss.org/browse/JBIDE-7232
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: smooks
Affects Versions: 3.2.0.Beta1
Environment: JBT 3.2.0.beta1 182
Reporter: Jiri Peterka
Assignee: Tom Fennelly
Priority: Blocker
Fix For: 3.2.0.Beta1
Smooks editor doesn't show connectors after file is reopened.
File is saved correctly
Still works with JBT 3.2.0.m2
Simple steps: Create simple XML->Java Mapping in Smooks in editor in connector, Save,
close, reopen
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira