Search in sources :

Example 41 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class AbstractCouchDbTransaction method getJsonBody.

public JSONObject getJsonBody(JSONObject jsonDocument) throws JSONException, EngineException {
    // add document members from variables
    for (RequestableVariable variable : getAllVariables()) {
        String variableName = variable.getName();
        if (!variableName.startsWith("__") && !variableName.startsWith(CouchParam.prefix)) {
            Object value = toJson(getParameterValue(variableName));
            addJson(jsonDocument, variableName, value, getParameterDataTypeClass(variableName));
        }
    }
    return jsonDocument;
}
Also used : RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) NativeObject(org.mozilla.javascript.NativeObject) NativeJavaObject(org.mozilla.javascript.NativeJavaObject) JSONObject(org.codehaus.jettison.json.JSONObject)

Example 42 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class Migration7_0_0 method handleRequestableVariable.

private static void handleRequestableVariable(List<RequestableVariable> variables) {
    for (RequestableVariable variable : variables) {
        QName qName = XmlSchemaUtils.getSchemaDataTypeName(variable.getSchemaType());
        variable.setXmlTypeAffectation(new XmlQName(qName));
    }
}
Also used : XmlQName(com.twinsoft.convertigo.beans.common.XmlQName) XmlQName(com.twinsoft.convertigo.beans.common.XmlQName) QName(javax.xml.namespace.QName) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable)

Example 43 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class TreeDropAdapter method pasteMobileComponent.

