use of com.twinsoft.convertigo.beans.core.RequestableObject in project convertigo by convertigo.
the class WebServiceTranslator method buildInputDocument.
public void buildInputDocument(Context context, Object inputData) throws Exception {
Engine.logBeans.debug("[WebServiceTranslator] Making input document");
HttpServletRequest request = (HttpServletRequest) inputData;
SOAPMessage requestMessage = (SOAPMessage) request.getAttribute(WebServiceServlet.REQUEST_MESSAGE_ATTRIBUTE);
SOAPPart sp = requestMessage.getSOAPPart();
SOAPEnvelope se = sp.getEnvelope();
SOAPBody sb = se.getBody();
Iterator<?> iterator = sb.getChildElements();
SOAPElement method, parameter;
String methodName;
InputDocumentBuilder inputDocumentBuilder = new InputDocumentBuilder(context);
while (iterator.hasNext()) {
// jmc 12/06/26
List<RequestableVariable> variableList = null;
Object element = iterator.next();
if (element instanceof SOAPElement) {
method = (SOAPElement) element;
methodName = method.getElementName().getLocalName();
Engine.logBeans.debug("[WebServiceTranslator] Requested web service name: " + methodName);
int i = methodName.indexOf("__");
// for statefull transaction, don't replace the project
if (context.project == null || !context.project.getName().equals(context.projectName)) {
context.project = Engine.theApp.databaseObjectsManager.getProjectByName(context.projectName);
}
String connectorName = null;
if (i == -1) {
context.connectorName = null;
context.sequenceName = methodName;
} else {
connectorName = methodName.substring(0, i);
context.transactionName = methodName.substring(i + 2);
}
if ((connectorName != null) && (!connectorName.equals(context.connectorName))) {
Engine.logBeans.debug("Connector name differs from previous one; requiring new session");
context.isNewSession = true;
context.connectorName = connectorName;
Engine.logBeans.debug("[WebServiceTranslator] The connector is overridden to \"" + context.connectorName + "\".");
}
Engine.logBeans.debug("[WebServiceTranslator] Connector: " + (context.connectorName == null ? "(default)" : context.connectorName));
Engine.logBeans.debug("[WebServiceTranslator] Transaction: " + context.transactionName);
// Connector connector = (context.connectorName == null ? context.project.getDefaultConnector() : context.project.getConnectorByName(context.connectorName));
// Transaction transaction = (context.transactionName == null ? connector.getDefaultTransaction() : connector.getTransactionByName(context.transactionName));
RequestableObject requestable = null;
if (context.sequenceName != null) {
requestable = context.project.getSequenceByName(context.sequenceName);
variableList = ((Sequence) requestable).getVariablesList();
} else if (context.connectorName != null) {
if (context.transactionName != null) {
requestable = context.project.getConnectorByName(context.connectorName).getTransactionByName(context.transactionName);
if (requestable instanceof TransactionWithVariables) {
variableList = ((TransactionWithVariables) requestable).getVariablesList();
}
}
}
Iterator<?> iterator2 = method.getChildElements();
String parameterName, parameterValue;
while (iterator2.hasNext()) {
element = iterator2.next();
if (element instanceof SOAPElement) {
parameter = (SOAPElement) element;
parameterName = parameter.getElementName().getLocalName();
parameterValue = parameter.getValue();
if (parameterValue == null) {
parameterValue = "";
}
if (variableList != null) {
// jmc 12/06/26 hide hidden variables in sequences
String str = (String) Visibility.Logs.replaceVariables(variableList, "" + parameterName + "=\"" + parameterValue + "\"");
Engine.logBeans.debug(" Parameter: " + str);
} else
Engine.logBeans.debug(" Parameter: " + parameterName + "=\"" + parameterValue + "\"");
// Handle convertigo parameters
if (parameterName.startsWith("__")) {
webServiceServletRequester.handleParameter(parameterName, parameterValue);
}
// Common parameter handling
if (inputDocumentBuilder.handleSpecialParameter(parameterName, parameterValue)) {
// handled
} else // Compatibility for Convertigo 2.x
if (parameterName.equals("context")) {
// Just ignore it
} else {
SOAPElement soapArrayElement = null;
Iterator<?> iterator3;
String href = parameter.getAttributeValue(se.createName("href"));
String arrayType = parameter.getAttributeValue(se.createName("soapenc:arrayType"));
if (arrayType == null) {
iterator3 = parameter.getAllAttributes();
while (iterator3.hasNext()) {
element = iterator3.next();
if (element instanceof Name) {
String s = ((Name) element).getQualifiedName();
if (s.equals("soapenc:arrayType")) {
arrayType = s;
break;
}
}
}
}
// Array (Microsoft .net)
if (href != null) {
Engine.logBeans.debug("Deserializing Microsoft .net array");
iterator3 = sb.getChildElements();
while (iterator3.hasNext()) {
element = iterator3.next();
if (element instanceof SOAPElement) {
soapArrayElement = (SOAPElement) element;
String elementId = soapArrayElement.getAttributeValue(se.createName("id"));
if (elementId != null) {
if (href.equals("#" + elementId)) {
iterator3 = soapArrayElement.getChildElements();
while (iterator3.hasNext()) {
element = iterator3.next();
if (element instanceof SOAPElement) {
break;
}
}
break;
}
}
}
}
// Find the element with href id
iterator3 = sb.getChildElements();
while (iterator3.hasNext()) {
element = iterator3.next();
if (element instanceof SOAPElement) {
soapArrayElement = (SOAPElement) element;
String elementId = soapArrayElement.getAttributeValue(se.createName("id"));
if (elementId != null) {
if (href.equals("#" + elementId)) {
break;
}
}
}
}
} else // Array (Java/Axis)
if (arrayType != null) {
Engine.logBeans.debug("Deserializing Java/Axis array");
soapArrayElement = parameter;
} else // If the node has children nodes, we assume it is an array.
if (parameter.getChildElements().hasNext()) {
if (isSoapArray((IVariableContainer) requestable, parameterName)) {
Engine.logBeans.debug("Deserializing array");
soapArrayElement = parameter;
}
}
// Deserializing array
if (soapArrayElement != null) {
iterator3 = soapArrayElement.getChildElements();
while (iterator3.hasNext()) {
element = iterator3.next();
if (element instanceof SOAPElement) {
soapArrayElement = (SOAPElement) element;
parameterValue = soapArrayElement.getValue();
if (parameterValue == null)
parameterValue = "";
handleSimpleVariable(context.inputDocument, soapArrayElement, parameterName, parameterValue, inputDocumentBuilder.transactionVariablesElement);
}
}
} else // Deserializing simple variable
{
handleSimpleVariable(context.inputDocument, parameter, parameterName, parameterValue, inputDocumentBuilder.transactionVariablesElement);
}
}
}
}
if (Engine.logBeans.isDebugEnabled()) {
String soapMessage = SOAPUtils.toString(requestMessage, request.getCharacterEncoding());
if (requestable instanceof TransactionWithVariables)
Engine.logBeans.debug("[WebServiceTranslator] SOAP message received:\n" + Visibility.Logs.replaceVariables(((TransactionWithVariables) (requestable)).getVariablesList(), request));
else if (requestable instanceof Sequence)
Engine.logBeans.debug("[WebServiceTranslator] SOAP message received:\n" + Visibility.Logs.replaceVariables(((Sequence) (requestable)).getVariablesList(), request));
else
Engine.logBeans.debug("[WebServiceTranslator] SOAP message received:\n" + soapMessage);
}
break;
}
}
Engine.logBeans.debug("[WebServiceTranslator] SOAP message analyzed");
Engine.logBeans.debug("[WebServiceTranslator] Input document created");
}
use of com.twinsoft.convertigo.beans.core.RequestableObject in project convertigo by convertigo.
the class TestCaseExecuteSelectedAction method run2.
@Override
protected void run2() throws Exception {
try {
WrapDatabaseObject treeObject = (WrapDatabaseObject) studio.getFirstSelectedTreeObject();
if ((treeObject != null) && (treeObject.instanceOf(TestCase.class))) {
TestCase testCase = (TestCase) treeObject.getObject();
ProjectView projectTreeObject = treeObject.getProjectViewObject();
RequestableObject requestable = (RequestableObject) testCase.getParent();
if (requestable instanceof Transaction) {
TransactionView transactionTreeObject = (TransactionView) treeObject.getParent();
transactionTreeObject.getConnectorTreeObject().openConnectorEditor();
Transaction transaction = (Transaction) testCase.getParent();
Connector connector = (Connector) transaction.getParent();
ConnectorEditorWrap connectorEditor = projectTreeObject.getConnectorEditor(connector);
if (connectorEditor != null) {
// getActivePage().activate(connectorEditor);
connectorEditor.getDocument(transaction.getName(), testCase.getName(), false);
}
} else if (requestable instanceof Sequence) {
SequenceView sequenceTreeObject = (SequenceView) treeObject.getParent();
new SequenceExecuteSelectedAction(studio).openEditors(sequenceTreeObject);
Sequence sequence = (Sequence) testCase.getParent();
SequenceEditorWrap sequenceEditor = projectTreeObject.getSequenceEditor(sequence);
if (sequenceEditor != null) {
// getActivePage().activate(sequenceEditor);
sequenceEditor.getDocument(sequence.getName(), testCase.getName(), false);
}
}
}
} catch (Exception e) {
throw e;
}
}
use of com.twinsoft.convertigo.beans.core.RequestableObject in project convertigo by convertigo.
the class TreeDropAdapter method move.
private boolean move(Node node, TreeObject targetTreeObject) throws EngineException {
if (targetTreeObject instanceof DatabaseObjectTreeObject) {
DatabaseObject parent = ((DatabaseObjectTreeObject) targetTreeObject).getObject();
DatabaseObject databaseObject = paste(node, null, true);
Element element = (Element) ((Element) node).getElementsByTagName("dnd").item(0);
// SEQUENCER
if (parent instanceof Sequence || parent instanceof StepWithExpressions) {
;
} else // URLMAPPER
if (parent instanceof UrlMappingOperation) {
// Set associated requestable
if (databaseObject instanceof RequestableObject) {
String dboQName = "";
if (databaseObject instanceof Sequence) {
dboQName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name") + "." + databaseObject.getName();
} else if (databaseObject instanceof Transaction) {
dboQName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name") + "." + ((Element) element.getElementsByTagName("connector").item(0)).getAttribute("name") + "." + databaseObject.getName();
}
UrlMappingOperation operation = (UrlMappingOperation) parent;
operation.setTargetRequestable(dboQName);
if (operation.getComment().isEmpty()) {
operation.setComment(databaseObject.getComment());
}
operation.hasChanged = true;
return true;
}
} else if (parent instanceof UrlMappingParameter) {
// Set associated mapped variable for parameter
if (databaseObject instanceof RequestableVariable) {
RequestableVariable variable = (RequestableVariable) databaseObject;
UrlMappingParameter parameter = (UrlMappingParameter) parent;
parameter.setMappedVariableName(variable.getName());
parameter.hasChanged = true;
return true;
}
}
}
return false;
}
use of com.twinsoft.convertigo.beans.core.RequestableObject in project convertigo by convertigo.
the class NgxPickerComposite method getJsonModel.
private JSONObject getJsonModel(Map<String, Object> data, DatabaseObject databaseObject) throws Exception {
JSONObject jsonModel = new JSONObject();
Map<String, String> params;
DatabaseObject dbo;
String dataPath;
if (databaseObject == null) {
dbo = (DatabaseObject) data.get("databaseObject");
params = GenericUtils.cast(data.get("params"));
dataPath = (String) data.get("searchPath");
} else {
dbo = databaseObject;
params = new HashMap<String, String>();
dataPath = "";
}
if (dbo != null) {
// case of requestable
if (dbo instanceof RequestableObject) {
RequestableObject ro = (RequestableObject) dbo;
Project project = ro.getProject();
String responseEltName = ro.getXsdTypePrefix() + ro.getName() + "Response";
boolean isDocumentNode = JsonRoot.docNode.equals(project.getJsonRoot()) && dataPath.isEmpty();
XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(project.getName());
XmlSchemaObject xso = SchemaMeta.getXmlSchemaObject(schema, ro);
if (xso != null) {
Document document = XmlSchemaUtils.getDomInstance(xso);
// System.out.println(XMLUtils.prettyPrintDOM(document));
String jsonString = XMLUtils.XmlToJson(document.getDocumentElement(), true, true);
JSONObject jsonObject = new JSONObject(jsonString);
String searchPath = "document." + responseEltName + ".response";
searchPath += isDocumentNode || !dataPath.startsWith(".document") ? dataPath : dataPath.replaceFirst("\\.document", "");
JSONObject jsonOutput = findJSONObject(jsonObject, searchPath);
jsonModel = isDocumentNode ? new JSONObject().put("document", jsonOutput) : jsonOutput;
}
} else if (dbo instanceof DesignDocument) {
DesignDocument dd = (DesignDocument) dbo;
Connector connector = dd.getConnector();
String ddoc = params.get("ddoc");
String view = params.get("view");
String viewName = ddoc + "/" + view;
String includeDocs = params.get("include_docs");
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ConnectorEditor connectorEditor = ConvertigoPlugin.getDefault().getConnectorEditor(connector);
if (connectorEditor == null) {
try {
connectorEditor = (ConnectorEditor) activePage.openEditor(new ConnectorEditorInput(connector), "com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor");
} catch (PartInitException e) {
ConvertigoPlugin.logException(e, "Error while loading the connector editor '" + connector.getName() + "'");
}
}
if (connectorEditor != null) {
// activate connector's editor
activePage.activate(connectorEditor);
// set transaction's parameters
Transaction transaction = connector.getTransactionByName(CouchDbConnector.internalView);
((GetViewTransaction) transaction).setViewname(viewName);
((GetViewTransaction) transaction).setQ_include_docs(includeDocs);
Variable view_reduce = ((GetViewTransaction) transaction).getVariable(CouchParam.prefix + "reduce");
view_reduce.setValueOrNull(false);
// execute view transaction
connectorEditor.getDocument(CouchDbConnector.internalView, false);
}
}
});
} else // case of UIForm
if (dbo instanceof UIForm) {
// JSONObject jsonObject = new JSONObject("{\"controls\":{\"['area']\":{\"value\":\"\"}}}");
JSONObject jsonObject = new JSONObject(((UIForm) dbo).computeJsonModel());
String searchPath = dataPath;
JSONObject jsonOutput = findJSONObject(jsonObject, searchPath);
jsonModel = jsonOutput;
} else // case of UIACtionStack
if (dbo instanceof UIActionStack) {
JSONObject jsonObject = new JSONObject(((UIActionStack) dbo).computeJsonModel());
String searchPath = dataPath;
JSONObject jsonOutput = findJSONObject(jsonObject, searchPath);
jsonModel = jsonOutput;
} else // case of UIDynamicAction or UICustomAction
if (dbo instanceof IAction) {
JSONObject jsonObject = new JSONObject();
if (dbo instanceof UIDynamicAction) {
UIDynamicAction uida = (UIDynamicAction) dbo;
jsonObject = new JSONObject(uida.computeJsonModel());
IonBean ionBean = uida.getIonBean();
if (ionBean != null) {
String name = ionBean.getName();
if ("CallSequenceAction".equals(name)) {
String qname = ionBean.getProperty("requestable").getValue().toString();
DatabaseObject sequence = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
if (sequence != null) {
JSONObject targetJsonModel = getJsonModel(data, sequence);
if (jsonObject.has("out")) {
jsonObject.put("out", targetJsonModel);
}
}
} else if ("CallFullSyncAction".equals(name)) {
String qname = ionBean.getProperty("requestable").getValue().toString();
String verb = ionBean.getProperty("verb").getValue().toString();
Connector connector = (Connector) Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
if (connector != null) {
XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(connector.getProject().getName());
AbstractCouchDbTransaction act = null;
if ("all".equals(verb))
act = new AllDocsTransaction();
else if ("create".equals(verb))
act = new PutDatabaseTransaction();
else if ("destroy".equals(verb))
act = new DeleteDatabaseTransaction();
else if ("get".equals(verb))
act = new GetDocumentTransaction();
else if ("delete".equals(verb))
act = new DeleteDocumentTransaction();
else if ("delete_attachment".equals(verb))
act = new DeleteDocumentAttachmentTransaction();
else if ("post".equals(verb))
act = new PostDocumentTransaction();
else if ("put_attachment".equals(verb))
act = new PutDocumentAttachmentTransaction();
else if ("replicate_push".equals(verb))
act = new PostReplicateTransaction();
else if ("reset".equals(verb))
act = new ResetDatabaseTransaction();
else if ("view".equals(verb))
act = new GetViewTransaction();
if (act != null) {
QName typeQName = act.getComplexTypeAffectation();
XmlSchemaType xmlSchemaType = schema.getTypeByName(typeQName);
Document document = XmlSchemaUtils.getDomInstance(xmlSchemaType);
String jsonString = XMLUtils.XmlToJson(document.getDocumentElement(), true, true);
JSONObject jsonOutput = new JSONObject(jsonString).getJSONObject("document");
cleanJsonModel(jsonOutput);
jsonOutput.remove("_c8oMeta");
jsonOutput.remove("error");
jsonOutput.remove("reason");
if (jsonObject.has("out")) {
jsonObject.put("out", jsonOutput);
}
}
}
} else if ("FullSyncGetAction".equals(name)) {
String qname = ionBean.getProperty("requestable").getValue().toString();
String docid = ionBean.getProperty("_id").getValue().toString();
Connector connector = (Connector) Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
if (connector != null) {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ConnectorEditor connectorEditor = ConvertigoPlugin.getDefault().getConnectorEditor(connector);
if (connectorEditor == null) {
try {
connectorEditor = (ConnectorEditor) activePage.openEditor(new ConnectorEditorInput(connector), "com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor");
} catch (PartInitException e) {
ConvertigoPlugin.logException(e, "Error while loading the connector editor '" + connector.getName() + "'");
}
}
if (connectorEditor != null) {
// activate connector's editor
activePage.activate(connectorEditor);
// set transaction's parameters
Transaction transaction = connector.getTransactionByName(CouchDbConnector.internalDocument);
Variable var_docid = ((GetDocumentTransaction) transaction).getVariable(CouchParam.docid.param());
var_docid.setValueOrNull(docid);
// execute view transaction
connectorEditor.getDocument(CouchDbConnector.internalDocument, false);
}
}
});
}
} else if ("FullSyncViewAction".equals(name)) {
String fsview = ionBean.getProperty("fsview").getValue().toString();
String includeDocs = ionBean.getProperty("include_docs").getValue().toString();
String reduce = ionBean.getProperty("reduce").getValue().toString();
String qname = fsview.substring(0, fsview.lastIndexOf('.'));
DesignDocument dd = (DesignDocument) Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
Connector connector = dd.getConnector();
String viewName = dd.getName() + "/" + fsview.substring(fsview.lastIndexOf('.') + 1);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
ConnectorEditor connectorEditor = ConvertigoPlugin.getDefault().getConnectorEditor(connector);
if (connectorEditor == null) {
try {
connectorEditor = (ConnectorEditor) activePage.openEditor(new ConnectorEditorInput(connector), "com.twinsoft.convertigo.eclipse.editors.connector.ConnectorEditor");
} catch (PartInitException e) {
ConvertigoPlugin.logException(e, "Error while loading the connector editor '" + connector.getName() + "'");
}
}
if (connectorEditor != null) {
// activate connector's editor
activePage.activate(connectorEditor);
// set transaction's parameters
Transaction transaction = connector.getTransactionByName(CouchDbConnector.internalView);
((GetViewTransaction) transaction).setViewname(viewName);
((GetViewTransaction) transaction).setQ_include_docs(includeDocs);
Variable view_reduce = ((GetViewTransaction) transaction).getVariable(CouchParam.prefix + "reduce");
view_reduce.setValueOrNull(reduce);
// execute view transaction
connectorEditor.getDocument(CouchDbConnector.internalView, false);
}
}
});
} else if (name.startsWith("FullSync")) {
if (ionBean.getProperty("requestable") != null) {
String qname = ionBean.getProperty("requestable").getValue().toString();
DatabaseObject connector = Engine.theApp.databaseObjectsManager.getDatabaseObjectByQName(qname);
if (connector != null) {
XmlSchema schema = Engine.theApp.schemaManager.getSchemaForProject(connector.getProject().getName());
AbstractCouchDbTransaction act = null;
if ("FullSyncDeleteAction".equals(name))
act = new DeleteDocumentTransaction();
else if ("FullSyncDeleteAttachmentAction".equals(name))
act = new DeleteDocumentAttachmentTransaction();
else if ("FullSyncPostAction".equals(name))
act = new PostDocumentTransaction();
else if ("FullSyncPutAttachmentAction".equals(name))
act = new PutDocumentAttachmentTransaction();
if (act != null) {
QName typeQName = act.getComplexTypeAffectation();
XmlSchemaType xmlSchemaType = schema.getTypeByName(typeQName);
Document document = XmlSchemaUtils.getDomInstance(xmlSchemaType);
String jsonString = XMLUtils.XmlToJson(document.getDocumentElement(), true, true);
JSONObject jsonOutput = new JSONObject(jsonString).getJSONObject("document");
cleanJsonModel(jsonOutput);
jsonOutput.remove("_c8oMeta");
jsonOutput.remove("error");
jsonOutput.remove("reason");
if (jsonObject.has("out")) {
jsonObject.put("out", jsonOutput);
}
}
}
}
}
}
} else if (dbo instanceof UICustomAction) {
jsonObject = new JSONObject(((UICustomAction) dbo).computeJsonModel());
}
String searchPath = dataPath;
JSONObject jsonOutput = findJSONObject(jsonObject, searchPath);
jsonModel = jsonOutput;
} else // case of UISharedComponent
if (dbo instanceof UISharedComponent) {
JSONObject jsonObject = new JSONObject(((UISharedComponent) dbo).computeJsonModel());
String searchPath = dataPath;
JSONObject jsonOutput = findJSONObject(jsonObject, searchPath);
jsonModel = jsonOutput;
} else // case of ApplicationComponent
if (dbo instanceof ApplicationComponent) {
String json = params.get("json");
jsonModel = new JSONObject(json);
} else // should not happened
{
throw new Exception("DatabaseObject " + dbo.getClass().getName() + " not supported!");
}
}
return jsonModel;
}
use of com.twinsoft.convertigo.beans.core.RequestableObject in project convertigo by convertigo.
the class MobilePickerComposite method lookupModelData.
private Map<String, Object> lookupModelData(TVObject tvObject) {
Map<String, Object> data = new HashMap<String, Object>();
Map<String, String> params = new HashMap<String, String>();
DatabaseObject dbo = null;
String searchPath = "";
Object object = tvObject.getObject();
JSONObject infos = tvObject.getInfos();
if (object != null) {
try {
if (object instanceof RequestableObject) {
dbo = (RequestableObject) object;
searchPath = "";
} else if (object instanceof DesignDocument) {
dbo = (DesignDocument) object;
DesignDocument dd = (DesignDocument) dbo;
params.put("ddoc", dd.getName());
params.put("view", tvObject.getParent().getName());
params.put("include_docs", infos.has("include_docs") ? infos.getString("include_docs") : "false");
searchPath = tvObject.getName().startsWith("get") ? ".rows.value" : "";
} else if (object instanceof UIControlDirective) {
dbo = (UIControlDirective) object;
do {
UIControlDirective directive = (UIControlDirective) dbo;
String rootDboName = "";
if (directive.getPage() != null) {
rootDboName = directive.getPage().getName();
} else if (directive.getMenu() != null) {
rootDboName = directive.getMenu().getName();
}
MobileSmartSourceType msst = directive.getSourceSmartType();
MobileSmartSource mss = msst.getSmartSource();
if (mss != null) {
dbo = mss.getDatabaseObject(rootDboName);
params.putAll(mss.getParameters());
searchPath = mss.getModelPath().replaceAll("\\?\\.", ".") + searchPath;
} else {
dbo = null;
}
} while (dbo != null && dbo instanceof UIControlDirective);
} else if (object instanceof UIForm) {
dbo = (UIForm) object;
searchPath = "";
} else if (object instanceof ApplicationComponent) {
dbo = (ApplicationComponent) object;
params.put("json", infos.toString());
searchPath = "";
} else if (object instanceof UIActionStack) {
dbo = (UIActionStack) object;
searchPath = "";
} else if (object instanceof IAction) {
if (object instanceof UIDynamicAction) {
dbo = (UIDynamicAction) object;
searchPath = "";
} else if (object instanceof UICustomAction) {
dbo = (UICustomAction) object;
searchPath = "";
}
} else if (object instanceof UISharedComponent) {
dbo = (UISharedComponent) object;
searchPath = "";
}
} catch (Exception e) {
e.printStackTrace();
}
}
data.put("databaseObject", dbo);
data.put("params", params);
data.put("searchPath", searchPath);
return data;
}
Aggregations