text:
/*jslint indent: 2 */
/*global window: false, XMLHttpRequest: false, chrome: false, btoa: false */
"use strict";
var TogglButton = {
  $user: null,
  $togglApiAdminToken: null,
  $trelloDesparkId: null,
  $trelloApiKey: null,
  $trelloAuthToken: null,
  $trelloApiUrl: "https://api.trello.com/1",
  $apiUrl: "https://www.toggl.com/api/v7",
  $newApiUrl: "https://www.toggl.com/api/v8",
  $databaseUrl: null,
  $sites: new RegExp([
    'asana\\.com',
    'podio\\.com',
    'trello\\.com',
    'github\\.com',
    'bitbucket\\.org',
    'gitlab\\.com',
    'redbooth\\.com',
    'teamweek\\.com',
    'basecamp\\.com',
    'unfuddle\\.com',
    'worksection\\.com',
    'pivotaltracker\\.com',
    'producteev\\.com'].join('|')),
  $curEntryId: null,
  $curTaskId: null,

  checkUrl: function (tabId, changeInfo, tab) {
    if (changeInfo.status === 'complete') {
      if (TogglButton.$sites.test(tab.url)) {
        TogglButton.setPageAction(tabId);
      } else if (/toggl\.com\/track/.test(tab.url)) {
        TogglButton.fetchUser(TogglButton.$apiUrl);
      } else if (/toggl\.com\/app/.test(tab.url)) {
        TogglButton.fetchUser(TogglButton.$newApiUrl);
      }
    }
  },

  fetchUser: function (apiUrl) {
    var xhr = new XMLHttpRequest();

    xhr.onreadystatechange = function(){
      if (xhr.status === 200) {
        var projectMap = {}, resp = JSON.parse(xhr.responseText);
        if (resp.data.projects) {
          resp.data.projects.forEach(function (project) {
            projectMap[project.name] = project.id;
          });
        }
        TogglButton.$user = resp.data;
        TogglButton.$user.projectMap = projectMap;

        chrome.storage.sync.get({
          savedTogglAdminAccessToken: '',
          savedTrelloDesparkId: '',
          savedTrelloApiKey: '',
          savedTrelloAuthToken: '',
          savedBackendUrl: '',
          }, function(items) {
            TogglButton.$trelloDesparkId = items.savedTrelloDesparkId;
            TogglButton.$trelloApiKey = items.savedTrelloApiKey;
            TogglButton.$trelloAuthToken = items.savedTrelloAuthToken;
            TogglButton.$databaseUrl = items.savedBackendUrl;
            for (var property in TogglButton.$user.workspaces) {
              if (TogglButton.$user.workspaces[property].name === 'Despark' && TogglButton.$user.workspaces[property].admin === false) {
                TogglButton.$togglApiAdminToken = items.savedTogglAdminAccessToken;
              } else {
                TogglButton.$togglApiAdminToken = TogglButton.$user.api_token;
              }
            }
          });
        // chrome.runtime.sendMessage({project_map: projectMap});

      } else if (apiUrl === TogglButton.$apiUrl) {
        TogglButton.fetchUser(TogglButton.$newApiUrl);
      }
    }

    xhr.open("GET", apiUrl + "/me?with_related_data=true", true);
    // xhr.onload = function () {
    //   if (xhr.status === 200) {
    //     var projectMap = {}, resp = JSON.parse(xhr.responseText);
    //     if (resp.data.projects) {
    //       resp.data.projects.forEach(function (project) {
    //         projectMap[project.name] = project.id;
    //       });
    //     }
    //     TogglButton.$user = resp.data;
    //     TogglButton.$user.projectMap = projectMap;

    //     // chrome.runtime.sendMessage({project_map: projectMap});

    //   } else if (apiUrl === TogglButton.$apiUrl) {
    //     TogglButton.fetchUser(TogglButton.$newApiUrl);
    //   }
    // };

    xhr.send();
  },

  createTimeEntry: function (timeEntry) {
    var start = new Date(),
      xhr = new XMLHttpRequest(),
      entry = {
        time_entry: {
          start: start.toISOString(),
          description: timeEntry.description,
          wid: timeEntry.workspaceId || null,
          pid: timeEntry.projectId || null,
          tid: timeEntry.tid || null,
          billable: timeEntry.billable || false,
          duration: -(start.getTime() / 1000),
          created_with: timeEntry.createdWith || 'TogglButton',
          tags: timeEntry.tags
        }
      };

    if (timeEntry.projectName !== undefined) {
      entry.time_entry.pid = TogglButton.$user.projectMap[timeEntry.projectName];
    }

    //Create a new Project incase the projects map array doesn't already contain the requested project
    if (timeEntry.projectName !== undefined && timeEntry.projectName != "" && (entry.time_entry.pid == null || entry.time_entry.pid == undefined)) {
      if (confirm('Toggl couldn\'t find a project called "' + timeEntry.projectName + '". Would you like to create one now ?')){
        TogglButton.createNewProject(timeEntry.projectName,timeEntry);
        return false; //stop here until the new project is created
      }
    }

      TogglButton.getTrelloBoardId(timeEntry.projectName, function (trelloBoardId) {
        TogglButton.getTrelloCardId(trelloBoardId, timeEntry.description, function(trelloCardId) {
          TogglButton.checkIfTaskExistsInDatabase(trelloCardId, entry.time_entry.pid, function(check) {
            if (check === null || check === '') {
              TogglButton.checkIfTaskExistsInToggl(timeEntry.description, entry.time_entry.pid, entry.time_entry.wid, function (data) {
                if (data === null) {
                  TogglButton.createNewTask(timeEntry.description, entry.time_entry.wid, entry.time_entry.pid, function(tid) {
                      if (tid !== null) {
                      TogglButton.saveTaskToDatabase(timeEntry.description, entry.time_entry.pid, tid, trelloCardId);
                      entry.time_entry.tid = tid;
                      TogglButton.createTimeEntryRequest(entry, xhr);
                    }
                  });
                } else {
                  TogglButton.saveTaskToDatabase(data.name, data.pid, data.id, trelloCardId);
                  entry.time_entry.tid = data.id;
                  TogglButton.createTimeEntryRequest(entry, xhr);
                }
              });
            } else {
              entry.time_entry.tid = check;
              TogglButton.getTask(entry.time_entry.tid, function(task){
                TogglButton.updateTask(timeEntry.description, task.data.estimated_seconds, task.data.name, entry.time_entry.tid);
              });
              TogglButton.createTimeEntryRequest(entry, xhr);
            }
          });
        });
      });
  },

  createTimeEntryRequest: function (entry, xhr) {
    xhr.open("POST", TogglButton.$newApiUrl + "/time_entries", true);
    xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$user.api_token + ':api_token'));

    // handle response
    xhr.addEventListener('load', function (e) {
      var responseData, entryId;
      responseData = JSON.parse(xhr.responseText);
      entryId = responseData && responseData.data && responseData.data.id;
      TogglButton.$curEntryId = entryId;
    });
    xhr.send(JSON.stringify(entry));
  },

  stopTimeEntry: function (entryId) {
    entryId = entryId || TogglButton.$curEntryId;
    if (!entryId) {
      return;
    }
    var xhr = new XMLHttpRequest();

    // PUT https://www.toggl.com/api/v8/time_entries/{time_entry_id}/stop
    xhr.open("PUT", TogglButton.$newApiUrl + "/time_entries/" + entryId + "/stop", true);
    xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$user.api_token + ':api_token'));
    xhr.send();
  },

  convertEstimationToSeconds: function (description, callback) {
    var estimation = 0;

    if (description.match(/\s\[(\d+)(min|h|d|wk)\]/) !== null) {
      estimation = description.match(/(\d+)(min|h|d|wk)/);
      estimation = estimation[0];

      if (estimation.indexOf('min') !== -1) {
        estimation = estimation.replace('min', '');
        estimation = estimation * 60;
      } else if (estimation.indexOf('h') !== -1) {
        estimation = estimation.replace('h', '');
        estimation = estimation * 3600;
      } else if (estimation.indexOf('d') !== -1) {
        estimation = estimation.replace('d', '');
        estimation = estimation * 86400;
      } else {
        estimation = estimation.replace('wk', '');
        estimation = estimation * 604800;
      }
      description = description.replace(/\s\[(\d+)(min|h|d|wk)\]/, '');
    }
    callback(description, estimation);
  },

  createNewTask: function (fullDescription, wid, pid, callback) {
    var xhr = new XMLHttpRequest();

    TogglButton.convertEstimationToSeconds(fullDescription, function(description, estimation) {
      var tid = null,
      entry = {
        task: {
          name: description,
          wid: wid,
          pid: pid,
          estimated_seconds: estimation
        }
      };

      xhr.open("POST", TogglButton.$newApiUrl + "/tasks", true);
      xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$togglApiAdminToken + ':api_token'));

      // handle response
      xhr.addEventListener('load', function (e) {
        if (xhr.status === 200) {
          var responseData, taskId;
          responseData = JSON.parse(xhr.responseText);
          taskId = responseData && responseData.data && responseData.data.id;
          TogglButton.$curTaskId = taskId;
          callback(TogglButton.$curTaskId);
        } else {
          alert('Cannot create new Toggl task! Please check your settings!');
        }
      });
      xhr.send(JSON.stringify(entry));
    });
  },

  getTask: function (tid, callback) {
    var xhr = new XMLHttpRequest();
    xhr.open("GET", TogglButton.$newApiUrl + "/tasks/" + tid, true);
    xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$togglApiAdminToken + ':api_token'));

    // handle response
    xhr.addEventListener('load', function (e) {
      if (xhr.status === 200) {
        var responseData;
        responseData = JSON.parse(xhr.responseText);
        callback(responseData);
      } else {
        alert('Cannot get Toggl Task! Please check your settings!');
      }
    });
    xhr.send();
  },

  checkIfTaskExistsInToggl (description, pid, wid, callback) {
    var xhr = new XMLHttpRequest();
    TogglButton.convertEstimationToSeconds(description, function (newDescription, estimation) {
      xhr.open("GET", TogglButton.$newApiUrl + "/workspaces/" + wid + "/tasks", true);
      xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$togglApiAdminToken + ':api_token'));

      // handle response
      xhr.addEventListener('load', function (e) {
        if (xhr.status === 200) {
          var responseData,
              task = null;
          responseData = JSON.parse(xhr.responseText);
          for (var property in responseData) {
              if (responseData[property].name == newDescription && responseData[property].pid == pid) {
                task = responseData[property];
                break;
              }
          }
          callback(task);
        } else {
          alert('Cannot check if the task exists in Toggl! Please check your settings!');
        }
      });
      xhr.send();
    });
  },

  updateTask: function (newDescription, estimatedSeconds, oldDescription, tid) {
    TogglButton.convertEstimationToSeconds(newDescription, function(description, estimation) {
      if (description !== oldDescription) {
        TogglButton.updateTaskInDatabase(description, tid);
      }
      if (estimation !== estimatedSeconds || description !== oldDescription) {
        var xhr = new XMLHttpRequest(),
          entry = {
            task: {
              name: description,
              estimated_seconds: estimation
            }
          };
        xhr.open("PUT", TogglButton.$newApiUrl + "/tasks/" + tid, true);
        xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$togglApiAdminToken + ':api_token'));

        // handle response
        xhr.addEventListener('load', function (e) {
          if (xhr.status === 200) {
            var responseData, taskId;
            responseData = JSON.parse(xhr.responseText);
          } else {
            alert('Cannot update task!');
          }
        });
        xhr.send(JSON.stringify(entry));
      }
    });
  },

  saveTaskToDatabase: function (description, pid, tid, trelloCardId) {
    if (description.match(/\s\[(\d+)(min|h|d|wk)\]/) !== null) {
      description = description.replace(/\s\[(\d+)(min|h|d|wk)\]\s\|\s(\d+)$/, '');
    } else if (description.match(/\s\|\s(\d+)$/) !== null) {
      description = description.replace(/\s\|\s(\d+)$/, '');
    } else {}

    var xhr = new XMLHttpRequest(),
    entry = "description="+description+"&pid="+pid+"&tid="+tid+"&trello_card_id="+trelloCardId;
    xhr.open("POST", TogglButton.$databaseUrl + "/insert.php", true);
    xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
    xhr.onreadystatechange = function() {
      if (xhr.readyState == XMLHttpRequest.DONE) {
          return xhr.responseText;
      }
    }
    xhr.send(entry);
  },

  updateTaskInDatabase: function (description, tid) {
    var xhr = new XMLHttpRequest(),
    entry = "description="+description+"&tid="+tid;
    xhr.open("POST", TogglButton.$databaseUrl + "/update.php", true);
    xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
    xhr.onreadystatechange = function() {
      if (xhr.readyState == XMLHttpRequest.DONE) {
          return xhr.responseText;
      }
    }
    xhr.send(entry);
  },

  checkIfTaskExistsInDatabase: function (trelloCardId, pid, callback) {
    var xhr = new XMLHttpRequest(),
    entry = "trello_card_id="+trelloCardId+"&pid="+pid;
    xhr.open("POST", TogglButton.$databaseUrl + "/select.php", true);
    xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");
    xhr.onreadystatechange = function() {
      if (xhr.readyState == XMLHttpRequest.DONE) {
          callback(xhr.responseText);
      }
    }
    xhr.send(entry);
  },

  getTrelloBoardId: function (projectName, callback) {
    projectName = projectName.replace(/\s/g,'').toLowerCase();
    projectName = projectName.replace(/^\d+-/, '');
    var xhr = new XMLHttpRequest();

    xhr.open("GET", TogglButton.$trelloApiUrl + "/organizations/" + TogglButton.$trelloDesparkId + "/boards?key=" + TogglButton.$trelloApiKey + "&token=" + TogglButton.$trelloAuthToken, true);

    // handle response
    xhr.addEventListener('load', function (e) {
      if (xhr.status === 200) {
        var responseData,
            trelloBoardName,
            trelloBoardId;
        responseData = JSON.parse(xhr.responseText);
        for (var property in responseData) {
            trelloBoardName = responseData[property].name.replace(/\s/g,'').toLowerCase();
            trelloBoardName = trelloBoardName.replace(/^\d+-/, '');
            if (trelloBoardName.indexOf(projectName) !== -1 || projectName.indexOf(trelloBoardName) !== -1) {
              trelloBoardId = responseData[property].id;
              break;
            }
        }
        callback(trelloBoardId);
      } else {
        alert('Cannot get Trello Board! Please check your settings!');
      }
    });
    xhr.send();
  },

