Monday, 27 May 2013

Connect Drupal and Alfresco


  1. Download CMIS API Module http://drupal.org/project/cmis
  2. Download Alfresco http://www.alfresco.com/products/community
  3. Add at ./sites/default/settings.php the following:

    $conf['cmis_repositories'] = array(

    'default' => array(
    'user' => 'user',
    'password' => 'password',
    'url' => 'http://127.0.0.1:8080/alfresco/s/cmis',
    )
    );

  4. Configure module root directory add " \ "


Thursday, 9 May 2013

Node.js Hello world and MySQL Example

var http = require("http");
var mysql = require('mysql'); // required modules

var connection = mysql.createConnection({ // connect to mysql database
  host     : 'localhost',
  port     : '3308',
  database : 'db',
  user     : 'user',
  password : 'password',
});


var data; // store query result
connection.query('SELECT * FROM table', function(err, rows, fields) { // query DB
if (err) throw err;

data = JSON.stringify(rows); // save query as JSON
});


http.createServer(function (request, response) { // create server

  response.writeHead(200, {"Content-Type": "text/html"});
  response.write("<h1>Hello World</h1>");
  response.write("<h2>Jefren Inocando</h2>");
  response.write('<pre>' + data + '</pre>');
  response.end();

}).listen(81);


console.log('Server running at http://127.0.0.1:81');