use of com.twinsoft.convertigo.beans.steps.IteratorStep in project convertigo by convertigo.
the class SourcePickerHelperWrap method displayTargetWsdlDom.
public void displayTargetWsdlDom(DatabaseObject dbo) {
try {
if (dbo instanceof Step) {
Step step = (Step) dbo;
String xpath = getSourceXPath();
String anchor = step.getAnchor();
Document stepDoc = null;
Step targetStep = step;
while (targetStep instanceof IteratorStep) {
targetStep = getTargetStep(targetStep);
}
if (targetStep != null) {
Project project = step.getProject();
XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(project.getName(), Option.fullSchema);
XmlSchemaObject xso = SchemaMeta.getXmlSchemaObject(schema, targetStep);
if (xso != null) {
stepDoc = XmlSchemaUtils.getDomInstance(xso);
}
}
if (stepDoc != null) /* && !(targetStep instanceof IteratorStep)*/
{
// stepDoc can be null for non "xml" step : e.g jIf
Document doc = step.getSequence().createDOM();
Element root = (Element) doc.importNode(stepDoc.getDocumentElement(), true);
doc.replaceChild(root, doc.getDocumentElement());
removeUserDefinedNodes(doc.getDocumentElement());
boolean shouldDisplayDom = (!(!step.isXml() && (step instanceof StepWithExpressions) && !(step instanceof IteratorStep)));
if ((doc != null) && (shouldDisplayDom)) {
xpath = onDisplayXhtml(xpath);
displayXhtml(doc);
xpathEvaluator.removeAnchor();
xpathEvaluator.displaySelectionXpathWithAnchor(twsDomTree, anchor, xpath);
return;
}
}
}
} catch (Exception e) {
// ConvertigoPlugin.logException(e, StringUtils.readStackTraceCauses(e));
}
clean();
}
use of com.twinsoft.convertigo.beans.steps.IteratorStep in project convertigo by convertigo.
the class SourcePickerHelper method displayTargetWsdlDom.
public void displayTargetWsdlDom(final DatabaseObject dbo) {
try {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
boolean needToClean = true;
try {
if (dbo instanceof Step) {
Step step = (Step) dbo;
String xpath = getSourceXPath();
String anchor = step.getAnchor();
Document stepDoc = null;
Step targetStep = step;
while (targetStep instanceof IteratorStep) {
targetStep = getTargetStep(targetStep);
}
if (targetStep != null) {
Project project = step.getProject();
String projectName = project.getName();
XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(projectName, Option.fullSchema);
XmlSchemaObject xso = SchemaMeta.getXmlSchemaObject(schema, targetStep);
if (xso != null) {
stepDoc = XmlSchemaUtils.getDomInstance(xso);
} else {
System.out.println("Could not retrieve schema for step \"" + targetStep.getName() + "\"!");
}
} else {
System.out.println("Could not retrieve schema : targeted step is null!");
}
if (stepDoc != null) /* && !(targetStep instanceof IteratorStep)*/
{
// stepDoc can be null for non "xml" step : e.g jIf
Document doc = step.getSequence().createDOM();
Element root = (Element) doc.importNode(stepDoc.getDocumentElement(), true);
doc.replaceChild(root, doc.getDocumentElement());
removeUserDefinedNodes(doc.getDocumentElement());
boolean shouldDisplayDom = (!(!step.isXml() && (step instanceof StepWithExpressions) && !(step instanceof IteratorStep)));
if ((doc != null) && (shouldDisplayDom)) {
needToClean = false;
xpath = onDisplayXhtml(xpath);
displayXhtml(doc);
xpathEvaluator.removeAnchor();
xpathEvaluator.displaySelectionXpathWithAnchor(twsDomTree, anchor, xpath);
}
}
}
} catch (Exception e) {
e.printStackTrace();
needToClean = true;
} finally {
if (needToClean) {
clean();
}
onDisplayDone();
shell.setCursor(null);
waitCursor.dispose();
}
}
});
} catch (Exception e) {
ConvertigoPlugin.logException(e, StringUtils.readStackTraceCauses(e));
clean();
}
}
use of com.twinsoft.convertigo.beans.steps.IteratorStep in project convertigo by convertigo.
the class StepUtils method createIteratorStep.
private static Step createIteratorStep(Sequence mainSequence, Object parent, Element element) throws EngineException {
Step step = (Step) parent;
if (parent != null) {
step = new IteratorStep();
step.bNew = true;
addStepToParent(mainSequence, parent, step);
}
return step;
}
Aggregations