getTrelloCardId: function (trelloBoardId, description, callback) {
  if (description.match(/\s\|\s(\d+)$/) !== null) {
      description = description.replace(/\s\|\s(\d+)$/, '');
  }
  var xhr = new XMLHttpRequest();

  xhr.open("GET", TogglButton.$trelloApiUrl + "/boards/" + trelloBoardId + "/cards?fields=name&key=" + TogglButton.$trelloApiKey + "&token=" + TogglButton.$trelloAuthToken, true);

  // handle response
  xhr.addEventListener('load', function (e) {
    if (xhr.status === 200) {
      var responseData,
          trelloCardId;
      responseData = JSON.parse(xhr.responseText);
      for (var property in responseData) {
          if (responseData[property].name == description) {
            trelloCardId = responseData[property].id;
            break;
          }
      }
      callback(trelloCardId);
    } else {
      alert('Cannot get Trello Card! Please check your settings!');
    }
  });
  xhr.send();
},

  //Create a New Project
  createNewProject: function (projectName,timeEntry) {

    var xhr = new XMLHttpRequest();
    var project_data = {
          project: {
            name: projectName,
            wid: TogglButton.$user.default_wid
          }
    };

    //POST https://www.toggl.com/api/v8/projects
    xhr.open("POST", TogglButton.$newApiUrl + "/projects", true);
    xhr.setRequestHeader('Authorization', 'Basic ' + btoa(TogglButton.$togglApiAdminToken + ':api_token'));

    // handle response
    xhr.addEventListener('load', function (e) {
      var responseData, projectId;
      responseData = JSON.parse(xhr.responseText);
      projectId = responseData && responseData.data && responseData.data.id;

      if(projectId == null || projectId == undefined){
        projectId = 0;
      }

      TogglButton.$user.projectMap[projectName] = projectId;

      TogglButton.createTimeEntry(timeEntry);

    });
    xhr.send(JSON.stringify(project_data));
  },

  setPageAction: function (tabId) {
    var imagePath = 'images/inactive-19.png';
    if (TogglButton.$user !== null) {
      imagePath = 'images/active-19.png';
    }
    chrome.pageAction.setIcon({
      tabId: tabId,
      path: imagePath
    });
    chrome.pageAction.show(tabId);
  },

  newMessage: function (request, sender, sendResponse) {
    if (request.type === 'activate') {
      TogglButton.setPageAction(sender.tab.id);
      sendResponse({success: TogglButton.$user !== null, user: TogglButton.$user});
    } else if (request.type === 'timeEntry') {
      TogglButton.createTimeEntry(request);
    } else if (request.type === 'stop') {
      TogglButton.stopTimeEntry();
    } else if (request.type === 'get_user_data') {
      sendResponse({user: TogglButton.$user});
    }
  }
};

chrome.pageAction.onClicked.addListener(function (tab) {
  if (TogglButton.$user === null) {
    chrome.tabs.create({url: 'https://toggl.com/login'});
  }
});

TogglButton.fetchUser(TogglButton.$apiUrl);
chrome.tabs.onUpdated.addListener(TogglButton.checkUrl);
chrome.extension.onMessage.addListener(TogglButton.newMessage);


text:
#include "../../inc/MarlinConfig.h"

#if ENABLED(PREVENT_COLD_EXTRUSION)

#include "../gcode.h"
#include "../../module/temperature.h"

