Skip to content

Instantly share code, notes, and snippets.

View tfoldi's full-sized avatar

Földi Tamás tfoldi

View GitHub Profile
@tfoldi
tfoldi / tableau.clj
Created March 20, 2015 22:52
Tableau Server Rest API from Clojure - Example
(ns tabsync.tableau
(:require [clj-http.client :as client]
[clojure.zip :refer [xml-zip]]
[clojure.data.zip.xml :refer [xml-> xml1-> attr ]]
[clojure.data.xml :as xml])
)
(defn tableau-url-for
"Constructs server API url. Target can be hostname or session returned from logon-to-server"
[target api-path]
@tfoldi
tfoldi / pgpydl.sql
Created April 1, 2015 17:22
Python example of getting files and parsing them inside postgres database
CREATE OR REPLACE FUNCTION from_url(
-- The URL to download.
IN url text,
-- The maximum number of bytes to download.
-- If 0 then the whole response is returned.
IN max_bytes integer DEFAULT 0,
-- Should any errors (like HTTP transport errors)
-- throw an exception or simply return default_response
IN should_throw boolean DEFAULT true,
-- The default response if any errors are found.
# CoffeeScript version of Google Spreadsheet Driver for Tableau Data Web Connector
init = ->
if !tableau
alert 'init- tableau NOT defined!'
return
tableau.scriptVersion = '1.0'
tableau.log 'init'
tableau.initCallback()
@tfoldi
tfoldi / MakeOrder.java
Created May 4, 2015 11:15
Compare Java and Clojure Tableau TDE API
// -----------------------------------------------------------------------
// The information in this file is the property of Tableau Software and
// is confidential.
//
// Copyright (C) 2012 Tableau Software.
// Patents Pending.
// -----------------------------------------------------------------------
// externalapi/samples/com/tableausoftware/demos/MakeOrder.java
// -----------------------------------------------------------------------
package com.tableausoftware.demos;
@tfoldi
tfoldi / WebServiceClient.java
Created May 14, 2015 14:09
Trigger Schedule from Java
/**
*
*/
package tableauSrvrWebservice.Auth;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
@tfoldi
tfoldi / WebServiceClient.java
Created July 13, 2015 17:09
Trigger a schedule
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StringReader;
import java.math.BigInteger;
import java.security.InvalidKeyException;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PublicKey;
import java.security.spec.InvalidKeySpecException;
@tfoldi
tfoldi / tableau-password-validator-full.js
Created August 4, 2015 13:18
Tableau Password Validation Full
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var jade = require("jade/runtime");
module.exports = function template(locals) {
var jade_debug = [ new jade.DebugItem( 1, "/home/t/git/tableau-server-password-validator/coffee/tableau-server-password-validator/messages.jade" ) ];
try {
var buf = [];
var jade_mixins = {};
var jade_interp;

Payload for test:

$ cat signin.xml
<tsRequest>
  <credentials name="yoyo" password="fofo" >
    <site contentUrl="" />
  </credentials>
</tsRequest>

CURL -F works with Tableau 9.0

@tfoldi
tfoldi / get_published_sources_with_workbook.sql
Created January 30, 2016 15:06
Get published data sources with workbooks
select *
from datasources
inner join data_connections on (data_connections.name = datasources.name)
inner join workbooks on (data_connections.owner_id = workbooks.id)
where data_connections.dbclass = 'sqlproxy';
@tfoldi
tfoldi / workgroup.yml
Last active December 6, 2016 10:21
Tableau Server Features
features.APIBasedEmbedCode: false
features.AQLDataPipeline2: false
features.AddSupportUser: false
features.AlertOnThresholdCondition: false
features.AlphabeticalSchemaSort: false
features.AlternativeFedEngine: false
features.AnalyticsObjectsEditors: false
features.AsyncJsModuleLoad: false
features.AutomaticDrill: false
features.Autosave: false