tags 2013-07-02

78
4D TAGS

Upload: kmiyako

Post on 19-Jun-2015

271 views

Category:

Technology


1 download

DESCRIPTION

sample database posted on GitHub: https://github.com/miyako/4d-training-tags

TRANSCRIPT

Page 1: Tags 2013-07-02

4D TAGS

Page 2: Tags 2013-07-02

4D TAGS Excel XML スプレッドシート編

Page 3: Tags 2013-07-02

4D TAGS

Page 4: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 5: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 6: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

HTMLXMLSVGTEXT

* テキスト全般

Page 7: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 8: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

変数・配列関数(コマンド)フィールドメソッド

Page 9: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 10: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

条件分岐繰り返し

Page 11: Tags 2013-07-02

4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 12: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 13: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 14: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--4DHTML [Product]name--><!--4DHTML vtProductName--><!--4DHTML atProductNames{7}--><!--4DHTML Table name(1)-->

Page 15: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 16: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 17: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--4DTEXT [Product]id--><!--4DTEXT vlProductPrice--><!--4DTEXT alProductPrices{7}--><!--4DTEXT Length(Table name(1))-->

Page 18: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 19: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 20: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--#4DSCRIPT/MethodName/Param-->

Page 21: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 22: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 23: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--#4DINCLUDE header/menu.html-->

Page 24: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 25: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 26: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--4DIF (Condition1)--> <!--4DINCLUDE menu1.html--><!--4DELSEIF (Condition2)--> <!--4DINCLUDE menu2.html--><!--4DELSE--> <!--4DINCLUDE menu0.html--><!--4DENDIF-->

Page 27: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 28: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 1/3• 4DBASE

Page 29: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 1/3• 4DBASE

<!--4DLOOP (atProductNames)--> <!--4DTEXT atProductNames{atProductNames}--><!--4DENDLOOP-->

Page 30: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 1/3• 4DBASE

Page 31: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 2/3• 4DBASE

Page 32: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 2/3• 4DBASE

<!--4DLOOP [Product]--> <!--4DTEXT [Product]name--><!--4DENDLOOP-->

Page 33: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 2/3• 4DBASE

Page 34: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 3/3• 4DBASE

Page 35: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 3/3• 4DBASE

<!--4DLOOP shouldProcessLoop--> <!--4DTEXT [Product]name--><!--4DENDLOOP-->

Page 36: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP 3/3• 4DBASE

Page 37: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 38: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

<!--4DINCLUDE header.html--><!--4DBASE folder/--><!--4DINCLUDE page.html--><!--4DBASE sub/--><!--4DINCLUDE subpage.html--><!--4DBASE WEBFOLDER--><!--4DINCLUDE footer.html-->

Page 39: Tags 2013-07-02

4D TAGS

• 4DHTML• 4DTEXT• 4DSCRIPT• 4DINCLUDE• 4DIF, 4DELSE, 4DELSEIF, 4DENDIF• 4DLOOP, 4DENDLOOP• 4DBASE

Page 40: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

Page 41: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

<p>

<!--4DHTML [Product]name--> </p>

Page 42: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

[Product]name:="オーブントースター"

<p>

<!--4DHTML [Product]name--> </p>

+

Page 43: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

[Product]name:="オーブントースター"

<p>

<!--4DHTML [Product]name--> </p>

<p>オーブントースター</p>

+=

Page 44: Tags 2013-07-02

4D TAGSHTTPサーバーで4Dタグを処理

WEB SEND FILEWEB SEND BLOBWEB SEND TEXT

HTMLに4D式や処理への参照を挿入するためのタグ

Page 45: Tags 2013-07-02

4D TAGSHTTPサーバーで4Dタグを処理

WEB SEND FILEWEB SEND BLOBWEB SEND TEXT

PROCESS 4D TAGSHTTPサーバーとは関係なく4Dタグを処理