/**
 * M302: Allow cold extrudes, or set the minimum extrude temperature
 *
 *       S<temperature> sets the minimum extrude temperature
 *       P<bool> enables (1) or disables (0) cold extrusion
 *
 *  Examples:
 *
 *       M302         ; report current cold extrusion state
 *       M302 P0      ; enable cold extrusion checking
 *       M302 P1      ; disable cold extrusion checking
 *       M302 S0      ; always allow extrusion (disables checking)
 *       M302 S170    ; only allow extrusion above 170
 *       M302 S170 P1 ; set min extrude temp to 170 but leave disabled
 */
void GcodeSuite::M302() {
  const bool seen_S = parser.seen('S');
  if (seen_S) {
    thermalManager.extrude_min_temp = parser.value_celsius();
    thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0);
  }

  if (parser.seen('P'))
    thermalManager.allow_cold_extrude = (thermalManager.extrude_min_temp == 0) || parser.value_bool();
  else if (!seen_S) {
    // Report current state
    SERIAL_ECHO_START();
    SERIAL_ECHOPGM("Cold extrudes are ");
    SERIAL_ECHOPGM_P(thermalManager.allow_cold_extrude ? PSTR("en") : PSTR("dis"));
    SERIAL_ECHOLNPAIR("abled (min temp ", thermalManager.extrude_min_temp, "C)");
  }
}

#endif // PREVENT_COLD_EXTRUSION

redpajama_set_name: RedPajamaGithub


text:
{-|
Description : Nix-relevant interfaces to NaCl signatures.
-}
module System.Nix.Signature
  ( Signature
  , NarSignature(..)
  ) where

import System.Nix.Internal.Signature


text:
package org.pentaho.di.ui.trans.steps.salesforceinsert;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.events.FocusListener;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.ShellAdapter;
import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

import org.pentaho.di.i18n.BaseMessages;
import org.pentaho.di.core.Props;
import org.pentaho.di.core.SourceToTargetMapping;
import org.pentaho.di.core.exception.KettleException;
import org.pentaho.di.core.row.RowMeta;
import org.pentaho.di.core.row.RowMetaInterface;
import org.pentaho.di.core.row.ValueMeta;
import org.pentaho.di.core.row.ValueMetaInterface;
import org.pentaho.di.core.Const;
import org.pentaho.di.trans.TransMeta;
import org.pentaho.di.ui.trans.step.BaseStepDialog;
import org.pentaho.di.ui.trans.step.TableItemInsertListener;
import org.pentaho.di.trans.step.BaseStepMeta;
import org.pentaho.di.trans.step.StepDialogInterface;
import org.pentaho.di.trans.step.StepMeta;
import org.pentaho.di.trans.steps.salesforceinput.SalesforceConnection;
import org.pentaho.di.trans.steps.salesforceinput.SalesforceConnectionUtils;
import org.pentaho.di.trans.steps.salesforceinsert.SalesforceInsertMeta;
import org.pentaho.di.ui.core.widget.ColumnInfo;
import org.pentaho.di.ui.core.widget.ComboVar;
import org.pentaho.di.ui.core.widget.TableView;
import org.pentaho.di.ui.core.widget.TextVar;
import org.pentaho.di.ui.core.widget.LabelTextVar;
import org.pentaho.di.ui.core.dialog.EnterMappingDialog;
import org.pentaho.di.ui.core.dialog.ErrorDialog;
import org.pentaho.di.ui.core.gui.GUIResource;
import org.pentaho.di.core.util.StringUtil;

public class SalesforceInsertDialog extends BaseStepDialog implements StepDialogInterface {

	private static Class<?> PKG = SalesforceInsertMeta.class; // for i18n purposes, needed by Translator2!!   $NON-NLS-1$

	private CTabFolder wTabFolder;
	private FormData fdTabFolder;

	private CTabItem wGeneralTab;

	private Composite wGeneralComp ;

	private FormData fdGeneralComp;

	private FormData fdlModule, fdModule;

	private FormData fdlBatchSize, fdBatchSize;

	private FormData fdUserName,fdURL,fdPassword;

	private Label wlModule,wlBatchSize;

    private Map<String, Integer> inputFields;

    private ColumnInfo[] ciReturn;

	private Button     wDoMapping;
	private FormData   fdDoMapping;

	private Label				wlReturn;
	private TableView			wReturn;
	private FormData			fdlReturn, fdReturn;

	private Button				wGetLU;
	private FormData			fdGetLU;
	private Listener			lsGetLU;

	private SalesforceInsertMeta input;

    private LabelTextVar wUserName,wURL,wPassword;

    private TextVar wBatchSize;

    private ComboVar  wModule;

	private Button wTest;

	private FormData fdTest;
    private Listener lsTest;

	private Group wConnectionGroup;
	private FormData fdConnectionGroup;

	private Group wSettingsGroup, wOutFieldsGroup;
	private FormData fdSettingsGroup, fdOutFieldsGroup;

	private Label wlSalesforceIDFieldName;
	private FormData fdlSalesforceIDFieldName;

	private TextVar wSalesforceIDFieldName;
	private FormData fdSalesforceIDFieldName;

    private Label wlUseCompression;
    private FormData fdlUseCompression;
    private Button wUseCompression;
    private FormData fdUseCompression;

    private Label wlTimeOut;
    private FormData fdlTimeOut;
    private TextVar wTimeOut;
    private FormData fdTimeOut;

	/**
	 * List of ColumnInfo that should have the field names of the selected database table
	 */
	private List<ColumnInfo> tableFieldColumns = new ArrayList<ColumnInfo>();
    private boolean  gotModule = false;
	private boolean gotFields=false;

    private Label wlRollbackAllChangesOnError;
    private FormData fdlRollbackAllChangesOnError;
    private Button wRollbackAllChangesOnError;
    private FormData fdRollbackAllChangesOnError;

    private boolean  getModulesListError = false;     /* True if error getting modules list */

	public SalesforceInsertDialog(Shell parent, Object in, TransMeta transMeta, String sname) {
		super(parent, (BaseStepMeta) in, transMeta, sname);
		input = (SalesforceInsertMeta) in;
        inputFields =new HashMap<String, Integer>();
	}

	public String open() {
		Shell parent = getParent();
		Display display = parent.getDisplay();

		shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX
				| SWT.MIN);
		props.setLook(shell);
		setShellImage(shell, input);

		ModifyListener lsMod = new ModifyListener() {
			public void modifyText(ModifyEvent e) {
				input.setChanged();
			}
		};
		ModifyListener lsTableMod = new ModifyListener() {
			public void modifyText(ModifyEvent arg0) {
				input.setChanged();
				setModuleFieldCombo();
			}
		};
		SelectionAdapter lsSelection = new SelectionAdapter()
		{
			public void widgetSelected(SelectionEvent e)
			{
				input.setChanged();
				setModuleFieldCombo();
			}
		};
		changed = input.hasChanged();

		FormLayout formLayout = new FormLayout();
		formLayout.marginWidth = Const.FORM_MARGIN;
		formLayout.marginHeight = Const.FORM_MARGIN;

		shell.setLayout(formLayout);
		shell.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.DialogTitle"));

		int middle = props.getMiddlePct();
		int margin = Const.MARGIN;

		// Stepname line
		wlStepname = new Label(shell, SWT.RIGHT);
		wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
		props.setLook(wlStepname);
		fdlStepname = new FormData();
		fdlStepname.left = new FormAttachment(0, 0);
		fdlStepname.top = new FormAttachment(0, margin);
		fdlStepname.right = new FormAttachment(middle, -margin);
		wlStepname.setLayoutData(fdlStepname);
		wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
		wStepname.setText(stepname);
		props.setLook(wStepname);
		wStepname.addModifyListener(lsMod);
		fdStepname = new FormData();
		fdStepname.left = new FormAttachment(middle, 0);
		fdStepname.top = new FormAttachment(0, margin);
		fdStepname.right = new FormAttachment(100, 0);
		wStepname.setLayoutData(fdStepname);

