Package com.sforce.ws.bind

Examples of com.sforce.ws.bind.XmlObject


    private void mapPartnerSObject(Row map, String prefix, XmlObject sobj) {
        Iterator<XmlObject> fields = sobj.getChildren();
        if (fields == null) return;
        while (fields.hasNext()) {
            XmlObject field = fields.next();

            final String fieldName = prefix + field.getName().getLocalPart();
            String localName = getMapping(fieldName);
            if (localName != null) {
                map.put(localName, field.getValue());
            }
            mapPartnerSObject(map, fieldName + ".", field);
        }
    }
View Full Code Here


            /**
             * Check if we are being asked for PK only. If so, return the ID that has been passed in
             */
            ForceFetchFieldManager fm;
            if (fieldNumbers.length == 1 && fieldNumbers[0] == pkPosition) {
                XmlObject sObject = new XmlObject();
                sObject.addField("Id", op.provideField(pkPosition));
                fm = new ForceFetchFieldManager(op, storeManager, mconn, sObject, null);
            } else {
                fm = new ForceFetchFieldManager(op, storeManager, mconn,
                    op.provideField(pkPosition), fieldNumbers, null);
            }
View Full Code Here

        /**
         * Skip the first two items. First item is "type" and second is "id".
         * If we have selected id then it will show up again in the list.
         */
        for (int i = 0; fieldIter.hasNext(); i++) {
            XmlObject xo = fieldIter.next();
            String name = xo.getName().getLocalPart();
            if (i < 2) continue;
            fieldNameList.add(name);
            if (createFieldNameExpressions) {
                fieldNameExprs.add(new PrimaryExpression(Arrays.asList(name)));
            }
View Full Code Here

    //   M E T H O D S
    public void parseInput(SObject sobject) {
        Iterator<XmlObject> iter = sobject.getChildren();
        while (iter.hasNext()) {
            XmlObject field = iter.next();
            String fieldName = field.getName().getLocalPart();
            String fieldValue = (String) field.getValue();

            if ("Id".equals(fieldName)) {
                setId(fieldValue);
            } else if ("Name".equals(fieldName)) {
                setName(fieldValue);
View Full Code Here

        if (qr != null && qr.getSize() > 0) {
            if (Utils.isNotEmpty(qr.getRecords())) {
                Iterator<XmlObject> it = qr.getRecords()[0].getChildren();
                int columnTally = 0;
                while (it.hasNext()) {
                    XmlObject field = it.next();
                    String fieldNameLC = field.getName().getLocalPart();
                    if (("Id".equalsIgnoreCase(fieldNameLC) && (field.getValue() == null))
                            || ("Id".equalsIgnoreCase(fieldNameLC) && _columnNames.contains(field.getName()
                                    .getLocalPart()))) {
                        // Skip this
                    } else {
                        if (XmlConstants.ELEM_TYPE.equals(field.getName().getLocalPart())) {
                            // skip this too
                        } else {
                            if (!_columnNames.contains(field.getName().getLocalPart())) {
                                // Create a new column
                                TableColumn col = new TableColumn(table, SWT.LEFT, columnTally);
                                col.setText(field.getName().getLocalPart());
                                col.setWidth(120);
                                _columnNames.add(field.getName().getLocalPart());
                                columnTally++;
                            }
                        }

                    }
View Full Code Here

                TableItem item = t.getItem(pt);
                for (int column = 0; column < t.getColumnCount(); column++) {
                    Rectangle rect = item.getBounds(column);
                    if (rect.contains(pt)) {
                        DataRow dr = (DataRow) item.getData();
                        XmlObject val = dr.getRecord().get(column);
                        if (val != null && val.getXmlType() != null) {
                            showDialog(val);
                        }
                    }
                }
            }
View Full Code Here

            dialogTitle = "Parent Record " + val.getName().getLocalPart();
            Iterator<XmlObject> iter = val.getChildren();
            Hashtable<String, Object> row = new Hashtable<String, Object>();
            ArrayList<String> rowsNames = new ArrayList<String>();
            while (iter.hasNext()) {
                XmlObject field = iter.next();
                if (!XmlConstants.ELEM_TYPE.equals(field.getName().getLocalPart())
                        && !rowsNames.contains(field.getName().getLocalPart())) {
                    if (field.getValue() != null) {
                        columnNames.put(field.getName().getLocalPart(), field.getName().getLocalPart());
                    }
                    Object fieldVal = field.getValue();
                    if (fieldVal == null) {
                        fieldVal = "";
                    }
                    row.put(field.getName().getLocalPart(), fieldVal);
                    rowsNames.add(field.getName().getLocalPart());
                }
            }
            rows.add(row);
        } else {
            Iterator<XmlObject> iter = val.getChildren();
            while (iter.hasNext()) {
                XmlObject oneElement = iter.next();
                dialogTitle = "Child records for " + val.getName().getLocalPart();

                if ("records".equals(oneElement.getName().getLocalPart())) {
                    Iterator<XmlObject> children = oneElement.getChildren();
                    Hashtable<String, Object> row = new Hashtable<String, Object>();
                    ArrayList<String> rowsNames = new ArrayList<String>();
                    while (children.hasNext()) {
                        XmlObject field = children.next();
                        if (!XmlConstants.ELEM_TYPE.equals(field.getName().getLocalPart())
                                && !rowsNames.contains(field.getName().getLocalPart())) {
                            if (field.getValue() != null) {
                                columnNames.put(field.getName().getLocalPart(), field.getName().getLocalPart());
                            }
                            Object fieldVal = field.getValue();
                            if (fieldVal == null) {
                                fieldVal = "";
                            }
                            row.put(field.getName().getLocalPart(), fieldVal);
                        }
                    }
                    rows.add(row);
                }
            }
View Full Code Here

     * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
     */
    public String getColumnText(Object element, int columnIndex) {
        String result = "";
        if (((DataRow) element).getRecord() != null) {
            XmlObject field = (((DataRow) element).getRecord()).get(columnIndex);
            if (field.getXmlType() != null) {
                // This is an sobject or a queryResult
                QName xmlType = field.getXmlType();
                if ("sObject".equals(xmlType.getLocalPart())) {
                    result = "Parent " + (String) field.getChildren(XmlConstants.ELEM_TYPE).next().getValue();
                } else if (xmlType.getLocalPart().equals(XmlConstants.XMLTYPE_QUERY_RESULT)) {
                    result = "Child " + field.getName().getLocalPart() + " (" + field.getChild("size").getValue() + ")";
                }
            } else {
                result = (String) field.getValue();
            }
        } else {
            DataRow task = (DataRow) element;

            switch (columnIndex) {
View Full Code Here

        Vector<XmlObject> vRecord = new Vector<XmlObject>();
        if (hasId) {
            vRecord.add(record.getChildren("Id").next());
        }
        while (it.hasNext()) {
            XmlObject field = it.next();
            String fieldName = field.getName().getLocalPart();
            if ("Id".equalsIgnoreCase(fieldName) && hasId) {
                // Skip
            } else if (XmlConstants.ELEM_TYPE.equals(fieldName) && record.getType().equals(field.getValue())) {
                // Skip
            } else if (field.getXmlType() != null) {
                // This can be either an sObjet or a queryResults
                javax.xml.namespace.QName xmlType = field.getXmlType();
                if ("sObject".equals(xmlType.getLocalPart())) {
                    // This is a lookup relationship, so we need to add the
                    // sobject which is actually
                    // the array of children, hmm....
                    vRecord.add(field);
                } else {
                    // field.getChild("records").
                    vRecord.add(field);
                }
            } else {
                if ("Id".equalsIgnoreCase(fieldName) && field.getValue() != null) {
                    vRecord.add(field);
                } else if (!"Id".equalsIgnoreCase(fieldName)) {
                    vRecord.add(field);
                }
            }
View Full Code Here

              if (index++ < DISCARDED_FIELD_COUNT){
                fields.next();
                continue;
              }
             
              XmlObject field = fields.next();
              Object newVal = convertFieldValue(field.getValue());
              if (newVal == null){
                newVal = "";
              }
              oneLine.addField(newVal.toString());
            }
View Full Code Here

TOP

Related Classes of com.sforce.ws.bind.XmlObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.