vicinityManager/server/services/mySql/sendQuery.js
/*
Receives groupName (of group which shares roster) and
CID of organisation which receives this roster.
!! groupName can be publicDevices, all orgs receive this roster upon registration in VCNT
*/
Receives groupName (of group which shares roster) and
CID of organisation which receives this roster.
groupName can be publicDevices, all orgs receive this roster upon registration in VCNT
Receives groupName ( of group which shares roster ) and CID of organisation which receives this roster . groupName can be publicDevices all orgs receive this roster upon registration in VCNT
function sendQuery(org, groupName){
 var orgOwn = org.toString() + '_ownDevices';
 var connection = mysql.createConnection(
      {
        host     : '138.201.156.73',
        user     : 'openfireRemote',
        password : 'VicinityOpenfireXMPP0',
        database : 'openfire',
      }
  );
  var qryString = "UPDATE ofGroupProp SET propValue=? WHERE groupName LIKE ? AND name LIKE 'sharedRoster.groupList'";
logger.debug(qryString);
logger.debug(orgOwn);
logger.debug(groupName);
  connection.connect(ifError);
  connection.beginTransaction(function(err) {
    if (err) { throw err; }
    connection.query( qryString , [ orgOwn, groupName ] , function(err, result) {
      if (err) {
        connection.rollback(function() {
          throw err;
        });
      }
      connection.commit(function(err) {
        if (err) {
          connection.rollback(function() {
            throw err;
          });
        }
        logger.debug('Transaction Complete.');
        connection.end();
        });
      });
    });
}
function sendQuery ( org , groupName ) { var orgOwn = org . toString ( ) + '_ownDevices' ; var connection = mysql . createConnection ( { host : '138.201.156.73' , user : 'openfireRemote' , password : 'VicinityOpenfireXMPP0' , database : 'openfire' , } ) ; var qryString = "UPDATE ofGroupProp SET propValue=? WHERE groupName LIKE ? AND name LIKE 'sharedRoster.groupList'" ; logger . debug ( qryString ) ; logger . debug ( orgOwn ) ; logger . debug ( groupName ) ; connection . connect ( ifError ) ; connection . beginTransaction ( function ( err ) { if ( err ) { throw err ; } connection . query ( qryString , [ orgOwn , groupName ] , function ( err , result ) { if ( err ) { connection . rollback ( function ( ) { throw err ; } ) ; } connection . commit ( function ( err ) { if ( err ) { connection . rollback ( function ( ) { throw err ; } ) ; } logger . debug ( 'Transaction Complete.' ) ; connection . end ( ) ; } ) ; } ) ; } ) ; }
Receives groupName (of group which shares roster) and
CID of organisation which receives this roster.
Receives groupName ( of group which shares roster ) and CID of organisation which receives this roster .
/* Begin transaction */ /* End transaction */