		wTabFolder = new CTabFolder(shell, SWT.BORDER);
		props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);

		// ////////////////////////
		// START OF FILE TAB ///
		// ////////////////////////
		wGeneralTab = new CTabItem(wTabFolder, SWT.NONE);
		wGeneralTab.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.General.Tab"));

		wGeneralComp = new Composite(wTabFolder, SWT.NONE);
		props.setLook(wGeneralComp);

		FormLayout generalLayout = new FormLayout();
		generalLayout.marginWidth = 3;
		generalLayout.marginHeight = 3;
		wGeneralComp.setLayout(generalLayout);

		/////////////////////////////////
		// START OF Connection GROUP  //
		/////////////////////////////////

		wConnectionGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
		props.setLook(wConnectionGroup);
		wConnectionGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.ConnectionGroup.Label"));

		FormLayout connectionGroupLayout = new FormLayout();
		connectionGroupLayout.marginWidth = 10;
		connectionGroupLayout.marginHeight = 10;
		wConnectionGroup.setLayout(connectionGroupLayout);

	     // Webservice URL
        wURL = new LabelTextVar(transMeta,wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.URL.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.URL.Tooltip"));
        props.setLook(wURL);
        wURL.addModifyListener(lsMod);
        fdURL = new FormData();
        fdURL.left = new FormAttachment(0, 0);
        fdURL.top = new FormAttachment(wStepname, margin);
        fdURL.right = new FormAttachment(100, 0);
        wURL.setLayoutData(fdURL);

	     // UserName line
        wUserName = new LabelTextVar(transMeta,wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.User.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.User.Tooltip"));
        props.setLook(wUserName);
        wUserName.addModifyListener(lsMod);
        fdUserName = new FormData();
        fdUserName.left = new FormAttachment(0, 0);
        fdUserName.top = new FormAttachment(wURL, margin);
        fdUserName.right = new FormAttachment(100, 0);
        wUserName.setLayoutData(fdUserName);

        // Password line
        wPassword = new LabelTextVar(transMeta,wConnectionGroup, BaseMessages.getString(PKG, "SalesforceInsertDialog.Password.Label"), BaseMessages.getString(PKG, "SalesforceInsertDialog.Password.Tooltip"));
        props.setLook(wPassword);
        wPassword.setEchoChar('*');
        wPassword.addModifyListener(lsMod);
        fdPassword = new FormData();
        fdPassword.left = new FormAttachment(0, 0);
        fdPassword.top = new FormAttachment(wUserName, margin);
        fdPassword.right = new FormAttachment(100, 0);
        wPassword.setLayoutData(fdPassword);

        // OK, if the password contains a variable, we don't want to have the password hidden...
        wPassword.getTextWidget().addModifyListener(new ModifyListener()
        {
            public void modifyText(ModifyEvent e)
            {
                checkPasswordVisible();
            }
        });

		// Test Salesforce connection button
		wTest=new Button(wConnectionGroup,SWT.PUSH);
		wTest.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TestConnection.Label"));
 		props.setLook(wTest);
		fdTest=new FormData();
		wTest.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TestConnection.Tooltip"));
		//fdTest.left = new FormAttachment(middle, 0);
		fdTest.top  = new FormAttachment(wPassword, margin);
		fdTest.right= new FormAttachment(100, 0);
		wTest.setLayoutData(fdTest);

		fdConnectionGroup = new FormData();
		fdConnectionGroup.left = new FormAttachment(0, margin);
		fdConnectionGroup.top = new FormAttachment(wStepname, margin);
		fdConnectionGroup.right = new FormAttachment(100, -margin);
		wConnectionGroup.setLayoutData(fdConnectionGroup);

		/////////////////////////////////
		// END OF Connection GROUP  //
		/////////////////////////////////

		/////////////////////////////////
		// START OF Settings GROUP  //
		/////////////////////////////////

		wSettingsGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
		props.setLook(wSettingsGroup);
		wSettingsGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SettingsGroup.Label"));

		FormLayout settingGroupLayout = new FormLayout();
		settingGroupLayout.marginWidth = 10;
		settingGroupLayout.marginHeight = 10;
		wSettingsGroup.setLayout(settingGroupLayout);

		// Timeout
		wlTimeOut = new Label(wSettingsGroup, SWT.RIGHT);
		wlTimeOut.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.TimeOut.Label"));
		props.setLook(wlTimeOut);
		fdlTimeOut = new FormData();
		fdlTimeOut.left = new FormAttachment(0, 0);
		fdlTimeOut.top = new FormAttachment(wSettingsGroup, margin);
		fdlTimeOut.right = new FormAttachment(middle, -margin);
		wlTimeOut.setLayoutData(fdlTimeOut);
		wTimeOut = new TextVar(transMeta,wSettingsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
		props.setLook(wTimeOut);
		wTimeOut.addModifyListener(lsMod);
		fdTimeOut = new FormData();
		fdTimeOut.left = new FormAttachment(middle, 0);
		fdTimeOut.top = new FormAttachment(wSettingsGroup, margin);
		fdTimeOut.right = new FormAttachment(100, 0);
		wTimeOut.setLayoutData(fdTimeOut);

		// Use compression?
		wlUseCompression=new Label(wSettingsGroup, SWT.RIGHT);
		wlUseCompression.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UseCompression.Label"));
 		props.setLook(wlUseCompression);
		fdlUseCompression=new FormData();
		fdlUseCompression.left = new FormAttachment(0, 0);
		fdlUseCompression.top  = new FormAttachment(wTimeOut, margin);
		fdlUseCompression.right= new FormAttachment(middle, -margin);
		wlUseCompression.setLayoutData(fdlUseCompression);
		wUseCompression=new Button(wSettingsGroup, SWT.CHECK );
 		props.setLook(wUseCompression);
		wUseCompression.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UseCompression.Tooltip"));
		fdUseCompression=new FormData();
		fdUseCompression.left = new FormAttachment(middle, 0);
		fdUseCompression.top  = new FormAttachment(wTimeOut, margin);
		wUseCompression.setLayoutData(fdUseCompression);

		// Rollback all changes on error?
		wlRollbackAllChangesOnError=new Label(wSettingsGroup, SWT.RIGHT);
		wlRollbackAllChangesOnError.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.RollbackAllChangesOnError.Label"));
 		props.setLook(wlRollbackAllChangesOnError);
		fdlRollbackAllChangesOnError=new FormData();
		fdlRollbackAllChangesOnError.left = new FormAttachment(0, 0);
		fdlRollbackAllChangesOnError.top  = new FormAttachment(wUseCompression, margin);
		fdlRollbackAllChangesOnError.right= new FormAttachment(middle, -margin);
		wlRollbackAllChangesOnError.setLayoutData(fdlRollbackAllChangesOnError);
		wRollbackAllChangesOnError=new Button(wSettingsGroup, SWT.CHECK );
 		props.setLook(wRollbackAllChangesOnError);
		wRollbackAllChangesOnError.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.RollbackAllChangesOnError.Tooltip"));
		fdRollbackAllChangesOnError=new FormData();
		fdRollbackAllChangesOnError.left = new FormAttachment(middle, 0);
		fdRollbackAllChangesOnError.top  = new FormAttachment(wUseCompression, margin);
		wRollbackAllChangesOnError.setLayoutData(fdRollbackAllChangesOnError);

		// BatchSize value
		wlBatchSize = new Label(wSettingsGroup, SWT.RIGHT);
		wlBatchSize.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.Limit.Label"));
		props.setLook(wlBatchSize);
		fdlBatchSize = new FormData();
		fdlBatchSize.left = new FormAttachment(0, 0);
		fdlBatchSize.top = new FormAttachment(wRollbackAllChangesOnError, margin);
		fdlBatchSize.right = new FormAttachment(middle, -margin);
		wlBatchSize.setLayoutData(fdlBatchSize);
		wBatchSize = new TextVar(transMeta,wSettingsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
		props.setLook(wBatchSize);
		wBatchSize.addModifyListener(lsMod);
		fdBatchSize = new FormData();
		fdBatchSize.left = new FormAttachment(middle, 0);
		fdBatchSize.top = new FormAttachment(wRollbackAllChangesOnError, margin);
		fdBatchSize.right = new FormAttachment(100, 0);
		wBatchSize.setLayoutData(fdBatchSize);

 		// Module
		wlModule=new Label(wSettingsGroup, SWT.RIGHT);
        wlModule.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.Module.Label"));
        props.setLook(wlModule);
        fdlModule=new FormData();
        fdlModule.left = new FormAttachment(0, 0);
        fdlModule.top  = new FormAttachment(wBatchSize, margin);
        fdlModule.right= new FormAttachment(middle, -margin);
        wlModule.setLayoutData(fdlModule);
        wModule=new ComboVar(transMeta, wSettingsGroup, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
        wModule.setEditable(true);
        props.setLook(wModule);
        wModule.addModifyListener(lsTableMod);
        wModule.addSelectionListener(lsSelection);
        fdModule=new FormData();
        fdModule.left = new FormAttachment(middle, 0);
        fdModule.top  = new FormAttachment(wBatchSize, margin);
        fdModule.right= new FormAttachment(100, -margin);
        wModule.setLayoutData(fdModule);
        wModule.addFocusListener(new FocusListener()
        {
            public void focusLost(org.eclipse.swt.events.FocusEvent e)
            {
            	getModulesListError = false;
            }

            public void focusGained(org.eclipse.swt.events.FocusEvent e)
            {
                // check if the URL and login credentials passed and not just had error
            	if (Const.isEmpty(wURL.getText()) ||
               		Const.isEmpty(wUserName.getText()) ||
            		Const.isEmpty(wPassword.getText()) ||
            		(getModulesListError )) return;

                Cursor busy = new Cursor(shell.getDisplay(), SWT.CURSOR_WAIT);
                shell.setCursor(busy);
                getModulesList();
                shell.setCursor(null);
                busy.dispose();
            }
        }
    );

		fdSettingsGroup = new FormData();
		fdSettingsGroup.left = new FormAttachment(0, margin);
		fdSettingsGroup.top = new FormAttachment(wConnectionGroup, margin);
		fdSettingsGroup.right = new FormAttachment(100, -margin);
		wSettingsGroup.setLayoutData(fdSettingsGroup);

		/////////////////////////////////
		// END OF Settings GROUP  //
		/////////////////////////////////

		/////////////////////////////////
		// START OF OutFields GROUP  //
		/////////////////////////////////

		wOutFieldsGroup = new Group(wGeneralComp, SWT.SHADOW_NONE);
		props.setLook(wOutFieldsGroup);
		wOutFieldsGroup.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.OutFieldsGroup.Label"));

		FormLayout OutFieldsGroupLayout = new FormLayout();
		OutFieldsGroupLayout.marginWidth = 10;
		OutFieldsGroupLayout.marginHeight = 10;
		wOutFieldsGroup.setLayout(OutFieldsGroupLayout);

		// SalesforceIDFieldName
		wlSalesforceIDFieldName= new Label(wOutFieldsGroup, SWT.RIGHT);
		wlSalesforceIDFieldName.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SalesforceIDFieldName.Label"));
		props.setLook(wlSalesforceIDFieldName);
		fdlSalesforceIDFieldName= new FormData();
		fdlSalesforceIDFieldName.left = new FormAttachment(0, 0);
		fdlSalesforceIDFieldName.top = new FormAttachment(wSettingsGroup, margin);
		fdlSalesforceIDFieldName.right = new FormAttachment(middle, -margin);
		wlSalesforceIDFieldName.setLayoutData(fdlSalesforceIDFieldName);
		wSalesforceIDFieldName= new TextVar(transMeta,wOutFieldsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
		props.setLook(wSalesforceIDFieldName);
		wSalesforceIDFieldName.setToolTipText(BaseMessages.getString(PKG, "SalesforceInsertDialog.SalesforceIDFieldName.Tooltip"));
		wSalesforceIDFieldName.addModifyListener(lsMod);
		fdSalesforceIDFieldName= new FormData();
		fdSalesforceIDFieldName.left = new FormAttachment(middle, 0);
		fdSalesforceIDFieldName.top = new FormAttachment(wSettingsGroup, margin);
		fdSalesforceIDFieldName.right = new FormAttachment(100, 0);
		wSalesforceIDFieldName.setLayoutData(fdSalesforceIDFieldName);

		fdOutFieldsGroup = new FormData();
		fdOutFieldsGroup.left = new FormAttachment(0, margin);
		fdOutFieldsGroup.top = new FormAttachment(wSettingsGroup, margin);
		fdOutFieldsGroup.right = new FormAttachment(100, -margin);
		wOutFieldsGroup.setLayoutData(fdOutFieldsGroup);

		/////////////////////////////////
		// END OF OutFields GROUP  //
		/////////////////////////////////

		// THE UPDATE/INSERT TABLE
		wlReturn = new Label(wGeneralComp, SWT.NONE);
		wlReturn.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.UpdateFields.Label")); //$NON-NLS-1$
 		props.setLook(wlReturn);
		fdlReturn = new FormData();
		fdlReturn.left = new FormAttachment(0, 0);
		fdlReturn.top = new FormAttachment(wOutFieldsGroup, margin);
		wlReturn.setLayoutData(fdlReturn);

		int UpInsCols = 3;
		int UpInsRows = (input.getUpdateLookup() != null ? input.getUpdateLookup().length : 1);

		ciReturn = new ColumnInfo[UpInsCols];
		ciReturn[0] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.TableField"),  ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false); //$NON-NLS-1$
		ciReturn[1] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.StreamField"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false); //$NON-NLS-1$
		ciReturn[2] = new ColumnInfo(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.UseExternalId"), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] {"Y","N"}); //$NON-NLS-1$
		ciReturn[2].setToolTip(BaseMessages.getString(PKG, "SalesforceInsertDialog.ColumnInfo.UseExternalId.Tooltip"));
		tableFieldColumns.add(ciReturn[0]);
		wReturn = new TableView(transMeta, wGeneralComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
				ciReturn, UpInsRows, lsMod, props);

		wGetLU = new Button(wGeneralComp, SWT.PUSH);
		wGetLU.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.GetAndUpdateFields.Label")); //$NON-NLS-1$
		fdGetLU = new FormData();
		fdGetLU.top   = new FormAttachment(wlReturn, margin);
		fdGetLU.right = new FormAttachment(100, 0);
		wGetLU.setLayoutData(fdGetLU);

		wDoMapping = new Button(wGeneralComp, SWT.PUSH);
		wDoMapping.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.EditMapping.Label")); //$NON-NLS-1$
		fdDoMapping = new FormData();
		fdDoMapping.top   = new FormAttachment(wGetLU, margin);
		fdDoMapping.right = new FormAttachment(100, 0);
		wDoMapping.setLayoutData(fdDoMapping);

		wDoMapping.addListener(SWT.Selection, new Listener() { 	public void handleEvent(Event arg0) { generateMappings();}});

		fdReturn = new FormData();
		fdReturn.left = new FormAttachment(0, 0);
		fdReturn.top = new FormAttachment(wlReturn, margin);
		fdReturn.right = new FormAttachment(wGetLU, -5*margin);
		fdReturn.bottom = new FormAttachment(100, -2*margin);
		wReturn.setLayoutData(fdReturn);

	    //
        // Search the fields in the background
        //

        final Runnable runnable = new Runnable()
        {
            public void run()
            {
                StepMeta stepMeta = transMeta.findStep(stepname);
                if (stepMeta!=null)
                {
                    try
                    {
                    	RowMetaInterface row = transMeta.getPrevStepFields(stepMeta);

                        // Remember these fields...
                        for (int i=0;i<row.size();i++)
                        {
                        	inputFields.put(row.getValueMeta(i).getName(), Integer.valueOf(i));
                        }

                        setComboBoxes();
                        // Dislay in red missing field names
	                      Display.getDefault().asyncExec(new Runnable() {
		                        public void run() {
		                        	if(!wReturn.isDisposed()) {
			                        	 for(int i=0; i< wReturn.table.getItemCount(); i++) {
				     	            			TableItem it=wReturn.table.getItem(i);
				     	            			if(!Const.isEmpty(it.getText(2))) {
				     	            				if(!inputFields.containsKey(it.getText(2)))
				     	            					it.setBackground(GUIResource.getInstance().getColorRed());
				     	            			}
				     	            		}
		                        	}
		                        }
		                    });
                    }
                    catch(KettleException e)
                    {
                        logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
                    }
                }
            }
        };
        new Thread(runnable).start();

		fdGeneralComp = new FormData();
		fdGeneralComp.left = new FormAttachment(0, 0);
		fdGeneralComp.top = new FormAttachment(wStepname, margin);
		fdGeneralComp.right = new FormAttachment(100, 0);
		fdGeneralComp.bottom = new FormAttachment(100, 0);
		wGeneralComp.setLayoutData(fdGeneralComp);

		wGeneralComp.layout();
		wGeneralTab.setControl(wGeneralComp);

		// THE BUTTONS
		wOK = new Button(shell, SWT.PUSH);
		wOK.setText(BaseMessages.getString(PKG, "System.Button.OK")); //$NON-NLS-1$
		wCancel = new Button(shell, SWT.PUSH);
		wCancel.setText(BaseMessages.getString(PKG, "System.Button.Cancel")); //$NON-NLS-1$

		setButtonPositions(new Button[] { wOK, wCancel }, margin, null);

		fdTabFolder = new FormData();
		fdTabFolder.left   = new FormAttachment(0, 0);
		fdTabFolder.top    = new FormAttachment(wStepname, margin);
		fdTabFolder.right  = new FormAttachment(100, 0);
		fdTabFolder.bottom = new FormAttachment(wOK, -margin);
		wTabFolder.setLayoutData(fdTabFolder);

		// Add listeners
		lsOK = new Listener() {
			public void handleEvent(Event e) {
				ok();
			}
		};
		lsTest     = new Listener() { public void handleEvent(Event e) { test(); } };

		lsGetLU = new Listener()
		{
			public void handleEvent(Event e)
			{
				getUpdate();
			}
		};
		lsCancel = new Listener() {
			public void handleEvent(Event e) {
				cancel();
			}
		};

		wOK.addListener(SWT.Selection, lsOK);
		wGetLU.addListener(SWT.Selection, lsGetLU);
		wTest.addListener    (SWT.Selection, lsTest    );
		wCancel.addListener(SWT.Selection, lsCancel);

		lsDef = new SelectionAdapter() {
			public void widgetDefaultSelected(SelectionEvent e) {
				ok();
			}
		};

		wStepname.addSelectionListener(lsDef);

		// Detect X or ALT-F4 or something that kills this window...
		shell.addShellListener(new ShellAdapter() {
			public void shellClosed(ShellEvent e) {
				cancel();
			}
		});

		wTabFolder.setSelection(0);

		// Set the shell size, based upon previous time...
		setSize();
		getData(input);
		input.setChanged(changed);

		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		return stepname;
	}
	private void getUpdate()
	{
		try
		{
			RowMetaInterface r = transMeta.getPrevStepFields(stepname);
			if (r != null)
			{
                TableItemInsertListener listener = new TableItemInsertListener()
                {
                    public boolean tableItemInserted(TableItem tableItem, ValueMetaInterface v)
                    {
                        tableItem.setText(3, "Y");
                        return true;
                    }
                };
                BaseStepDialog.getFieldsFromPrevious(r, wReturn, 1, new int[] { 1, 2}, new int[] {}, -1, -1, listener);
			}
		}
		catch (KettleException ke)
		{
			new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceInsertDialog.FailedToGetFields.DialogTitle"), //$NON-NLS-1$
					BaseMessages.getString(PKG, "SalesforceInsertDialog.FailedToGetFields.DialogMessage"), ke); //$NON-NLS-1$
		}
	}
 public void checkPasswordVisible()
    {
        String password = wPassword.getText();
        List<String> list = new ArrayList<String>();
        StringUtil.getUsedVariables(password, list, true);
        if (list.size() == 0)
            wPassword.setEchoChar('*');
        else
            wPassword.setEchoChar('\0'); // Show it all...
    }

 private void test()
 {
	 boolean successConnection=true;
	 String msgError=null;
	 SalesforceConnection connection=null;
	try
     {
			SalesforceInsertMeta meta = new SalesforceInsertMeta();
			getInfo(meta);

			// check if the user is given
			if (!checkUser()) return;

			connection=new SalesforceConnection(log, transMeta.environmentSubstitute(meta.getTargetURL()),
					transMeta.environmentSubstitute(meta.getUserName()),
					transMeta.environmentSubstitute(meta.getPassword()));
			connection.connect();

			successConnection=true;

		}
		catch(Exception e) {
			successConnection=false;
			msgError=e.getMessage();
		} finally{
			if(connection!=null) {
				try {connection.close();}catch(Exception e){};
			}
		}

		if(successConnection) {
			MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_INFORMATION );
			mb.setMessage(BaseMessages.getString(PKG, "SalesforceInsertDialog.Connected.OK",wUserName.getText()) +Const.CR);
			mb.setText(BaseMessages.getString(PKG, "SalesforceInsertDialog.Connected.Title.Ok"));
			mb.open();
		}else{
			new ErrorDialog(shell,BaseMessages.getString(PKG, "SalesforceInsertDialog.Connected.Title.Error"),
					BaseMessages.getString(PKG, "SalesforceInsertDialog.Connected.NOK",wUserName.getText()),new Exception(msgError));
		}

	}

	/**
	 * Read the data from the TextFileInputMeta object and show it in this
	 * dialog.
	 *
	 * @param in
	 *            The SalesforceInsertMeta object to obtain the data from.
	 */
	public void getData(SalesforceInsertMeta in)
	{
		wURL.setText(Const.NVL(in.getTargetURL(),""));
		wUserName.setText(Const.NVL(in.getUserName(),""));
		wPassword.setText(Const.NVL(in.getPassword(),""));
		wBatchSize.setText(in.getBatchSize());
		wModule.setText(Const.NVL(in.getModule(), "Account"));
		wBatchSize.setText("" + in.getBatchSize());
		wSalesforceIDFieldName.setText(Const.NVL(in.getSalesforceIDFieldName(),""));
		if(isDebug()) logDebug( BaseMessages.getString(PKG, "SalesforceInsertDialog.Log.GettingFieldsInfo"));

		if (input.getUpdateLookup() != null)
			for (int i = 0; i < input.getUpdateLookup().length; i++)
			{
				TableItem item = wReturn.table.getItem(i);
				if (input.getUpdateLookup()[i] != null)
					item.setText(1, input.getUpdateLookup()[i]);
				if (input.getUpdateStream()[i] != null)
					item.setText(2, input.getUpdateStream()[i]);
				if (input.getUseExternalId()[i]==null||input.getUseExternalId()[i].booleanValue()) {
					item.setText(3,"Y");
				} else {
					item.setText(3,"N");
				}
			}

		wReturn.removeEmptyRows();
		wReturn.setRowNums();
		wReturn.optWidth(true);

		wTimeOut.setText(Const.NVL(in.getTimeOut(), SalesforceConnectionUtils.DEFAULT_TIMEOUT));
		wUseCompression.setSelection(in.isUsingCompression());
		wRollbackAllChangesOnError.setSelection(in.isRollbackAllChangesOnError());
		wStepname.selectAll();
	}

	private void cancel() {
		stepname = null;
		input.setChanged(changed);
		dispose();
	}

	private void ok() {
		try {
			getInfo(input);
		} catch (KettleException e) {
			new ErrorDialog(
			shell,BaseMessages.getString(PKG, "SalesforceInsertDialog.ErrorValidateData.DialogTitle"),
			BaseMessages.getString(PKG, "SalesforceInsertDialog.ErrorValidateData.DialogMessage"),	e);
		}

		dispose();
	}

	private void getInfo(SalesforceInsertMeta in) throws KettleException {
		stepname = wStepname.getText(); // return value

		// copy info to SalesforceInsertMeta class (input)
		in.setTargetURL(Const.NVL(wURL.getText(),SalesforceConnectionUtils.TARGET_DEFAULT_URL));
		in.setUserName(wUserName.getText());
		in.setPassword(wPassword.getText());
		in.setModule(Const.NVL(wModule.getText(),"Account"));
		in.setSalesforceIDFieldName(wSalesforceIDFieldName.getText());
		in.setBatchSize(wBatchSize.getText());

		int nrfields = wReturn.nrNonEmpty();

		in.allocate(nrfields);

		for (int i = 0; i < nrfields; i++)
		{
			TableItem item = wReturn.getNonEmpty(i);
			in.getUpdateLookup()[i] = item.getText(1);
			in.getUpdateStream()[i] = item.getText(2);
			in.getUseExternalId()[i] = Boolean.valueOf("Y".equals(item.getText(3)));
		}
		in.setUseCompression(wUseCompression.getSelection());
		in.setTimeOut(Const.NVL(wTimeOut.getText(),"0"));
		in.setRollbackAllChangesOnError(wRollbackAllChangesOnError.getSelection());
	}

	// check if module, username is given
	private boolean checkInput(){
        if (Const.isEmpty(wModule.getText()))
        {
            MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
            mb.setMessage(BaseMessages.getString(PKG, "SalesforceInsertDialog.ModuleMissing.DialogMessage"));
            mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
            mb.open();
            return false;
        }
        return checkUser();
	}
	// check if module, username is given
	private boolean checkUser() {

        if (Const.isEmpty(wUserName.getText()))
        {
            MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
            mb.setMessage(BaseMessages.getString(PKG, "SalesforceInsertDialog.UsernameMissing.DialogMessage"));
            mb.setText(BaseMessages.getString(PKG, "System.Dialog.Error.Title"));
            mb.open();
            return false;
        }

        return true;
	}

	private String[] getFields() throws KettleException
	{
		  SalesforceInsertMeta meta = new SalesforceInsertMeta();
		  getInfo(meta);

		  SalesforceConnection connection=null;
		  String url = transMeta.environmentSubstitute(meta.getTargetURL());
		  try {
			  String selectedModule=transMeta.environmentSubstitute(meta.getModule());
			  // Define a new Salesforce connection
			  connection=new SalesforceConnection(log, url, transMeta.environmentSubstitute(meta.getUserName()),transMeta.environmentSubstitute(meta.getPassword()));
			  int realTimeOut=Const.toInt(transMeta.environmentSubstitute(meta.getTimeOut()),0);
			  connection.setTimeOut(realTimeOut);
			  // connect to Salesforce
			  connection.connect();
			  // return fieldsname for the module
			  return connection.getFields(selectedModule);
		   } catch(Exception e) {
			  throw new KettleException("Erreur getting fields from module [" + url + "]!", e);
		   } finally{
			  if(connection!=null) {
					try {connection.close();}catch(Exception e){};
				}
		  }
	}
	/**
	 * Reads in the fields from the previous steps and from the ONE next step and opens an
	 * EnterMappingDialog with this information. After the user did the mapping, those information
	 * is put into the Select/Rename table.
	 */
	private void generateMappings() {

		if(!checkInput()) return;

		// Determine the source and target fields...
		//
		RowMetaInterface sourceFields;
		RowMetaInterface targetFields = new RowMeta();

		try {
			sourceFields = transMeta.getPrevStepFields(stepMeta);
		} catch(KettleException e) {
			new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.UnableToFindSourceFields.Title"), BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.UnableToFindSourceFields.Message"), e);
			return;
		}

		try {

			  String[] fields = getFields();
			  for (int i = 0; i < fields.length; i++)  {
	              targetFields.addValueMeta(new ValueMeta(fields[i]));
	           }
		  }catch(Exception e) {
				new ErrorDialog(shell, BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.UnableToFindTargetFields.Title"), BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.UnableToFindTargetFields.Message"), e);
				return;
		  }

		String[] inputNames = new String[sourceFields.size()];
		for (int i = 0; i < sourceFields.size(); i++) {
			ValueMetaInterface value = sourceFields.getValueMeta(i);
			inputNames[i] = value.getName()+
			     EnterMappingDialog.STRING_ORIGIN_SEPARATOR+value.getOrigin()+")";
		}

		// Create the existing mapping list...
		//
		List<SourceToTargetMapping> mappings = new ArrayList<SourceToTargetMapping>();
		StringBuffer missingSourceFields = new StringBuffer();
		StringBuffer missingTargetFields = new StringBuffer();

		int nrFields = wReturn.nrNonEmpty();
		for (int i = 0; i < nrFields ; i++) {
			TableItem item = wReturn.getNonEmpty(i);
			String source = item.getText(2);
			String target = item.getText(1);

			int sourceIndex = sourceFields.indexOfValue(source);
			if (sourceIndex<0) {
				missingSourceFields.append(Const.CR + "   " + source+" --> " + target);
			}
			int targetIndex = targetFields.indexOfValue(target);
			if (targetIndex<0) {
				missingTargetFields.append(Const.CR + "   " + source+" --> " + target);
			}
			if (sourceIndex<0 || targetIndex<0) {
				continue;
			}

			SourceToTargetMapping mapping = new SourceToTargetMapping(sourceIndex, targetIndex);
			mappings.add(mapping);
		}

		// show a confirm dialog if some missing field was found
		//
		if (missingSourceFields.length()>0 || missingTargetFields.length()>0){

			String message="";
			if (missingSourceFields.length()>0) {
				message+=BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.SomeSourceFieldsNotFound", missingSourceFields.toString())+Const.CR;
			}
			if (missingTargetFields.length()>0) {
				message+=BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.SomeTargetFieldsNotFound", missingSourceFields.toString())+Const.CR;
			}
			message+=Const.CR;
			message+=BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.SomeFieldsNotFoundContinue")+Const.CR;
			MessageDialog.setDefaultImage(GUIResource.getInstance().getImageSpoon());
			boolean goOn = MessageDialog.openConfirm(shell, BaseMessages.getString(PKG, "SalesforceInsertDialog.DoMapping.SomeFieldsNotFoundTitle"), message);
			if (!goOn) {
				return;
			}
		}
		EnterMappingDialog d = new EnterMappingDialog(SalesforceInsertDialog.this.shell, sourceFields.getFieldNames(), targetFields.getFieldNames(), mappings);
		mappings = d.open();

		// mappings == null if the user pressed cancel
		//
		if (mappings!=null) {
			// Clear and re-populate!
			//
			wReturn.table.removeAll();
			wReturn.table.setItemCount(mappings.size());
			for (int i = 0; i < mappings.size(); i++) {
				SourceToTargetMapping mapping = (SourceToTargetMapping) mappings.get(i);
				TableItem item = wReturn.table.getItem(i);
				item.setText(2, sourceFields.getValueMeta(mapping.getSourcePosition()).getName());
				item.setText(1, targetFields.getValueMeta(mapping.getTargetPosition()).getName());
			}
			wReturn.setRowNums();
			wReturn.optWidth(true);
		}
	}
	protected void setComboBoxes()
    {
        // Something was changed in the row.
        //
		final Map<String, Integer> fields = new HashMap<String, Integer>();

        // Add the currentMeta fields...
        fields.putAll(inputFields);

        Set<String> keySet = fields.keySet();
        List<String> entries = new ArrayList<String>(keySet);

        String[] fieldNames= (String[]) entries.toArray(new String[entries.size()]);
        Const.sortStrings(fieldNames);
        // return fields
        ciReturn[1].setComboValues(fieldNames);
    }

	public void setModuleFieldCombo() {
		if(gotFields) return;
		gotFields=true;
		Display display = shell.getDisplay();
		if (!(display==null || display.isDisposed())) {
			display.asyncExec(new Runnable () {
				public void run() {
					//clear
					for (int i = 0; i < tableFieldColumns.size(); i++) {
						ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
						colInfo.setComboValues(new String[] {});
					}
					if(wModule.isDisposed()) return;
					String selectedModule= transMeta.environmentSubstitute(wModule.getText());
					if (!Const.isEmpty(selectedModule)) {
						try {
								// loop through the objects and find build the list of fields
							    String[] fieldsName = getFields();

							    if(fieldsName!=null) {
									for (int i = 0; i < tableFieldColumns.size(); i++) {
										ColumnInfo colInfo = (ColumnInfo) tableFieldColumns.get(i);
										colInfo.setComboValues(fieldsName);
									}
							}
						}catch (Exception e) {
							for (int i = 0; i < tableFieldColumns.size(); i++) {
								ColumnInfo colInfo = (ColumnInfo) tableFieldColumns	.get(i);
								colInfo.setComboValues(new String[] {});
							}
							// ignore any errors here. drop downs will not be
							// filled, but no problem for the user
						}
					}

				}
			});
		}
	}
	private void getModulesList()
	  {
		  if (!gotModule){
			  SalesforceConnection connection=null;

			  try{
				  SalesforceInsertMeta meta = new SalesforceInsertMeta();
				  getInfo(meta);
				  String url = transMeta.environmentSubstitute(meta.getTargetURL());

				  String selectedField=wModule.getText();
				  wModule.removeAll();

				  // Define a new Salesforce connection
				  connection=new SalesforceConnection(log, url, transMeta.environmentSubstitute(meta.getUserName()),transMeta.environmentSubstitute(meta.getPassword()));
				  // connect to Salesforce
				  connection.connect();
				  // return
				  wModule.setItems(connection.getAllAvailableObjects(false));

				  if(!Const.isEmpty(selectedField)) wModule.setText(selectedField);

			      gotModule = true;
	        	  getModulesListError = false;

			  }catch(Exception e)
			  {
					new ErrorDialog(shell,BaseMessages.getString(PKG, "SalesforceInsertDialog.ErrorRetrieveModules.DialogTitle"),
							BaseMessages.getString(PKG, "SalesforceInsertDialog.ErrorRetrieveData.ErrorRetrieveModules"),e);
					getModulesListError = true;
			  } finally{
				  if(connection!=null) {
						try {connection.close();}catch(Exception e){};
					}
		 	 }
		  }
	  }
}


