This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
... | |
<script type="text/javascript" src="https://cf-4053.kxcdn.com/conversational-form/0.9.4/conversational-form.min.js" crossorigin></script> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello extends Component { | |
constructor(props) { | |
super(props): | |
this.cf = null; // <-- Conversational Form ref | |
} | |
... | |
} | |
export default Hello; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello extends Component { | |
... | |
componentDidMount(){ | |
// customize your questions here | |
this.refs.name.setAttribute('cf-questions', "What is your name?"); | |
this.refs.email.setAttribute('cf-questions', "What is your email?"); | |
this.refs.description.setAttribute('cf-questions', "Describe your requirement"); | |
this.cf = window.cf.ConversationalForm.startTheConversation({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Hello extends Component { | |
... | |
render() { | |
return ( | |
<div> | |
<h2>Conversational Form</h2> | |
<div id="cf-context" > {/* <-- the cf form will be bound to this element */} | |
<form id="form" className="form" ref="form"> | |
<input type="text" ref="name" placeholder="Name" defaultValue={this.props.name}/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML Template --> | |
<template> | |
<div> | |
<div class="input-group"> | |
<input type="text" class="form-control" placeholder="Select file..." :value="file.name" readonly> | |
<span class="input-group-btn"> | |
<button class="btn btn-default" type="button" @click="selectFile">Select file</button> | |
<button class="btn btn-default" type="button" @click="uploadFile">Upload</button> | |
</span> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
const BASE_URL = "[YOUR_PROJECT_URL]" | |
export default { | |
name: 'FileUpload', | |
directives: { | |
uploader: { | |
bind (el, binding, vnode) { | |
el.addEventListener('change', e => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package [Your_Project] | |
class UploadController { | |
def amazonS3Service | |
def s3Bucket = 'Your_S3_Bucket_Name' | |
def index() { | |
def uploadedFile = request.getFile('file') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from variables import datawarehouse_name | |
# sql-server (target db, datawarehouse) | |
datawarehouse_db_config = { | |
'Trusted_Connection': 'yes', | |
'driver': '{SQL Server}', | |
'server': 'datawarehouse_sql_server', | |
'database': '{}'.format(datawarehouse_name), | |
'user': 'your_db_username', | |
'password': 'your_db_password', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def etl(query, source_cnx, target_cnx): | |
# extract data from source db | |
source_cursor = source_cnx.cursor() | |
source_cursor.execute(query.extract_query) | |
data = source_cursor.fetchall() | |
source_cursor.close() | |
# load data into warehouse db | |
if data: | |
target_cursor = target_cnx.cursor() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# example queries, will be different across different db platform | |
firebird_extract = (''' | |
SELECT fbd_column_1, fbd_column_2, fbd_column_3 | |
FROM fbd_table; | |
''') | |
firebird_insert = (''' | |
INSERT INTO table (column_1, column_2, column_3) | |
VALUES (?, ?, ?) | |
''') |
OlderNewer