private boolean pasteMobileComponent(DatabaseObject parent, DatabaseObject databaseObject, Element element) throws EngineException {
    // MOBILE COMPONENTS
    if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.MobileComponent) {
        if (parent.priority == databaseObject.priority) {
            return true;
        }
        // Case dbo is a Sequence
        if (databaseObject instanceof Sequence) {
            Sequence sequence = (Sequence) databaseObject;
            // Add child components to fill the form
            if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIForm) {
                com.twinsoft.convertigo.beans.mobile.components.UIForm uiForm = GenericUtils.cast(parent);
                try {
                    String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                    // add an onSubmit event with a callSequence
                    com.twinsoft.convertigo.beans.mobile.components.UIControlEvent event = new com.twinsoft.convertigo.beans.mobile.components.UIControlEvent();
                    event.setEventName(com.twinsoft.convertigo.beans.mobile.components.UIControlEvent.AttrEvent.onSubmit.name());
                    event.bNew = true;
                    event.hasChanged = true;
                    DatabaseObject call = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("CallSequenceAction"));
                    if (call != null && call instanceof com.twinsoft.convertigo.beans.mobile.components.UIDynamicAction) {
                        com.twinsoft.convertigo.beans.mobile.components.UIDynamicAction dynAction = GenericUtils.cast(call);
                        com.twinsoft.convertigo.beans.mobile.components.dynamic.IonBean ionBean = dynAction.getIonBean();
                        if (ionBean != null && ionBean.hasProperty("requestable")) {
                            ionBean.setPropertyValue("requestable", new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType(projectName + "." + sequence.getName()));
                        }
                    }
                    call.bNew = true;
                    call.hasChanged = true;
                    event.add(call);
                    // add a list of item with label & input for each variable
                    DatabaseObject dboList = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("List"));
                    for (RequestableVariable variable : sequence.getVariables()) {
                        DatabaseObject dboItem = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("ListItem"));
                        dboList.add(dboItem);
                        DatabaseObject dboLabel = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("Label"));
                        dboItem.add(dboLabel);
                        com.twinsoft.convertigo.beans.mobile.components.UIText uiText = new com.twinsoft.convertigo.beans.mobile.components.UIText();
                        uiText.bNew = true;
                        uiText.hasChanged = true;
                        uiText.setTextSmartType(new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType(variable.getName() + ":"));
                        dboLabel.add(uiText);
                        DatabaseObject dboInput = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("Input"));
                        if (dboInput != null && dboInput instanceof com.twinsoft.convertigo.beans.mobile.components.UIDynamicElement) {
                            com.twinsoft.convertigo.beans.mobile.components.UIDynamicElement dynElem = GenericUtils.cast(dboInput);
                            com.twinsoft.convertigo.beans.mobile.components.dynamic.IonBean ionBean = dynElem.getIonBean();
                            if (ionBean != null && ionBean.hasProperty("FormControlName")) {
                                ionBean.setPropertyValue("FormControlName", new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType(variable.getName()));
                            }
                            dboItem.add(dboInput);
                        }
                    }
                    // add a buttonset with a submit and a reset button
                    DatabaseObject dboBtnSet = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("ButtonSet"));
                    DatabaseObject dboSubmit = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("SubmitButton"));
                    dboBtnSet.add(dboSubmit);
                    com.twinsoft.convertigo.beans.mobile.components.UIText sText = new com.twinsoft.convertigo.beans.mobile.components.UIText();
                    sText.bNew = true;
                    sText.hasChanged = true;
                    sText.setTextSmartType(new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType("Submit"));
                    dboSubmit.add(sText);
                    DatabaseObject dboReset = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("ResetButton"));
                    dboBtnSet.add(dboReset);
                    com.twinsoft.convertigo.beans.mobile.components.UIText rText = new com.twinsoft.convertigo.beans.mobile.components.UIText();
                    rText.bNew = true;
                    rText.hasChanged = true;
                    rText.setTextSmartType(new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType("Reset"));
                    dboReset.add(rText);
                    uiForm.add(event);
                    uiForm.add(dboList);
                    uiForm.add(dboBtnSet);
                } catch (Exception e) {
                    throw new EngineException("Unable to create filled Form from requestable", e);
                }
                return true;
            }
            // Add a CallSequenceAction
            if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIPageEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIAppEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIActionEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIControlEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.IAction || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIActionStack) {
                com.twinsoft.convertigo.beans.mobile.components.UIComponent uiComponent = GenericUtils.cast(parent);
                String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                DatabaseObject call = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("CallSequenceAction"));
                if (call != null && call instanceof com.twinsoft.convertigo.beans.mobile.components.UIDynamicAction) {
                    com.twinsoft.convertigo.beans.mobile.components.UIDynamicAction dynAction = GenericUtils.cast(call);
                    com.twinsoft.convertigo.beans.mobile.components.dynamic.IonBean ionBean = dynAction.getIonBean();
                    if (ionBean != null && ionBean.hasProperty("requestable")) {
                        ionBean.setPropertyValue("requestable", new com.twinsoft.convertigo.beans.mobile.components.MobileSmartSourceType(projectName + "." + sequence.getName()));
                        call.bNew = true;
                        call.hasChanged = true;
                        uiComponent.add(call);
                        uiComponent.hasChanged = true;
                    }
                }
                return true;
            }
        } else // Case dbo is a SharedAction
        if (databaseObject instanceof com.twinsoft.convertigo.beans.mobile.components.UIActionStack) {
            com.twinsoft.convertigo.beans.mobile.components.UIActionStack stack = GenericUtils.cast(databaseObject);
            // Add an InvokeAction
            if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIPageEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIAppEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIActionEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIControlEvent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.IAction || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIActionStack) {
                com.twinsoft.convertigo.beans.mobile.components.UIComponent uiComponent = GenericUtils.cast(parent);
                String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                String mobileAppName = ((Element) element.getElementsByTagName("mobileapplication").item(0)).getAttribute("name");
                String applicationName = ((Element) element.getElementsByTagName("application").item(0)).getAttribute("name");
                DatabaseObject invokeAction = com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.createBean(com.twinsoft.convertigo.beans.mobile.components.dynamic.ComponentManager.getComponentByName("InvokeAction"));
                com.twinsoft.convertigo.beans.mobile.components.UIDynamicInvoke invoke = GenericUtils.cast(invokeAction);
                if (invoke != null) {
                    invoke.setSharedActionQName(projectName + "." + mobileAppName + "." + applicationName + "." + stack.getName());
                    invoke.bNew = true;
                    invoke.hasChanged = true;
                    uiComponent.add(invoke);
                    uiComponent.hasChanged = true;
                }
                return true;
            }
        } else // Case dbo is a SharedComponent
        if (databaseObject instanceof com.twinsoft.convertigo.beans.mobile.components.UISharedComponent) {
            com.twinsoft.convertigo.beans.mobile.components.UISharedComponent usc = GenericUtils.cast(databaseObject);
            // Add a UseShared component
            if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.PageComponent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UISharedComponent || parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIElement && !(parent instanceof com.twinsoft.convertigo.beans.mobile.components.UIUseShared)) {
                com.twinsoft.convertigo.beans.mobile.components.MobileComponent mc = GenericUtils.cast(parent);
                String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                String mobileAppName = ((Element) element.getElementsByTagName("mobileapplication").item(0)).getAttribute("name");
                String applicationName = ((Element) element.getElementsByTagName("application").item(0)).getAttribute("name");
                com.twinsoft.convertigo.beans.mobile.components.UIUseShared use = new com.twinsoft.convertigo.beans.mobile.components.UIUseShared();
                if (use != null) {
                    use.setSharedComponentQName(projectName + "." + mobileAppName + "." + applicationName + "." + usc.getName());
                    use.bNew = true;
                    use.hasChanged = true;
                    mc.add(use);
                    mc.hasChanged = true;
                }
                return true;
            }
        }
    }
    return false;
}
Also used : Element(org.w3c.dom.Element) EngineException(com.twinsoft.convertigo.engine.EngineException) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) Sequence(com.twinsoft.convertigo.beans.core.Sequence) IOException(java.io.IOException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) SAXException(org.xml.sax.SAXException) EngineException(com.twinsoft.convertigo.engine.EngineException) InvalidOperationException(com.twinsoft.convertigo.engine.InvalidOperationException)