text:
create or replace function data_commons.register_domain_table(term_schema name, term_table name, rel_type_schema name, rel_type_table name, path_schema name, path_table name) returns boolean  as $$
  insert into data_commons.domain_registry(term_schema, term_table, rel_type_schema, rel_type_table, path_schema, path_table)
     values (term_schema, term_table, rel_type_schema, rel_type_table, path_schema, path_table);
  select true;
$$ language sql;

create or replace function data_commons.deregister_domain_table(term_schema name, term_table name) returns boolean as $$
  delete from data_commons.domain_registry where term_schema = term_schema and term_table = term_table;
  select true;
$$ language sql;

create or replace function data_commons.populate_domain_cvterm() returns trigger as $$
declare
   dbxref_unversioned text;
   cv text;
   name text;
   definition text;
   is_obsolete boolean;
   is_relationshiptype boolean;
   synonyms text[];
   alternate_dbxrefs text[];
begin
   select c.dbxref_unversioned, c.cv, c.name, c.definition, c.is_obsolete, c.is_relationshiptype, c.synonyms, c.alternate_dbxrefs
     into dbxref_unversioned, cv, name, definition, is_obsolete, is_relationshiptype, synonyms, alternate_dbxrefs
     from data_commons.cvterm c where c.dbxref = NEW.dbxref;
   NEW.dbxref_unversioned = dbxref_unversioned;
   NEW.cv = cv;
   NEW.name = name;
   NEW.definition = definition;
   NEW.is_obsolete = is_obsolete;
   NEW.is_relationshiptype = is_relationshiptype;
   NEW.synonyms = synonyms;
   NEW.alternate_dbxrefs = alternate_dbxrefs;
   return NEW;