HTMLに4D式や処理への参照を挿入するためのタグ

Page 46: Tags 2013-07-02

4D TAGSHTTPサーバーで4Dタグを処理

WEB SEND FILEWEB SEND BLOBWEB SEND TEXT

PROCESS 4D TAGSHTTPサーバーとは関係なく4Dタグを処理

HTMLに4D式や処理への参照を挿入するためのタグ

Page 47: Tags 2013-07-02

4D TAGS

PROCESS 4D TAGS

HTMLに4D式や処理への参照を挿入するためのタグ

Page 48: Tags 2013-07-02

4D TAGS

PROCESS 4D TAGS(inText;outText)

Unicode(推奨)

HTMLに4D式や処理への参照を挿入するためのタグ

Page 49: Tags 2013-07-02

4D TAGS

PROCESS 4D TAGS(inBlob;outBlob)

non-Unicode(非推奨)

HTMLに4D式や処理への参照を挿入するためのタグ

Page 50: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

HTMLXMLSVGTEXT

Page 51: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグ

Excel 2004 XML スプレッドシートXML

Excel ブックXLSX

Excel 97-2004ブックXLS

HTMLXMLSVGTEXT

Page 52: Tags 2013-07-02

4D TAGS

HTMLXMLSVGTEXT

HTMLに4D式や処理への参照を挿入するためのタグ

Excel 2004 XML スプレッドシートXML

Excel ブックXLSX

Excel 97-2004ブックXLS

XML

Page 53: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

Page 54: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

タブ区切りテキストデータ

TSV

Page 55: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

タブ区切りテキストデータ

TSV

Page 56: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

タブ区切りテキストデータ

TSV

Excel 2004 XML スプレッドシート

XML

Page 57: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

タブ区切りテキストデータ

TSV

Excel 2004 XML スプレッドシート

XMLXML

4D TAGS

TAGS

Page 58: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Page 59: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Excel 2004 XML スプレッドシート

XML

Page 60: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Page 61: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

オープンオフィスXML

OOXMLZIP

Page 62: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

XLSXExcel ブック

オープンオフィスXML

OOXMLZIP

Page 63: Tags 2013-07-02

https://github.com/miyako/4d-training-tags

VLOOKUP

Page 64: Tags 2013-07-02

VLOOKUP

Page 65: Tags 2013-07-02

VLOOKUP

[Product]idプライマリーキー自動インクリメント倍長整数

Page 66: Tags 2013-07-02

VLOOKUP

Page 67: Tags 2013-07-02

VLOOKUP

[Inventory]idプライマリーキー自動インクリメント倍長整数

Page 68: Tags 2013-07-02

VLOOKUP

1. [Product] レコード作成 『Product_IMPORT_RECORDS』

2. [Product] レコード書き出し 『 タブ区切りテキスト形式』(UTF-8)

3. Excel ワークシート追加 『Product』

4. Excel テキストファイル読み込み 『インポート...』(UTF-8)

5. Excel 数値フォーマット設定 『数値: 桁区切り(,)を使用する』

Page 69: Tags 2013-07-02

VLOOKUP

6. Excel ワークシート名前変更 『Inventory』

7. Excel B列関数 『=VLOOKUP(A2,Product!$A$2:$C$21,2,FALSE)』

8. Excel C列関数 『=VLOOKUP(A2,Product!$A$2:$C$21,3,FALSE)』

9. Excel E列関数 『=C2*D2』

10.Excel ワークブック書き出し 『Excel 2004 XML スプレッドシート』

Page 70: Tags 2013-07-02

VLOOKUP

ss:ExpandedRowCount"21""<!--#4dtext Records in selection([Product])+1-->""<!--#4dtext Records in selection([Inventory])+1-->"

<Created><LastSaved>2013-06-28T08:02:22Z<!--#4dhtml string(Current date;ISO Date GMT;Current time)-->