Example 44 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class TreeDropAdapter method paste.

private boolean paste(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) {
            if (parent instanceof XMLElementStep)
                return false;
            if (parent instanceof IThenElseContainer)
                return false;
            // Add a TransactionStep
            if (databaseObject instanceof Transaction) {
                String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                String connectorName = ((Element) element.getElementsByTagName("connector").item(0)).getAttribute("name");
                Transaction transaction = (Transaction) databaseObject;
                TransactionStep transactionStep = new TransactionStep();
                transactionStep.setSourceTransaction(projectName + TransactionStep.SOURCE_SEPARATOR + connectorName + TransactionStep.SOURCE_SEPARATOR + transaction.getName());
                transactionStep.bNew = true;
                parent.add(transactionStep);
                parent.hasChanged = true;
                if (transaction instanceof TransactionWithVariables) {
                    for (Variable variable : ((TransactionWithVariables) transaction).getVariablesList()) {
                        StepVariable stepVariable = variable.isMultiValued() ? new StepMultiValuedVariable() : new StepVariable();
                        stepVariable.setName(variable.getName());
                        stepVariable.setComment(variable.getComment());
                        stepVariable.setDescription(variable.getDescription());
                        stepVariable.setRequired(variable.isRequired());
                        stepVariable.setValueOrNull(variable.getValueOrNull());
                        stepVariable.setVisibility(variable.getVisibility());
                        transactionStep.addVariable(stepVariable);
                    }
                }
                return true;
            } else // Add a SequenceStep
            if (databaseObject instanceof Sequence) {
                String projectName = ((Element) element.getElementsByTagName("project").item(0)).getAttribute("name");
                Sequence seq = (Sequence) databaseObject;
                SequenceStep sequenceStep = new SequenceStep();
                sequenceStep.setSourceSequence(projectName + SequenceStep.SOURCE_SEPARATOR + seq.getName());
                sequenceStep.bNew = true;
                parent.add(sequenceStep);
                parent.hasChanged = true;
                for (Variable variable : seq.getVariablesList()) {
                    StepVariable stepVariable = variable.isMultiValued() ? new StepMultiValuedVariable() : new StepVariable();
                    stepVariable.setName(variable.getName());
                    stepVariable.setComment(variable.getComment());
                    stepVariable.setDescription(variable.getDescription());
                    stepVariable.setRequired(variable.isRequired());
                    stepVariable.setValueOrNull(variable.getValueOrNull());
                    stepVariable.setVisibility(variable.getVisibility());
                    sequenceStep.addVariable(stepVariable);
                }
                return true;
            }
        } else // URLMAPPER
        if (parent instanceof UrlMappingOperation) {
            // Set associated requestable, add all parameters for operation
            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;
                try {
                    StringTokenizer st = new StringTokenizer(dboQName, ".");
                    int count = st.countTokens();
                    Project p = Engine.theApp.databaseObjectsManager.getProjectByName(st.nextToken());
                    List<RequestableVariable> variables = new ArrayList<RequestableVariable>();
                    if (count == 2) {
                        variables = p.getSequenceByName(st.nextToken()).getVariablesList();
                    } else if (count == 3) {
                        variables = ((TransactionWithVariables) p.getConnectorByName(st.nextToken()).getTransactionByName(st.nextToken())).getVariablesList();
                    }
                    for (RequestableVariable variable : variables) {
                        String variableName = variable.getName();
                        Object variableValue = variable.getValueOrNull();
                        UrlMappingParameter parameter = null;
                        try {
                            parameter = operation.getParameterByName(variableName);
                        } catch (Exception e) {
                        }
                        if (parameter == null) {
                            boolean acceptForm = operation.getMethod().equalsIgnoreCase(HttpMethodType.POST.name()) || operation.getMethod().equalsIgnoreCase(HttpMethodType.PUT.name());
                            parameter = acceptForm ? new FormParameter() : new QueryParameter();
                            parameter.setName(variableName);
                            parameter.setComment(variable.getComment());
                            parameter.setArray(false);
                            parameter.setExposed(((RequestableVariable) variable).isWsdl());
                            parameter.setMultiValued(variable.isMultiValued());
                            parameter.setRequired(variable.isRequired());
                            parameter.setValueOrNull(!variable.isMultiValued() ? variableValue : null);
                            parameter.setMappedVariableName(variableName);
                            parameter.bNew = true;
                            operation.add(parameter);
                            operation.hasChanged = true;
                        }
                    }
                } catch (Exception e) {
                }
                return true;
            } else // Add a parameter to mapping operation
            if (databaseObject instanceof RequestableVariable) {
                RequestableVariable variable = (RequestableVariable) databaseObject;
                UrlMappingOperation operation = (UrlMappingOperation) parent;
                UrlMappingParameter parameter = null;
                String variableName = variable.getName();
                Object variableValue = variable.getValueOrNull();
                try {
                    parameter = operation.getParameterByName(variableName);
                } catch (Exception e) {
                }
                if (parameter == null) {
                    boolean acceptForm = operation.getMethod().equalsIgnoreCase(HttpMethodType.POST.name()) || operation.getMethod().equalsIgnoreCase(HttpMethodType.PUT.name());
                    parameter = acceptForm ? new FormParameter() : new QueryParameter();
                    parameter.setName(variableName);
                    parameter.setComment(variable.getComment());
                    parameter.setArray(false);
                    parameter.setExposed(((RequestableVariable) variable).isWsdl());
                    parameter.setMultiValued(variable.isMultiValued());
                    parameter.setRequired(variable.isRequired());
                    parameter.setValueOrNull(!variable.isMultiValued() ? variableValue : null);
                    parameter.setMappedVariableName(variableName);
                    parameter.bNew = true;
                    operation.add(parameter);
                    operation.hasChanged = true;
                }
                return true;
            }
        } else // MOBILE COMPONENTS
        if (parent instanceof com.twinsoft.convertigo.beans.mobile.components.MobileComponent) {
            return pasteMobileComponent(parent, databaseObject, element);
        } else // NGX COMPONENTS
        if (parent instanceof com.twinsoft.convertigo.beans.ngx.components.MobileComponent) {
            return pasteNgxComponent(parent, databaseObject, element);
        }
    }
    return false;
}
Also used : QueryParameter(com.twinsoft.convertigo.beans.rest.QueryParameter) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) IThenElseContainer(com.twinsoft.convertigo.beans.steps.IThenElseContainer) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) Variable(com.twinsoft.convertigo.beans.core.Variable) StepMultiValuedVariable(com.twinsoft.convertigo.beans.variables.StepMultiValuedVariable) StepVariable(com.twinsoft.convertigo.beans.variables.StepVariable) UrlMappingParameter(com.twinsoft.convertigo.beans.core.UrlMappingParameter) XMLElementStep(com.twinsoft.convertigo.beans.steps.XMLElementStep) Element(org.w3c.dom.Element) StepWithExpressions(com.twinsoft.convertigo.beans.core.StepWithExpressions) StepVariable(com.twinsoft.convertigo.beans.variables.StepVariable) FormParameter(com.twinsoft.convertigo.beans.rest.FormParameter) StepMultiValuedVariable(com.twinsoft.convertigo.beans.variables.StepMultiValuedVariable) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) ArrayList(java.util.ArrayList) List(java.util.List) NodeList(org.w3c.dom.NodeList) SequenceStep(com.twinsoft.convertigo.beans.steps.SequenceStep) UrlMappingOperation(com.twinsoft.convertigo.beans.core.UrlMappingOperation) RequestableObject(com.twinsoft.convertigo.beans.core.RequestableObject) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable) Sequence(com.twinsoft.convertigo.beans.core.Sequence) IOException(java.io.IOException) ObjectWithSameNameException(com.twinsoft.convertigo.engine.ObjectWithSameNameException) SAXException(org.xml.sax.SAXException) EngineException(com.twinsoft.convertigo.engine.EngineException) InvalidOperationException(com.twinsoft.convertigo.engine.InvalidOperationException) TransactionStep(com.twinsoft.convertigo.beans.steps.TransactionStep) Project(com.twinsoft.convertigo.beans.core.Project) StringTokenizer(java.util.StringTokenizer) Transaction(com.twinsoft.convertigo.beans.core.Transaction) HtmlTransaction(com.twinsoft.convertigo.beans.transactions.HtmlTransaction) TransactionWithVariables(com.twinsoft.convertigo.beans.core.TransactionWithVariables) PropertyTableRowTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableRowTreeObject) NgxComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxComponentTreeObject) IOrderableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IOrderableTreeObject) ProjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ProjectTreeObject) FolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.FolderTreeObject) DatabaseObject(com.twinsoft.convertigo.beans.core.DatabaseObject) ObjectsFolderTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ObjectsFolderTreeObject) NgxUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.NgxUIComponentTreeObject) MobileUIComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileUIComponentTreeObject) IPropertyTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.IPropertyTreeObject) RequestableObject(com.twinsoft.convertigo.beans.core.RequestableObject) PropertyTableTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.PropertyTableTreeObject) TreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject) DatabaseObjectTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject) ScreenClassTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.ScreenClassTreeObject) MobileComponentTreeObject(com.twinsoft.convertigo.eclipse.views.projectexplorer.model.MobileComponentTreeObject)