end
$$ language plpgsql;

create or replace function data_commons.push_path_table_entries(type_schema name, type_table name, term_schema name, term_table name, path_schema name, path_table name, dbxref text) returns boolean as $$
begin
   execute format ('insert into %I.%I(cvtermpath_id, type_dbxref, subject_dbxref, object_dbxref, cv, pathdistance)
       select p.cvtermpath_id, p.type_dbxref, p.subject_dbxref, p.object_dbxref, p.cv, p.pathdistance from data_commons.cvtermpath p
       where %L in (type_dbxref, subject_dbxref, object_dbxref)
       and exists (select 1 from %I.%I t where t.cvterm_dbxref = p.type_dbxref)
       and exists (select 1 from %I.%I s where s.dbxref = p.subject_dbxref)
       and exists (select 1 from %I.%I o where o.dbxref = p.object_dbxref)
       on conflict (type_dbxref, subject_dbxref, object_dbxref) do update set cv=EXCLUDED.cv, pathdistance=EXCLUDED.pathdistance',
       path_schema, path_table,
       dbxref,
       type_schema, type_table,
       term_schema, term_table,
       term_schema, term_table);
   perform public.try_ermrest_data_change_event(path_schema, path_table);
   return true;
end
$$ language plpgsql;

create or replace function data_commons.populate_domain_tables_from_cvterm() returns trigger as $$
declare
   rel_type_schema name;
   rel_type_table name;
   path_schema name;
   path_table name;
