Package com.salesforce.dataloader.config

Examples of com.salesforce.dataloader.config.Config


            if(button == SWT.NO) {
                return this;
            }
        }

        Config config = controller.getConfig();
        //get entity
        IStructuredSelection selection = (IStructuredSelection)lv.getSelection();
        DescribeGlobalSObjectResult entity = (DescribeGlobalSObjectResult)selection.getFirstElement();
        config.setValue(Config.ENTITY, entity.getName());
        // set DAO - CSV file name
        config.setValue(Config.DAO_NAME, fileText.getText());
        // set DAO type to CSV
        config.setValue(Config.DAO_TYPE, DataAccessObjectFactory.CSV_WRITE_TYPE);
        controller.saveConfig();

        try {
            // create data access object for the extraction output
            controller.createDao();
            // reinitialize the data mapping (UI extraction currently uses only implicit mapping)
            config.setValue(Config.MAPPING_FILE, "");
            controller.createMapper();
        } catch (DataAccessObjectInitializationException e) {
            MessageBox msgBox = new MessageBox(getShell(), SWT.OK | SWT.ICON_ERROR);
            msgBox.setMessage(Labels.getString("ExtractionDataSelectionPage.extractOutputError")); //$NON-NLS-1$
            msgBox.open();
View Full Code Here


    }

    public void initializeSOQLText() {
        logger.debug(Labels.getString("ExtractionSOQLPage.initializeMsg")); //$NON-NLS-1$
        Config config = controller.getConfig();

        DescribeSObjectResult result = controller.getFieldTypes();
        fields = result.getFields();
        fieldViewer.setInput(fields);
        fieldCombo.removeAll();
        List<String> fieldNames = new ArrayList<String>();
        for (int i = 0; i < fields.length; i++) {
            // include all fields except encrypted string ones
            if(FieldType.encryptedstring != fields[i].getType()) {
                fieldNames.add(fields[i].getName());
            }
        }
        String[] fieldNamesArray = fieldNames.toArray(new String[fieldNames.size()]);
        Arrays.sort(fieldNamesArray);
        fieldCombo.setItems(fieldNamesArray);
        builderComp.layout();
        whereComp.layout();

        fromPart = new StringBuffer("FROM ").append(config.getString(Config.ENTITY)).append(" "); //$NON-NLS-1$ //$NON-NLS-2$

    }
View Full Code Here

            @Override
            public void widgetSelected(SelectionEvent event) {
                FileDialog dlg = new FileDialog(getShell(), SWT.OPEN);
                String filename = dlg.open();
                if (filename != null && !"".equals(filename)) { //$NON-NLS-1$
                    Config config = controller.getConfig();
                    config.setValue(Config.MAPPING_FILE, filename);
                    LoadMapper mapper = (LoadMapper)controller.getMapper();
                    mapper.clearMap();
                    try {
                        mapper.putPropertyFileMappings(filename);
                        updateMapping();
View Full Code Here

        buttonSave.setLayoutData(data);
        buttonSave.addSelectionListener(new SelectionAdapter() {
            @Override
            public void widgetSelected(SelectionEvent event) {
                FileDialog dlg = new FileDialog(shell, SWT.SAVE);
                Config config = controller.getConfig();
                dlg.setFileName(config.getString(Config.MAPPING_FILE));
                dlg.setFilterPath(config.getString(Config.MAPPING_FILE));
                dlg.setFilterExtensions(new String[] { "*.sdl" });
                String filename = dlg.open();
                boolean cancel = false;

                if (filename == null || "".equals(filename)) { //$NON-NLS-1$
                    cancel = true;
                }

                // check if file already exists
                while (!cancel && new File(filename).exists()) {
                    int selectedButton = UIUtils.warningConfMessageBox(shell, Labels.getString("UI.fileAlreadyExists"));
                    if (selectedButton == SWT.YES) {
                        break;
                    } else if (selectedButton == SWT.NO) {
                        filename = dlg.open();
                        if (filename == null || "".equals(filename)) { //$NON-NLS-1$
                            cancel = true;
                        }
                    }
                }

                if (!cancel) {
                    config.setValue(Config.MAPPING_FILE, filename);
                    try {
                        mapper.save(filename);
                    } catch (IOException e1) {
                        logger.error(Labels.getString("MappingDialog.errorSave"), e1); //$NON-NLS-1$
                    }
View Full Code Here

    /**
     * Save the data from this page in the config
     * @param selectedObjects
     */
    private void saveExtIdData() {
        Config config = controller.getConfig();

        // external id field
        String extIdField = extIdFieldCombo.getText();
        config.setValue(Config.EXTERNAL_ID_FIELD, extIdField);

        controller.saveConfig();
    }
View Full Code Here

        }

        initLog();

        try {
            config = new Config(getAppPath(), configPath, lastRunFileName);
            // set default before actual values are loaded
            config.setDefaults();
            config.setBatchMode(isBatchMode);
            config.load();
            logger.info(Messages.getMessage(getClass(), "configInit")); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of com.salesforce.dataloader.config.Config

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.