Example 45 with RequestableVariable

use of com.twinsoft.convertigo.beans.variables.RequestableVariable in project convertigo by convertigo.

the class CouchVariablesDialog method createDialogArea.

@Override
protected Control createDialogArea(Composite parent) {
    try {
        PropertyDescriptor[] availablesParameters = null;
        List<RequestableVariable> dboVariables = null;
        if (props != null) {
            availablesParameters = props;
        } else {
            availablesParameters = CachedIntrospector.getBeanInfo(couchDbTransaction).getPropertyDescriptors();
        }
        if (couchDbTransaction != null) {
            dboVariables = couchDbTransaction.getVariablesList();
        }
        couchVariablesComposite = new CouchVariablesComposite(parent, SWT.V_SCROLL, dboVariables);
        couchVariablesComposite.setBackground(parent.getBackground());
        couchVariablesComposite.setPropertyDescriptor(couchDbTransaction, availablesParameters, couchDbTransaction.getParent());
        GridData couchVarData = new GridData(GridData.FILL_BOTH);
        couchVarData.horizontalSpan = 2;
        couchVariablesComposite.setLayoutData(couchVarData);
        if (couchVariablesComposite.getSelectedParameters().size() == 0) {
            setReturnCode(-1);
        }
    } catch (IntrospectionException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return couchVariablesComposite;
}
Also used : PropertyDescriptor(java.beans.PropertyDescriptor) GridData(org.eclipse.swt.layout.GridData) IntrospectionException(java.beans.IntrospectionException) RequestableVariable(com.twinsoft.convertigo.beans.variables.RequestableVariable)

Aggregations

RequestableVariable (com.twinsoft.convertigo.beans.variables.RequestableVariable)57 EngineException (com.twinsoft.convertigo.engine.EngineException)24 DatabaseObject (com.twinsoft.convertigo.beans.core.DatabaseObject)14 Sequence (com.twinsoft.convertigo.beans.core.Sequence)11 Element (org.w3c.dom.Element)11 RequestableHttpVariable (com.twinsoft.convertigo.beans.variables.RequestableHttpVariable)10 DatabaseObjectTreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.DatabaseObjectTreeObject)8 TreeObject (com.twinsoft.convertigo.eclipse.views.projectexplorer.model.TreeObject)8 StepVariable (com.twinsoft.convertigo.beans.variables.StepVariable)7 TestCaseVariable (com.twinsoft.convertigo.beans.variables.TestCaseVariable)7 Variable (com.twinsoft.convertigo.beans.core.Variable)6 Shell (org.eclipse.swt.widgets.Shell)6 TransactionWithVariables (com.twinsoft.convertigo.beans.core.TransactionWithVariables)5 RequestableMultiValuedVariable (com.twinsoft.convertigo.beans.variables.RequestableMultiValuedVariable)5 ProjectExplorerView (com.twinsoft.convertigo.eclipse.views.projectexplorer.ProjectExplorerView)5 Cursor (org.eclipse.swt.graphics.Cursor)5 Display (org.eclipse.swt.widgets.Display)5 XMLVector (com.twinsoft.convertigo.beans.common.XMLVector)4 RequestableObject (com.twinsoft.convertigo.beans.core.RequestableObject)4 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)4