begin
   rel_type_schema = TG_ARGV[0];
   rel_type_table = TG_ARGV[1];
   path_schema = TG_TABLE_SCHEMA;
   select regexp_replace(TG_TABLE_NAME, '_terms$', '_paths') into path_table;

   if NEW.is_relationshiptype then
      execute format('insert into %I.%I(cvterm_dbxref) values (%L)',
	 rel_type_schema, rel_type_table, NEW.dbxref);
   end if;

   perform data_commons.push_path_table_entries(rel_type_schema, rel_type_table, TG_TABLE_SCHEMA, TG_TABLE_NAME, path_schema, path_table, NEW.dbxref);
   return NEW;
end
$$ language plpgsql;

create or replace function data_commons.update_domain_paths_from_relationship_type() returns trigger as $$
declare
   term_schema text;
   term_table text;
   path_schema text;
   path_table text;
begin
   for term_schema, term_table, path_schema, path_table in
       select d.term_schema, d.term_table, d.path_schema, d.path_table from data_commons.domain_registry d
         where d.rel_type_schema = TG_TABLE_SCHEMA and d.rel_type_table = TG_TABLE_NAME
   loop
       begin
           perform data_commons.push_path_table_entries(TG_TABLE_SCHEMA, TG_TABLE_NAME, term_schema, term_table, path_schema, path_table, NEW.cvterm_dbxref);
       exception when others then
           continue;
       end;
   end loop;
   return NEW;