Page 71: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Page 72: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Excel 2004 XML スプレッドシート

XML

Page 73: Tags 2013-07-02

4D TAGSHTMLに4D式や処理への参照を挿入するためのタグXML

4D TAGS

XMLTAGS

Excel 2004 XML スプレッドシート

XML

Excel 97-2004ブック

XLSASVBS

Page 74: Tags 2013-07-02

AppleScripttell application "Microsoft Excel"!! launch!! tell application "System Events"! ! set visible of processes whose name is "Microsoft Excel" to true! end tell!! set screen updating to false! set display alerts to false!! set theXmlPath to argument("XML_DOCUMENT_PATH") of parameters! set theXlsPath to argument("XLS_DOCUMENT_PATH") of parameters!! set theBooks to every workbook!! repeat with theBook in theBooks! ! if name of theBook is theXlsPath then close theBook saving no! ! if full name of theBook is theXlsPath then close theBook saving no! end repeat!! set theWorkbook to open workbook workbook file name theXmlPath!! save workbook as theWorkbook file format Excel98to2004 file format filename

theXlsPath with overwrite!! set screen updating to true!! activate!end tell

Page 75: Tags 2013-07-02

AppleScripttell application "Microsoft Excel"!! launch!! tell application "System Events"! ! set visible of processes whose name is "Microsoft Excel" to true! end tell!! set screen updating to false! set display alerts to false!! set theXmlPath to argument("XML_DOCUMENT_PATH") of parameters! set theXlsPath to argument("XLS_DOCUMENT_PATH") of parameters!! set theBooks to every workbook!! repeat with theBook in theBooks! ! if name of theBook is theXlsPath then close theBook saving no! ! if full name of theBook is theXlsPath then close theBook saving no! end repeat!! set theWorkbook to open workbook workbook file name theXmlPath!! save workbook as theWorkbook file format Excel98to2004 file format filename

theXlsPath with overwrite!! set screen updating to true!! activate!end tell

Page 76: Tags 2013-07-02

VBScriptSet objExcelApplication!= GETAPP("Excel.Application")

theXmlPath = GETENV("XML_DOCUMENT_PATH")theXlsPath = GETENV("XLS_DOCUMENT_PATH")

objExcelApplication.Visible = True

objExcelApplication.ScreenUpdating = FalseobjExcelApplication.DisplayAlerts = False

Set theWorkbooks = objExcelApplication.Workbooks

For Each theWorkbook In theWorkbooks! If (theWorkbook.FullName = theXlsPath) Or (theWorkbook.Name = theXlsPath) Then! ! theWorkbook.Close (False)! End IfNext

Set theWorkbook = objExcelApplication.Workbooks.Open(theXmlPath)

theWorkbook.SaveAs theXlsPath, 56

objExcelApplication.ScreenUpdating = True

CreateObject("WScript.Shell").AppActivate objExcelApplication.Caption

Page 77: Tags 2013-07-02

VBScriptSet objExcelApplication!= GETAPP("Excel.Application")

theXmlPath = GETENV("XML_DOCUMENT_PATH")theXlsPath = GETENV("XLS_DOCUMENT_PATH")

objExcelApplication.Visible = True

objExcelApplication.ScreenUpdating = FalseobjExcelApplication.DisplayAlerts = False

Set theWorkbooks = objExcelApplication.Workbooks

For Each theWorkbook In theWorkbooks! If (theWorkbook.FullName = theXlsPath) Or (theWorkbook.Name = theXlsPath) Then! ! theWorkbook.Close (False)! End IfNext

Set theWorkbook = objExcelApplication.Workbooks.Open(theXmlPath)

theWorkbook.SaveAs theXlsPath, 56

objExcelApplication.ScreenUpdating = True

CreateObject("WScript.Shell").AppActivate objExcelApplication.Caption

Page 78: Tags 2013-07-02

4D TAGS Excel XML スプレッドシート編