ZINC_code.js
/* Searches for relevant vendor information and adds it to the selected
 * object in the main Hydra interface.
 * @param {String[]} vendInfo String array defining the property names to add data as defined by vendIndices
 * @param {int[]} vendIndices Integer array defining the relevant columns. Matched to vendInfo
 * @param {Object} obj The object to modify. Intended object: comp selected in lists
 */
Searches for relevant vendor information and adds it to the selected
object in the main Hydra interface.
@param {String[]} vendInfo String array defining the property names to add data as defined by vendIndices
@param {int[]} vendIndices Integer array defining the relevant columns. Matched to vendInfo
@param {Object} obj The object to modify. Intended object: comp selected in lists
Searches for relevant vendor information and adds it to the selected object in the main Hydra interface . @param { String [] } vendInfo String array defining the property names to add data as defined by vendIndices @param { int [] } vendIndices Integer array defining the relevant columns . Matched to vendInfo @param { Object } obj The object to modify . Intended object : comp selected in lists
function addVendFromDb(vendInfo, vendIndices, obj){
   var zId = obj.zincId;
   if (vendKeyMap[zId]) {
      var matchedData = vendKeyMap[zId]; 
      var processedData = []; 
      for(elem in matchedData){
         var vendor = matchedData[elem].split('\t');
         var dataElem = [];  
         for(var x=0; x<vendInfo.length; x++){
            dataElem[vendInfo[x]] = vendor[vendIndices[x]];
         }
         processedData.push(dataElem);
      }
      obj.vendors = processedData; 
   }
   else { 
      obj.vendors = '';
   }
}
function addVendFromDb ( vendInfo , vendIndices , obj ) { var zId = obj . zincId ; if ( vendKeyMap [ zId ] ) { var matchedData = vendKeyMap [ zId ] ; var processedData = [ ] ; for ( elem in matchedData ) { var vendor = matchedData [ elem ] . split ( '\t' ) ; var dataElem = [ ] ; for ( var x = 0 ; x < vendInfo . length ; x ++ ) { dataElem [ vendInfo [ x ] ] = vendor [ vendIndices [ x ] ] ; } processedData . push ( dataElem ) ; } obj . vendors = processedData ; } else { obj . vendors = '' ; } }
Searches for relevant vendor information and adds it to the selected
 object in the main Hydra interface.
Searches for relevant vendor information and adds it to the selected object in the main Hydra interface .
//Raw input from database //Must declare as an array //Make text line with vendor info into an array as delimited by \t //Dump relevant data into a new array (dataElem) //Must declare as an array //Add all info queried in vendInfo using vendIndices to find the data //Add each info bit as a key-object pair //Export processed data to main Hydra obj //if not in processed database -> blank prop