Commit 6ba2fc5e authored by Nikhil Rane's avatar Nikhil Rane
Browse files

Adding pending changes since long and also initiating PigStudio implementation.

parent fc4202e6
autostudio
==========
Readme is being updated yet.
A generic web-app for creating script-flow-designs in UI and generating corresponding scripts.
{
"_comment": "***I hold all config data for ---pigstudio--- app.***",
"dbName": "pigstudio",
"_comment": "***Below are properties for execution of ---pigstudio--- app.***",
"_comment": "***Below are properties of operators for ---pigstudio--- app.***",
"pigstudio.shape.Load": {
"operator": "LOAD",
"type": "pigstudio.shape.Load",
"noOfInputs": 0,
"parameters": {
"file": {
"required": true,
"bracketsRequired": false
},
"using": {
"required": true,
"bracketsRequired": false
},
"as": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Filter": {
"operator": "FILTER",
"type": "pigstudio.shape.Filter",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"by": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Projection": {
"operator": "FOREACH",
"type": "pigstudio.shape.Projection",
"noOfInputs": 1,
"parameters": {
"generate": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.OrderBy": {
"operator": "ORDER BY",
"type": "pigstudio.shape.OrderBy",
"noOfInputs": 1,
"parameters": {
"by": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.GroupBy": {
"operator": "GROUP BY",
"type": "pigstudio.shape.GroupBy",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"by": {
"required": true,
"bracketsRequired": false
},
"using": {
"required": true,
"bracketsRequired": false
},
"partition_by": {
"required": true,
"bracketsRequired": false
},
"parallel": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Distinct": {
"operator": "DISTINCT",
"type": "pigstudio.shape.Distinct",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"alias": {
"required": true,
"bracketsRequired": false
},
"partition_by": {
"required": true,
"bracketsRequired": false
},
"parallel": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Filter": {
"operator": "FILTER",
"type": "pigstudio.shape.Filter",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"by": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Limit": {
"operator": "LIMIT",
"type": "pigstudio.shape.Limit",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"amount": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Sample": {
"operator": "SAMPLE",
"type": "pigstudio.shape.Sample",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"alias": {
"required": true,
"bracketsRequired": false
},
"size": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Dump": {
"operator": "DUMP",
"type": "pigstudio.shape.Dump",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Stream": {
"operator": "STREAM",
"type": "pigstudio.shape.Stream",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"through": {
"required": true,
"bracketsRequired": false
},
"as": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Describe": {
"operator": "DESCRIBE",
"type": "pigstudio.shape.Describe",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Explain": {
"operator": "EXPLAIN",
"type": "pigstudio.shape.Explain",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Illustrate": {
"operator": "illustrate",
"type": "pigstudio.shape.Illustrate",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Average": {
"operator": "AVG",
"type": "pigstudio.shape.Average",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Concat": {
"operator": "CONCAT",
"type": "pigstudio.shape.Concat",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Count": {
"operator": "COUNT",
"type": "pigstudio.shape.Count",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.CountStar": {
"operator": "COUNT_STAR",
"type": "pigstudio.shape.CountStar",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Difference": {
"operator": "DIFFERENCE",
"type": "pigstudio.shape.Difference",
"noOfInputs": 1,
"parameters": {
"expression1": {
"required": true,
"bracketsRequired": false
},
"expression2": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.IsEmpty": {
"operator": "IsEmpty",
"type": "pigstudio.shape.IsEmpty",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Max": {
"operator": "MAX",
"type": "pigstudio.shape.Max",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Min": {
"operator": "MIN",
"type": "pigstudio.shape.Min",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Size": {
"operator": "SIZE",
"type": "pigstudio.shape.Size",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Sum": {
"operator": "SUM",
"type": "pigstudio.shape.Sum",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Tokenize": {
"operator": "TOKENIZE",
"type": "pigstudio.shape.Tokenize",
"noOfInputs": 1,
"parameters": {
"expression": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Join": {
"operator": "JOIN",
"type": "pigstudio.shape.Join",
"noOfInputs": 1,
"parameters": {
"alias": {
"required": true,
"bracketsRequired": false
},
"by": {
"required": true,
"bracketsRequired": false
},
"partition_by": {
"required": true,
"bracketsRequired": false
},
"parallel": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
},
"pigstudio.shape.Union": {
"operator": "UNION",
"type": "pigstudio.shape.Union",
"noOfInputs": 1,
"parameters": {
"aliases": {
"required": true,
"bracketsRequired": false
},
"comment": {
"required": true,
"bracketsRequired": false
}
}
}
}
\ No newline at end of file
......@@ -657,7 +657,7 @@ module.exports = function(app, mongo, io, cookie, transporter) {
saveScriptToDB(generatedScript, fileName, user, sessionID, eventName);
var today = new Date();
var dateString = today.getDate() + UNDERSCORE_KEY + today.getMonth() + UNDERSCORE_KEY + today.getFullYear();
var dateString = today.getDate() + UNDERSCORE_KEY + (today.getMonth() + 1) + UNDERSCORE_KEY + today.getFullYear();
// This will create a path: ./executions/output/<username>/<date_month_year>/<filename_dateTime>
var dirPath = path.join(EXECUTIONS_DIR, user, dateString, fileName + UNDERSCORE_KEY + today.toJSON());
......@@ -707,8 +707,8 @@ module.exports = function(app, mongo, io, cookie, transporter) {
var coll = mongo.collection(pstudio_config.get(DB_NAME));
//TODO: check if we support localStorage and change columns below
var stream = coll.find({ username : user }, {_id:0, name: 1, status: 1, email_notification: 1}).sort({accessedTimestamp: -1}).limit(5).stream();
var jsonData = JSON.parse('{"tuples": [], "appName":"pipestudio" }');
var stream = coll.find({ username : user }, {_id:0, name: 1, appName: 1, status: 1, email_notification: 1}).sort({accessedTimestamp: -1}).limit(5).stream();
var jsonData = JSON.parse('{"tuples": []}'); // CHANGED_HERE
stream.on("data", function(item) {
if(item.email_notification == "true") {
......
......@@ -22,6 +22,15 @@ module.exports = function(app, mongo) {
});
/*
* TODO: Remove this repetition.
* This is the same call as above, just serving a different App.s
*/
app.get('/pigstudio', requireUser, function(req, res){
res.status(200).sendfile('./public/autostudio.html');
});
/*
* Send the user's home page.
*/
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="nikhilrane">
<link rel="icon" href="./public/images/favicon.png">
<title>AutoStudio</title>
<!-- Bootstrap core CSS -->
<link href="./public/css/bootstrap.css" rel="stylesheet">
<link href="./public/css/application.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="./public/css/starter-template.css" rel="stylesheet">
<style type='text/css'>
body
{
background-color:#eee;
}
</style>
<script src="./public/js/jquery-1.11.1.js"></script>
<script src="./public/js/bootstrap.js"></script>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>