end
$$ language plpgsql;

create or replace function data_commons.update_relationshiptype_properties() returns trigger as $$
begin
   select is_reflexive, is_transitive into NEW.is_reflexive, NEW.is_transitive from data_commons.relationship_types where cvterm_dbxref = NEW.cvterm_dbxref;
   return NEW;
end
$$ language plpgsql;

create or replace function data_commons.make_domain_tables(schema_name name, base_name name, rel_type_schema name, rel_type_table name) returns boolean as $$
declare
   cvterm_name text = base_name || '_terms';
   path_name text = base_name || '_paths';
begin
   if rel_type_schema is null then
      rel_type_schema = schema_name;
   end if;
   if rel_type_table is null then
      rel_type_table = 'relationship_types';
   end if;
   execute format('create table %I.%I (
                    dbxref text primary key references data_commons.cvterm(dbxref),
                    dbxref_unversioned text not null,
                    cv text not null references data_commons.cv(name),
                    name text not null,
                    definition text,
                    is_obsolete boolean not null,
                    is_relationshiptype boolean not null,
                    synonyms text[],
                    alternate_dbxrefs text[],
                    unique(cv, name, is_obsolete))',
		    schema_name, cvterm_name);

   execute format('create index on %I.%I(name)', schema_name, cvterm_name);
   execute format('create index on %I.%I(dbxref_unversioned)', schema_name, cvterm_name);
   execute format ('create index on %I.%I using gin(synonyms)', schema_name, cvterm_name);
   execute format ('create index on %I.%I using gin(alternate_dbxrefs)', schema_name, cvterm_name);
   execute format ('create trigger %I before insert on %I.%I for each row execute procedure data_commons.populate_domain_cvterm()',
                   cvterm_name || '_populate_trigger', schema_name, cvterm_name);
   execute format ('create trigger %I after insert on %I.%I for each row execute procedure data_commons.populate_domain_tables_from_cvterm(%I, %I)',
                   cvterm_name || '_populate_other_tables_trigger', schema_name, cvterm_name, rel_type_schema, rel_type_table);

   execute format('create table if not exists %I.%I (
     cvterm_dbxref text primary key references data_commons.relationship_types(cvterm_dbxref) on delete cascade deferrable,
     is_reflexive boolean not null,
     is_transitive boolean not null)',
     rel_type_schema, rel_type_table);

   execute format('drop trigger if exists relationship_properties_trigger on %I.%I', rel_type_schema, rel_type_table);
   execute format('create trigger relationship_properties_trigger before insert on %I.%I for each row execute procedure data_commons.update_relationshiptype_properties()',
                   rel_type_schema, rel_type_table);

   execute format('drop trigger if exists %I on %I.%I', rel_type_table || '_push_trigger', rel_type_schema, rel_type_table);
   execute format('create trigger %I after insert on %I.%I for each row execute procedure data_commons.update_domain_paths_from_relationship_type()',
     rel_type_table || '_push_trigger', rel_type_schema, rel_type_table);

   execute format ('create table %I.%I (
                    cvtermpath_id bigint primary key,
                    type_dbxref text not null references %I.%I(cvterm_dbxref),
                    subject_dbxref text not null references %I.%I(dbxref),
                    object_dbxref text not null references %I.%I(dbxref),
                    cv text not null,
                    pathdistance integer not null,
                    unique(type_dbxref, subject_dbxref, object_dbxref),
                    foreign key (type_dbxref, subject_dbxref, object_dbxref) references data_commons.cvtermpath(type_dbxref, subject_dbxref, object_dbxref))',
		    schema_name, path_name,
		    rel_type_schema, rel_type_table,
		    schema_name, cvterm_name,
		    schema_name, cvterm_name);
   execute format ('create index on %I.%I(subject_dbxref, type_dbxref)', schema_name, path_name);
   execute format ('create index on %I.%I(object_dbxref, type_dbxref)', schema_name, path_name);
   perform data_commons.register_domain_table(schema_name, cvterm_name, rel_type_schema, rel_type_table, schema_name, path_name);
   return true;
end
$$ language plpgsql;

create or replace function data_commons.make_domain_tables(schema_name name, base_name name) returns boolean as $$
begin
   return data_commons.make_domain_tables(schema_name, base_name, null, null);
end
$$ language plpgsql;


text:
/* --------------------------------------------------
	Google Maps Settings
-------------------------------------------------- */

$(document).ready(function(){

	function initGMap() {
		'use strict';

		var mapOptions = {
		// How zoomed in you want the map to start at (always required)
		zoom: 13,
		scrollwheel: false,

		// The latitude and longitude to center the map (always required)
		center: new google.maps.LatLng(41.880038, -87.601127), // Chicago

		// Styling of the map in JSON object
		styles: [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":"#cdd2d4"},{"visibility":"on"}]}]
		};
		var map = new google.maps.Map(document.getElementById('map-canvas'),
		  mapOptions);

		// Map marker
		var image = 'assets/images/map-pin.png';
		var myLatLng = new google.maps.LatLng(41.880038, -87.631127);
		var beachMarker = new google.maps.Marker({
			position: myLatLng,
			map: map,
			icon: image
		});
	} // initGMap

	google.maps.event.addDomListener(window, 'load', initGMap);

});


text:
package pl.mmkay.ztm.repository;

import org.bson.types.ObjectId;
import org.springframework.data.mongodb.repository.MongoRepository;
import pl.mmkay.ztm.model.NewsItem;

public interface NewsItemRepository extends MongoRepository<NewsItem, ObjectId> {

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2012 the original author or authors.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
 -->
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

  <context:annotation-config/>

  <context:component-scan base-package="org.vertx.mods.examples.beans"/>

  <bean id="echo-vertx-prop-inject" class="org.vertx.mods.examples.beans.EchoVertxPropertyInjection" p:vertx-ref="vertx"></bean>

  <bean id="echo-vertx-autowired" class="org.vertx.mods.examples.beans.EchoAutowiredVertx"></bean>

  <bean id="echo-vertx-aware-inject" class="org.vertx.mods.examples.beans.EchoVertxAwareInjection"></bean>

</beans>


text:
<?xml version="1.0" encoding="UTF-8"?>
<CustomFieldTranslation xmlns="http://soap.sforce.com/2006/04/metadata">
    <name>Do_Not_Contact__c</name>
    <help>Gibt an, dass diese Person keine Anrufe und E-Mails von Ihrer Organisation erhalten möchte. Mit diesem Feld filtern Sie Kontakte aus E-Mail- und Telefonlisten heraus.</help>
    <label>Nicht kontaktieren</label>
</CustomFieldTranslation>


text:
//
//  NSArrayController+TCSUtils.m
//  TomcatSlapper
//
//  Created by John Clayton on 8/22/05.
//  Copyright 2005 Fivesquare Software, LLC. All rights reserved.
//

#import "NSArrayController+TCSUtils.h"
#import "TCSLogger.h"

@implementation NSArrayController (TCSUtils)

/*
 * What you may actually get is _NSStateMarker which has no boolValue: selector
 */
- (BOOL) safeBoolValueForKey:(NSString *)key {
    id value = [self valueForKey:key];
    logTrace(@"value = %@",value);
    BOOL boolValue = [value isEqual:[NSNumber numberWithInt:1]] ? YES : NO;
    logTrace(@"boolValue = %d",boolValue);
    return boolValue;
}

/*
 * What you may actually get is _NSStateMarker which has no boolValue: selector
 */
- (BOOL) safeBoolValueForKeyPath:(NSString *)keyPath {
    id value = [self valueForKeyPath:keyPath];
    logTrace(@"value = %@",value);
    BOOL boolValue = [value isEqual:[NSNumber numberWithInt:1]] ? YES : NO;
    logTrace(@"boolValue = %d",boolValue);
    return boolValue;
}

@end


text:
package worldmap.maptileproperties.biomes;

import java.awt.*;

public class Scorched implements Biome {
    private static Scorched instance;
    private Scorched()
    {

    }
    public static Scorched getInstance()
    {
        if(instance == null) instance = new Scorched();
        return instance;
    }

    @Override
    public Color getBiomeColor() {
        return new Color(153,153,153);
    }

    @Override
    public TexturePaint getBiomeTexture() {
        return null;
    }

}