use of com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap in project convertigo by convertigo.
the class ShowStepInPickerAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
if (treeObject != null) {
if (treeObject.instanceOf(DatabaseObject.class)) {
DatabaseObject selectedDbo = ((DatabaseObjectView) treeObject).getObject();
if (selectedDbo != null) {
StepSourceEventWrap event = null;
if (showSource) {
if (selectedDbo instanceof Step) {
Step step = (Step) selectedDbo;
Set<StepSource> sources = step.getSources();
if (!sources.isEmpty()) {
event = new StepSourceEventWrap(sources.iterator().next());
} else {
throw new Exception("No Source defined");
}
}
} else {
event = new StepSourceEventWrap(selectedDbo);
}
if (event != null) {
SourcePickerViewWrap spv = studio.getSourcePickerView();
spv.sourceSelected(event);
}
}
}
}
} catch (Exception e) {
throw e;
// ConvertigoPlugin.logException(e, "Unable to show object in Picker!");
}
}
use of com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap in project convertigo by convertigo.
the class EvaluateXpath method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
String xpath = request.getParameter("xpath").trim();
try {
Document doc = XpathEvaluatorCompositeWrap.getXpathData(spv.getDom(), xpath);
Element xPathTree = TwsDomTreeWrap.getTree2(doc, doc.getDocumentElement(), "xpath_tree");
xPathTree = (Element) document.importNode(xPathTree, true);
document.getDocumentElement().appendChild(xPathTree);
} catch (Exception e) {
}
}
}
}
use of com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap in project convertigo by convertigo.
the class SetStepSourceDefinition method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
Element root = document.getDocumentElement();
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
// Retrieve the StepSource definition
String qname = request.getParameter("qname");
DatabaseObject dbo = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
StepSourceWrap ssw = (StepSourceWrap) spv.getDragData();
// Update step source definition
if (com.twinsoft.convertigo.engine.admin.services.studio.sourcepicker.CanCreateSource.canCreateSource(dbo, ssw)) {
XMLVector<String> sourceDefinition = new XMLVector<>(2);
sourceDefinition.add(ssw.getPriority());
sourceDefinition.add(ssw.getXpath());
IStepSourceContainer stepSourceContainer = (IStepSourceContainer) dbo;
stepSourceContainer.setSourceDefinition(sourceDefinition);
root.appendChild(new SetPropertyResponse("sourceDefinition").toXml(document, qname));
}
}
}
}
use of com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap in project convertigo by convertigo.
the class ModifyXPathText method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
String xpath = request.getParameter("xpath").trim();
spv.modifyXpathText(xpath);
}
}
}
use of com.twinsoft.convertigo.engine.studio.views.sourcepicker.SourcePickerViewWrap in project convertigo by convertigo.
the class CanCreateSource method getServiceResult.
@Override
protected void getServiceResult(HttpServletRequest request, Document document) throws Exception {
HttpSession session = request.getSession();
CheStudio cheStudio = CallAction.getStudio(session);
if (cheStudio != null) {
SourcePickerViewWrap spv = cheStudio.getSourcePickerView();
if (spv != null) {
String qname = request.getParameter("qname");
DatabaseObject dbo = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
StepSourceWrap ssw = (StepSourceWrap) spv.getDragData();
boolean canCreateSource = canCreateSource(dbo, ssw);
document.getDocumentElement().appendChild(DOMUtils.createElementWithText(document, "response", Boolean.toString(canCreateSource)));
}
}
}
Aggregations