Skip to content

Instantly share code, notes, and snippets.

View bheyde's full-sized avatar

Brennan Heyde bheyde

View GitHub Profile
@bheyde
bheyde / gist:f5c094e5b39183495eda
Created September 8, 2014 19:02
DTS: Writing a CSV File
// Writing a CSV File
<mvt:assign name="g.filename" value="'Export.csv'" />
<mvt:assign name="g.filepath" value="'/test/'" />
<mvt:assign name="g.newline" value="asciichar(10)" />
<mvt:assign name="g.headerrow" value="'Product_Code,Product_Name,Product_Price' $ g.new_line" />
<mvt:assign name="g.file_exists" value="sexists(g.filepath $ g.filename)" />
<mvt:if expr="g.file_exists EQ 1">
@bheyde
bheyde / mvt_call_headers.html
Created July 14, 2016 15:49
mvt:call - passing custom headers example
<mvt:assign name="g.api_endpoint" value="'https://DJDHGSDJD-dsn.algolia.net'" />
<mvt:assign name="g.index_name" value="'docs.miva'" />
<mvt:assign name="g.path" value="'/1/indexes/' $ g.index_name $ '/390342730'" />
<mvt:assign name="g.api_request" value="g.api_endpoint $ g.path" />
<mvt:assign name="g.headers" value="'X-Algolia-API-Key: 17181817181912' $ asciichar( 13 ) $ asciichar( 10 )" />
<mvt:assign name="g.headers" value=" g.headers $ 'X-Algolia-Application-Id: HSGDJDJDGD' $ asciichar( 13 ) $ asciichar( 10 )" />
<mvt:call action="g.api_request" method="'PUT'" headers="'g.headers'">
<mvt:call action = "expression | 'literal'"
method = "'GET|POST|HEAD|XML|RAW|OPTIONS|PUT|DELETE|TRACE|CONNECT'"
content-type = "expression | 'literal'"
fields = " expression | 'variable list'"
files = " expression | 'literal'"
certfile = "expression | 'literal'"
certtype = "expression | 'literal'"
certpass = "expression | 'literal'"
timeout = "expression | 'literal'"
headers = "expression | 'literal'"
@bheyde
bheyde / quote_form
Created January 5, 2019 00:30
Customer Quote Form
<mvt:if expr="l.settings:messages:error_message_count">
<div class="error-message">
<mvt:foreach iterator="error" array="messages:error_messages">
&mvt:error;
</mvt:foreach>
</div>
</mvt:if>
<mvt:if expr="l.settings:messages:information_message_count">
<div class="information-message">
<mvt:foreach iterator="message" array="messages:information_messages">
@bheyde
bheyde / sample_list_query_response
Created August 14, 2018 17:48
Sample List_Load_Query Response
{
"success": true,
"data":
{
"total_count": <numeric total count of records matching any input filters>,
"start_offset": <numeric starting offset of the records>,
"data":
[
{ record },
{ record },
@bheyde
bheyde / ondemandcolumns
Created August 14, 2018 17:35
Ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
@bheyde
bheyde / ondemandcolumns
Created August 14, 2018 17:35
Ondemandcolumns
{
"name": "ondemandcolumns",
"value": [ "field", "field", "field", ... ]
}
@bheyde
bheyde / parenthentical_comparison
Created August 14, 2018 17:26
Parenthetical comparisons can be accomplished using the "SUBWHERE" operator and special field names "search", "search_AND" and "search_OR"
"Filter":
[
{
"name": "search",
"value":
[
{
"field": "ship_lname",
"operator": "EQ",
"value": "Burchmore"
@bheyde
bheyde / json_success
Created August 14, 2018 15:56
Successful calls return their data as a JSON structure in the following format:
{
"success": true,
"data": call-specific data
}
@bheyde
bheyde / xml_export.xml
Created December 11, 2017 23:50
XML Template
<?xml version="1.0" encoding="utf-8"?>
<orders>
<mvt:foreach iterator="order" array="admin_order:orders">
<order>
<!--General Order Information -->
<order_date>&mvte:order:date;</order_date>
<order_id>&mvt:order:id;</order_id>
<order_status>&mvte:order:formatted_status;</order_status>
<batch_id>&mvt:order:batch_id;</batch_id>